diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000000..398ffb8bee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,34 @@ +--- +name: Bug Report +about: File a bug to help us improve ResearchKit +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots or screen recordings** +Screenshots or screen recordings help us understand your problem with more clarity. + +**ResearchKit Version** +- Version: [e.g. 3.0.1] + +**Device Information** + - OS: [e.g. iOS 18.1/watchOS 11.0/visionOS 2.0] + - Device: [e.g. iPhone 16 Pro] + +**Additional context** +Add surrounding context to bring more clarity to your problem. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000000..494e696283 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,20 @@ +--- +name: Feature Request +about: Suggest an idea for ResearchKit +title: '' +labels: new feature +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/general-question.md b/.github/ISSUE_TEMPLATE/general-question.md new file mode 100644 index 0000000000..26fcf956d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/general-question.md @@ -0,0 +1,10 @@ +--- +name: General Question +about: Ask a general question about ResearchKit's capabilities +title: '' +labels: question +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/technical-question.md b/.github/ISSUE_TEMPLATE/technical-question.md new file mode 100644 index 0000000000..98bbfa4274 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/technical-question.md @@ -0,0 +1,10 @@ +--- +name: Technical Question +about: Ask a question about ResearchKit's API +title: '' +labels: tech question +assignees: '' + +--- + + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..9f105e4847 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build + +on: + push: + branches: [ 'main', 'stable' ] + pull_request: + branches: [ 'main', 'stable' ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: macos-14 + strategy: + matrix: + destination: ['platform=iOS\ Simulator,OS=17.4,name=iPhone\ 15\ Pro'] + scheme: ['ResearchKit'] + name: ${{ matrix.scheme }} Unit Tests + steps: + - uses: actions/checkout@v4 + - name: Set Xcode Version + run: sudo xcode-select -s /Applications/Xcode_15.3.app + - name: Test + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -verbose -workspace RKWorkspace.xcworkspace -scheme ${{ matrix.scheme }} -destination ${{ matrix.destination }} build test | xcpretty diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95e6cf945b..ee4045e8fb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ codebase. However, other types of contributions are welcome too, in keeping with the ResearchKit™ framework [best practices](../../wiki/best-practices). For example, contributions of original free-to-use survey content, back-end integrations, validation data, and analysis or processing tools are all welcome. Ask -on the [*ResearchKit* Forum](https://forums.developer.apple.com/community/researchkit) or [contact us](https://developer.apple.com/contact/researchkit/) for guidance. +on the [*ResearchKit* Forum](https://developer.apple.com/forums/tags/researchkit) or [contact us](mailto:researchkit@apple.com) for guidance. Contributing software @@ -16,8 +16,7 @@ This page assumes you already know how to check out and build the code. Contributions to the ResearchKit framework are expected to comply with the [ResearchKit Contribution Terms and License Policy](#contribution); please familiarize yourself with this policy prior to submitting a pull request. For any contribution, ensure that you own -the rights or have permission from the copyright holder. (e.g. code, images, surveys, videos -and other content you may include) +the rights or have permission from the copyright holder (e.g. code, images, surveys, videos and other content you may include). To contribute to ResearchKit: @@ -27,7 +26,7 @@ To contribute to ResearchKit: 4. [Run the tests.](#test) 5. [Submit a pull request.](#request) 6. Make any changes requested by the reviewer, and update your pull request as needed. -7. Once accepted, your pull request will be merged into master. +7. Once accepted, your pull request will be merged into main. Choosing an issue to work on ---------------------------- @@ -36,13 +35,12 @@ To find an issue to work on, either pick something that you need for your app, or select one of the issues from our [issue list](../../issues). Or, consider one of the areas where we'd like to extend ResearchKit: -* Faster 'get started' to a useful app -* More active tasks -* Data analysis for active tasks -* More consent sections -* Back end integrations +* Improving the APIs needed to get started with a ResearchKit project +* New Active Tasks +* Data analysis for Active Tasks +* Backend integrations -If in doubt, bring your idea up on the [*ResearchKit* Forum](https://forums.developer.apple.com/community/researchkit). +If in doubt, bring your idea up on the [ResearchKit Forum](https://developer.apple.com/forums/tags/researchkit). Creating a personal fork @@ -56,8 +54,7 @@ Develop your changes in your fork --------------------------------- Develop your changes using your normal development process. If you -already have code from an existing project, you may need to adjust its -style to more closely match the [ResearchKit framework coding style](./docs-standalone/coding-style-guide.md). +already have code from an existing project, you may need to adjust its style to more closely match the [ResearchKit framework coding style](./docs-standalone/coding-style-guide.md). New components may need to expose new Public or Private headers. Public headers are for APIs that are likely to be a stable @@ -78,7 +75,7 @@ code to other existing demo apps to exercise your feature. When adding UI driven components, make sure that they are accessible. Follow the steps outlined in the [Best Practices](../../wiki/best-practices) section under Accessibility. Before submitting the pull request, you should -audit your components with Voice Over (or other relevant assistive technologies) +audit your components with VoiceOver (or other relevant assistive technologies) enabled. Keep changes that fix different issues separate. For bug fixes, @@ -99,11 +96,11 @@ verify that test apps run on both device and simulator. Where your code affects UI presentation, also test: -* Multiple device form factors (for instance, iPhone 4S, iPhone 5, iPhone 6, iPhone 6 Plus). +* Multiple device form factors (for instance, iPhone SE, iPhone 14, iPhone 15 Pro, iPhone 15 Pro Max). * Dynamic text, especially at the "Large" setting. * Rotation between portrait and landscape, where appropriate. -You can use the apps in the `Testing` and `samples` directories to +You can use the `ORKCatalog` app in the `samples` directory to test your changes. Submit a pull request @@ -120,7 +117,7 @@ After acceptance ---------------- Once your pull request has been accepted, your changes will be merged -to master. You are still responsible for your change after it is +to main. You are still responsible for your change after it is accepted. Stay in contact, in case bugs are detected that may require your attention. @@ -134,7 +131,7 @@ documentation, or other issues during this process. Release process ----------------- -The `master` branch is used for work in progress. On `master`: +The `main` branch is used for work in progress. On `main`: * All test apps should build and run error free. * Unit tests should all pass. @@ -142,9 +139,9 @@ The `master` branch is used for work in progress. On `master`: base language). The project will make periodic releases. When preparing a stable release, we - will branch from `master` to a convergence branch. During this process, + will branch from `main` to a convergence branch. During this process, changes will be made first to the convergence branch, and then merged into - `master`. On the convergence branch, changes will be made only to: + `main`. On the convergence branch, changes will be made only to: * Fix high priority issues. * Update documentation. diff --git a/LICENSE b/LICENSE index 78ff5424ff..3e4145c388 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015, Apple Inc. All rights reserved. +Copyright (c) 2015-2024, Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index a01476d14b..b5d6400a7a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ + +![ResearchKit](https://github.com/user-attachments/assets/0384c1a6-ec67-45d3-be68-136a2e4cacff) + ResearchKit Framework =========== @@ -6,293 +9,170 @@ ResearchKit Framework The *ResearchKit™ framework* is an open source software framework that makes it easy to create apps for medical research or for other research projects. -* [Getting Started](#gettingstarted) -* [Documentation](docs/) -* [Best Practices](../../wiki/best-practices) -* [Contributing to ResearchKit](CONTRIBUTING.md) -* [Website](https://www.researchandcare.org) -* [ResearchKit BSD License](#license) - -Getting More Information -======================== - -* Join the [*ResearchKit* Forum](https://developer.apple.com/forums/tags/researchkit) for discussing uses of the *ResearchKit framework and* related projects. - -Use Cases -=========== - -A task in the *ResearchKit framework* contains a set of steps to present to a user. Everything, -whether it’s a *survey*, the *consent process*, or *active tasks*, is represented as a task that can -be presented with a task view controller. - -Surveys -------- - -The *ResearchKit framework* provides a pre-built user interface for surveys, which can be presented -modally on an *iPhone*, *iPod Touch*, or *iPad*. See - *[Creating Surveys](docs/Survey/)* for more - information. - - -Consent ----------------- - -The *ResearchKit framework* provides visual consent templates that you can customize to explain the -details of your research study and obtain a signature if needed. -See *[Obtaining Consent](docs/InformedConsent/)* for -more information. - - -Active Tasks ------------- - -Some studies may need data beyond survey questions or the passive data collection capabilities -available through use of the *HealthKit* and *CoreMotion* APIs if you are programming for *iOS*. -*ResearchKit*'s active tasks invite users to perform activities under semi-controlled conditions, -while *iPhone* sensors actively collect data. See -*[Active Tasks](docs/ActiveTasks/)* for more -information. -ResearchKit active tasks are not diagnostic tools nor medical devices of any kind and output from those active tasks may not be used for diagnosis. Developers and researchers are responsible for complying with all applicable laws and regulations with respect to further development and use of the active tasks. - -Charts ------------- -*ResearchKit* includes a *Charts module*. It features three chart types: a *pie chart* (`ORKPieChartView`), a *line graph chart* (`ORKLineGraphChartView`), and a *discrete graph chart* (`ORKDiscreteGraphChartView`). - -The views in the *Charts module* can be used independently of the rest of *ResearchKit*. They don't automatically connect with any other part of *ResearchKit*: the developer has to supply the data to be displayed through the views' `dataSources`, which allows for maximum flexibility. - - -Getting Started -=============== - - -Requirements ------------- - -The primary *ResearchKit framework* codebase supports *iOS* and requires *Xcode 8.0* or newer. The -*ResearchKit framework* has a *Base SDK* version of *8.0*, meaning that apps using the *ResearchKit -framework* can run on devices with *iOS 8.0* or newer. - - -Installation ------------- - -The latest stable version of *ResearchKit framework* can be cloned with - -``` -git clone -b stable https://github.com/ResearchKit/ResearchKit.git -``` - -Or, for the latest changes, use the `main` branch: - -``` -git clone https://github.com/ResearchKit/ResearchKit.git -``` - -CocoaPods Installation ------------- -For latest stable release - -``` -pod 'ResearchKit' -``` - -For early development releases +# Table of Contents -``` - pod 'ResearchKit', :git => 'https://github.com/ResearchKit/ResearchKit.git', :branch => 'main' -``` +* [Requirements](#requirements) +* [Documentation](#documentation) +* [Getting Started](#gettingstarted) + * [Installing](#installation) + * [ORKCatalog App](#orkcatalog-app) +* [Surveys](#surveys) +* [Consent](#consent) +* [Active Tasks](#active-tasks) +* [Getting Help](#getting-help) +* [License](#license) -Building --------- +# Requirements -Build the *ResearchKit framework* by opening `ResearchKit.xcodeproj` and running the `ResearchKit` -framework target. Optionally, run the unit tests too. +The *ResearchKit framework* codebase supports iOS and requires Xcode 12.0 or newer. The *ResearchKit framework* has a Base SDK version of 13.0. +# Documentation -Adding the ResearchKit framework to your App ------------------------------- +ebedded-framework -This walk-through shows how to embed the *ResearchKit framework* in your app as a dynamic framework, -and present a simple task view controller. +View the *ResearchKit framework* documentation by setting ResearchKit as your target in Xcode and selecting 'Build Documentation' in the Product menu dropdown. -### 1. Add the ResearchKit framework to Your Project -To get started, drag `ResearchKit.xcodeproj` from your checkout into your *iOS* app project -in *Xcode*: +# Getting Started -
-
- Adding the ResearchKit framework to your
-   project -
-
+* [Website](https://www.researchandcare.org) +* [WWDC: ResearchKit and CareKit Reimagined](https://developer.apple.com/videos/play/wwdc2019/217/) -Then, embed the *ResearchKit framework* as a dynamic framework in your app, by adding it to the -*Embedded Binaries* section of the *General* pane for your target as shown in the figure below. -
-
- Adding the ResearchKit framework to
-   Embedded Binaries -
Adding the ResearchKit framework to Embedded Binaries
-
-
+### Install as an embedded framework -Note: You can also import *ResearchKit* into your project using a - [dependency manager](./docs-standalone/dependency-management.md) such as *CocoaPods* or *Carthage*. +Download the project source code and drag in ResearchKit.xcodeproj. Then, embed *ResearchKit* framework in your app by adding it to the "Frameworks, Libraries, and Embedded Content" section for your target as shown in the figure below. -### 2. Create a Step +ebedded-framework -In this walk-through, we will use the *ResearchKit framework* to modally present a simple - single-step task showing a single instruction. +### ORKCatalog App -Create a step for your task by adding some code, perhaps in `viewDidAppear:` of an existing view -controller. To keep things simple, we'll use an instruction step (`ORKInstructionStep`) and name -the step `myStep`. +The included catalog app demonstrates the different modules that are available in *ResearchKit*. Find the +project in ResearchKit's [`samples`](samples) directory. -*Objective-C* +| | | +|---|---| +| ![catalog-home](https://github.com/ResearchKit/ResearchKit/assets/29615893/45357cf8-17bf-4f38-aebc-bdf1c3395eb5) | ![catalog-survey](https://github.com/ResearchKit/ResearchKit/assets/29615893/a850f20b-7a05-4d14-bc2d-2d6dab7af30d) | -```objc -ORKInstructionStep *myStep = - [[ORKInstructionStep alloc] initWithIdentifier:@"intro"]; -myStep.title = @"Welcome to ResearchKit"; -``` +# Surveys -*Swift* +The *ResearchKit framework* provides a pre-built user interface for surveys, which can be presented +modally on an *iPhone* or *iPad*. The example below shows the process to present a height question for a participant to answer. ```swift -let myStep = ORKInstructionStep(identifier: "intro") -myStep.title = "Welcome to ResearchKit" -``` - -### 3. Create a Task +import ResearchKit +import ResearchKitUI + +let sectionHeaderFormItem = ORKFormItem(sectionTitle: "Your question here.") -Use the ordered task class (`ORKOrderedTask`) to create a task that contains `myStep`. An ordered -task is just a task where the order and selection of later steps does not depend on the results of -earlier ones. Name your task `task` and initialize it with `myStep`. +let heightQuestionFormItem = ORKFormItem(identifier: "heightQuestionFormItem1", text: nil, answerFormat: ORKAnswerFormat.heightAnswerFormat()) +heightQuestionFormItem.placeholder = "Tap here" -*Objective-C* +let formStep = ORKFormStep(identifier: "HeightQuestionIdentifier", title: "Height", text: "Local system") +formStep.formItems = [sectionHeaderFormItem, heightQuestionFormItem] -```objc -ORKOrderedTask *task = - [[ORKOrderedTask alloc] initWithIdentifier:@"task" steps:@[myStep]]; +return formStep ``` -*Swift* +The height question is presented in the figure below. -```swift -let task = ORKOrderedTask(identifier: "task", steps: [myStep]) -``` +| | | +|---|---| +| ![height-question](https://github.com/ResearchKit/ResearchKit/assets/29615893/4f425329-83b7-45c3-84f9-58cdbcaf2529) | ![height-question-2](https://github.com/ResearchKit/ResearchKit/assets/29615893/2cc0dc2c-5c2a-4b50-a4be-834363fb64b5) | -### 4. Present the Task +# Consent -Create a task view controller (`ORKTaskViewController`) and initialize it with your `task`. A task -view controller manages a task and collects the results of each step. In this case, your task view -controller simply displays your instruction step. +The *ResearchKit framework* provides classes that you can customize to explain the +details of your research study and obtain a signature if needed. Use *ResearchKit's* provided classes to quickly welcome, and inform your participants of what the study entails. -*Objective-C* +```swift +import ResearchKit +import ResearchKitUI + +// Welcome page. +let welcomeStep = ORKInstructionStep(identifier: String(describing: Identifier.consentWelcomeInstructionStep)) +welcomeStep.iconImage = UIImage(systemName: "hand.wave") +welcomeStep.title = "Welcome!" +welcomeStep.detailText = "Thank you for joining our study. Tap Next to learn more before signing up." + +// Before You Join page. +let beforeYouJoinStep = ORKInstructionStep(identifier: String(describing: Identifier.informedConsentInstructionStep)) +beforeYouJoinStep.iconImage = UIImage(systemName: "doc.text.magnifyingglass") +beforeYouJoinStep.title = "Before You Join" + +let sharingHealthDataBodyItem = ORKBodyItem(text: "The study will ask you to share some of your Health data.", + detailText: nil, + image: UIImage(systemName: "heart.fill"), + learnMoreItem: nil, + bodyItemStyle: .image) + +let completingTasksBodyItem = ORKBodyItem(text: "You will be asked to complete various tasks over the duration of the study.", + detailText: nil, + image: UIImage(systemName: "checkmark.circle.fill"), + learnMoreItem: nil, + bodyItemStyle: .image) + +let signatureBodyItem = ORKBodyItem(text: "Before joining, we will ask you to sign an informed consent document.", + detailText: nil, + image: UIImage(systemName: "signature"), + learnMoreItem: nil, + bodyItemStyle: .image) + +let secureDataBodyItem = ORKBodyItem(text: "Your data is kept private and secure.", + detailText: nil, + image: UIImage(systemName: "lock.fill"), + learnMoreItem: nil, + bodyItemStyle: .image) + +beforeYouJoinStep.bodyItems = [ + sharingHealthDataBodyItem, + completingTasksBodyItem, + signatureBodyItem, + secureDataBodyItem +] +``` +The consent steps are presented in the figure below. + +| | | +|---|---| +| ![consent-welcome-page](https://github.com/ResearchKit/ResearchKit/assets/29615893/e6cbbe07-47ed-4bb4-a84a-f3bf612e9122) | ![consent-before-you-join](https://github.com/ResearchKit/ResearchKit/assets/29615893/687fe345-14d9-4356-9c37-c6a2714875ae) | + +Vist the `Obtaining Consent`article in ResearchKit's Documentation for +more examples that include signature collection and PDF file storage. + +# Active Tasks -```objc -ORKTaskViewController *taskViewController = - [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; -taskViewController.delegate = self; -[self presentViewController:taskViewController animated:YES completion:nil]; -``` +Some studies may need data beyond survey questions or the passive data collection capabilities +available through use of the *HealthKit* and *CoreMotion* APIs if you are programming for *iOS*. +*ResearchKit*'s active tasks invite users to perform activities under semi-controlled conditions, +while *iPhone* sensors actively collect data. +ResearchKit active tasks are not diagnostic tools nor medical devices of any kind and output from those active tasks may not be used for diagnosis. Developers and researchers are responsible for complying with all applicable laws and regulations with respect to further development and use of the active tasks. -*Swift* +Use predefined tasks provided by *ResearchKit* to guide your participants through specific actions. ```swift -let taskViewController = ORKTaskViewController(task: task, taskRun: nil) +import ResearchKit +import ResearchKitUI +import ResearchKitActiveTask + +let orderedTask = ORKOrderedTask.dBHLToneAudiometryTask(withIdentifier: "dBHLToneAudiometryTaskIdentifier", + intendedUseDescription: nil, options: []) + +let taskViewController = ORKTaskViewController(task: orderedTask, taskRun: nil) taskViewController.delegate = self -present(taskViewController, animated: true, completion: nil) -``` - -The above snippet assumes that your class implements the `ORKTaskViewControllerDelegate` protocol. -This has just one required method, which you must implement in order to handle the completion of - the task: - -*Objective-C* - -```objc -- (void)taskViewController:(ORKTaskViewController *)taskViewController - didFinishWithReason:(ORKTaskViewControllerFinishReason)reason - error:(NSError *)error { - ORKTaskResult *taskResult = [taskViewController result]; - // You could do something with the result here. - - // Then, dismiss the task view controller. - [self dismissViewControllerAnimated:YES completion:nil]; -} -``` - -*Swift* - -```swift -func taskViewController(_ taskViewController: ORKTaskViewController, - didFinishWith reason: ORKTaskViewControllerFinishReason, - error: Error?) { - let taskResult = taskViewController.result - // You could do something with the result here. - - // Then, dismiss the task view controller. - dismiss(animated: true, completion: nil) -} +present(taskViewController, animated: true) ``` +The dBHL Tone Audiometry task is presented in the figure below. +| | | +|---|---| +| ![noise-check](https://github.com/ResearchKit/ResearchKit/assets/29615893/d8fb669c-bb60-482d-9a2d-e5b6b6696aa5) | ![dbhl-tone-test](https://github.com/ResearchKit/ResearchKit/assets/29615893/04df862b-46bc-4749-8c3e-02d2e54dbcbf) | -If you now run your app, you should see your first *ResearchKit framework* instruction step: +# Getting Help -
-
- HelloWorld example screenshot -
-
+GitHub is our primary forum for ResearchKit. Feel free to open up issues about questions, problems, or ideas. +# License - -What else can the ResearchKit framework do? ------------------------------ - -The *ResearchKit* [`ORKCatalog`](samples/ORKCatalog) sample app is a good place to start. Find the -project in ResearchKit's [`samples`](samples) directory. This project includes a list of all the -types of steps supported by the *ResearchKit framework* in the first tab, and displays a browser for the -results of the last completed task in the second tab. The third tab shows some examples from the *Charts module*. - - - -License -======= - -The source in the *ResearchKit* repository is made available under the following license unless -another license is explicitly identified: - -``` -Copyright (c) 2015 - 2018, Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -``` +This project is made available under the terms of a BSD license. See the [LICENSE](LICENSE) file. diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c8474e6090..7de3845a4d 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,5 +1,78 @@ # ResearchKit Release Notes +## ResearchKit 3.1.1 Release Notes +General bug fixes for the following: + +- **ORKMotionActivityPermissionType** +Fixed issue that caused the next button to remain disabled after gaining permission from user. + +- **ORKRegistrationStep** +Removed yellow overlay that prevented password entry. + +- **ORKdBHLToneAudiometryStep** +Fixed issue that caused the tap button to appear twice. + + +## ResearchKit 3.1 Release Notes +In addition to general stability and performance improvements, ResearchKit 3.1 includes the following updates: + +- **ORKFamilyHistoryStep** +The `ORKFamilyHistoryStep` can be configured to present a Family Health History survey. + +- **ORKColorChoiceAnswerFormat** +The `ORKColorChoiceAnswerFormat` presents the user with a list of color choices. + +- **ORKAgeAnswerFormat** +The `ORKAgeAnswerFormat` presents a age picker that presents birth year or current age options depending on how you configure it. + +- **CLLocation Flag** +A compiler flag that prevents your app from being flagged during app store submission if your app doesn't require location services. + +- **HealthKit Flag** +A compiler flag that prevents your app from being flagged during app store submission if your app doesn't use HealthKit. + + +## ResearchKit 3.0.1 Release Notes +In addition to general stability and performance improvements, ResearchKit 3.0.1 includes the following updates: + +- **ORKFormStep** +The `ORKFormStep` has an additional property named `autoScrollEnabled` that allows developers to disable autoscrolling. + +- **ORKBodyItem** +The `ORKBodyItem` has an additional property named `alignImageToTop` that will align a body item's image and text to the top of each other. + +- **ORK3DModelStep** +An example of the `ORK3DModelStep` has been added to the ORKCatalog app. + + +## ResearchKit 3.0 Release Notes + +*ResearchKit 3.0* is a beta release + +In addition to general stability and performance improvements, ResearchKit 3.0 includes the following updates. + +### Framework Updates + +In order to modularize ResearchKit we have separated its functionality into the following modules. + +- **ResearchKit** +contains the core classes and objects needed to run ResearchKit in any environment. + +- **ResearchKitUI** +contains the UI classes and objects needed to present ResearchKit views in an IOS environment. + +- **ResearchKitActiveTask** +contains the classes and objects needed to present Active Tasks in an IOS enviroment. These tasks usually require access to device sensors. + +### Future Deprecations +The following APIs will be labeled deprecated spring of 2025. + +- **Consent** +Our `ORKConsent` APIs will be deprecated in favor of using existing functionality (e.g `ORKInstructionStep` and `ORKWebViewStep`) to achieve informed consent. Please visit the `ORKCatalog` app to view a recommended example. + +- **Question Step** +The `ORKQuestionStep` will be deprecated in favor of using the `ORKFormStep`. Certain answer formats will present slightly different UI when used with a `ORKFormStep`. Updates will be made to ensure backwards compatibility before the question step is removed. + ## ResearchKit 2.0 Release Notes *ResearchKit 2.0* supports *iOS* and requires *Xcode 9.0* or newer. diff --git a/RKWorkspace.xcworkspace/contents.xcworkspacedata b/RKWorkspace.xcworkspace/contents.xcworkspacedata index 3e858c8fc9..05c8ab4b21 100644 --- a/RKWorkspace.xcworkspace/contents.xcworkspacedata +++ b/RKWorkspace.xcworkspace/contents.xcworkspacedata @@ -4,9 +4,6 @@ - - diff --git a/ResearchKit.podspec b/ResearchKit.podspec index e364b5f56b..4ac578f0d8 100644 --- a/ResearchKit.podspec +++ b/ResearchKit.podspec @@ -1,18 +1,34 @@ Pod::Spec.new do |s| s.name = 'ResearchKit' - s.version = '2.1.0' + s.version = '3.0.1' s.summary = 'ResearchKit is an open source software framework that makes it easy to create apps for medical research or for other research projects.' s.homepage = 'https://www.github.com/ResearchKit/ResearchKit' s.documentation_url = 'http://researchkit.github.io/docs/' s.license = { :type => 'BSD', :file => 'LICENSE' } s.author = { 'researchkit.org' => 'http://researchkit.org' } s.source = { :git => 'https://github.com/ResearchKit/ResearchKit.git', :tag => s.version.to_s } - s.public_header_files = `./scripts/find_headers.rb --public`.split("\n") - s.private_header_files = `./scripts/find_headers.rb --private`.split("\n") - s.source_files = 'ResearchKit/**/*.{h,m,swift}' - s.resources = 'ResearchKit/**/*.{fsh,vsh}', 'ResearchKit/Animations/**/*.m4v', 'ResearchKit/Artwork.xcassets', 'ResearchKit/Localized/*.lproj' - s.platform = :ios, '11.0' - s.requires_arc = true - s.swift_version = '5' - s.module_map = "ResearchKit/ResearchKit.modulemap" + + s.default_subspec = "ResearchKitAllTargets" + + s.subspec 'ResearchKitCore' do |ss| + ss.vendored_frameworks = 'xcframework/ResearchKit.xcframework' + end + + s.subspec 'ResearchKitUI' do |ss| + ss.vendored_frameworks = 'xcframework/ResearchKitUI.xcframework' + ss.dependency 'ResearchKit/ResearchKitCore' + end + + s.subspec 'ResearchKitActiveTask' do |ss| + ss.vendored_frameworks = 'xcframework/ResearchKitActiveTask.xcframework' + ss.dependency 'ResearchKit/ResearchKitUI' + ss.dependency 'ResearchKit/ResearchKitCore' + end + + s.subspec 'ResearchKitAllTargets' do |ss| + ss.dependency 'ResearchKit/ResearchKitCore' + ss.dependency 'ResearchKit/ResearchKitUI' + ss.dependency 'ResearchKit/ResearchKitActiveTask' + end end + diff --git a/ResearchKit.xcodeproj/project.pbxproj b/ResearchKit.xcodeproj/project.pbxproj index c7155e882c..7feb41e180 100644 --- a/ResearchKit.xcodeproj/project.pbxproj +++ b/ResearchKit.xcodeproj/project.pbxproj @@ -7,30 +7,25 @@ objects = { /* Begin PBXAggregateTarget section */ - B18FF3A41A9FE25700C0C3B0 /* docs */ = { + 0BC672D82BD9C52D005798AC /* ResearchKitAllTargets */ = { isa = PBXAggregateTarget; - buildConfigurationList = B18FF3A71A9FE25700C0C3B0 /* Build configuration list for PBXAggregateTarget "docs" */; + buildConfigurationList = 0BC672D92BD9C52D005798AC /* Build configuration list for PBXAggregateTarget "ResearchKitAllTargets" */; buildPhases = ( - B18FF3A81A9FE26300C0C3B0 /* ShellScript */, ); dependencies = ( - B11DF3B11AA10795009E76D2 /* PBXTargetDependency */, + 0BC672E02BD9C541005798AC /* PBXTargetDependency */, + 0BC672E22BD9C541005798AC /* PBXTargetDependency */, + 0BC672E62BD9C541005798AC /* PBXTargetDependency */, ); - name = docs; - productName = docs; + name = ResearchKitAllTargets; + productName = ResearchKitAllTargets; }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ 00B1F7852241503900D022FE /* Speech.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B1F7842241503900D022FE /* Speech.framework */; }; - 00C2668A2302244300337E0B /* ORKCustomStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 00C266882302244300337E0B /* ORKCustomStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 00C2668B2302244300337E0B /* ORKCustomStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C266892302244300337E0B /* ORKCustomStepViewController.m */; }; 00C2668E23022CD400337E0B /* ORKCustomStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 00C2668C23022CD400337E0B /* ORKCustomStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 00C2668F23022CD400337E0B /* ORKCustomStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C2668D23022CD400337E0B /* ORKCustomStep.m */; }; - 03057F392515771800C4EC5B /* ORKAudioFitnessStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 03057F372515771800C4EC5B /* ORKAudioFitnessStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 03057F3A2515771800C4EC5B /* ORKAudioFitnessStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 03057F382515771800C4EC5B /* ORKAudioFitnessStepViewController.m */; }; - 03057F3D2515772E00C4EC5B /* ORKAudioFitnessStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 03057F3B2515772E00C4EC5B /* ORKAudioFitnessStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 03057F3E2515772E00C4EC5B /* ORKAudioFitnessStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 03057F3C2515772E00C4EC5B /* ORKAudioFitnessStep.m */; }; 03057F492518ECDC00C4EC5B /* ORKAudioStepViewControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03057F482518ECDC00C4EC5B /* ORKAudioStepViewControllerTests.m */; }; 031A0FC124CF4ECD000E4455 /* ORKSensorPermissionType.h in Headers */ = {isa = PBXBuildFile; fileRef = 031A0FBF24CF4ECD000E4455 /* ORKSensorPermissionType.h */; settings = {ATTRIBUTES = (Public, ); }; }; 031A0FC224CF4ECD000E4455 /* ORKSensorPermissionType.m in Sources */ = {isa = PBXBuildFile; fileRef = 031A0FC024CF4ECD000E4455 /* ORKSensorPermissionType.m */; }; @@ -41,60 +36,24 @@ 03BD9EA4253E62A0008ADBE1 /* ORKBundleAsset.m in Sources */ = {isa = PBXBuildFile; fileRef = 03BD9EA2253E62A0008ADBE1 /* ORKBundleAsset.m */; }; 03EDD58024CA6B1D006245E9 /* ORKNotificationPermissionType.h in Headers */ = {isa = PBXBuildFile; fileRef = 03EDD57E24CA6B1D006245E9 /* ORKNotificationPermissionType.h */; settings = {ATTRIBUTES = (Public, ); }; }; 03EDD58124CA6B1D006245E9 /* ORKNotificationPermissionType.m in Sources */ = {isa = PBXBuildFile; fileRef = 03EDD57F24CA6B1D006245E9 /* ORKNotificationPermissionType.m */; }; + 0B0852742BD872C400149963 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0B0852732BD872C400149963 /* PrivacyInfo.xcprivacy */; }; + 0B0852762BD872D800149963 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0B0852752BD872D800149963 /* PrivacyInfo.xcprivacy */; }; + 0B0852782BD872EA00149963 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 0B0852772BD872EA00149963 /* PrivacyInfo.xcprivacy */; }; + 0B53DA642BD0595100227126 /* ResearchKitUI.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0B53DA622BD0595100227126 /* ResearchKitUI.strings */; }; 0B59A6BF28C1738D005035B4 /* ORKPickerTestDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B59A6BE28C1738D005035B4 /* ORKPickerTestDelegate.m */; }; - 0B6CD14329119C7F004BC4A0 /* ORKNormalizedReactionTimeStimulusView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BAF9797291088EE00EF138A /* ORKNormalizedReactionTimeStimulusView.h */; }; - 0B6CD14429119CBA004BC4A0 /* ORKNormalizedReactionTimeContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BAF9798291088EE00EF138A /* ORKNormalizedReactionTimeContentView.h */; }; - 0B6CD14529119CCC004BC4A0 /* ORKNormalizedReactionTimeViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BAF979D291088F000EF138A /* ORKNormalizedReactionTimeViewController.h */; }; - 0BAF97A0291088F200EF138A /* ORKNormalizedReactionTimeResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BAF9796291088ED00EF138A /* ORKNormalizedReactionTimeResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0BAF97A3291088F200EF138A /* ORKNormalizedReactionTimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BAF9799291088EE00EF138A /* ORKNormalizedReactionTimeStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0BAF97A4291088F200EF138A /* ORKNormalizedReactionTimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BAF979A291088EF00EF138A /* ORKNormalizedReactionTimeViewController.m */; }; - 0BAF97A5291088F200EF138A /* ORKNormalizedReactionTimeStimulusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BAF979B291088EF00EF138A /* ORKNormalizedReactionTimeStimulusView.m */; }; - 0BAF97A6291088F200EF138A /* ORKNormalizedReactionTimeContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BAF979C291088F000EF138A /* ORKNormalizedReactionTimeContentView.m */; }; - 0BAF97A8291088F200EF138A /* ORKNormalizedReactionTimeResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BAF979E291088F100EF138A /* ORKNormalizedReactionTimeResult.m */; }; - 0BAF97A9291088F200EF138A /* ORKNormalizedReactionTimeStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BAF979F291088F200EF138A /* ORKNormalizedReactionTimeStep.m */; }; - 106FF29E1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF29C1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 106FF29F1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF29D1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.m */; }; - 106FF2A21B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2A01B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 106FF2A31B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2A11B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.m */; }; - 106FF2A61B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2A41B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.h */; }; - 106FF2A71B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2A51B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.m */; }; - 106FF2AA1B690FD7004EACF2 /* ORKHolePegTestPlacePegView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2A81B690FD7004EACF2 /* ORKHolePegTestPlacePegView.h */; }; - 106FF2AB1B690FD7004EACF2 /* ORKHolePegTestPlacePegView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2A91B690FD7004EACF2 /* ORKHolePegTestPlacePegView.m */; }; - 106FF2AE1B6FACA8004EACF2 /* ORKDirectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2AC1B6FACA8004EACF2 /* ORKDirectionView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 106FF2AF1B6FACA8004EACF2 /* ORKDirectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2AD1B6FACA8004EACF2 /* ORKDirectionView.m */; }; - 106FF2B41B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2B21B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.h */; }; - 106FF2B51B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2B31B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.m */; }; - 10864C9E1B27146B000F4158 /* ORKPSATStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C961B27146B000F4158 /* ORKPSATStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10864C9F1B27146B000F4158 /* ORKPSATStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C971B27146B000F4158 /* ORKPSATStep.m */; }; - 10864CA01B27146B000F4158 /* ORKPSATStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C981B27146B000F4158 /* ORKPSATStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10864CA11B27146B000F4158 /* ORKPSATStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C991B27146B000F4158 /* ORKPSATStepViewController.m */; }; - 10864CA21B27146B000F4158 /* ORKPSATContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C9A1B27146B000F4158 /* ORKPSATContentView.h */; }; - 10864CA31B27146B000F4158 /* ORKPSATContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C9B1B27146B000F4158 /* ORKPSATContentView.m */; }; - 10864CA41B27146B000F4158 /* ORKPSATKeyboardView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C9C1B27146B000F4158 /* ORKPSATKeyboardView.h */; }; - 10864CA51B27146B000F4158 /* ORKPSATKeyboardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C9D1B27146B000F4158 /* ORKPSATKeyboardView.m */; }; - 10BAA2CA1B5FCB4F004FE478 /* ORKProgressView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10BAA2C81B5FCB4F004FE478 /* ORKProgressView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10BAA2CB1B5FCB4F004FE478 /* ORKProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10BAA2C91B5FCB4F004FE478 /* ORKProgressView.m */; }; - 10FF9AC31B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AC11B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10FF9AC41B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9AC21B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.m */; }; - 10FF9ACB1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AC91B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10FF9ACC1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9ACA1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.m */; }; - 10FF9ACF1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9ACD1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.h */; }; - 10FF9AD01B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9ACE1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.m */; }; - 10FF9AD31B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AD11B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.h */; }; - 10FF9AD41B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9AD21B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.m */; }; - 10FF9AD71B7A045E00ECB5B4 /* ORKSeparatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AD51B7A045E00ECB5B4 /* ORKSeparatorView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 10FF9AD81B7A045E00ECB5B4 /* ORKSeparatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9AD61B7A045E00ECB5B4 /* ORKSeparatorView.m */; }; + 0B9A990F2A8AC47500D64C40 /* NSObject+TestingSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B9A990E2A8AC47500D64C40 /* NSObject+TestingSupport.m */; }; + 0BD9B60D2B75991B00A64EF9 /* Sentence1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6620BF6A3A00D7A6BB /* Sentence1.wav */; }; + 0BD9B60E2B75991F00A64EF9 /* Sentence2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6520BF6A3A00D7A6BB /* Sentence2.wav */; }; + 0BD9B60F2B75992200A64EF9 /* Sentence3.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6420BF6A3A00D7A6BB /* Sentence3.wav */; }; + 0BD9B6102B75992500A64EF9 /* Sentence4.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6120BF6A3A00D7A6BB /* Sentence4.wav */; }; + 0BD9B6112B75992800A64EF9 /* Sentence5.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6320BF6A3A00D7A6BB /* Sentence5.wav */; }; + 0BD9B6122B75992C00A64EF9 /* Sentence6.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6220BF6A3A00D7A6BB /* Sentence6.wav */; }; + 0BD9B6132B75992F00A64EF9 /* Sentence7.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6020BF6A3900D7A6BB /* Sentence7.wav */; }; + 0BE9D5272947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BE9D5252947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.m */; }; + 0BFD27562B8D1D3B00B540E8 /* ORKJSONSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51AF19562B583BBA00D3B399 /* ORKJSONSerializationTests.m */; }; 10FF9ADB1B7BA78400ECB5B4 /* ORKOrderedTask_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AD91B7BA78400ECB5B4 /* ORKOrderedTask_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; 12F339BF26A1F09A000665E4 /* ORKLocationPermissionType.m in Sources */ = {isa = PBXBuildFile; fileRef = 12F339BD26A1F09A000665E4 /* ORKLocationPermissionType.m */; }; 12F339C026A1F09A000665E4 /* ORKLocationPermissionType.h in Headers */ = {isa = PBXBuildFile; fileRef = 12F339BE26A1F09A000665E4 /* ORKLocationPermissionType.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 147503AF1AEE8071004B17F3 /* ORKAudioGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503AD1AEE8071004B17F3 /* ORKAudioGenerator.h */; }; - 147503B01AEE8071004B17F3 /* ORKAudioGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503AE1AEE8071004B17F3 /* ORKAudioGenerator.m */; }; - 147503B71AEE807C004B17F3 /* ORKToneAudiometryContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503B11AEE807C004B17F3 /* ORKToneAudiometryContentView.h */; }; - 147503B81AEE807C004B17F3 /* ORKToneAudiometryContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503B21AEE807C004B17F3 /* ORKToneAudiometryContentView.m */; }; - 147503B91AEE807C004B17F3 /* ORKToneAudiometryStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503B31AEE807C004B17F3 /* ORKToneAudiometryStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 147503BA1AEE807C004B17F3 /* ORKToneAudiometryStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503B41AEE807C004B17F3 /* ORKToneAudiometryStep.m */; }; - 147503BB1AEE807C004B17F3 /* ORKToneAudiometryStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503B51AEE807C004B17F3 /* ORKToneAudiometryStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 147503BC1AEE807C004B17F3 /* ORKToneAudiometryStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503B61AEE807C004B17F3 /* ORKToneAudiometryStepViewController.m */; }; 1483DBB5220125BE004C26B6 /* ORKActiveStepTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1483DBB4220125BE004C26B6 /* ORKActiveStepTests.swift */; }; 148E58BD227B36DB00EEF915 /* ORKCompletionStepViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 148E58BC227B36DB00EEF915 /* ORKCompletionStepViewControllerTests.swift */; }; 148E58C2227B753F00EEF915 /* ORKContinueButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 148E58C1227B753F00EEF915 /* ORKContinueButtonTests.swift */; }; @@ -110,330 +69,248 @@ 14BE7091220A201E005DEF07 /* ORKDataLoggerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EAC1AC09383001CCD89 /* ORKDataLoggerTests.m */; }; 14BE7092220A206B005DEF07 /* ORKDataLoggerManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EAB1AC09383001CCD89 /* ORKDataLoggerManagerTests.m */; }; 14D3F09C225BCA8100A3962D /* ORKBorderedButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14D3F09B225BCA8100A3962D /* ORKBorderedButtonTests.swift */; }; - 14E79040226A5F72009D8083 /* ORKStepViewControllerHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14E7903F226A5F72009D8083 /* ORKStepViewControllerHelpers.swift */; }; 14F7AC8B2269035200D52F41 /* ORKStepViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14F7AC8A2269035200D52F41 /* ORKStepViewControllerTests.swift */; }; - 1B4B95B81F5F012E006B629F /* ORKWeightPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B4B95B71F5F012E006B629F /* ORKWeightPicker.m */; }; - 1B4B95BA1F5F014E006B629F /* ORKWeightPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B4B95B91F5F014E006B629F /* ORKWeightPicker.h */; }; - 2246E5152749350300261D5A /* frequency_dBSPL_AIRPODSV3.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2246E5122749350200261D5A /* frequency_dBSPL_AIRPODSV3.plist */; }; - 2246E5162749350300261D5A /* retspl_AIRPODSV3.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2246E5132749350200261D5A /* retspl_AIRPODSV3.plist */; }; - 2246E5172749350300261D5A /* volume_curve_AIRPODSV3.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2246E5142749350200261D5A /* volume_curve_AIRPODSV3.plist */; }; - 224CD4FD283540FF0029B820 /* ORKAudiometryProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 224CD4FC283540FF0029B820 /* ORKAudiometryProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 226565532847FD1D00E916FF /* ORKAudiometryStimulus.h in Headers */ = {isa = PBXBuildFile; fileRef = 226565512847FD1D00E916FF /* ORKAudiometryStimulus.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 226565542847FD1D00E916FF /* ORKAudiometryStimulus.m in Sources */ = {isa = PBXBuildFile; fileRef = 226565522847FD1D00E916FF /* ORKAudiometryStimulus.m */; }; - 2295B221282AF92700A5D9E0 /* ORKAudiometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2295B21F282AF92700A5D9E0 /* ORKAudiometry.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 2295B222282AF92700A5D9E0 /* ORKAudiometry.m in Sources */ = {isa = PBXBuildFile; fileRef = 2295B220282AF92700A5D9E0 /* ORKAudiometry.m */; }; 22ED1847285290250052406B /* ORKAudiometryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 22ED1845285290250052406B /* ORKAudiometryTests.m */; }; 22ED1848285290250052406B /* ORKAudiometryTestData.plist in Resources */ = {isa = PBXBuildFile; fileRef = 22ED1846285290250052406B /* ORKAudiometryTestData.plist */; }; - 241A2E871B94FD8800ED3B39 /* ORKPasscodeStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 241A2E861B94FD8800ED3B39 /* ORKPasscodeStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2429D5721BBB5397003A512F /* ORKRegistrationStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 2429D5701BBB5397003A512F /* ORKRegistrationStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2429D5731BBB5397003A512F /* ORKRegistrationStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2429D5711BBB5397003A512F /* ORKRegistrationStep.m */; }; 242C9E051BBDFDAC0088B7F4 /* ORKVerificationStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 242C9E031BBDFDAC0088B7F4 /* ORKVerificationStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 242C9E061BBDFDAC0088B7F4 /* ORKVerificationStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 242C9E041BBDFDAC0088B7F4 /* ORKVerificationStep.m */; }; - 242C9E0D1BBE03F90088B7F4 /* ORKVerificationStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 242C9E0B1BBE03F90088B7F4 /* ORKVerificationStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 242C9E0E1BBE03F90088B7F4 /* ORKVerificationStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 242C9E0C1BBE03F90088B7F4 /* ORKVerificationStepViewController.m */; }; - 242C9E111BBE06DE0088B7F4 /* ORKVerificationStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 242C9E0F1BBE06DE0088B7F4 /* ORKVerificationStepView.h */; }; - 242C9E121BBE06DE0088B7F4 /* ORKVerificationStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 242C9E101BBE06DE0088B7F4 /* ORKVerificationStepView.m */; }; 2433C9E31B9A506F0052D375 /* ORKKeychainWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 2433C9E11B9A506F0052D375 /* ORKKeychainWrapper.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2433C9E41B9A506F0052D375 /* ORKKeychainWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2433C9E21B9A506F0052D375 /* ORKKeychainWrapper.m */; }; - 2441034F1B966D4C00EEAB0C /* ORKPasscodeViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2441034D1B966D4C00EEAB0C /* ORKPasscodeViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 244103501B966D4C00EEAB0C /* ORKPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2441034E1B966D4C00EEAB0C /* ORKPasscodeViewController.m */; }; 244EFAD21BCEFD83001850D9 /* ORKAnswerFormat_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 244EFAD11BCEFD83001850D9 /* ORKAnswerFormat_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 24850E191BCDA9C7006E91FB /* ORKLoginStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 24850E171BCDA9C7006E91FB /* ORKLoginStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 24850E1A1BCDA9C7006E91FB /* ORKLoginStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24850E181BCDA9C7006E91FB /* ORKLoginStepViewController.m */; }; 248604061B4C98760010C8A0 /* ORKAnswerFormatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 248604051B4C98760010C8A0 /* ORKAnswerFormatTests.m */; }; - 24898B0D1B7186C000B0E7E7 /* ORKScaleRangeImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 24898B0B1B7186C000B0E7E7 /* ORKScaleRangeImageView.h */; }; - 24898B0E1B7186C000B0E7E7 /* ORKScaleRangeImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 24898B0C1B7186C000B0E7E7 /* ORKScaleRangeImageView.m */; }; - 2489F7AF1D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2489F7A71D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.h */; }; - 2489F7B01D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2489F7A81D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.m */; }; 2489F7B11D65214D008DEF20 /* ORKVideoCaptureStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 2489F7A91D65214D008DEF20 /* ORKVideoCaptureStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2489F7B21D65214D008DEF20 /* ORKVideoCaptureStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2489F7AA1D65214D008DEF20 /* ORKVideoCaptureStep.m */; }; - 2489F7B31D65214D008DEF20 /* ORKVideoCaptureStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2489F7AB1D65214D008DEF20 /* ORKVideoCaptureStepViewController.h */; }; - 2489F7B41D65214D008DEF20 /* ORKVideoCaptureStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2489F7AC1D65214D008DEF20 /* ORKVideoCaptureStepViewController.m */; }; - 2489F7B51D65214D008DEF20 /* ORKVideoCaptureView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2489F7AD1D65214D008DEF20 /* ORKVideoCaptureView.h */; }; - 2489F7B61D65214D008DEF20 /* ORKVideoCaptureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2489F7AE1D65214D008DEF20 /* ORKVideoCaptureView.m */; }; - 249F44E51BCD9EAC0000D57E /* ORKFormStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 249F44E31BCD9EAC0000D57E /* ORKFormStepViewController_Internal.h */; }; - 24A4DA101B8D0F21009C797A /* ORKPasscodeStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A4DA0E1B8D0F21009C797A /* ORKPasscodeStepView.h */; }; - 24A4DA111B8D0F21009C797A /* ORKPasscodeStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 24A4DA0F1B8D0F21009C797A /* ORKPasscodeStepView.m */; }; 24A4DA141B8D1115009C797A /* ORKPasscodeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A4DA121B8D1115009C797A /* ORKPasscodeStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24A4DA151B8D1115009C797A /* ORKPasscodeStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 24A4DA131B8D1115009C797A /* ORKPasscodeStep.m */; }; - 24A4DA181B8D13FE009C797A /* ORKPasscodeStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A4DA161B8D13FE009C797A /* ORKPasscodeStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 24A4DA191B8D13FE009C797A /* ORKPasscodeStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24A4DA171B8D13FE009C797A /* ORKPasscodeStepViewController.m */; }; 24BC5CEE1BC345D900846B43 /* ORKLoginStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 24BC5CEC1BC345D900846B43 /* ORKLoginStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24BC5CEF1BC345D900846B43 /* ORKLoginStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 24BC5CED1BC345D900846B43 /* ORKLoginStep.m */; }; 24C296751BD052F800B42EF1 /* ORKVerificationStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 24C296741BD052F800B42EF1 /* ORKVerificationStep_Internal.h */; }; 24C296771BD055B800B42EF1 /* ORKLoginStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 24C296761BD055B800B42EF1 /* ORKLoginStep_Internal.h */; }; - 250F94041B4C5A6600FA23EB /* ORKTowerOfHanoiStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 250F94021B4C5A6600FA23EB /* ORKTowerOfHanoiStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 250F94051B4C5A6600FA23EB /* ORKTowerOfHanoiStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 250F94031B4C5A6600FA23EB /* ORKTowerOfHanoiStep.m */; }; - 250F94081B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 250F94061B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.h */; }; - 250F94091B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 250F94071B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.m */; }; - 257FCE1F1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 257FCE1D1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.h */; }; - 257FCE201B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 257FCE1E1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.m */; }; - 257FCE231B4D37A80001EF06 /* ORKTowerOfHanoiTower.h in Headers */ = {isa = PBXBuildFile; fileRef = 257FCE211B4D37A80001EF06 /* ORKTowerOfHanoiTower.h */; }; - 257FCE241B4D37A80001EF06 /* ORKTowerOfHanoiTower.m in Sources */ = {isa = PBXBuildFile; fileRef = 257FCE221B4D37A80001EF06 /* ORKTowerOfHanoiTower.m */; }; - 25ECC0951AFBD68300F3D63B /* ORKReactionTimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC0931AFBD68300F3D63B /* ORKReactionTimeStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 25ECC0961AFBD68300F3D63B /* ORKReactionTimeStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC0941AFBD68300F3D63B /* ORKReactionTimeStep.m */; }; - 25ECC09B1AFBD8B300F3D63B /* ORKReactionTimeViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC0991AFBD8B300F3D63B /* ORKReactionTimeViewController.h */; }; - 25ECC09C1AFBD8B300F3D63B /* ORKReactionTimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC09A1AFBD8B300F3D63B /* ORKReactionTimeViewController.m */; }; - 25ECC09F1AFBD92D00F3D63B /* ORKReactionTimeContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC09D1AFBD92D00F3D63B /* ORKReactionTimeContentView.h */; }; - 25ECC0A01AFBD92D00F3D63B /* ORKReactionTimeContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC09E1AFBD92D00F3D63B /* ORKReactionTimeContentView.m */; }; - 25ECC0A31AFBDD2700F3D63B /* ORKReactionTimeStimulusView.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC0A11AFBDD2700F3D63B /* ORKReactionTimeStimulusView.h */; }; - 25ECC0A41AFBDD2700F3D63B /* ORKReactionTimeStimulusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC0A21AFBDD2700F3D63B /* ORKReactionTimeStimulusView.m */; }; - 2E557D2C2032AB6D007B39D6 /* ORKSpeechRecognitionError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3408C92028E13B0027D6B8 /* ORKSpeechRecognitionError.h */; }; - 2E8070941FA7DC5100E4FC7F /* ORKStreamingAudioRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E80C1A81FA2A6E500399A0C /* ORKStreamingAudioRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 2E8070F71FAD217500E4FC7F /* ORKSpeechRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070F11FAD217400E4FC7F /* ORKSpeechRecognizer.h */; }; - 2E8070F81FAD217500E4FC7F /* ORKSpeechRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070F21FAD217400E4FC7F /* ORKSpeechRecognizer.m */; }; - 2E8070F91FAD217500E4FC7F /* ORKSpeechRecognitionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070F31FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.m */; }; - 2E8070FA1FAD217500E4FC7F /* ORKSpeechRecognitionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070F41FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 2E8070FB1FAD217500E4FC7F /* ORKSpeechRecognitionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070F51FAD217400E4FC7F /* ORKSpeechRecognitionStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 2E8070FC1FAD217500E4FC7F /* ORKSpeechRecognitionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070F61FAD217400E4FC7F /* ORKSpeechRecognitionStep.m */; }; - 2E8070FF1FAD256A00E4FC7F /* ORKSpeechRecognitionContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070FE1FAD256A00E4FC7F /* ORKSpeechRecognitionContentView.m */; }; - 2E8071021FB0E6BE00E4FC7F /* ORKAudioGraphView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8071001FB0E6BE00E4FC7F /* ORKAudioGraphView.m */; }; - 2E8071031FB0E6BE00E4FC7F /* ORKAudioGraphView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8071011FB0E6BE00E4FC7F /* ORKAudioGraphView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 2E8071131FB0EEF900E4FC7F /* ORKSpeechRecognitionContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070FD1FAD255000E4FC7F /* ORKSpeechRecognitionContentView.h */; }; - 2E80C1AA1FA2AA8D00399A0C /* ORKStreamingAudioRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E80C1A91FA2AA8D00399A0C /* ORKStreamingAudioRecorder.m */; }; 2EBFE11D1AE1B32D00CB8254 /* ORKUIViewAccessibilityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EBFE11C1AE1B32D00CB8254 /* ORKUIViewAccessibilityTests.m */; }; 2EBFE1201AE1B74100CB8254 /* ORKVoiceEngineTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EBFE11F1AE1B74100CB8254 /* ORKVoiceEngineTests.m */; }; - 51198769245CA50D004FC2C7 /* ORKUSDZModelManagerScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 51198767245CA50D004FC2C7 /* ORKUSDZModelManagerScene.h */; }; - 5119876A245CA50D004FC2C7 /* ORKUSDZModelManagerScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 51198768245CA50D004FC2C7 /* ORKUSDZModelManagerScene.m */; }; - 5119879B245FC33C004FC2C7 /* ORK3DModelManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 51198799245FC33C004FC2C7 /* ORK3DModelManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5119879C245FC33C004FC2C7 /* ORK3DModelManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5119879A245FC33C004FC2C7 /* ORK3DModelManager.m */; }; - 5119879F245FE68D004FC2C7 /* ORKUSDZModelManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5119879D245FE68D004FC2C7 /* ORKUSDZModelManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511987A0245FE68D004FC2C7 /* ORKUSDZModelManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5119879E245FE68D004FC2C7 /* ORKUSDZModelManager.m */; }; 511987C3246330CA004FC2C7 /* ORKRequestPermissionsStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 511987C1246330CA004FC2C7 /* ORKRequestPermissionsStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 511987C4246330CA004FC2C7 /* ORKRequestPermissionsStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 511987C2246330CA004FC2C7 /* ORKRequestPermissionsStep.m */; }; - 511987C72463316E004FC2C7 /* ORKRequestPermissionsStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511987C52463316E004FC2C7 /* ORKRequestPermissionsStepViewController.h */; }; - 511987C82463316E004FC2C7 /* ORKRequestPermissionsStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511987C62463316E004FC2C7 /* ORKRequestPermissionsStepViewController.m */; }; - 511A7891294D67F80011D85D /* ORKTextButtonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 511A7890294D67F80011D85D /* ORKTextButtonTests.swift */; }; - 511B8A91293A757E00049947 /* ORKTouchAbilityContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8A8F293A757E00049947 /* ORKTouchAbilityContentView.h */; }; - 511B8A92293A757E00049947 /* ORKTouchAbilityContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8A90293A757E00049947 /* ORKTouchAbilityContentView.m */; }; - 511B8A95293A759300049947 /* ORKTouchAbilityArrowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8A93293A759200049947 /* ORKTouchAbilityArrowView.h */; }; - 511B8A96293A759300049947 /* ORKTouchAbilityArrowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8A94293A759300049947 /* ORKTouchAbilityArrowView.m */; }; - 511B8A99293A75B900049947 /* ORKTouchAbilityTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8A97293A75B900049947 /* ORKTouchAbilityTouch.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8A9A293A75B900049947 /* ORKTouchAbilityTouch.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8A98293A75B900049947 /* ORKTouchAbilityTouch.m */; }; - 511B8A9D293A75F300049947 /* ORKTouchAbilityTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8A9B293A75F300049947 /* ORKTouchAbilityTrack.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8A9E293A75F300049947 /* ORKTouchAbilityTrack.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8A9C293A75F300049947 /* ORKTouchAbilityTrack.m */; }; - 511B8AA0293A760A00049947 /* ORKTouchAbilityTrack_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8A9F293A760A00049947 /* ORKTouchAbilityTrack_Internal.h */; }; - 511B8AA3293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AA1293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.m */; }; - 511B8AA4293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AA2293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AA7293A764900049947 /* ORKTouchAbilityTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AA5293A764900049947 /* ORKTouchAbilityTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AA8293A764900049947 /* ORKTouchAbilityTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AA6293A764900049947 /* ORKTouchAbilityTrial.m */; }; - 511B8AAA293A766300049947 /* ORKTouchAbilityTrial_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AA9293A766300049947 /* ORKTouchAbilityTrial_Internal.h */; }; - 511B8AAD293A767C00049947 /* ORKTouchAbilityTouchTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AAB293A767C00049947 /* ORKTouchAbilityTouchTracker.m */; }; - 511B8AAE293A767C00049947 /* ORKTouchAbilityTouchTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AAC293A767C00049947 /* ORKTouchAbilityTouchTracker.h */; }; - 511B8AB1293A76A100049947 /* ORKTouchAbilityTapStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AAF293A76A100049947 /* ORKTouchAbilityTapStep.m */; }; - 511B8AB2293A76A100049947 /* ORKTouchAbilityTapStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AB0293A76A100049947 /* ORKTouchAbilityTapStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 511B8AB5293A76B200049947 /* ORKTouchAbilityTapStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AB3293A76B200049947 /* ORKTouchAbilityTapStepViewController.m */; }; - 511B8AB6293A76B200049947 /* ORKTouchAbilityTapStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AB4293A76B200049947 /* ORKTouchAbilityTapStepViewController.h */; }; - 511B8AB9293A76DE00049947 /* ORKTouchAbilityTapContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AB7293A76DE00049947 /* ORKTouchAbilityTapContentView.h */; }; - 511B8ABA293A76DE00049947 /* ORKTouchAbilityTapContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AB8293A76DE00049947 /* ORKTouchAbilityTapContentView.m */; }; - 511B8ABD293A770D00049947 /* ORKTouchAbilityTapTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8ABB293A770D00049947 /* ORKTouchAbilityTapTrial.m */; }; - 511B8ABE293A770D00049947 /* ORKTouchAbilityTapTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8ABC293A770D00049947 /* ORKTouchAbilityTapTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AC1293A772400049947 /* ORKTouchAbilityTapResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8ABF293A772400049947 /* ORKTouchAbilityTapResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AC2293A772400049947 /* ORKTouchAbilityTapResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AC0293A772400049947 /* ORKTouchAbilityTapResult.m */; }; - 511B8AC8293A777400049947 /* ORKTouchAbilityLongPressStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AC4293A777400049947 /* ORKTouchAbilityLongPressStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 511B8AC9293A777400049947 /* ORKTouchAbilityLongPressStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AC5293A777400049947 /* ORKTouchAbilityLongPressStep.m */; }; - 511B8ACA293A777400049947 /* ORKTouchAbilityLongPressStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AC6293A777400049947 /* ORKTouchAbilityLongPressStepViewController.m */; }; - 511B8ACB293A777400049947 /* ORKTouchAbilityLongPressStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AC7293A777400049947 /* ORKTouchAbilityLongPressStepViewController.h */; }; - 511B8ACE293A779200049947 /* ORKTouchAbilityLongPressContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8ACC293A779200049947 /* ORKTouchAbilityLongPressContentView.m */; }; - 511B8ACF293A779200049947 /* ORKTouchAbilityLongPressContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8ACD293A779200049947 /* ORKTouchAbilityLongPressContentView.h */; }; - 511B8AD2293A77AA00049947 /* ORKTouchAbilityLongPressTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AD0293A77AA00049947 /* ORKTouchAbilityLongPressTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AD3293A77AA00049947 /* ORKTouchAbilityLongPressTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AD1293A77AA00049947 /* ORKTouchAbilityLongPressTrial.m */; }; - 511B8AD6293A77BE00049947 /* ORKTouchAbilityLongPressResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AD4293A77BE00049947 /* ORKTouchAbilityLongPressResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AD7293A77BE00049947 /* ORKTouchAbilityLongPressResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AD5293A77BE00049947 /* ORKTouchAbilityLongPressResult.m */; }; - 511B8ADB293A781000049947 /* ORKTouchAbilitySwipeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AD9293A781000049947 /* ORKTouchAbilitySwipeStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 511B8ADC293A781000049947 /* ORKTouchAbilitySwipeStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8ADA293A781000049947 /* ORKTouchAbilitySwipeStep.m */; }; - 511B8ADF293A782800049947 /* ORKTouchAbilitySwipeStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8ADD293A782800049947 /* ORKTouchAbilitySwipeStepViewController.h */; }; - 511B8AE0293A782800049947 /* ORKTouchAbilitySwipeStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8ADE293A782800049947 /* ORKTouchAbilitySwipeStepViewController.m */; }; - 511B8AE3293A783B00049947 /* ORKTouchAbilitySwipeContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AE1293A783B00049947 /* ORKTouchAbilitySwipeContentView.h */; }; - 511B8AE4293A783B00049947 /* ORKTouchAbilitySwipeContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AE2293A783B00049947 /* ORKTouchAbilitySwipeContentView.m */; }; - 511B8AED293A785A00049947 /* ORKTouchAbilitySwipeTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AE9293A785900049947 /* ORKTouchAbilitySwipeTrial.m */; }; - 511B8AEE293A785A00049947 /* ORKTouchAbilitySwipeTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AEA293A785900049947 /* ORKTouchAbilitySwipeTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AEF293A785A00049947 /* ORKTouchAbilitySwipeResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AEB293A785900049947 /* ORKTouchAbilitySwipeResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8AF0293A785A00049947 /* ORKTouchAbilitySwipeResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AEC293A785900049947 /* ORKTouchAbilitySwipeResult.m */; }; - 511B8AF6293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AF2293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.m */; }; - 511B8AF7293A78BB00049947 /* ORKTouchAbilityScrollStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AF3293A78BB00049947 /* ORKTouchAbilityScrollStep.m */; }; - 511B8AF8293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AF4293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.h */; }; - 511B8AF9293A78BB00049947 /* ORKTouchAbilityScrollStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AF5293A78BB00049947 /* ORKTouchAbilityScrollStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 511B8AFC293A78CF00049947 /* ORKTouchAbilityScrollContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AFA293A78CF00049947 /* ORKTouchAbilityScrollContentView.h */; }; - 511B8AFD293A78CF00049947 /* ORKTouchAbilityScrollContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AFB293A78CF00049947 /* ORKTouchAbilityScrollContentView.m */; }; - 511B8B00293A78EF00049947 /* ORKTouchAbilityScrollTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8AFE293A78EF00049947 /* ORKTouchAbilityScrollTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8B01293A78EF00049947 /* ORKTouchAbilityScrollTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8AFF293A78EF00049947 /* ORKTouchAbilityScrollTrial.m */; }; - 511B8B04293A791B00049947 /* ORKTouchAbilityScrollResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B02293A791B00049947 /* ORKTouchAbilityScrollResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8B05293A791B00049947 /* ORKTouchAbilityScrollResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B03293A791B00049947 /* ORKTouchAbilityScrollResult.m */; }; - 511B8B09293A794D00049947 /* ORKTouchAbilityPinchStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B07293A794D00049947 /* ORKTouchAbilityPinchStep.m */; }; - 511B8B0A293A794D00049947 /* ORKTouchAbilityPinchStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B08293A794D00049947 /* ORKTouchAbilityPinchStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 511B8B0D293A795900049947 /* ORKTouchAbilityPinchStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B0B293A795800049947 /* ORKTouchAbilityPinchStepViewController.h */; }; - 511B8B0E293A795900049947 /* ORKTouchAbilityPinchStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B0C293A795900049947 /* ORKTouchAbilityPinchStepViewController.m */; }; - 511B8B11293A796600049947 /* ORKTouchAbilityPinchContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B0F293A796600049947 /* ORKTouchAbilityPinchContentView.h */; }; - 511B8B12293A796600049947 /* ORKTouchAbilityPinchContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B10293A796600049947 /* ORKTouchAbilityPinchContentView.m */; }; - 511B8B15293A797C00049947 /* ORKTouchAbilityPinchGuideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B13293A797C00049947 /* ORKTouchAbilityPinchGuideView.m */; }; - 511B8B16293A797C00049947 /* ORKTouchAbilityPinchGuideView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B14293A797C00049947 /* ORKTouchAbilityPinchGuideView.h */; }; - 511B8B19293A798D00049947 /* ORKTouchAbilityPinchTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B17293A798D00049947 /* ORKTouchAbilityPinchTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8B1A293A798D00049947 /* ORKTouchAbilityPinchTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B18293A798D00049947 /* ORKTouchAbilityPinchTrial.m */; }; - 511B8B1D293A799800049947 /* ORKTouchAbilityPinchResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B1B293A799800049947 /* ORKTouchAbilityPinchResult.m */; }; - 511B8B1E293A799800049947 /* ORKTouchAbilityPinchResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B1C293A799800049947 /* ORKTouchAbilityPinchResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8B24293A79C000049947 /* ORKTouchAbilityRotationStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B20293A79C000049947 /* ORKTouchAbilityRotationStepViewController.m */; }; - 511B8B25293A79C000049947 /* ORKTouchAbilityRotationStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B21293A79C000049947 /* ORKTouchAbilityRotationStepViewController.h */; }; - 511B8B26293A79C000049947 /* ORKTouchAbilityRotationStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B22293A79C000049947 /* ORKTouchAbilityRotationStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 511B8B27293A79C000049947 /* ORKTouchAbilityRotationStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B23293A79C000049947 /* ORKTouchAbilityRotationStep.m */; }; - 511B8B2A293A79E500049947 /* ORKTouchAbilityRotationContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B28293A79E400049947 /* ORKTouchAbilityRotationContentView.h */; }; - 511B8B2B293A79E500049947 /* ORKTouchAbilityRotationContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B29293A79E400049947 /* ORKTouchAbilityRotationContentView.m */; }; - 511B8B2E293A79FF00049947 /* ORKTouchAbilityRotationTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B2C293A79FF00049947 /* ORKTouchAbilityRotationTrial.m */; }; - 511B8B2F293A79FF00049947 /* ORKTouchAbilityRotationTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B2D293A79FF00049947 /* ORKTouchAbilityRotationTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 511B8B32293A7A0B00049947 /* ORKTouchAbilityRotationResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 511B8B30293A7A0B00049947 /* ORKTouchAbilityRotationResult.m */; }; - 511B8B33293A7A0B00049947 /* ORKTouchAbilityRotationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 511B8B31293A7A0B00049947 /* ORKTouchAbilityRotationResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 515310CF233570CF007BCA58 /* ORKDontKnowButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 515310CD233570CF007BCA58 /* ORKDontKnowButton.h */; }; - 515310D0233570CF007BCA58 /* ORKDontKnowButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 515310CE233570CF007BCA58 /* ORKDontKnowButton.m */; }; - 5166E49F247355D500151C57 /* ORKUSDZModelManagerResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5166E49D247355D500151C57 /* ORKUSDZModelManagerResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5166E4A0247355D500151C57 /* ORKUSDZModelManagerResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5166E49E247355D500151C57 /* ORKUSDZModelManagerResult.m */; }; - 5170009D254A197300CACE12 /* ORKRequestPermissionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 5170009C254A197300CACE12 /* ORKRequestPermissionButton.m */; }; - 5170009E254A255F00CACE12 /* ORKRequestPermissionButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 5170009B254A191F00CACE12 /* ORKRequestPermissionButton.h */; }; - 5175144E2459EBF0009E8FFC /* ORK3DModelStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5175144C2459EBF0009E8FFC /* ORK3DModelStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5175144F2459EBF0009E8FFC /* ORK3DModelStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5175144D2459EBF0009E8FFC /* ORK3DModelStep.m */; }; - 517514522459EF5D009E8FFC /* ORK3DModelStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 517514502459EF5D009E8FFC /* ORK3DModelStepViewController.h */; }; - 517514532459EF5D009E8FFC /* ORK3DModelStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 517514512459EF5D009E8FFC /* ORK3DModelStepViewController.m */; }; - 517514562459F0BE009E8FFC /* ORK3DModelStepContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 517514542459F0BE009E8FFC /* ORK3DModelStepContentView.h */; }; - 517514572459F0BE009E8FFC /* ORK3DModelStepContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 517514552459F0BE009E8FFC /* ORK3DModelStepContentView.m */; }; - 5175145E245A4FF1009E8FFC /* ORKFrontFacingCameraStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5175145C245A4FF1009E8FFC /* ORKFrontFacingCameraStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5175145F245A4FF1009E8FFC /* ORKFrontFacingCameraStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5175145D245A4FF1009E8FFC /* ORKFrontFacingCameraStep.m */; }; - 51751463245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 51751461245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.h */; }; - 51751464245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 51751462245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.m */; }; - 51751467245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51751465245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.h */; }; - 51751468245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51751466245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.m */; }; - 5190141924759E6800E3A418 /* ORKFrontFacingCameraStepResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5190141724759E6800E3A418 /* ORKFrontFacingCameraStepResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5190141A24759E6800E3A418 /* ORKFrontFacingCameraStepResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5190141824759E6800E3A418 /* ORKFrontFacingCameraStepResult.m */; }; - 51906C51291D790800FF4185 /* ORKLandoltCStepContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C4D291D790700FF4185 /* ORKLandoltCStepContentView.swift */; }; - 51906C52291D790800FF4185 /* ORKLandoltCStepViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C4E291D790700FF4185 /* ORKLandoltCStepViewController.swift */; }; - 51906C53291D790800FF4185 /* ORKLandoltCStep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C4F291D790700FF4185 /* ORKLandoltCStep.swift */; }; - 51906C54291D790800FF4185 /* ORKLandoltCResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C50291D790700FF4185 /* ORKLandoltCResult.swift */; }; - 51906C56291D791900FF4185 /* ExtensionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C55291D791900FF4185 /* ExtensionModel.swift */; }; - 51906C59291D794400FF4185 /* TrackLayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C58291D794400FF4185 /* TrackLayer.swift */; }; - 51906C5D291D796600FF4185 /* Math.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C5A291D796600FF4185 /* Math.swift */; }; - 51906C5E291D796600FF4185 /* CircleSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C5B291D796600FF4185 /* CircleSlider.swift */; }; - 51906C5F291D796600FF4185 /* EyeActivitySlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C5C291D796600FF4185 /* EyeActivitySlider.swift */; }; - 51906C65291D7A5A00FF4185 /* ORKSwiftStroopStep.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C61291D7A5A00FF4185 /* ORKSwiftStroopStep.swift */; }; - 51906C66291D7A5A00FF4185 /* ORKSwiftStroopResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C62291D7A5A00FF4185 /* ORKSwiftStroopResult.swift */; }; - 51906C67291D7A5A00FF4185 /* ORKSwiftStroopContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C63291D7A5A00FF4185 /* ORKSwiftStroopContentView.swift */; }; - 51906C68291D7A5A00FF4185 /* ORKSwiftStroopStepViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51906C64291D7A5A00FF4185 /* ORKSwiftStroopStepViewController.swift */; }; - 519C298126D027AB00FD5F44 /* SwiftUIViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519C298026D027AB00FD5F44 /* SwiftUIViewFactory.swift */; }; - 519C298E26D027E500FD5F44 /* TextChoiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519C298D26D027E500FD5F44 /* TextChoiceView.swift */; }; - 51BF30BE247B330900E2E669 /* ORKIconButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BF30BC247B330900E2E669 /* ORKIconButton.h */; }; - 51BF30BF247B330A00E2E669 /* ORKIconButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 51BF30BD247B330900E2E669 /* ORKIconButton.m */; }; - 51D823052472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D823032472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.h */; }; - 51D823062472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51D823042472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.m */; }; - 51DB3848293E811C0089C82C /* ResearchKit_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 51DB3847293E811C0089C82C /* ResearchKit_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 511BB024298DCCC200936EC0 /* ORKSpeechRecognitionStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 511BB022298DCCC200936EC0 /* ORKSpeechRecognitionStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 511E8D622995C20E00A384A5 /* ORKEnvironmentSPLMeterStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 511E8D602995C20E00A384A5 /* ORKEnvironmentSPLMeterStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 512741272B1557220045A449 /* ResearchKit.docc in Sources */ = {isa = PBXBuildFile; fileRef = 512741262B1557220045A449 /* ResearchKit.docc */; }; + 5156C9C52B7E426900983535 /* ORKTouchAbilityArrowView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9C12B7E426900983535 /* ORKTouchAbilityArrowView.h */; }; + 5156C9C62B7E426900983535 /* ORKTouchAbilityContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9C22B7E426900983535 /* ORKTouchAbilityContentView.m */; }; + 5156C9C72B7E426900983535 /* ORKTouchAbilityContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9C32B7E426900983535 /* ORKTouchAbilityContentView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156C9C82B7E426900983535 /* ORKTouchAbilityArrowView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9C42B7E426900983535 /* ORKTouchAbilityArrowView.m */; }; + 5156C9D62B7E42C200983535 /* ORKTouchAbilityTouchTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9CA2B7E42C100983535 /* ORKTouchAbilityTouchTracker.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156C9D72B7E42C200983535 /* ORKTouchAbilityTrack_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9CB2B7E42C100983535 /* ORKTouchAbilityTrack_Internal.h */; }; + 5156C9D82B7E42C200983535 /* ORKTouchAbilityGestureRecoginzerEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9CC2B7E42C100983535 /* ORKTouchAbilityGestureRecoginzerEvent.m */; }; + 5156C9D92B7E42C200983535 /* ORKTouchAbilityTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9CD2B7E42C100983535 /* ORKTouchAbilityTouch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156C9DA2B7E42C200983535 /* ORKTouchAbilityTrial_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9CE2B7E42C100983535 /* ORKTouchAbilityTrial_Internal.h */; }; + 5156C9DB2B7E42C200983535 /* ORKTouchAbilityTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9CF2B7E42C100983535 /* ORKTouchAbilityTrack.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156C9DC2B7E42C200983535 /* ORKTouchAbilityTouch.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9D02B7E42C100983535 /* ORKTouchAbilityTouch.m */; }; + 5156C9DD2B7E42C200983535 /* ORKTouchAbilityTouchTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9D12B7E42C100983535 /* ORKTouchAbilityTouchTracker.m */; }; + 5156C9DE2B7E42C200983535 /* ORKTouchAbilityTrack.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9D22B7E42C100983535 /* ORKTouchAbilityTrack.m */; }; + 5156C9DF2B7E42C200983535 /* ORKTouchAbilityTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9D32B7E42C200983535 /* ORKTouchAbilityTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156C9E02B7E42C200983535 /* ORKTouchAbilityTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9D42B7E42C200983535 /* ORKTouchAbilityTrial.m */; }; + 5156C9E12B7E42C200983535 /* ORKTouchAbilityGestureRecoginzerEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9D52B7E42C200983535 /* ORKTouchAbilityGestureRecoginzerEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156C9ED2B7E437A00983535 /* ORKTouchAbilityTapStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9E32B7E437A00983535 /* ORKTouchAbilityTapStepViewController.h */; }; + 5156C9EE2B7E437A00983535 /* ORKTouchAbilityTapStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9E42B7E437A00983535 /* ORKTouchAbilityTapStepViewController.m */; }; + 5156C9EF2B7E437A00983535 /* ORKTouchAbilityTapResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9E52B7E437A00983535 /* ORKTouchAbilityTapResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156C9F02B7E437A00983535 /* ORKTouchAbilityTapStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9E62B7E437A00983535 /* ORKTouchAbilityTapStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156C9F12B7E437A00983535 /* ORKTouchAbilityTapContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9E72B7E437A00983535 /* ORKTouchAbilityTapContentView.m */; }; + 5156C9F22B7E437A00983535 /* ORKTouchAbilityTapContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9E82B7E437A00983535 /* ORKTouchAbilityTapContentView.h */; }; + 5156C9F32B7E437A00983535 /* ORKTouchAbilityTapTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9E92B7E437A00983535 /* ORKTouchAbilityTapTrial.m */; }; + 5156C9F42B7E437A00983535 /* ORKTouchAbilityTapTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9EA2B7E437A00983535 /* ORKTouchAbilityTapTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156C9F52B7E437A00983535 /* ORKTouchAbilityTapResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9EB2B7E437A00983535 /* ORKTouchAbilityTapResult.m */; }; + 5156C9F62B7E437A00983535 /* ORKTouchAbilityTapStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9EC2B7E437A00983535 /* ORKTouchAbilityTapStep.m */; }; + 5156CA022B7E440A00983535 /* ORKTouchAbilityLongPressTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9F82B7E440A00983535 /* ORKTouchAbilityLongPressTrial.m */; }; + 5156CA032B7E440A00983535 /* ORKTouchAbilityLongPressContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9F92B7E440A00983535 /* ORKTouchAbilityLongPressContentView.m */; }; + 5156CA042B7E440A00983535 /* ORKTouchAbilityLongPressStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9FA2B7E440A00983535 /* ORKTouchAbilityLongPressStep.m */; }; + 5156CA052B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9FB2B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.h */; }; + 5156CA062B7E440A00983535 /* ORKTouchAbilityLongPressResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9FC2B7E440A00983535 /* ORKTouchAbilityLongPressResult.m */; }; + 5156CA072B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156C9FD2B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.m */; }; + 5156CA082B7E440A00983535 /* ORKTouchAbilityLongPressContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9FE2B7E440A00983535 /* ORKTouchAbilityLongPressContentView.h */; }; + 5156CA092B7E440A00983535 /* ORKTouchAbilityLongPressStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156C9FF2B7E440A00983535 /* ORKTouchAbilityLongPressStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156CA0A2B7E440A00983535 /* ORKTouchAbilityLongPressTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA002B7E440A00983535 /* ORKTouchAbilityLongPressTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA0B2B7E440A00983535 /* ORKTouchAbilityLongPressResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA012B7E440A00983535 /* ORKTouchAbilityLongPressResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA172B7E448600983535 /* ORKTouchAbilitySwipeContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA0D2B7E448600983535 /* ORKTouchAbilitySwipeContentView.h */; }; + 5156CA182B7E448600983535 /* ORKTouchAbilitySwipeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA0E2B7E448600983535 /* ORKTouchAbilitySwipeStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156CA192B7E448600983535 /* ORKTouchAbilitySwipeTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA0F2B7E448600983535 /* ORKTouchAbilitySwipeTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA1A2B7E448600983535 /* ORKTouchAbilitySwipeStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA102B7E448600983535 /* ORKTouchAbilitySwipeStep.m */; }; + 5156CA1B2B7E448600983535 /* ORKTouchAbilitySwipeContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA112B7E448600983535 /* ORKTouchAbilitySwipeContentView.m */; }; + 5156CA1C2B7E448600983535 /* ORKTouchAbilitySwipeResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA122B7E448600983535 /* ORKTouchAbilitySwipeResult.m */; }; + 5156CA1D2B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA132B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.m */; }; + 5156CA1E2B7E448600983535 /* ORKTouchAbilitySwipeResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA142B7E448600983535 /* ORKTouchAbilitySwipeResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA1F2B7E448600983535 /* ORKTouchAbilitySwipeTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA152B7E448600983535 /* ORKTouchAbilitySwipeTrial.m */; }; + 5156CA202B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA162B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.h */; }; + 5156CA2C2B7E451C00983535 /* ORKTouchAbilityScrollStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA222B7E451B00983535 /* ORKTouchAbilityScrollStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156CA2D2B7E451C00983535 /* ORKTouchAbilityScrollContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA232B7E451B00983535 /* ORKTouchAbilityScrollContentView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156CA2E2B7E451C00983535 /* ORKTouchAbilityScrollStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA242B7E451B00983535 /* ORKTouchAbilityScrollStep.m */; }; + 5156CA2F2B7E451C00983535 /* ORKTouchAbilityScrollStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA252B7E451B00983535 /* ORKTouchAbilityScrollStepViewController.h */; }; + 5156CA302B7E451C00983535 /* ORKTouchAbilityScrollStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA262B7E451B00983535 /* ORKTouchAbilityScrollStepViewController.m */; }; + 5156CA312B7E451C00983535 /* ORKTouchAbilityScrollResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA272B7E451B00983535 /* ORKTouchAbilityScrollResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA322B7E451C00983535 /* ORKTouchAbilityScrollResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA282B7E451B00983535 /* ORKTouchAbilityScrollResult.m */; }; + 5156CA332B7E451C00983535 /* ORKTouchAbilityScrollTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA292B7E451B00983535 /* ORKTouchAbilityScrollTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA342B7E451C00983535 /* ORKTouchAbilityScrollContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA2A2B7E451B00983535 /* ORKTouchAbilityScrollContentView.m */; }; + 5156CA352B7E451C00983535 /* ORKTouchAbilityScrollTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA2B2B7E451C00983535 /* ORKTouchAbilityScrollTrial.m */; }; + 5156CA432B7E45AE00983535 /* ORKTouchAbilityPinchResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA372B7E45AE00983535 /* ORKTouchAbilityPinchResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA442B7E45AE00983535 /* ORKTouchAbilityPinchTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA382B7E45AE00983535 /* ORKTouchAbilityPinchTrial.m */; }; + 5156CA452B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA392B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.h */; }; + 5156CA462B7E45AE00983535 /* ORKTouchAbilityPinchContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA3A2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.m */; }; + 5156CA472B7E45AE00983535 /* ORKTouchAbilityPinchStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA3B2B7E45AE00983535 /* ORKTouchAbilityPinchStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156CA482B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA3C2B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.m */; }; + 5156CA492B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA3D2B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.h */; }; + 5156CA4A2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA3E2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.h */; }; + 5156CA4B2B7E45AE00983535 /* ORKTouchAbilityPinchResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA3F2B7E45AE00983535 /* ORKTouchAbilityPinchResult.m */; }; + 5156CA4C2B7E45AE00983535 /* ORKTouchAbilityPinchTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA402B7E45AE00983535 /* ORKTouchAbilityPinchTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA4D2B7E45AE00983535 /* ORKTouchAbilityPinchStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA412B7E45AE00983535 /* ORKTouchAbilityPinchStep.m */; }; + 5156CA4E2B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA422B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.m */; }; + 5156CA5A2B7E465500983535 /* ORKTouchAbilityRotationStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA502B7E465400983535 /* ORKTouchAbilityRotationStepViewController.h */; }; + 5156CA5B2B7E465500983535 /* ORKTouchAbilityRotationContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA512B7E465400983535 /* ORKTouchAbilityRotationContentView.m */; }; + 5156CA5C2B7E465500983535 /* ORKTouchAbilityRotationStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA522B7E465500983535 /* ORKTouchAbilityRotationStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5156CA5D2B7E465500983535 /* ORKTouchAbilityRotationResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA532B7E465500983535 /* ORKTouchAbilityRotationResult.m */; }; + 5156CA5E2B7E465500983535 /* ORKTouchAbilityRotationContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA542B7E465500983535 /* ORKTouchAbilityRotationContentView.h */; }; + 5156CA5F2B7E465500983535 /* ORKTouchAbilityRotationTrial.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA552B7E465500983535 /* ORKTouchAbilityRotationTrial.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5156CA602B7E465500983535 /* ORKTouchAbilityRotationStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA562B7E465500983535 /* ORKTouchAbilityRotationStepViewController.m */; }; + 5156CA612B7E465500983535 /* ORKTouchAbilityRotationTrial.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA572B7E465500983535 /* ORKTouchAbilityRotationTrial.m */; }; + 5156CA622B7E465500983535 /* ORKTouchAbilityRotationStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5156CA582B7E465500983535 /* ORKTouchAbilityRotationStep.m */; }; + 5156CA632B7E465500983535 /* ORKTouchAbilityRotationResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5156CA592B7E465500983535 /* ORKTouchAbilityRotationResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BEE62AE043A2006E43FB /* ORKTimedWalkStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BEE42AE043A2006E43FB /* ORKTimedWalkStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BEE72AE043A2006E43FB /* ORKTimedWalkStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BEE52AE043A2006E43FB /* ORKTimedWalkStep.m */; }; + 5192BEEC2AE043D3006E43FB /* ORKTimedWalkContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BEE82AE043D3006E43FB /* ORKTimedWalkContentView.m */; }; + 5192BEED2AE043D3006E43FB /* ORKTimedWalkStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BEE92AE043D3006E43FB /* ORKTimedWalkStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BEEE2AE043D3006E43FB /* ORKTimedWalkContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BEEA2AE043D3006E43FB /* ORKTimedWalkContentView.h */; }; + 5192BEEF2AE043D3006E43FB /* ORKTimedWalkStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BEEB2AE043D3006E43FB /* ORKTimedWalkStepViewController.m */; }; + 5192BF502AE09673006E43FB /* ORKPredicateFormItemVisibilityRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF4D2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BF512AE09673006E43FB /* ORKPredicateFormItemVisibilityRule.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF4E2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule.m */; }; + 5192BF522AE09673006E43FB /* ORKPredicateFormItemVisibilityRule_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF4F2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 5192BF592AE09794006E43FB /* ORKFormItemVisibilityRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF572AE09793006E43FB /* ORKFormItemVisibilityRule.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BF5A2AE09794006E43FB /* ORKFormItemVisibilityRule.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF582AE09794006E43FB /* ORKFormItemVisibilityRule.m */; }; + 5192BF5D2AE19036006E43FB /* frequency_dBSPL_AIRPODSPROV2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5192BF5C2AE19036006E43FB /* frequency_dBSPL_AIRPODSPROV2.plist */; }; + 5192BF7D2AE1A87D006E43FB /* retspl_AIRPODSPROV2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5192BF7C2AE1A87D006E43FB /* retspl_AIRPODSPROV2.plist */; }; + 5192BF7F2AE1A9BA006E43FB /* volume_curve_AIRPODSPROV2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5192BF7E2AE1A9BA006E43FB /* volume_curve_AIRPODSPROV2.plist */; }; + 5192BF842AE1BA47006E43FB /* ORKFrontFacingCameraStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF802AE1BA47006E43FB /* ORKFrontFacingCameraStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BF852AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF812AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.m */; }; + 5192BF862AE1BA47006E43FB /* ORKFrontFacingCameraStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF822AE1BA47006E43FB /* ORKFrontFacingCameraStep.m */; }; + 5192BF872AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF832AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BF8A2AE1BBB0006E43FB /* ORKSecondaryTaskStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF882AE1BBB0006E43FB /* ORKSecondaryTaskStep.m */; }; + 5192BF8B2AE1BBB0006E43FB /* ORKSecondaryTaskStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF892AE1BBB0006E43FB /* ORKSecondaryTaskStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BF8F2AE1C051006E43FB /* ORKAgePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF8D2AE1C051006E43FB /* ORKAgePicker.h */; }; + 5192BF902AE1C051006E43FB /* ORKAgePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF8E2AE1C051006E43FB /* ORKAgePicker.m */; }; + 5192BF932AE1C2F8006E43FB /* ORKChoiceViewCell+ORKColorChoice.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF912AE1C2F7006E43FB /* ORKChoiceViewCell+ORKColorChoice.h */; }; + 5192BF942AE1C2F8006E43FB /* ORKChoiceViewCell+ORKColorChoice.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF922AE1C2F7006E43FB /* ORKChoiceViewCell+ORKColorChoice.m */; }; + 5192BF972AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF952AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.h */; }; + 5192BF982AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF962AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.m */; }; + 5192BF992AE1D876006E43FB /* ORKChoiceViewCell+ORKTextChoice.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B8444632A79C25000292DEA /* ORKChoiceViewCell+ORKTextChoice.h */; }; + 5192BF9A2AE1D8A4006E43FB /* ORKChoiceViewCell+ORKTextChoice.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B8444642A79C25000292DEA /* ORKChoiceViewCell+ORKTextChoice.m */; }; + 5192BF9D2AE1DE62006E43FB /* ORKColorChoiceCellGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 5192BF9B2AE1DE62006E43FB /* ORKColorChoiceCellGroup.m */; }; + 5192BF9E2AE1DE62006E43FB /* ORKColorChoiceCellGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 5192BF9C2AE1DE62006E43FB /* ORKColorChoiceCellGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5192BFA12AEAD7B5006E43FB /* Artwork.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 861610BF1A8D8EDD00245F7A /* Artwork.xcassets */; }; + 519CE8222C6582BE003BB584 /* ORKHealthCondition.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE8162C6582BD003BB584 /* ORKHealthCondition.m */; }; + 519CE8232C6582BE003BB584 /* ORKFamilyHistoryStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE8172C6582BD003BB584 /* ORKFamilyHistoryStep.m */; }; + 519CE8242C6582BE003BB584 /* ORKHealthCondition.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE8182C6582BD003BB584 /* ORKHealthCondition.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE8252C6582BE003BB584 /* ORKFamilyHistoryResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE8192C6582BD003BB584 /* ORKFamilyHistoryResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE8262C6582BE003BB584 /* ORKRelatedPerson.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE81A2C6582BD003BB584 /* ORKRelatedPerson.m */; }; + 519CE8272C6582BE003BB584 /* ORKRelativeGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE81B2C6582BD003BB584 /* ORKRelativeGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE8282C6582BE003BB584 /* ORKRelativeGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE81C2C6582BD003BB584 /* ORKRelativeGroup.m */; }; + 519CE8292C6582BE003BB584 /* ORKConditionStepConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE81D2C6582BE003BB584 /* ORKConditionStepConfiguration.m */; }; + 519CE82A2C6582BE003BB584 /* ORKConditionStepConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE81E2C6582BE003BB584 /* ORKConditionStepConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE82B2C6582BE003BB584 /* ORKFamilyHistoryStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE81F2C6582BE003BB584 /* ORKFamilyHistoryStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE82C2C6582BE003BB584 /* ORKRelatedPerson.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE8202C6582BE003BB584 /* ORKRelatedPerson.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE82D2C6582BE003BB584 /* ORKFamilyHistoryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE8212C6582BE003BB584 /* ORKFamilyHistoryResult.m */; }; + 519CE8352C658617003BB584 /* ORKFamilyHistoryStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE8302C658617003BB584 /* ORKFamilyHistoryStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE8382C658617003BB584 /* ORKFamilyHistoryStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE8332C658617003BB584 /* ORKFamilyHistoryStepViewController.m */; }; + 519CE8412C658654003BB584 /* ORKFamilyHistoryRelatedPersonCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE83B2C658653003BB584 /* ORKFamilyHistoryRelatedPersonCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE8422C658654003BB584 /* ORKFamilyHistoryRelatedPersonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE83C2C658653003BB584 /* ORKFamilyHistoryRelatedPersonCell.m */; }; + 519CE8432C658654003BB584 /* ORKFamilyHistoryTableFooterView.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE83D2C658653003BB584 /* ORKFamilyHistoryTableFooterView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 519CE8442C658654003BB584 /* ORKFamilyHistoryTableFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE83E2C658654003BB584 /* ORKFamilyHistoryTableFooterView.m */; }; + 519CE8452C658654003BB584 /* ORKFamilyHistoryTableHeaderView.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE83F2C658654003BB584 /* ORKFamilyHistoryTableHeaderView.h */; }; + 519CE8462C658654003BB584 /* ORKFamilyHistoryTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 519CE8402C658654003BB584 /* ORKFamilyHistoryTableHeaderView.m */; }; + 519CE85C2C6AD858003BB584 /* ORKFamilyHistoryStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 519CE85B2C6AD858003BB584 /* ORKFamilyHistoryStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 519CE85F2C6BC1DB003BB584 /* ORKFamilyHistoryResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519CE85E2C6BC1DB003BB584 /* ORKFamilyHistoryResultTests.swift */; }; + 51A11F172BD08D5E0060C07E /* HKSample+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A11F132BD08D5D0060C07E /* HKSample+ORKJSONDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51A11F182BD08D5E0060C07E /* CMMotionActivity+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 51A11F142BD08D5D0060C07E /* CMMotionActivity+ORKJSONDictionary.m */; }; + 51A11F192BD08D5E0060C07E /* HKSample+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 51A11F152BD08D5D0060C07E /* HKSample+ORKJSONDictionary.m */; }; + 51A11F1A2BD08D5E0060C07E /* CMMotionActivity+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A11F162BD08D5E0060C07E /* CMMotionActivity+ORKJSONDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51A11F222BD152660060C07E /* ORKActiveStepCustomView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A11F202BD152660060C07E /* ORKActiveStepCustomView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51A11F232BD152660060C07E /* ORKActiveStepCustomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51A11F212BD152660060C07E /* ORKActiveStepCustomView.m */; }; + 51A11F242BD1548C0060C07E /* UIImageView+ResearchKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B9CC5662A68C02C00080E29 /* UIImageView+ResearchKit.m */; }; + 51AEAAB22B744AC200F4D107 /* ORKQuestionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AEAAA82B743FA500F4D107 /* ORKQuestionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51AEAAB32B744ACC00F4D107 /* ORKQuestionStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AEAAA72B743FA500F4D107 /* ORKQuestionStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 51AEAAB42B744B5700F4D107 /* ORKQuestionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 51AEAAA62B743FA500F4D107 /* ORKQuestionStepViewController.m */; }; + 51AEAAB52B744BC000F4D107 /* ORKQuestionStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AEAAAE2B7446F400F4D107 /* ORKQuestionStepView.h */; }; + 51AEAAB62B744BC800F4D107 /* ORKQuestionStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51AEAAAF2B7446F400F4D107 /* ORKQuestionStepView.m */; }; + 51AF19582B583BBA00D3B399 /* ORKDataCollectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51AF19532B583BB900D3B399 /* ORKDataCollectionTests.m */; }; + 51AF19592B583BBA00D3B399 /* samples.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 51AF19542B583BB900D3B399 /* samples.bundle */; }; + 51AF19662B583D0F00D3B399 /* ORKESerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 51AF19552B583BB900D3B399 /* ORKESerialization.m */; }; + 51AF1B152B67F30500D3B399 /* ORKSignatureFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AF1B132B67F30500D3B399 /* ORKSignatureFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51AF1B162B67F30500D3B399 /* ORKSignatureFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 51AF1B142B67F30500D3B399 /* ORKSignatureFormatter.m */; }; + 51AF1B202B683C3400D3B399 /* ORKWebViewStepResult_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AF1B1F2B683C3400D3B399 /* ORKWebViewStepResult_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 51AF1B232B69803A00D3B399 /* Window.wav in Resources */ = {isa = PBXBuildFile; fileRef = 51AF1B212B69803A00D3B399 /* Window.wav */; }; + 51AF1B242B69803A00D3B399 /* Noise.wav in Resources */ = {isa = PBXBuildFile; fileRef = 51AF1B222B69803A00D3B399 /* Noise.wav */; }; + 51B76DFB2CB5B5A30061698A /* ResearchKitActiveTask.docc in Sources */ = {isa = PBXBuildFile; fileRef = 51B76DFA2CB5B5A30061698A /* ResearchKitActiveTask.docc */; }; + 51B76DFD2CB5C73C0061698A /* ResearchKitUI.docc in Sources */ = {isa = PBXBuildFile; fileRef = 51B76DFC2CB5C73C0061698A /* ResearchKitUI.docc */; }; + 51B94DBD2B311E810039B0E7 /* CLLocationManager+ResearchKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B94DBC2B311E810039B0E7 /* CLLocationManager+ResearchKit.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 51B94DC72B3254FE0039B0E7 /* CLLocationManager+ResearchKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 51B94DC62B3254FD0039B0E7 /* CLLocationManager+ResearchKit.m */; }; + 51BD8FC929D60FB60001D54E /* frequency_dBSPL_AIRPODSMAX.plist in Resources */ = {isa = PBXBuildFile; fileRef = E293655D25757CC700092A7C /* frequency_dBSPL_AIRPODSMAX.plist */; }; + 51BD8FCA29D60FB60001D54E /* frequency_dBSPL_EARPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 713D4B1B20FE5464002BE28D /* frequency_dBSPL_EARPODS.plist */; }; + 51BD8FCB29D60FB60001D54E /* frequency_dBSPL_AIRPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71B7B4D820AA91D400C5768A /* frequency_dBSPL_AIRPODS.plist */; }; + 51BD8FCC29D60FB60001D54E /* volume_curve_AIRPODSV3.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2246E5142749350200261D5A /* volume_curve_AIRPODSV3.plist */; }; + 51BD8FCD29D60FB60001D54E /* retspl_AIRPODSMAX.plist in Resources */ = {isa = PBXBuildFile; fileRef = E293655F25757E6100092A7C /* retspl_AIRPODSMAX.plist */; }; + 51BD8FCE29D60FB60001D54E /* retspl_EARPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 713D4B1D20FE5480002BE28D /* retspl_EARPODS.plist */; }; + 51BD8FCF29D60FB60001D54E /* retspl_AIRPODSV3.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2246E5132749350200261D5A /* retspl_AIRPODSV3.plist */; }; + 51BD8FD029D60FB60001D54E /* volume_curve_AIRPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71B7B4D920AA91D400C5768A /* volume_curve_AIRPODS.plist */; }; + 51BD8FD129D60FB60001D54E /* retspl_AIRPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71B7B4D420AA91D300C5768A /* retspl_AIRPODS.plist */; }; + 51BD8FD229D60FB60001D54E /* frequency_dBSPL_AIRPODSV3.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2246E5122749350200261D5A /* frequency_dBSPL_AIRPODSV3.plist */; }; + 51BD8FD329D60FB60001D54E /* volume_curve_AIRPODSMAX.plist in Resources */ = {isa = PBXBuildFile; fileRef = E293656125757E7700092A7C /* volume_curve_AIRPODSMAX.plist */; }; + 51BD8FD429D60FB60001D54E /* volume_curve_WIRED.plist in Resources */ = {isa = PBXBuildFile; fileRef = 713D4B0F20FE4702002BE28D /* volume_curve_WIRED.plist */; }; + 51BD8FD529D60FB60001D54E /* volume_curve_AIRPODSPRO.plist in Resources */ = {isa = PBXBuildFile; fileRef = E29189BA23855BA2001AFF0F /* volume_curve_AIRPODSPRO.plist */; }; + 51BD8FD629D60FB60001D54E /* retspl_AIRPODSPRO.plist in Resources */ = {isa = PBXBuildFile; fileRef = E29189BC23855BAE001AFF0F /* retspl_AIRPODSPRO.plist */; }; + 51BD8FD729D60FB60001D54E /* frequency_dBSPL_AIRPODSPRO.plist in Resources */ = {isa = PBXBuildFile; fileRef = E29189B823855B96001AFF0F /* frequency_dBSPL_AIRPODSPRO.plist */; }; + 51CB80D62AFEBE7E00A1F410 /* ORKFormStepViewControllerConditionalFormItemsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51CB80D52AFEBE7E00A1F410 /* ORKFormStepViewControllerConditionalFormItemsTests.swift */; }; + 51CB80D82AFEBEC600A1F410 /* ORKPredicateFormItemVisibilityRuleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51CB80D72AFEBEC600A1F410 /* ORKPredicateFormItemVisibilityRuleTests.swift */; }; + 51CB80DA2AFEBF3800A1F410 /* ORKFormItemVisibilityRuleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51CB80D92AFEBF3800A1F410 /* ORKFormItemVisibilityRuleTests.swift */; }; 51E03D6324919711008F8406 /* ORKPermissionType.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E03D6124919711008F8406 /* ORKPermissionType.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51E03D6424919711008F8406 /* ORKPermissionType.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E03D6224919711008F8406 /* ORKPermissionType.m */; }; 51E03D682491A601008F8406 /* ORKHealthKitPermissionType.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E03D662491A601008F8406 /* ORKHealthKitPermissionType.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51E03D692491A601008F8406 /* ORKHealthKitPermissionType.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E03D672491A601008F8406 /* ORKHealthKitPermissionType.m */; }; - 51E03D6D2491B6DB008F8406 /* ORKRequestPermissionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E03D6B2491B6DB008F8406 /* ORKRequestPermissionView.h */; }; - 51E03D6E2491B6DB008F8406 /* ORKRequestPermissionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E03D6C2491B6DB008F8406 /* ORKRequestPermissionView.m */; }; - 5D003DA126377E7400A6439B /* ORKAccuracyStroopResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D003D9F26377E7400A6439B /* ORKAccuracyStroopResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5D003DA226377E7400A6439B /* ORKAccuracyStroopResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D003DA026377E7400A6439B /* ORKAccuracyStroopResult.m */; }; + 51EB9A532B8408D50064A515 /* ORKInstructionStepHTMLFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EB9A512B8408D50064A515 /* ORKInstructionStepHTMLFormatter.h */; }; + 51EB9A542B8408D50064A515 /* ORKInstructionStepHTMLFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 51EB9A522B8408D50064A515 /* ORKInstructionStepHTMLFormatter.m */; }; + 51EB9A5E2B8D3BA70064A515 /* ORKInstructionStepHTMLFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51EB9A5D2B8D3BA70064A515 /* ORKInstructionStepHTMLFormatterTests.m */; }; + 51F716C1297E288A00D8ACF7 /* ORKNormalizedReactionTimeStimulusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F716B7297E288900D8ACF7 /* ORKNormalizedReactionTimeStimulusView.m */; }; + 51F716C2297E288A00D8ACF7 /* ORKNormalizedReactionTimeStimulusView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F716B8297E288900D8ACF7 /* ORKNormalizedReactionTimeStimulusView.h */; }; + 51F716C3297E288A00D8ACF7 /* ORKNormalizedReactionTimeContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F716B9297E288900D8ACF7 /* ORKNormalizedReactionTimeContentView.m */; }; + 51F716C4297E288A00D8ACF7 /* ORKNormalizedReactionTimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F716BA297E288900D8ACF7 /* ORKNormalizedReactionTimeStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51F716C5297E288A00D8ACF7 /* ORKNormalizedReactionTimeResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F716BB297E288900D8ACF7 /* ORKNormalizedReactionTimeResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51F716C6297E288A00D8ACF7 /* ORKNormalizedReactionTimeResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F716BC297E288900D8ACF7 /* ORKNormalizedReactionTimeResult.m */; }; + 51F716C7297E288A00D8ACF7 /* ORKNormalizedReactionTimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F716BD297E288900D8ACF7 /* ORKNormalizedReactionTimeViewController.m */; }; + 51F716C8297E288A00D8ACF7 /* ORKNormalizedReactionTimeStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F716BE297E288900D8ACF7 /* ORKNormalizedReactionTimeStep.m */; }; + 51F716C9297E288A00D8ACF7 /* ORKNormalizedReactionTimeViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F716BF297E288A00D8ACF7 /* ORKNormalizedReactionTimeViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 51F716CA297E288A00D8ACF7 /* ORKNormalizedReactionTimeContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F716C0297E288A00D8ACF7 /* ORKNormalizedReactionTimeContentView.h */; }; + 51F716CB297E2A1100D8ACF7 /* ORKConsentDocument+ORKInstructionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BE9D5242947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51F716D1297E2CC400D8ACF7 /* ORKConsentLearnMoreViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F716CD297E2CB600D8ACF7 /* ORKConsentLearnMoreViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51F716D3297E2FB600D8ACF7 /* ORKConsentLearnMoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 51F716CE297E2CB600D8ACF7 /* ORKConsentLearnMoreViewController.m */; }; + 51F716EB2981B49000D8ACF7 /* ORKSpeechInNoiseStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F716E82981AF1200D8ACF7 /* ORKSpeechInNoiseStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 51FBAC5D2BC9CE4A009CA28F /* ORKBorderedButton_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FBAC5C2BC9CE4A009CA28F /* ORKBorderedButton_Internal.h */; }; + 51FBAC902BD07333009CA28F /* UIImageView+ResearchKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9CC5652A68C02C00080E29 /* UIImageView+ResearchKit.h */; }; 5D04884C25EF4CC30006C68B /* ORKQuestionStep_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D04884B25EF4CC30006C68B /* ORKQuestionStep_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5D04885725F19A7A0006C68B /* ORKDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D04885525F19A7A0006C68B /* ORKDevice.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5D04885825F19A7A0006C68B /* ORKDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D04885625F19A7A0006C68B /* ORKDevice.m */; }; 5D04885C25F1B3AB0006C68B /* ORKDevice_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D04885B25F1B3AB0006C68B /* ORKDevice_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 5D1CE45A23FC85F4004CB416 /* ORKAudioMeteringView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1CE45823FC85F3004CB416 /* ORKAudioMeteringView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 5D1CE45B23FC85F4004CB416 /* ORKAudioMeteringView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D1CE45923FC85F4004CB416 /* ORKAudioMeteringView.m */; }; - 5D26E77824997EA200E53D27 /* ORK3DModelManager_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D26E77724997EA200E53D27 /* ORK3DModelManager_Internal.h */; }; - 5D38006B2437E53500E7D2BD /* ORKAudioStreamer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D3800692437E53500E7D2BD /* ORKAudioStreamer.h */; }; - 5D38006C2437E53500E7D2BD /* ORKAudioStreamer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D38006A2437E53500E7D2BD /* ORKAudioStreamer.m */; }; - 5D43C5D124217393006F4084 /* ORKRecordButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D43C5CF24217393006F4084 /* ORKRecordButton.h */; }; - 5D43C5D224217393006F4084 /* ORKRecordButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D43C5D024217393006F4084 /* ORKRecordButton.m */; }; - 5D43C5D424255675006F4084 /* ORKBodyItem_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D43C5D324255675006F4084 /* ORKBodyItem_Internal.h */; }; - 5D58800B24007140005B3D91 /* ORKPlaybackButton_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D58800A24007140005B3D91 /* ORKPlaybackButton_Internal.h */; }; - 5D5880392410394F005B3D91 /* ORKSpeechInNoiseResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D5880372410394E005B3D91 /* ORKSpeechInNoiseResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 5D58803A2410394F005B3D91 /* ORKSpeechInNoiseResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D5880382410394E005B3D91 /* ORKSpeechInNoiseResult.m */; }; + 5D43C5D424255675006F4084 /* ORKBodyItem_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D43C5D324255675006F4084 /* ORKBodyItem_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5DABE5AE24DA173F00570C57 /* ResearchKit_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 5DABE5AD24DA16E600570C57 /* ResearchKit_Prefix.pch */; }; - 6146D0A31B84A91E0068491D /* ORKGraphChartAccessibilityElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6146D0A11B84A91E0068491D /* ORKGraphChartAccessibilityElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 6146D0A41B84A91E0068491D /* ORKGraphChartAccessibilityElement.m in Sources */ = {isa = PBXBuildFile; fileRef = 6146D0A21B84A91E0068491D /* ORKGraphChartAccessibilityElement.m */; }; - 618DA04E1A93D0D600E63AA8 /* ORKAccessibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 618DA0481A93D0D600E63AA8 /* ORKAccessibility.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 618DA0501A93D0D600E63AA8 /* ORKAccessibilityFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 618DA0491A93D0D600E63AA8 /* ORKAccessibilityFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 618DA0521A93D0D600E63AA8 /* ORKAccessibilityFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 618DA04A1A93D0D600E63AA8 /* ORKAccessibilityFunctions.m */; }; - 618DA0541A93D0D600E63AA8 /* UIView+ORKAccessibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 618DA04B1A93D0D600E63AA8 /* UIView+ORKAccessibility.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 618DA0561A93D0D600E63AA8 /* UIView+ORKAccessibility.m in Sources */ = {isa = PBXBuildFile; fileRef = 618DA04C1A93D0D600E63AA8 /* UIView+ORKAccessibility.m */; }; - 62DF9F4528CA87D300D13018 /* retspl_AIRPODSPROV2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 62DF9F4428CA87D300D13018 /* retspl_AIRPODSPROV2.plist */; }; - 62DF9F4728CA87DE00D13018 /* frequency_dBSPL_AIRPODSPROV2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 62DF9F4628CA87DE00D13018 /* frequency_dBSPL_AIRPODSPROV2.plist */; }; - 62DF9F4928CA87E800D13018 /* volume_curve_AIRPODSPROV2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 62DF9F4828CA87E800D13018 /* volume_curve_AIRPODSPROV2.plist */; }; - 7118AC6720BF6A3A00D7A6BB /* Sentence7.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6020BF6A3900D7A6BB /* Sentence7.wav */; }; - 7118AC6820BF6A3A00D7A6BB /* Sentence4.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6120BF6A3A00D7A6BB /* Sentence4.wav */; }; - 7118AC6920BF6A3A00D7A6BB /* Sentence6.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6220BF6A3A00D7A6BB /* Sentence6.wav */; }; - 7118AC6A20BF6A3A00D7A6BB /* Sentence5.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6320BF6A3A00D7A6BB /* Sentence5.wav */; }; - 7118AC6B20BF6A3A00D7A6BB /* Sentence3.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6420BF6A3A00D7A6BB /* Sentence3.wav */; }; - 7118AC6C20BF6A3A00D7A6BB /* Sentence2.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6520BF6A3A00D7A6BB /* Sentence2.wav */; }; - 7118AC6D20BF6A3A00D7A6BB /* Sentence1.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC6620BF6A3A00D7A6BB /* Sentence1.wav */; }; - 7118AC7420BF6A7800D7A6BB /* ORKSpeechInNoiseStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7118AC6E20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.m */; }; - 7118AC7520BF6A7800D7A6BB /* ORKSpeechInNoiseStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118AC6F20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.h */; }; - 7118AC7620BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7118AC7020BF6A7700D7A6BB /* ORKSpeechInNoiseContentView.m */; }; - 7118AC7720BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118AC7120BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.h */; }; - 7118AC7820BF6A7800D7A6BB /* ORKSpeechInNoiseStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 7118AC7220BF6A7800D7A6BB /* ORKSpeechInNoiseStep.m */; }; - 7118AC7920BF6A7800D7A6BB /* ORKSpeechInNoiseStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118AC7320BF6A7800D7A6BB /* ORKSpeechInNoiseStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 713D4B1020FE4702002BE28D /* volume_curve_WIRED.plist in Resources */ = {isa = PBXBuildFile; fileRef = 713D4B0F20FE4702002BE28D /* volume_curve_WIRED.plist */; }; - 713D4B1C20FE5464002BE28D /* frequency_dBSPL_EARPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 713D4B1B20FE5464002BE28D /* frequency_dBSPL_EARPODS.plist */; }; - 713D4B1E20FE5480002BE28D /* retspl_EARPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 713D4B1D20FE5480002BE28D /* retspl_EARPODS.plist */; }; + 5E6AB7DF2BC86900009ED0D5 /* ORKTaskViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E6AB7DE2BC86900009ED0D5 /* ORKTaskViewControllerTests.swift */; }; + 5EB91CC62BCE2ED500BBF23E /* ORKActiveStepQuantityView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40AFB1A8D7C5B00081FAC /* ORKActiveStepQuantityView.m */; }; + 5EB91CC72BCE2EE600BBF23E /* ORKActiveStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86AD910F1AB7B8A600361FEB /* ORKActiveStepView.m */; }; + 5EB91CC82BCE2EFD00BBF23E /* splMeter_sensitivity_offset.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71F3B27F21001DEC00FB1C41 /* splMeter_sensitivity_offset.plist */; }; + 5EB91CC92BCE2F1D00BBF23E /* SentencesList.txt in Resources */ = {isa = PBXBuildFile; fileRef = BA22F76C20C4F884006E6E11 /* SentencesList.txt */; }; + 622774402C5CF7DC00F2E741 /* retspl_dBFS_AIRPODSPROV2.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6227743F2C5CF7DC00F2E741 /* retspl_dBFS_AIRPODSPROV2.plist */; }; 714080DB235FD14700281E04 /* ResearchKit.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = 714080D9235FD14700281E04 /* ResearchKit.stringsdict */; }; 714151D0225C4A23002CA33B /* ORKPasscodeViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14A92C6922444F93007547F2 /* ORKPasscodeViewControllerTests.swift */; }; 7141EA2222EFBC0C00650145 /* ORKLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7141EA2122EFBC0C00650145 /* ORKLoggingTests.m */; }; 7167D028231B1EAA00AAB4DD /* ORKFormStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7167D027231B1EAA00AAB4DD /* ORKFormStep_Internal.h */; }; - 716B126520A78C6B00590264 /* ORKEnvironmentSPLMeterResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 716B126320A78C6B00590264 /* ORKEnvironmentSPLMeterResult.m */; }; - 716B126820A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 716B126620A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h */; }; - 716B126920A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 716B126720A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m */; }; - 71769E2920880C4500A19914 /* ORKdBHLToneAudiometryResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E2720880C4500A19914 /* ORKdBHLToneAudiometryResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 71769E2A20880C4500A19914 /* ORKdBHLToneAudiometryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E2820880C4500A19914 /* ORKdBHLToneAudiometryResult.m */; }; - 71769E2D208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E2B208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 71769E2E208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E2C208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m */; }; - 71769E312088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E2F2088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h */; }; - 71769E322088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E302088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m */; }; - 71769E352088291B00A19914 /* ORKdBHLToneAudiometryContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E332088291B00A19914 /* ORKdBHLToneAudiometryContentView.h */; }; - 71769E362088291B00A19914 /* ORKdBHLToneAudiometryContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E342088291B00A19914 /* ORKdBHLToneAudiometryContentView.m */; }; - 71769E3920882CED00A19914 /* ORKdBHLToneAudiometryStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E3720882CED00A19914 /* ORKdBHLToneAudiometryStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 71769E3A20882CED00A19914 /* ORKdBHLToneAudiometryStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E3820882CED00A19914 /* ORKdBHLToneAudiometryStep.m */; }; - 71769E3D20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E3B20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h */; }; - 71769E3E20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E3C20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m */; }; - 71B7B4DA20AA91D400C5768A /* retspl_AIRPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71B7B4D420AA91D300C5768A /* retspl_AIRPODS.plist */; }; - 71B7B4DE20AA91D400C5768A /* frequency_dBSPL_AIRPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71B7B4D820AA91D400C5768A /* frequency_dBSPL_AIRPODS.plist */; }; - 71B7B4DF20AA91D400C5768A /* volume_curve_AIRPODS.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71B7B4D920AA91D400C5768A /* volume_curve_AIRPODS.plist */; }; - 71BD9EA520969BE1007B436E /* ORKEnvironmentSPLMeterStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD9EA320969BE1007B436E /* ORKEnvironmentSPLMeterStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 71BD9EA620969BE1007B436E /* ORKEnvironmentSPLMeterStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD9EA420969BE1007B436E /* ORKEnvironmentSPLMeterStep.m */; }; - 71BD9EA920969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD9EA720969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.h */; }; - 71BD9EAA20969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD9EA820969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.m */; }; - 71BD9EAD2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD9EAB2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.h */; }; - 71BD9EAE2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD9EAC2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.m */; }; - 71D8EF1720B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 71D8EF1520B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 71D8EF1820B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D8EF1620B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.m */; }; - 71F3B28021001DED00FB1C41 /* splMeter_sensitivity_offset.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71F3B27F21001DEC00FB1C41 /* splMeter_sensitivity_offset.plist */; }; - 781D54101DF886AB00223305 /* ORKTrailmakingContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 781D540A1DF886AB00223305 /* ORKTrailmakingContentView.h */; }; - 781D54111DF886AB00223305 /* ORKTrailmakingContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 781D540B1DF886AB00223305 /* ORKTrailmakingContentView.m */; }; - 781D54121DF886AB00223305 /* ORKTrailmakingStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 781D540C1DF886AB00223305 /* ORKTrailmakingStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 781D54131DF886AB00223305 /* ORKTrailmakingStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 781D540D1DF886AB00223305 /* ORKTrailmakingStep.m */; }; - 781D54141DF886AB00223305 /* ORKTrailmakingStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 781D540E1DF886AB00223305 /* ORKTrailmakingStepViewController.h */; }; - 781D54151DF886AB00223305 /* ORKTrailmakingStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 781D540F1DF886AB00223305 /* ORKTrailmakingStepViewController.m */; }; - 805685791C90C19500BF437A /* UIImage+ResearchKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 805685771C90C19500BF437A /* UIImage+ResearchKit.h */; }; - 8056857A1C90C19500BF437A /* UIImage+ResearchKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 805685781C90C19500BF437A /* UIImage+ResearchKit.m */; }; 8419D66E1FB73CC80088D7E5 /* ORKWebViewStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 8419D66C1FB73CC80088D7E5 /* ORKWebViewStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8419D66F1FB73CC80088D7E5 /* ORKWebViewStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 8419D66D1FB73CC80088D7E5 /* ORKWebViewStep.m */; }; - 8419D6721FB73EC60088D7E5 /* ORKWebViewStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8419D6701FB73EC60088D7E5 /* ORKWebViewStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 8419D6731FB73EC60088D7E5 /* ORKWebViewStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8419D6711FB73EC60088D7E5 /* ORKWebViewStepViewController.m */; }; - 861D11A91AA691BB003C98A7 /* ORKScaleSliderView.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D11A71AA691BB003C98A7 /* ORKScaleSliderView.h */; }; - 861D11AA1AA691BB003C98A7 /* ORKScaleSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D11A81AA691BB003C98A7 /* ORKScaleSliderView.m */; }; - 861D11AD1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D11AB1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.h */; }; + 861D11AD1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D11AB1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.h */; settings = {ATTRIBUTES = (Private, ); }; }; 861D11AE1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D11AC1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.m */; }; - 861D11B51AA7D073003C98A7 /* ORKTextChoiceCellGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D11B31AA7D073003C98A7 /* ORKTextChoiceCellGroup.h */; }; - 861D11B61AA7D073003C98A7 /* ORKTextChoiceCellGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D11B41AA7D073003C98A7 /* ORKTextChoiceCellGroup.m */; }; - 861D2AE81B840991008C4CD0 /* ORKTimedWalkStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D2AE61B840991008C4CD0 /* ORKTimedWalkStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 861D2AE91B840991008C4CD0 /* ORKTimedWalkStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D2AE71B840991008C4CD0 /* ORKTimedWalkStep.m */; }; - 861D2AEC1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D2AEA1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 861D2AED1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D2AEB1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.m */; }; - 861D2AF01B8409D9008C4CD0 /* ORKTimedWalkContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D2AEE1B8409D9008C4CD0 /* ORKTimedWalkContentView.h */; }; - 861D2AF11B8409D9008C4CD0 /* ORKTimedWalkContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D2AEF1B8409D9008C4CD0 /* ORKTimedWalkContentView.m */; }; - 861D2AF71B843968008C4CD0 /* ORKCompletionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B551A8D7C5B00081FAC /* ORKCompletionStepViewController.m */; }; - 865EA1621AB8DF750037C68E /* ORKDateTimePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 865EA1601AB8DF750037C68E /* ORKDateTimePicker.h */; }; - 865EA1631AB8DF750037C68E /* ORKDateTimePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 865EA1611AB8DF750037C68E /* ORKDateTimePicker.m */; }; - 865EA1681ABA1AA10037C68E /* ORKPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 865EA1661ABA1AA10037C68E /* ORKPicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 865EA1691ABA1AA10037C68E /* ORKPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 865EA1671ABA1AA10037C68E /* ORKPicker.m */; }; - 865EA16C1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 865EA16A1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.h */; }; - 865EA16D1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 865EA16B1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.m */; }; 866DA51F1D63D04700C9AF3F /* ORKCollector_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 866DA5131D63D04700C9AF3F /* ORKCollector_Internal.h */; }; 866DA5201D63D04700C9AF3F /* ORKCollector.h in Headers */ = {isa = PBXBuildFile; fileRef = 866DA5141D63D04700C9AF3F /* ORKCollector.h */; settings = {ATTRIBUTES = (Public, ); }; }; 866DA5211D63D04700C9AF3F /* ORKCollector.m in Sources */ = {isa = PBXBuildFile; fileRef = 866DA5151D63D04700C9AF3F /* ORKCollector.m */; }; @@ -446,260 +323,45 @@ 866DA5281D63D04700C9AF3F /* ORKMotionActivityQueryOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 866DA51C1D63D04700C9AF3F /* ORKMotionActivityQueryOperation.m */; }; 866DA5291D63D04700C9AF3F /* ORKOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 866DA51D1D63D04700C9AF3F /* ORKOperation.h */; }; 866DA52A1D63D04700C9AF3F /* ORKOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 866DA51E1D63D04700C9AF3F /* ORKOperation.m */; }; - 866F86011A96CBF3007B282C /* ORKSurveyAnswerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 866F86001A96CBF3007B282C /* ORKSurveyAnswerCell.m */; }; - 86AD910A1AB7AD1E00361FEB /* ORKNavigationContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AD91081AB7AD1E00361FEB /* ORKNavigationContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86AD910B1AB7AD1E00361FEB /* ORKNavigationContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86AD91091AB7AD1E00361FEB /* ORKNavigationContainerView.m */; }; - 86AD910D1AB7AE4100361FEB /* ORKNavigationContainerView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AD910C1AB7AE4100361FEB /* ORKNavigationContainerView_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86AD91101AB7B8A600361FEB /* ORKActiveStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AD910E1AB7B8A600361FEB /* ORKActiveStepView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86AD91111AB7B8A600361FEB /* ORKActiveStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86AD910F1AB7B8A600361FEB /* ORKActiveStepView.m */; }; - 86AD91141AB7B97E00361FEB /* ORKQuestionStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AD91121AB7B97E00361FEB /* ORKQuestionStepView.h */; }; - 86AD91151AB7B97E00361FEB /* ORKQuestionStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86AD91131AB7B97E00361FEB /* ORKQuestionStepView.m */; }; - 86B781BB1AA668ED00688151 /* ORKTimeIntervalPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B781B71AA668ED00688151 /* ORKTimeIntervalPicker.h */; }; - 86B781BC1AA668ED00688151 /* ORKTimeIntervalPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 86B781B81AA668ED00688151 /* ORKTimeIntervalPicker.m */; }; - 86B781BD1AA668ED00688151 /* ORKValuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B781B91AA668ED00688151 /* ORKValuePicker.h */; }; - 86B781BE1AA668ED00688151 /* ORKValuePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 86B781BA1AA668ED00688151 /* ORKValuePicker.m */; }; - 86B89ABB1AB3BECC001626A4 /* ORKStepHeaderView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B89AB91AB3BECC001626A4 /* ORKStepHeaderView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86B89ABC1AB3BECC001626A4 /* ORKStepHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86B89ABA1AB3BECC001626A4 /* ORKStepHeaderView.m */; }; - 86B89ABE1AB3BFDB001626A4 /* ORKStepHeaderView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B89ABD1AB3BFDB001626A4 /* ORKStepHeaderView_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C121A8D7C5C00081FAC /* ORKActiveStepQuantityView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40AFA1A8D7C5B00081FAC /* ORKActiveStepQuantityView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C141A8D7C5C00081FAC /* ORKActiveStepQuantityView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40AFB1A8D7C5B00081FAC /* ORKActiveStepQuantityView.m */; }; - 86C40C161A8D7C5C00081FAC /* ORKAudioContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40AFC1A8D7C5B00081FAC /* ORKAudioContentView.h */; }; - 86C40C181A8D7C5C00081FAC /* ORKAudioContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40AFD1A8D7C5B00081FAC /* ORKAudioContentView.m */; }; - 86C40C1A1A8D7C5C00081FAC /* ORKAudioStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40AFE1A8D7C5B00081FAC /* ORKAudioStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C1C1A8D7C5C00081FAC /* ORKAudioStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40AFF1A8D7C5B00081FAC /* ORKAudioStep.m */; }; - 86C40C1E1A8D7C5C00081FAC /* ORKAudioStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B001A8D7C5B00081FAC /* ORKAudioStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C201A8D7C5C00081FAC /* ORKAudioStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B011A8D7C5B00081FAC /* ORKAudioStepViewController.m */; }; - 86C40C221A8D7C5C00081FAC /* ORKCountdownStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B021A8D7C5B00081FAC /* ORKCountdownStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C241A8D7C5C00081FAC /* ORKCountdownStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B031A8D7C5B00081FAC /* ORKCountdownStep.m */; }; - 86C40C261A8D7C5C00081FAC /* ORKCountdownStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B041A8D7C5B00081FAC /* ORKCountdownStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C281A8D7C5C00081FAC /* ORKCountdownStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B051A8D7C5B00081FAC /* ORKCountdownStepViewController.m */; }; - 86C40C2A1A8D7C5C00081FAC /* ORKFitnessContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B061A8D7C5B00081FAC /* ORKFitnessContentView.h */; }; - 86C40C2C1A8D7C5C00081FAC /* ORKFitnessContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B071A8D7C5B00081FAC /* ORKFitnessContentView.m */; }; - 86C40C2E1A8D7C5C00081FAC /* ORKFitnessStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B081A8D7C5B00081FAC /* ORKFitnessStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C301A8D7C5C00081FAC /* ORKFitnessStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B091A8D7C5B00081FAC /* ORKFitnessStep.m */; }; - 86C40C321A8D7C5C00081FAC /* ORKFitnessStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B0A1A8D7C5B00081FAC /* ORKFitnessStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C341A8D7C5C00081FAC /* ORKFitnessStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B0B1A8D7C5B00081FAC /* ORKFitnessStepViewController.m */; }; - 86C40C361A8D7C5C00081FAC /* ORKSpatialSpanGame.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B0C1A8D7C5B00081FAC /* ORKSpatialSpanGame.h */; }; - 86C40C381A8D7C5C00081FAC /* ORKSpatialSpanGame.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B0D1A8D7C5B00081FAC /* ORKSpatialSpanGame.m */; }; - 86C40C3A1A8D7C5C00081FAC /* ORKSpatialSpanGameState.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B0E1A8D7C5B00081FAC /* ORKSpatialSpanGameState.h */; }; - 86C40C3C1A8D7C5C00081FAC /* ORKSpatialSpanGameState.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B0F1A8D7C5B00081FAC /* ORKSpatialSpanGameState.m */; }; - 86C40C3E1A8D7C5C00081FAC /* ORKSpatialSpanMemoryContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B101A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.h */; }; - 86C40C401A8D7C5C00081FAC /* ORKSpatialSpanMemoryContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B111A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.m */; }; - 86C40C421A8D7C5C00081FAC /* ORKSpatialSpanMemoryStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B121A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C441A8D7C5C00081FAC /* ORKSpatialSpanMemoryStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B131A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.m */; }; - 86C40C461A8D7C5C00081FAC /* ORKSpatialSpanMemoryStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B141A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C481A8D7C5C00081FAC /* ORKSpatialSpanMemoryStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B151A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.m */; }; - 86C40C4A1A8D7C5C00081FAC /* ORKSpatialSpanTargetView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B161A8D7C5B00081FAC /* ORKSpatialSpanTargetView.h */; }; - 86C40C4C1A8D7C5C00081FAC /* ORKSpatialSpanTargetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B171A8D7C5B00081FAC /* ORKSpatialSpanTargetView.m */; }; - 86C40C4E1A8D7C5C00081FAC /* ORKTappingContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B181A8D7C5B00081FAC /* ORKTappingContentView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C501A8D7C5C00081FAC /* ORKTappingContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B191A8D7C5B00081FAC /* ORKTappingContentView.m */; }; - 86C40C521A8D7C5C00081FAC /* ORKTappingIntervalStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B1A1A8D7C5B00081FAC /* ORKTappingIntervalStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C541A8D7C5C00081FAC /* ORKTappingIntervalStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B1B1A8D7C5B00081FAC /* ORKTappingIntervalStep.m */; }; - 86C40C561A8D7C5C00081FAC /* ORKTappingIntervalStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B1C1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C581A8D7C5C00081FAC /* ORKTappingIntervalStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B1D1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.m */; }; - 86C40C5A1A8D7C5C00081FAC /* ORKWalkingTaskStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B1E1A8D7C5B00081FAC /* ORKWalkingTaskStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C5C1A8D7C5C00081FAC /* ORKWalkingTaskStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B1F1A8D7C5B00081FAC /* ORKWalkingTaskStep.m */; }; - 86C40C5E1A8D7C5C00081FAC /* ORKWalkingTaskStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B201A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C601A8D7C5C00081FAC /* ORKWalkingTaskStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B211A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.m */; }; - 86C40C621A8D7C5C00081FAC /* CLLocation+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B221A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.h */; }; - 86C40C641A8D7C5C00081FAC /* CLLocation+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B231A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.m */; }; - 86C40C661A8D7C5C00081FAC /* CMAccelerometerData+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B241A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.h */; }; - 86C40C681A8D7C5C00081FAC /* CMAccelerometerData+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B251A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.m */; }; - 86C40C6A1A8D7C5C00081FAC /* CMDeviceMotion+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B261A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.h */; }; - 86C40C6C1A8D7C5C00081FAC /* CMDeviceMotion+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B271A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.m */; }; - 86C40C6E1A8D7C5C00081FAC /* CMMotionActivity+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B281A8D7C5B00081FAC /* CMMotionActivity+ORKJSONDictionary.h */; }; - 86C40C701A8D7C5C00081FAC /* CMMotionActivity+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B291A8D7C5B00081FAC /* CMMotionActivity+ORKJSONDictionary.m */; }; - 86C40C721A8D7C5C00081FAC /* CMPedometerData+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B2A1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.h */; }; - 86C40C741A8D7C5C00081FAC /* CMPedometerData+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B2B1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.m */; }; - 86C40C761A8D7C5C00081FAC /* HKSample+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B2C1A8D7C5B00081FAC /* HKSample+ORKJSONDictionary.h */; }; - 86C40C781A8D7C5C00081FAC /* HKSample+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B2D1A8D7C5B00081FAC /* HKSample+ORKJSONDictionary.m */; }; - 86C40C7A1A8D7C5C00081FAC /* ORKAccelerometerRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B2E1A8D7C5B00081FAC /* ORKAccelerometerRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C7C1A8D7C5C00081FAC /* ORKAccelerometerRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B2F1A8D7C5B00081FAC /* ORKAccelerometerRecorder.m */; }; - 86C40C7E1A8D7C5C00081FAC /* ORKActiveStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B301A8D7C5B00081FAC /* ORKActiveStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40C801A8D7C5C00081FAC /* ORKActiveStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B311A8D7C5B00081FAC /* ORKActiveStep.m */; }; - 86C40C821A8D7C5C00081FAC /* ORKActiveStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B321A8D7C5B00081FAC /* ORKActiveStep_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C841A8D7C5C00081FAC /* ORKActiveStepTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B331A8D7C5B00081FAC /* ORKActiveStepTimer.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C861A8D7C5C00081FAC /* ORKActiveStepTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B341A8D7C5B00081FAC /* ORKActiveStepTimer.m */; }; - 86C40C881A8D7C5C00081FAC /* ORKActiveStepTimerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B351A8D7C5B00081FAC /* ORKActiveStepTimerView.h */; }; - 86C40C8A1A8D7C5C00081FAC /* ORKActiveStepTimerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B361A8D7C5B00081FAC /* ORKActiveStepTimerView.m */; }; - 86C40C8C1A8D7C5C00081FAC /* ORKActiveStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B371A8D7C5B00081FAC /* ORKActiveStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40C8E1A8D7C5C00081FAC /* ORKActiveStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B381A8D7C5B00081FAC /* ORKActiveStepViewController.m */; }; - 86C40C901A8D7C5C00081FAC /* ORKActiveStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B391A8D7C5B00081FAC /* ORKActiveStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C921A8D7C5C00081FAC /* ORKAudioRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B3A1A8D7C5B00081FAC /* ORKAudioRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C941A8D7C5C00081FAC /* ORKAudioRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B3B1A8D7C5B00081FAC /* ORKAudioRecorder.m */; }; - 86C40C961A8D7C5C00081FAC /* ORKDataLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B3C1A8D7C5B00081FAC /* ORKDataLogger.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C981A8D7C5C00081FAC /* ORKDataLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B3D1A8D7C5B00081FAC /* ORKDataLogger.m */; }; - 86C40C9C1A8D7C5C00081FAC /* ORKDeviceMotionRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B3F1A8D7C5B00081FAC /* ORKDeviceMotionRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40C9E1A8D7C5C00081FAC /* ORKDeviceMotionRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B401A8D7C5B00081FAC /* ORKDeviceMotionRecorder.m */; }; - 86C40CA01A8D7C5C00081FAC /* ORKHealthQuantityTypeRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B411A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40CA21A8D7C5C00081FAC /* ORKHealthQuantityTypeRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B421A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.m */; }; - 86C40CA41A8D7C5C00081FAC /* ORKLocationRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B431A8D7C5B00081FAC /* ORKLocationRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40CA61A8D7C5C00081FAC /* ORKLocationRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B441A8D7C5B00081FAC /* ORKLocationRecorder.m */; }; - 86C40CA81A8D7C5C00081FAC /* ORKPedometerRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B451A8D7C5B00081FAC /* ORKPedometerRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40CAA1A8D7C5C00081FAC /* ORKPedometerRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B461A8D7C5B00081FAC /* ORKPedometerRecorder.m */; }; - 86C40CAC1A8D7C5C00081FAC /* ORKRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B471A8D7C5B00081FAC /* ORKRecorder.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40CAE1A8D7C5C00081FAC /* ORKRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B481A8D7C5B00081FAC /* ORKRecorder.m */; }; - 86C40CB01A8D7C5C00081FAC /* ORKRecorder_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B491A8D7C5B00081FAC /* ORKRecorder_Internal.h */; }; - 86C40CB21A8D7C5C00081FAC /* ORKRecorder_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4A1A8D7C5B00081FAC /* ORKRecorder_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40CB41A8D7C5C00081FAC /* ORKTouchRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4B1A8D7C5B00081FAC /* ORKTouchRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40CB61A8D7C5C00081FAC /* ORKTouchRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B4C1A8D7C5B00081FAC /* ORKTouchRecorder.m */; }; - 86C40CB81A8D7C5C00081FAC /* ORKVoiceEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4D1A8D7C5B00081FAC /* ORKVoiceEngine.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40CBA1A8D7C5C00081FAC /* ORKVoiceEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B4E1A8D7C5B00081FAC /* ORKVoiceEngine.m */; }; - 86C40CBC1A8D7C5C00081FAC /* UITouch+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4F1A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.h */; }; - 86C40CBE1A8D7C5C00081FAC /* UITouch+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B501A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.m */; }; 86C40CC01A8D7C5C00081FAC /* ORKCompletionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B521A8D7C5B00081FAC /* ORKCompletionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40CC21A8D7C5C00081FAC /* ORKCompletionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B531A8D7C5B00081FAC /* ORKCompletionStep.m */; }; - 86C40CC41A8D7C5C00081FAC /* ORKCompletionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B541A8D7C5B00081FAC /* ORKCompletionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40CC81A8D7C5C00081FAC /* ORKFormItemCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B561A8D7C5B00081FAC /* ORKFormItemCell.h */; }; - 86C40CCA1A8D7C5C00081FAC /* ORKFormItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B571A8D7C5B00081FAC /* ORKFormItemCell.m */; }; - 86C40CCC1A8D7C5C00081FAC /* ORKImageSelectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B581A8D7C5B00081FAC /* ORKImageSelectionView.h */; }; - 86C40CCE1A8D7C5C00081FAC /* ORKImageSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B591A8D7C5B00081FAC /* ORKImageSelectionView.m */; }; - 86C40CD01A8D7C5C00081FAC /* ORKInstructionStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B5A1A8D7C5B00081FAC /* ORKInstructionStepView.h */; }; - 86C40CD21A8D7C5C00081FAC /* ORKInstructionStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B5B1A8D7C5B00081FAC /* ORKInstructionStepView.m */; }; - 86C40CD41A8D7C5C00081FAC /* ORKTableContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B5C1A8D7C5B00081FAC /* ORKTableContainerView.h */; }; - 86C40CD61A8D7C5C00081FAC /* ORKTableContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B5D1A8D7C5B00081FAC /* ORKTableContainerView.m */; }; - 86C40CD81A8D7C5C00081FAC /* ORKTextFieldView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B5E1A8D7C5B00081FAC /* ORKTextFieldView.h */; }; - 86C40CDA1A8D7C5C00081FAC /* ORKTextFieldView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B5F1A8D7C5B00081FAC /* ORKTextFieldView.m */; }; - 86C40CDC1A8D7C5C00081FAC /* ORKTintedImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B601A8D7C5B00081FAC /* ORKTintedImageView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40CDE1A8D7C5C00081FAC /* ORKTintedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B611A8D7C5B00081FAC /* ORKTintedImageView.m */; }; 86C40CE41A8D7C5C00081FAC /* ORKAnswerFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B641A8D7C5B00081FAC /* ORKAnswerFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40CE61A8D7C5C00081FAC /* ORKAnswerFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B651A8D7C5B00081FAC /* ORKAnswerFormat.m */; }; - 86C40CE81A8D7C5C00081FAC /* ORKAnswerFormat_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B661A8D7C5B00081FAC /* ORKAnswerFormat_Internal.h */; }; - 86C40CEA1A8D7C5C00081FAC /* ORKAnswerTextField.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B671A8D7C5B00081FAC /* ORKAnswerTextField.h */; }; - 86C40CEC1A8D7C5C00081FAC /* ORKAnswerTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B681A8D7C5B00081FAC /* ORKAnswerTextField.m */; }; - 86C40CEE1A8D7C5C00081FAC /* ORKAnswerTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B691A8D7C5B00081FAC /* ORKAnswerTextView.h */; }; - 86C40CF01A8D7C5C00081FAC /* ORKAnswerTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B6A1A8D7C5B00081FAC /* ORKAnswerTextView.m */; }; - 86C40CF21A8D7C5C00081FAC /* ORKBodyLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B6B1A8D7C5B00081FAC /* ORKBodyLabel.h */; }; - 86C40CF41A8D7C5C00081FAC /* ORKBodyLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B6C1A8D7C5B00081FAC /* ORKBodyLabel.m */; }; - 86C40CF61A8D7C5C00081FAC /* ORKBorderedButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B6D1A8D7C5B00081FAC /* ORKBorderedButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40CF81A8D7C5C00081FAC /* ORKBorderedButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B6E1A8D7C5C00081FAC /* ORKBorderedButton.m */; }; - 86C40CFA1A8D7C5C00081FAC /* ORKCaption1Label.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B6F1A8D7C5C00081FAC /* ORKCaption1Label.h */; }; - 86C40CFC1A8D7C5C00081FAC /* ORKCaption1Label.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B701A8D7C5C00081FAC /* ORKCaption1Label.m */; }; - 86C40CFE1A8D7C5C00081FAC /* ORKChoiceViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B711A8D7C5C00081FAC /* ORKChoiceViewCell.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D001A8D7C5C00081FAC /* ORKChoiceViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B721A8D7C5C00081FAC /* ORKChoiceViewCell.m */; }; - 86C40D021A8D7C5C00081FAC /* ORKContinueButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B731A8D7C5C00081FAC /* ORKContinueButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40D041A8D7C5C00081FAC /* ORKContinueButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B741A8D7C5C00081FAC /* ORKContinueButton.m */; }; - 86C40D061A8D7C5C00081FAC /* ORKCountdownLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B751A8D7C5C00081FAC /* ORKCountdownLabel.h */; }; - 86C40D081A8D7C5C00081FAC /* ORKCountdownLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B761A8D7C5C00081FAC /* ORKCountdownLabel.m */; }; - 86C40D0A1A8D7C5C00081FAC /* ORKCustomStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B771A8D7C5C00081FAC /* ORKCustomStepView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D0C1A8D7C5C00081FAC /* ORKCustomStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B781A8D7C5C00081FAC /* ORKCustomStepView.m */; }; - 86C40D0E1A8D7C5C00081FAC /* ORKCustomStepView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B791A8D7C5C00081FAC /* ORKCustomStepView_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D101A8D7C5C00081FAC /* ORKDefaultFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B7A1A8D7C5C00081FAC /* ORKDefaultFont.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 86C40CE81A8D7C5C00081FAC /* ORKAnswerFormat_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B661A8D7C5B00081FAC /* ORKAnswerFormat_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86C40D121A8D7C5C00081FAC /* ORKDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B7B1A8D7C5C00081FAC /* ORKDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D141A8D7C5C00081FAC /* ORKHelpers_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B7C1A8D7C5C00081FAC /* ORKHelpers_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86C40D161A8D7C5C00081FAC /* ORKErrors.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B7D1A8D7C5C00081FAC /* ORKErrors.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86C40D181A8D7C5C00081FAC /* ORKErrors.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B7E1A8D7C5C00081FAC /* ORKErrors.m */; }; 86C40D1A1A8D7C5C00081FAC /* ORKFormItem_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B7F1A8D7C5C00081FAC /* ORKFormItem_Internal.h */; }; - 86C40D1C1A8D7C5C00081FAC /* ORKFormSectionTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B801A8D7C5C00081FAC /* ORKFormSectionTitleLabel.h */; }; - 86C40D1E1A8D7C5C00081FAC /* ORKFormSectionTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B811A8D7C5C00081FAC /* ORKFormSectionTitleLabel.m */; }; 86C40D201A8D7C5C00081FAC /* ORKFormStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B821A8D7C5C00081FAC /* ORKFormStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D221A8D7C5C00081FAC /* ORKFormStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B831A8D7C5C00081FAC /* ORKFormStep.m */; }; - 86C40D241A8D7C5C00081FAC /* ORKFormStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B841A8D7C5C00081FAC /* ORKFormStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40D261A8D7C5C00081FAC /* ORKFormStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B851A8D7C5C00081FAC /* ORKFormStepViewController.m */; }; - 86C40D281A8D7C5C00081FAC /* ORKFormTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B861A8D7C5C00081FAC /* ORKFormTextView.h */; }; - 86C40D2A1A8D7C5C00081FAC /* ORKFormTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B871A8D7C5C00081FAC /* ORKFormTextView.m */; }; - 86C40D2C1A8D7C5C00081FAC /* ORKHeadlineLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B881A8D7C5C00081FAC /* ORKHeadlineLabel.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D2E1A8D7C5C00081FAC /* ORKHeadlineLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B891A8D7C5C00081FAC /* ORKHeadlineLabel.m */; }; 86C40D301A8D7C5C00081FAC /* ORKHealthAnswerFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B8A1A8D7C5C00081FAC /* ORKHealthAnswerFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D321A8D7C5C00081FAC /* ORKHealthAnswerFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B8B1A8D7C5C00081FAC /* ORKHealthAnswerFormat.m */; }; 86C40D361A8D7C5C00081FAC /* ORKHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B8D1A8D7C5C00081FAC /* ORKHelpers.m */; }; - 86C40D381A8D7C5C00081FAC /* ORKHTMLPDFWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B8E1A8D7C5C00081FAC /* ORKHTMLPDFWriter.h */; }; - 86C40D3A1A8D7C5C00081FAC /* ORKHTMLPDFWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B8F1A8D7C5C00081FAC /* ORKHTMLPDFWriter.m */; }; - 86C40D3C1A8D7C5C00081FAC /* ORKImageChoiceLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B901A8D7C5C00081FAC /* ORKImageChoiceLabel.h */; }; - 86C40D3E1A8D7C5C00081FAC /* ORKImageChoiceLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B911A8D7C5C00081FAC /* ORKImageChoiceLabel.m */; }; 86C40D401A8D7C5C00081FAC /* ORKInstructionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B921A8D7C5C00081FAC /* ORKInstructionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D421A8D7C5C00081FAC /* ORKInstructionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B931A8D7C5C00081FAC /* ORKInstructionStep.m */; }; - 86C40D441A8D7C5C00081FAC /* ORKInstructionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B941A8D7C5C00081FAC /* ORKInstructionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40D461A8D7C5C00081FAC /* ORKInstructionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B951A8D7C5C00081FAC /* ORKInstructionStepViewController.m */; }; - 86C40D481A8D7C5C00081FAC /* ORKInstructionStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B961A8D7C5C00081FAC /* ORKInstructionStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D4A1A8D7C5C00081FAC /* ORKLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B971A8D7C5C00081FAC /* ORKLabel.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D4C1A8D7C5C00081FAC /* ORKLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B981A8D7C5C00081FAC /* ORKLabel.m */; }; 86C40D561A8D7C5C00081FAC /* ORKOrderedTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B9D1A8D7C5C00081FAC /* ORKOrderedTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D581A8D7C5C00081FAC /* ORKOrderedTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B9E1A8D7C5C00081FAC /* ORKOrderedTask.m */; }; 86C40D5E1A8D7C5C00081FAC /* ORKQuestionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BA11A8D7C5C00081FAC /* ORKQuestionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D601A8D7C5C00081FAC /* ORKQuestionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BA21A8D7C5C00081FAC /* ORKQuestionStep.m */; }; 86C40D621A8D7C5C00081FAC /* ORKQuestionStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BA31A8D7C5C00081FAC /* ORKQuestionStep_Internal.h */; }; - 86C40D641A8D7C5C00081FAC /* ORKQuestionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BA41A8D7C5C00081FAC /* ORKQuestionStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D661A8D7C5C00081FAC /* ORKQuestionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BA51A8D7C5C00081FAC /* ORKQuestionStepViewController.m */; }; - 86C40D681A8D7C5C00081FAC /* ORKQuestionStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BA61A8D7C5C00081FAC /* ORKQuestionStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86C40D6A1A8D7C5C00081FAC /* ORKResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BA71A8D7C5C00081FAC /* ORKResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D6C1A8D7C5C00081FAC /* ORKResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BA81A8D7C5C00081FAC /* ORKResult.m */; }; 86C40D6E1A8D7C5C00081FAC /* ORKResult_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BA91A8D7C5C00081FAC /* ORKResult_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D701A8D7C5C00081FAC /* ORKRoundTappingButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BAA1A8D7C5C00081FAC /* ORKRoundTappingButton.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D721A8D7C5C00081FAC /* ORKRoundTappingButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BAB1A8D7C5C00081FAC /* ORKRoundTappingButton.m */; }; - 86C40D741A8D7C5C00081FAC /* ORKScaleRangeLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BAC1A8D7C5C00081FAC /* ORKScaleRangeLabel.h */; }; - 86C40D761A8D7C5C00081FAC /* ORKScaleRangeLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BAD1A8D7C5C00081FAC /* ORKScaleRangeLabel.m */; }; - 86C40D781A8D7C5C00081FAC /* ORKScaleSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BAE1A8D7C5C00081FAC /* ORKScaleSlider.h */; }; - 86C40D7A1A8D7C5C00081FAC /* ORKScaleSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BAF1A8D7C5C00081FAC /* ORKScaleSlider.m */; }; - 86C40D7C1A8D7C5C00081FAC /* ORKScaleValueLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB01A8D7C5C00081FAC /* ORKScaleValueLabel.h */; }; - 86C40D7E1A8D7C5C00081FAC /* ORKScaleValueLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB11A8D7C5C00081FAC /* ORKScaleValueLabel.m */; }; - 86C40D801A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB21A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.h */; }; - 86C40D821A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB31A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.m */; }; - 86C40D841A8D7C5C00081FAC /* ORKSelectionTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB41A8D7C5C00081FAC /* ORKSelectionTitleLabel.h */; }; - 86C40D861A8D7C5C00081FAC /* ORKSelectionTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB51A8D7C5C00081FAC /* ORKSelectionTitleLabel.m */; }; - 86C40D8A1A8D7C5C00081FAC /* ORKSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB71A8D7C5C00081FAC /* ORKSkin.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D8C1A8D7C5C00081FAC /* ORKSkin.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB81A8D7C5C00081FAC /* ORKSkin.m */; }; 86C40D8E1A8D7C5C00081FAC /* ORKStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB91A8D7C5C00081FAC /* ORKStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40D901A8D7C5C00081FAC /* ORKStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BBA1A8D7C5C00081FAC /* ORKStep.m */; }; 86C40D921A8D7C5C00081FAC /* ORKStep_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BBB1A8D7C5C00081FAC /* ORKStep_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D941A8D7C5C00081FAC /* ORKStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BBC1A8D7C5C00081FAC /* ORKStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40D961A8D7C5C00081FAC /* ORKStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BBD1A8D7C5C00081FAC /* ORKStepViewController.m */; }; - 86C40D981A8D7C5C00081FAC /* ORKStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BBE1A8D7C5C00081FAC /* ORKStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D9C1A8D7C5C00081FAC /* ORKSubheadlineLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC01A8D7C5C00081FAC /* ORKSubheadlineLabel.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40D9E1A8D7C5C00081FAC /* ORKSubheadlineLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BC11A8D7C5C00081FAC /* ORKSubheadlineLabel.m */; }; - 86C40DA01A8D7C5C00081FAC /* ORKSurveyAnswerCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC21A8D7C5C00081FAC /* ORKSurveyAnswerCell.h */; }; - 86C40DA61A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC51A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.h */; }; - 86C40DA81A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BC61A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.m */; }; - 86C40DAA1A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC71A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.h */; }; - 86C40DAC1A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BC81A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.m */; }; - 86C40DAE1A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC91A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.h */; }; - 86C40DB01A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BCA1A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.m */; }; - 86C40DB61A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BCD1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.h */; }; - 86C40DB81A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BCE1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.m */; }; - 86C40DBE1A8D7C5C00081FAC /* ORKTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD11A8D7C5C00081FAC /* ORKTableViewCell.h */; }; - 86C40DC01A8D7C5C00081FAC /* ORKTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BD21A8D7C5C00081FAC /* ORKTableViewCell.m */; }; - 86C40DC21A8D7C5C00081FAC /* ORKTapCountLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD31A8D7C5C00081FAC /* ORKTapCountLabel.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40DC41A8D7C5C00081FAC /* ORKTapCountLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BD41A8D7C5C00081FAC /* ORKTapCountLabel.m */; }; 86C40DC61A8D7C5C00081FAC /* ORKTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD51A8D7C5C00081FAC /* ORKTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40DCA1A8D7C5C00081FAC /* ORKTaskViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD71A8D7C5C00081FAC /* ORKTaskViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40DCC1A8D7C5C00081FAC /* ORKTaskViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BD81A8D7C5C00081FAC /* ORKTaskViewController.m */; }; - 86C40DCE1A8D7C5C00081FAC /* ORKTaskViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD91A8D7C5C00081FAC /* ORKTaskViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40DD01A8D7C5C00081FAC /* ORKTaskViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BDA1A8D7C5C00081FAC /* ORKTaskViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40DD21A8D7C5C00081FAC /* ORKTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BDB1A8D7C5C00081FAC /* ORKTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40DD41A8D7C5C00081FAC /* ORKTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BDC1A8D7C5C00081FAC /* ORKTextButton.m */; }; - 86C40DD61A8D7C5C00081FAC /* ORKUnitLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BDD1A8D7C5C00081FAC /* ORKUnitLabel.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40DD81A8D7C5C00081FAC /* ORKUnitLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BDE1A8D7C5C00081FAC /* ORKUnitLabel.m */; }; - 86C40DDE1A8D7C5C00081FAC /* ORKVerticalContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE11A8D7C5C00081FAC /* ORKVerticalContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40DE01A8D7C5C00081FAC /* ORKVerticalContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BE21A8D7C5C00081FAC /* ORKVerticalContainerView.m */; }; - 86C40DE21A8D7C5C00081FAC /* ORKVerticalContainerView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE31A8D7C5C00081FAC /* ORKVerticalContainerView_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40DEA1A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE71A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.h */; }; - 86C40DEC1A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BE81A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.m */; }; - 86C40DEE1A8D7C5C00081FAC /* UIResponder+ResearchKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE91A8D7C5C00081FAC /* UIResponder+ResearchKit.h */; }; - 86C40DF01A8D7C5C00081FAC /* UIResponder+ResearchKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BEA1A8D7C5C00081FAC /* UIResponder+ResearchKit.m */; }; - 86C40DF21A8D7C5C00081FAC /* ORKConsentReviewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BEC1A8D7C5C00081FAC /* ORKConsentReviewController.h */; }; - 86C40DF41A8D7C5C00081FAC /* ORKConsentReviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BED1A8D7C5C00081FAC /* ORKConsentReviewController.m */; }; - 86C40DF61A8D7C5C00081FAC /* ORKSignatureStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BEE1A8D7C5C00081FAC /* ORKSignatureStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40DF81A8D7C5C00081FAC /* ORKSignatureStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BEF1A8D7C5C00081FAC /* ORKSignatureStepViewController.m */; }; - 86C40DFA1A8D7C5C00081FAC /* MovieTintShader.fsh in Resources */ = {isa = PBXBuildFile; fileRef = 86C40BF01A8D7C5C00081FAC /* MovieTintShader.fsh */; }; - 86C40DFC1A8D7C5C00081FAC /* MovieTintShader.vsh in Resources */ = {isa = PBXBuildFile; fileRef = 86C40BF11A8D7C5C00081FAC /* MovieTintShader.vsh */; }; 86C40DFE1A8D7C5C00081FAC /* ORKConsentDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BF21A8D7C5C00081FAC /* ORKConsentDocument.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40E001A8D7C5C00081FAC /* ORKConsentDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BF31A8D7C5C00081FAC /* ORKConsentDocument.m */; }; 86C40E021A8D7C5C00081FAC /* ORKConsentDocument_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BF41A8D7C5C00081FAC /* ORKConsentDocument_Internal.h */; }; - 86C40E041A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BF51A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.h */; }; - 86C40E061A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BF61A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.m */; }; 86C40E081A8D7C5C00081FAC /* ORKConsentReviewStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BF71A8D7C5C00081FAC /* ORKConsentReviewStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40E0A1A8D7C5C00081FAC /* ORKConsentReviewStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BF81A8D7C5C00081FAC /* ORKConsentReviewStep.m */; }; - 86C40E0C1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BF91A8D7C5C00081FAC /* ORKConsentReviewStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 86C40E0E1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BFA1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.m */; }; 86C40E181A8D7C5C00081FAC /* ORKConsentSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BFF1A8D7C5C00081FAC /* ORKConsentSection.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40E1A1A8D7C5C00081FAC /* ORKConsentSection.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40C001A8D7C5C00081FAC /* ORKConsentSection.m */; }; 86C40E1C1A8D7C5C00081FAC /* ORKConsentSection_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40C011A8D7C5C00081FAC /* ORKConsentSection_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; 86C40E1E1A8D7C5C00081FAC /* ORKConsentSignature.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40C021A8D7C5C00081FAC /* ORKConsentSignature.h */; settings = {ATTRIBUTES = (Public, ); }; }; 86C40E201A8D7C5C00081FAC /* ORKConsentSignature.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40C031A8D7C5C00081FAC /* ORKConsentSignature.m */; }; - 86C40E241A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40C051A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.h */; }; - 86C40E261A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40C061A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.m */; }; - 86C40E281A8D7C5C00081FAC /* ORKSignatureView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40C071A8D7C5C00081FAC /* ORKSignatureView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 86C40E2A1A8D7C5C00081FAC /* ORKSignatureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40C081A8D7C5C00081FAC /* ORKSignatureView.m */; }; 86CC8EB31AC09383001CCD89 /* ORKAccessibilityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EA81AC09383001CCD89 /* ORKAccessibilityTests.m */; }; 86CC8EB41AC09383001CCD89 /* ORKChoiceAnswerFormatHelperTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EA91AC09383001CCD89 /* ORKChoiceAnswerFormatHelperTests.m */; }; 86CC8EB51AC09383001CCD89 /* ORKConsentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EAA1AC09383001CCD89 /* ORKConsentTests.m */; }; @@ -707,228 +369,627 @@ 86CC8EBA1AC09383001CCD89 /* ORKResultTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EAF1AC09383001CCD89 /* ORKResultTests.m */; }; 86CC8EBB1AC09383001CCD89 /* ORKTextChoiceCellGroupTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86CC8EB01AC09383001CCD89 /* ORKTextChoiceCellGroupTests.m */; }; 86D348021AC161B0006DB02B /* ORKRecorderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86D348001AC16175006DB02B /* ORKRecorderTests.m */; }; - 8DE27B401D5BC0B9009A26E3 /* ORKHTMLPDFPageRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DE27B3F1D5BC0B9009A26E3 /* ORKHTMLPDFPageRenderer.m */; }; - 8DE27B411D5BC9E2009A26E3 /* ORKHTMLPDFPageRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8DE27B3E1D5BC072009A26E3 /* ORKHTMLPDFPageRenderer.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 9550E6731D58DBCF00C691B8 /* ORKTouchAnywhereStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 9550E6711D58DBCF00C691B8 /* ORKTouchAnywhereStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9550E6741D58DBCF00C691B8 /* ORKTouchAnywhereStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E6721D58DBCF00C691B8 /* ORKTouchAnywhereStep.m */; }; - 9550E67C1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9550E67A1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9550E67D1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E67B1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m */; }; - 959A2BFC1D68B98700841B04 /* ORKRangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFA1D68B98700841B04 /* ORKRangeOfMotionStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 959A2BFD1D68B98700841B04 /* ORKRangeOfMotionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFB1D68B98700841B04 /* ORKRangeOfMotionStep.m */; }; - 959A2C001D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFE1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h */; }; - 959A2C011D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFF1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m */; }; - 959A2C0D1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2C0B1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 959A2C0E1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2C0C1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.m */; }; - 95E11E551D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E11E531D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.h */; }; - 95E11E561D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 95E11E541D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.m */; }; - A659C53A262E0A3200E920DA /* ORKAccuracyStroopStep.h in Headers */ = {isa = PBXBuildFile; fileRef = A659C538262E0A3200E920DA /* ORKAccuracyStroopStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A659C53B262E0A3200E920DA /* ORKAccuracyStroopStep.m in Sources */ = {isa = PBXBuildFile; fileRef = A659C539262E0A3200E920DA /* ORKAccuracyStroopStep.m */; }; - A659C53E262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A659C53C262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.h */; }; - A659C53F262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A659C53D262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.m */; }; - A659C546262E0F5600E920DA /* UIColor+String.h in Headers */ = {isa = PBXBuildFile; fileRef = A659C544262E0F5600E920DA /* UIColor+String.h */; }; - A659C547262E0F5600E920DA /* UIColor+String.m in Sources */ = {isa = PBXBuildFile; fileRef = A659C545262E0F5600E920DA /* UIColor+String.m */; }; - AE2CF2C123231C5A00FDD733 /* ORKTagLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = AE2CF2BF23231C5A00FDD733 /* ORKTagLabel.h */; }; - AE2CF2C223231C5A00FDD733 /* ORKTagLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = AE2CF2C023231C5A00FDD733 /* ORKTagLabel.m */; }; AE75433A24E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = AE75433824E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; AE75433B24E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = AE75433924E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.m */; }; - AEFE0AC1230DB857004D0519 /* ORKReviewIncompleteCell.h in Headers */ = {isa = PBXBuildFile; fileRef = AEFE0ABF230DB857004D0519 /* ORKReviewIncompleteCell.h */; }; - AEFE0AC2230DB857004D0519 /* ORKReviewIncompleteCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AEFE0AC0230DB857004D0519 /* ORKReviewIncompleteCell.m */; }; B11C54991A9EEF8800265E61 /* ORKConsentSharingStep.h in Headers */ = {isa = PBXBuildFile; fileRef = B11C54961A9EEF8800265E61 /* ORKConsentSharingStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; B11C549B1A9EEF8800265E61 /* ORKConsentSharingStep.m in Sources */ = {isa = PBXBuildFile; fileRef = B11C54971A9EEF8800265E61 /* ORKConsentSharingStep.m */; }; - B11C549F1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B11C549C1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - B11C54A11A9EF4A700265E61 /* ORKConsentSharingStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B11C549D1A9EF4A700265E61 /* ORKConsentSharingStepViewController.m */; }; - B17FE7FD1A8DBE7C00BF9C28 /* Artwork.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 861610BF1A8D8EDD00245F7A /* Artwork.xcassets */; }; + B183A4A21A8535D100C76870 /* ResearchKit_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = B1B894391A00345200C5CF2D /* ResearchKit_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; B183A4DD1A8535D100C76870 /* ResearchKit.h in Headers */ = {isa = PBXBuildFile; fileRef = B1C1DE4F196F541F00F75544 /* ResearchKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B1A860EA1A9693C400EA57B7 /* consent_01@2x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860DB1A9693C400EA57B7 /* consent_01@2x.m4v */; }; - B1A860EB1A9693C400EA57B7 /* consent_02@2x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860DC1A9693C400EA57B7 /* consent_02@2x.m4v */; }; - B1A860EC1A9693C400EA57B7 /* consent_03@2x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860DD1A9693C400EA57B7 /* consent_03@2x.m4v */; }; - B1A860ED1A9693C400EA57B7 /* consent_04@2x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860DE1A9693C400EA57B7 /* consent_04@2x.m4v */; }; - B1A860EE1A9693C400EA57B7 /* consent_05@2x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860DF1A9693C400EA57B7 /* consent_05@2x.m4v */; }; - B1A860EF1A9693C400EA57B7 /* consent_06@2x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E01A9693C400EA57B7 /* consent_06@2x.m4v */; }; - B1A860F01A9693C400EA57B7 /* consent_07@2x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E11A9693C400EA57B7 /* consent_07@2x.m4v */; }; - B1A860F11A9693C400EA57B7 /* consent_01@3x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E31A9693C400EA57B7 /* consent_01@3x.m4v */; }; - B1A860F21A9693C400EA57B7 /* consent_02@3x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E41A9693C400EA57B7 /* consent_02@3x.m4v */; }; - B1A860F31A9693C400EA57B7 /* consent_03@3x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E51A9693C400EA57B7 /* consent_03@3x.m4v */; }; - B1A860F41A9693C400EA57B7 /* consent_04@3x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E61A9693C400EA57B7 /* consent_04@3x.m4v */; }; - B1A860F51A9693C400EA57B7 /* consent_05@3x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E71A9693C400EA57B7 /* consent_05@3x.m4v */; }; - B1A860F61A9693C400EA57B7 /* consent_06@3x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E81A9693C400EA57B7 /* consent_06@3x.m4v */; }; - B1A860F71A9693C400EA57B7 /* consent_07@3x.m4v in Resources */ = {isa = PBXBuildFile; fileRef = B1A860E91A9693C400EA57B7 /* consent_07@3x.m4v */; }; B1C0F4E41A9BA65F0022C153 /* ResearchKit.strings in Resources */ = {isa = PBXBuildFile; fileRef = B1C0F4E11A9BA65F0022C153 /* ResearchKit.strings */; }; B1C7955E1A9FBF04007279BA /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1C7955D1A9FBF04007279BA /* HealthKit.framework */; settings = {ATTRIBUTES = (Required, ); }; }; - B8760F2B1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = B8760F291AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.h */; }; - B8760F2C1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = B8760F2A1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.m */; }; - BA0AA6941EAEC0B600671ACE /* ORKStroopContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA0AA68E1EAEC0B600671ACE /* ORKStroopContentView.h */; }; - BA0AA6951EAEC0B600671ACE /* ORKStroopContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA0AA68F1EAEC0B600671ACE /* ORKStroopContentView.m */; }; - BA0AA6961EAEC0B600671ACE /* ORKStroopStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BA0AA6901EAEC0B600671ACE /* ORKStroopStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA0AA6971EAEC0B600671ACE /* ORKStroopStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BA0AA6911EAEC0B600671ACE /* ORKStroopStep.m */; }; - BA0AA6981EAEC0B600671ACE /* ORKStroopStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA0AA6921EAEC0B600671ACE /* ORKStroopStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA0AA6991EAEC0B600671ACE /* ORKStroopStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA0AA6931EAEC0B600671ACE /* ORKStroopStepViewController.m */; }; - BA22F76D20C4F884006E6E11 /* SentencesList.txt in Resources */ = {isa = PBXBuildFile; fileRef = BA22F76C20C4F884006E6E11 /* SentencesList.txt */; }; - BA2645E62301571800D00B73 /* ORKReviewViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2645E42301571800D00B73 /* ORKReviewViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BA2645E72301571800D00B73 /* ORKReviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA2645E52301571800D00B73 /* ORKReviewViewController.m */; }; - BA2CFBB02342935800B71919 /* ORKCompletionCheckmarkView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2CFBAE2342935800B71919 /* ORKCompletionCheckmarkView.h */; }; - BA2CFBB12342935800B71919 /* ORKCompletionCheckmarkView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA2CFBAF2342935800B71919 /* ORKCompletionCheckmarkView.m */; }; - BA2FE3EE20B109C600AAC231 /* ORKAmslerGridResult.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2FE3EC20B109C600AAC231 /* ORKAmslerGridResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BA2FE3EF20B109C600AAC231 /* ORKAmslerGridResult.m in Sources */ = {isa = PBXBuildFile; fileRef = BA2FE3ED20B109C600AAC231 /* ORKAmslerGridResult.m */; }; - BA3D7E732223F8B90023FE3A /* ORKChoiceViewCell_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BA3D7E722223F8B90023FE3A /* ORKChoiceViewCell_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA43CCA42271741C00F2A2D2 /* ORKStepContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA43CCA22271741C00F2A2D2 /* ORKStepContentView.h */; }; - BA43CCA52271741C00F2A2D2 /* ORKStepContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA43CCA32271741C00F2A2D2 /* ORKStepContentView.m */; }; - BA43CCA822722C6E00F2A2D2 /* ORKStepContentView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BA43CCA622722C6E00F2A2D2 /* ORKStepContentView_Private.h */; }; - BA473FE3224DAFEF00A362E3 /* ORKBodyContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA473FE1224DAFEF00A362E3 /* ORKBodyContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA473FE4224DAFEF00A362E3 /* ORKBodyContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA473FE2224DAFEF00A362E3 /* ORKBodyContainerView.m */; }; BA473FE8224DB38900A362E3 /* ORKBodyItem.h in Headers */ = {isa = PBXBuildFile; fileRef = BA473FE6224DB38900A362E3 /* ORKBodyItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; BA473FE9224DB38900A362E3 /* ORKBodyItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BA473FE7224DB38900A362E3 /* ORKBodyItem.m */; }; - BA473FED224DBA3700A362E3 /* ORKLearnMoreView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA473FEB224DBA3700A362E3 /* ORKLearnMoreView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA473FEE224DBA3700A362E3 /* ORKLearnMoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA473FEC224DBA3700A362E3 /* ORKLearnMoreView.m */; }; - BA5B9207204F5D9A007C2F9D /* ORKSpeechRecognitionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = BA5B9205204F5D9A007C2F9D /* ORKSpeechRecognitionResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BA5B9208204F5D9A007C2F9D /* ORKSpeechRecognitionResult.m in Sources */ = {isa = PBXBuildFile; fileRef = BA5B9206204F5D9A007C2F9D /* ORKSpeechRecognitionResult.m */; }; - BA6E1EB6209E9A3F00DA9D55 /* ORKPDFViewerStepView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BA6E1EB5209E9A3F00DA9D55 /* ORKPDFViewerStepView_Internal.h */; }; - BA8078E3224A8D6E0013B554 /* ORKTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8078E1224A8D6E0013B554 /* ORKTitleLabel.h */; }; - BA8078E4224A8D6E0013B554 /* ORKTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8078E2224A8D6E0013B554 /* ORKTitleLabel.m */; }; - BA8078F3224AC8AA0013B554 /* ORKStepContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8078F1224AC8AA0013B554 /* ORKStepContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA8078F4224AC8AA0013B554 /* ORKStepContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8078F2224AC8AA0013B554 /* ORKStepContainerView.m */; }; - BA87E26D20A79FA100B375A9 /* ORKRingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA87E26B20A79FA100B375A9 /* ORKRingView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA87E26E20A79FA100B375A9 /* ORKRingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA87E26C20A79FA100B375A9 /* ORKRingView.m */; }; - BA8C066B22ECF7C200ACDE6B /* ORKSecondaryTaskStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8C066922ECF7C200ACDE6B /* ORKSecondaryTaskStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BA8C066C22ECF7C200ACDE6B /* ORKSecondaryTaskStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8C066A22ECF7C200ACDE6B /* ORKSecondaryTaskStep.m */; }; - BA8C066F22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8C066D22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.h */; }; - BA8C067022ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8C066E22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.m */; }; - BA8C067822EEB84B00ACDE6B /* ORKPlaybackButton.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8C067622EEB84B00ACDE6B /* ORKPlaybackButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BA8C067922EEB84B00ACDE6B /* ORKPlaybackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8C067722EEB84B00ACDE6B /* ORKPlaybackButton.m */; }; BA8C5021226FFB04001896D0 /* ORKLearnMoreItem.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8C501F226FFB04001896D0 /* ORKLearnMoreItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BA8C5022226FFB04001896D0 /* ORKLearnMoreItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8C5020226FFB04001896D0 /* ORKLearnMoreItem.m */; }; - BA95AA9620ACD07A00E7FF8E /* ORKAmslerGridStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BA95AA9420ACD07A00E7FF8E /* ORKAmslerGridStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA95AA9720ACD07A00E7FF8E /* ORKAmslerGridStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BA95AA9520ACD07A00E7FF8E /* ORKAmslerGridStep.m */; }; - BA95AA9A20ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA95AA9820ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BA95AA9B20ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA95AA9920ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.m */; }; - BA95AA9E20ACD0E700E7FF8E /* ORKAmslerGridContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA95AA9C20ACD0E700E7FF8E /* ORKAmslerGridContentView.h */; }; - BA95AA9F20ACD0E700E7FF8E /* ORKAmslerGridContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA95AA9D20ACD0E700E7FF8E /* ORKAmslerGridContentView.m */; }; - BAB3942F22601CAB00E59B0B /* ORKStepContainerView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BAB3942E22601CAB00E59B0B /* ORKStepContainerView_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; BAB96755226E5D67006AAC56 /* ORKStepContainerViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BAB96754226E5D67006AAC56 /* ORKStepContainerViewTests.m */; }; - BABBB19D2093299A00CB29E5 /* ORKSurveyCardHeaderView.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB19B2093299A00CB29E5 /* ORKSurveyCardHeaderView.h */; }; - BABBB19E2093299A00CB29E5 /* ORKSurveyCardHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB19C2093299A00CB29E5 /* ORKSurveyCardHeaderView.m */; }; BABBB1AE2097D97200CB29E5 /* ORKPDFViewerStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB1AC2097D97200CB29E5 /* ORKPDFViewerStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; BABBB1AF2097D97200CB29E5 /* ORKPDFViewerStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB1AD2097D97200CB29E5 /* ORKPDFViewerStep.m */; }; - BABBB1B22097E16700CB29E5 /* ORKPDFViewerStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB1B02097E16700CB29E5 /* ORKPDFViewerStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BABBB1B32097E16700CB29E5 /* ORKPDFViewerStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB1B12097E16700CB29E5 /* ORKPDFViewerStepViewController.m */; }; - BABBB1B62097E58300CB29E5 /* ORKPDFViewerStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB1B42097E58300CB29E5 /* ORKPDFViewerStepView.h */; }; - BABBB1B72097E58300CB29E5 /* ORKPDFViewerStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB1B52097E58300CB29E5 /* ORKPDFViewerStepView.m */; }; - BABBB1BA2097EF3800CB29E5 /* ORKFreehandDrawingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB1B82097EF3800CB29E5 /* ORKFreehandDrawingView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BABBB1BB2097EF3800CB29E5 /* ORKFreehandDrawingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB1B92097EF3800CB29E5 /* ORKFreehandDrawingView.m */; }; - BAC2B65722F252F70079304E /* ORKSurveyAnswerCellForSES.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC2B65522F252F70079304E /* ORKSurveyAnswerCellForSES.h */; }; - BAC2B65822F252F70079304E /* ORKSurveyAnswerCellForSES.m in Sources */ = {isa = PBXBuildFile; fileRef = BAC2B65622F252F70079304E /* ORKSurveyAnswerCellForSES.m */; }; - BAC2B65B22F25A2E0079304E /* ORKSESSelectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC2B65922F25A2E0079304E /* ORKSESSelectionView.h */; }; - BAC2B65C22F25A2F0079304E /* ORKSESSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = BAC2B65A22F25A2E0079304E /* ORKSESSelectionView.m */; }; - BAC6F1A922AF535100E31C22 /* ORKTaskReviewViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC6F1A722AF535100E31C22 /* ORKTaskReviewViewController.h */; }; - BAC6F1AA22AF535100E31C22 /* ORKTaskReviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BAC6F1A822AF535100E31C22 /* ORKTaskReviewViewController.m */; }; - BAD65E4B2284EFF9008A5DCE /* ORKStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD65E492284EFF9008A5DCE /* ORKStepView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BAD65E4C2284EFF9008A5DCE /* ORKStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD65E4A2284EFF9008A5DCE /* ORKStepView.m */; }; - BAD65E502284F266008A5DCE /* ORKStepView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD65E4F2284F266008A5DCE /* ORKStepView_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BAD6FAB12332A2FD006647E7 /* ORKCheckmarkView.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD6FAAF2332A2FD006647E7 /* ORKCheckmarkView.h */; }; - BAD6FAB22332A2FD006647E7 /* ORKCheckmarkView.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD6FAB02332A2FD006647E7 /* ORKCheckmarkView.m */; }; BAD9E9122255E9750014FA29 /* ORKLearnMoreInstructionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD9E9102255E9750014FA29 /* ORKLearnMoreInstructionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; BAD9E9132255E9750014FA29 /* ORKLearnMoreInstructionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD9E9112255E9750014FA29 /* ORKLearnMoreInstructionStep.m */; }; - BAD9E9162255E9CE0014FA29 /* ORKLearnMoreStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD9E9142255E9CE0014FA29 /* ORKLearnMoreStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BAD9E9172255E9CE0014FA29 /* ORKLearnMoreStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD9E9152255E9CE0014FA29 /* ORKLearnMoreStepViewController.m */; }; - BADA2F26225DA54B005D2255 /* ORKInstructionStepContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BADA2F24225DA54B005D2255 /* ORKInstructionStepContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BADA2F27225DA54B005D2255 /* ORKInstructionStepContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = BADA2F25225DA54B005D2255 /* ORKInstructionStepContainerView.m */; }; - BC01B0FB1B0EB99700863803 /* ORKTintedImageView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC01B0FA1B0EB99700863803 /* ORKTintedImageView_Internal.h */; }; BC081DE224CBC4DE00AD92AA /* ORKTypes_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BC081DE124CBC4DE00AD92AA /* ORKTypes_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC13CE391B0660220044153C /* ORKNavigableOrderedTask.h in Headers */ = {isa = PBXBuildFile; fileRef = BC13CE371B0660220044153C /* ORKNavigableOrderedTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC13CE3A1B0660220044153C /* ORKNavigableOrderedTask.m in Sources */ = {isa = PBXBuildFile; fileRef = BC13CE381B0660220044153C /* ORKNavigableOrderedTask.m */; }; BC13CE3C1B0662990044153C /* ORKStepNavigationRule_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BC13CE3B1B0662990044153C /* ORKStepNavigationRule_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC13CE401B0666FD0044153C /* ORKResultPredicate.h in Headers */ = {isa = PBXBuildFile; fileRef = BC13CE3F1B0666FD0044153C /* ORKResultPredicate.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC13CE421B066A990044153C /* ORKStepNavigationRule_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC13CE411B066A990044153C /* ORKStepNavigationRule_Internal.h */; }; - BC1C032C1CA301E300869355 /* ORKHeightPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1C032A1CA301E300869355 /* ORKHeightPicker.h */; }; - BC1C032D1CA301E300869355 /* ORKHeightPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1C032B1CA301E300869355 /* ORKHeightPicker.m */; }; BC2908BC1FBD628F0030AB89 /* ORKTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = BC2908BB1FBD628F0030AB89 /* ORKTypes.m */; }; - BC37323222B76D1A0021F665 /* ORKTextButton_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC37323122B76D190021F665 /* ORKTextButton_Internal.h */; }; - BC37323622B76DC70021F665 /* ORKFormStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BC37323522B76DC70021F665 /* ORKFormStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC40696121104DDF00A4100C /* ResearchKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B183A5951A8535D100C76870 /* ResearchKit.framework */; }; - BC4194291AE8453A00073D6B /* ORKObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4194271AE8453A00073D6B /* ORKObserver.h */; }; - BC41942A1AE8453A00073D6B /* ORKObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4194281AE8453A00073D6B /* ORKObserver.m */; }; - BC4A213F1C85FC0000BFC271 /* ORKBarGraphChartView.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A213D1C85FC0000BFC271 /* ORKBarGraphChartView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BC4A21401C85FC0000BFC271 /* ORKBarGraphChartView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4A213E1C85FC0000BFC271 /* ORKBarGraphChartView.m */; }; - BC5FAF841C6901A200057CF1 /* ORKChartTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5FAF821C6901A200057CF1 /* ORKChartTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BC5FAF851C6901A200057CF1 /* ORKChartTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = BC5FAF831C6901A200057CF1 /* ORKChartTypes.m */; }; - BC8FC6781CA9B17C00D12768 /* ORKVoiceEngine_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EBFE11E1AE1B68800CB8254 /* ORKVoiceEngine_Internal.h */; }; + BC4D521F27B326EA0099DC18 /* ORKSecureCodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC4D521E27B326EA0099DC18 /* ORKSecureCodingTests.swift */; }; BC94EF311E962F7400143081 /* ORKDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94EF2F1E962F7400143081 /* ORKDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BC94EF321E962F7400143081 /* ORKDeprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = BC94EF301E962F7400143081 /* ORKDeprecated.m */; }; BC94EF361E96394C00143081 /* ORKRegistrationStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC94EF351E96394C00143081 /* ORKRegistrationStep_Internal.h */; }; BCA5C0351AEC05F20092AC8D /* ORKStepNavigationRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA5C0331AEC05F20092AC8D /* ORKStepNavigationRule.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCA5C0361AEC05F20092AC8D /* ORKStepNavigationRule.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA5C0341AEC05F20092AC8D /* ORKStepNavigationRule.m */; }; BCAD50E81B0201EE0034806A /* ORKTaskTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCAD50E71B0201EE0034806A /* ORKTaskTests.m */; }; BCB080A11B83EFB900A3F400 /* ORKStepNavigationRule.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCB080A01B83EFB900A3F400 /* ORKStepNavigationRule.swift */; }; - BCB6E64A1B7D531C000D5B34 /* ORKPieChartView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E6481B7D531C000D5B34 /* ORKPieChartView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BCB6E64B1B7D531C000D5B34 /* ORKPieChartView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6E6491B7D531C000D5B34 /* ORKPieChartView.m */; }; - BCB6E6501B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E64C1B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.h */; }; - BCB6E6511B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6E64D1B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.m */; }; - BCB6E6521B7D533B000D5B34 /* ORKPieChartLegendCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E64E1B7D533B000D5B34 /* ORKPieChartLegendCell.h */; }; - BCB6E6531B7D533B000D5B34 /* ORKPieChartLegendCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6E64F1B7D533B000D5B34 /* ORKPieChartLegendCell.m */; }; - BCB6E65B1B7D534C000D5B34 /* ORKDiscreteGraphChartView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E6541B7D534C000D5B34 /* ORKDiscreteGraphChartView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BCB6E65C1B7D534C000D5B34 /* ORKDiscreteGraphChartView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6E6551B7D534C000D5B34 /* ORKDiscreteGraphChartView.m */; }; - BCB6E65D1B7D534C000D5B34 /* ORKGraphChartView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E6561B7D534C000D5B34 /* ORKGraphChartView_Internal.h */; }; - BCB6E65E1B7D534C000D5B34 /* ORKGraphChartView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E6571B7D534C000D5B34 /* ORKGraphChartView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BCB6E65F1B7D534C000D5B34 /* ORKGraphChartView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6E6581B7D534C000D5B34 /* ORKGraphChartView.m */; }; - BCB6E6601B7D534C000D5B34 /* ORKLineGraphChartView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E6591B7D534C000D5B34 /* ORKLineGraphChartView.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BCB6E6611B7D534C000D5B34 /* ORKLineGraphChartView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6E65A1B7D534C000D5B34 /* ORKLineGraphChartView.m */; }; - BCB6E6661B7D535F000D5B34 /* ORKXAxisView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB6E6621B7D535F000D5B34 /* ORKXAxisView.h */; }; - BCB6E6671B7D535F000D5B34 /* ORKXAxisView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB6E6631B7D535F000D5B34 /* ORKXAxisView.m */; }; BCB8133C1C98367A00346561 /* ORKTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB8133B1C98367A00346561 /* ORKTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCB96C131B19C0EC002A0B96 /* ORKStepTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BCB96C121B19C0EC002A0B96 /* ORKStepTests.m */; }; - BCC1CD9A1B7ED64F00D86886 /* ORKYAxisView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC1CD981B7ED64F00D86886 /* ORKYAxisView.h */; }; - BCC1CD9B1B7ED64F00D86886 /* ORKYAxisView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC1CD991B7ED64F00D86886 /* ORKYAxisView.m */; }; BCCE9EC121104B2200B809F8 /* ORKConsentDocument_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCE9EC021104B2200B809F8 /* ORKConsentDocument_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BCD192DF1B81240400FCC08A /* ORKPieChartPieView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD192DD1B81240400FCC08A /* ORKPieChartPieView.h */; }; - BCD192E01B81240400FCC08A /* ORKPieChartPieView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD192DE1B81240400FCC08A /* ORKPieChartPieView.m */; }; - BCD192E71B81243900FCC08A /* ORKPieChartLegendView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD192E51B81243900FCC08A /* ORKPieChartLegendView.h */; }; - BCD192E81B81243900FCC08A /* ORKPieChartLegendView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD192E61B81243900FCC08A /* ORKPieChartLegendView.m */; }; - BCD192EB1B81245500FCC08A /* ORKPieChartTitleTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD192E91B81245500FCC08A /* ORKPieChartTitleTextView.h */; }; - BCD192EC1B81245500FCC08A /* ORKPieChartTitleTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCD192EA1B81245500FCC08A /* ORKPieChartTitleTextView.m */; }; - BCD192EE1B81255F00FCC08A /* ORKPieChartView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD192ED1B81255F00FCC08A /* ORKPieChartView_Internal.h */; }; BCFF24BD1B0798D10044EC35 /* ORKResultPredicate.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFF24BC1B0798D10044EC35 /* ORKResultPredicate.m */; }; BF1D43851D4904C6007EE90B /* ORKVideoInstructionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BF1D43831D4904C6007EE90B /* ORKVideoInstructionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF1D43861D4904C6007EE90B /* ORKVideoInstructionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BF1D43841D4904C6007EE90B /* ORKVideoInstructionStep.m */; }; - BF1D43891D4905FC007EE90B /* ORKVideoInstructionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BF1D43871D4905FC007EE90B /* ORKVideoInstructionStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BF1D438A1D4905FC007EE90B /* ORKVideoInstructionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF1D43881D4905FC007EE90B /* ORKVideoInstructionStepViewController.m */; }; BF5161501BE9C53D00174DDD /* ORKWaitStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155A11BDE8DA9007FA459 /* ORKWaitStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF91559B1BDE8D7D007FA459 /* ORKReviewStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155951BDE8D7D007FA459 /* ORKReviewStep_Internal.h */; }; BF91559C1BDE8D7D007FA459 /* ORKReviewStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155961BDE8D7D007FA459 /* ORKReviewStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; BF91559D1BDE8D7D007FA459 /* ORKReviewStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9155971BDE8D7D007FA459 /* ORKReviewStep.m */; }; - BF91559E1BDE8D7E007FA459 /* ORKReviewStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155981BDE8D7D007FA459 /* ORKReviewStepViewController_Internal.h */; }; - BF91559F1BDE8D7E007FA459 /* ORKReviewStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155991BDE8D7D007FA459 /* ORKReviewStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - BF9155A01BDE8D7E007FA459 /* ORKReviewStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF91559A1BDE8D7D007FA459 /* ORKReviewStepViewController.m */; }; BF9155A81BDE8DA9007FA459 /* ORKWaitStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9155A21BDE8DA9007FA459 /* ORKWaitStep.m */; }; - BF9155A91BDE8DA9007FA459 /* ORKWaitStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155A31BDE8DA9007FA459 /* ORKWaitStepView.h */; }; - BF9155AA1BDE8DA9007FA459 /* ORKWaitStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9155A41BDE8DA9007FA459 /* ORKWaitStepView.m */; }; - BF9155AB1BDE8DA9007FA459 /* ORKWaitStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155A51BDE8DA9007FA459 /* ORKWaitStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BF9155AC1BDE8DA9007FA459 /* ORKWaitStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9155A61BDE8DA9007FA459 /* ORKWaitStepViewController.m */; }; - CBD34A561BB1FB9000F204EA /* ORKLocationSelectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD34A541BB1FB9000F204EA /* ORKLocationSelectionView.h */; }; - CBD34A571BB1FB9000F204EA /* ORKLocationSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD34A551BB1FB9000F204EA /* ORKLocationSelectionView.m */; }; - CBD34A5A1BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD34A581BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.h */; }; - CBD34A5B1BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD34A591BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.m */; }; - D3C8072A21891EBE00F9A231 /* ORKEnvironmentSPLMeterResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 716B126220A78C6B00590264 /* ORKEnvironmentSPLMeterResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D42FEFB81AF7557000A124F8 /* ORKImageCaptureView.h in Headers */ = {isa = PBXBuildFile; fileRef = D42FEFB61AF7557000A124F8 /* ORKImageCaptureView.h */; }; - D42FEFB91AF7557000A124F8 /* ORKImageCaptureView.m in Sources */ = {isa = PBXBuildFile; fileRef = D42FEFB71AF7557000A124F8 /* ORKImageCaptureView.m */; }; + CA08054028AD7CC8001695EF /* ORKViewControllerProviding.h in Headers */ = {isa = PBXBuildFile; fileRef = CA08053F28AD7CC8001695EF /* ORKViewControllerProviding.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA0AC56928BD4FAC00E80040 /* ORKStepViewControllerHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA0AC56828BD4FAB00E80040 /* ORKStepViewControllerHelpers.swift */; }; + CA1C7A44288B0C68004DAB3A /* ResearchKitUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D06632F24FEF272005D9B40 /* ResearchKitUI.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA1C7A5C288B0CA2004DAB3A /* ResearchKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B183A5951A8535D100C76870 /* ResearchKit.framework */; }; + CA23A31D2899941700EC6E91 /* ORKSkin_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = CA23A31C2899941700EC6E91 /* ORKSkin_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2616D32894649A008B1425 /* ORKRequestPermissionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E03D6C2491B6DB008F8406 /* ORKRequestPermissionView.m */; }; + CA2616D42894649A008B1425 /* ORKRequestPermissionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 5170009C254A197300CACE12 /* ORKRequestPermissionButton.m */; }; + CA2B8F6128A16B050025B773 /* ORKSpeechInNoiseStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7118AC6E20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.m */; }; + CA2B8F6228A16B050025B773 /* ORKSpeechInNoiseContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7118AC7020BF6A7700D7A6BB /* ORKSpeechInNoiseContentView.m */; }; + CA2B8F6D28A16BAC0025B773 /* ORKSpeechInNoiseContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118AC7120BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B8F6E28A16BBA0025B773 /* ORKSpeechInNoiseStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118AC6F20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F8228A16CF40025B773 /* ORK3DModelStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 517514512459EF5D009E8FFC /* ORK3DModelStepViewController.m */; }; + CA2B8F8328A16CF40025B773 /* ORK3DModelStepContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 517514552459F0BE009E8FFC /* ORK3DModelStepContentView.m */; }; + CA2B8F8428A16CFC0025B773 /* ORKUSDZModelManagerScene.h in Headers */ = {isa = PBXBuildFile; fileRef = 51198767245CA50D004FC2C7 /* ORKUSDZModelManagerScene.h */; }; + CA2B8F8528A16D030025B773 /* ORKUSDZModelManagerScene.m in Sources */ = {isa = PBXBuildFile; fileRef = 51198768245CA50D004FC2C7 /* ORKUSDZModelManagerScene.m */; }; + CA2B8F8628A16D070025B773 /* ORKUSDZModelManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5119879D245FE68D004FC2C7 /* ORKUSDZModelManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F8728A16D0E0025B773 /* ORKUSDZModelManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5119879E245FE68D004FC2C7 /* ORKUSDZModelManager.m */; }; + CA2B8F8828A16D110025B773 /* ORKUSDZModelManagerResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5166E49D247355D500151C57 /* ORKUSDZModelManagerResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F8928A16D170025B773 /* ORKUSDZModelManagerResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5166E49E247355D500151C57 /* ORKUSDZModelManagerResult.m */; }; + CA2B8F8A28A16D1F0025B773 /* ORK3DModelStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 517514502459EF5D009E8FFC /* ORK3DModelStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F8B28A16D290025B773 /* ORK3DModelStepContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 517514542459F0BE009E8FFC /* ORK3DModelStepContentView.h */; }; + CA2B8F8C28A16E2E0025B773 /* ORKEnvironmentSPLMeterBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = E293668425EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.m */; }; + CA2B8F8D28A16E2E0025B773 /* ORKEnvironmentSPLMeterContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD9EAC2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.m */; }; + CA2B8F8E28A16E2E0025B773 /* ORKEnvironmentSPLMeterStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD9EA820969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.m */; }; + CA2B8F8F28A16E320025B773 /* ORKEnvironmentSPLMeterStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD9EA720969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F9028A16E380025B773 /* ORKEnvironmentSPLMeterBarView.h in Headers */ = {isa = PBXBuildFile; fileRef = E293668325EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.h */; }; + CA2B8F9128A16E3B0025B773 /* ORKEnvironmentSPLMeterContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD9EAB2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.h */; }; + CA2B8F9228A16E860025B773 /* ORKdBHLToneAudiometryAudioGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 716B126720A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m */; }; + CA2B8F9328A16E860025B773 /* ORKdBHLToneAudiometryContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E342088291B00A19914 /* ORKdBHLToneAudiometryContentView.m */; }; + CA2B8F9428A16E860025B773 /* ORKdBHLToneAudiometryStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E3C20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m */; }; + CA2B8F9528A16E860025B773 /* ORKdBHLToneAudiometryOnboardingStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E302088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m */; }; + CA2B8F9628A16E8F0025B773 /* ORKdBHLToneAudiometryOnboardingStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E2F2088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F9728A16E930025B773 /* ORKdBHLToneAudiometryAudioGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 716B126620A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B8F9828A16E960025B773 /* ORKdBHLToneAudiometryContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E332088291B00A19914 /* ORKdBHLToneAudiometryContentView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B8F9928A16E9C0025B773 /* ORKdBHLToneAudiometryStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E3B20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F9A28A16EF90025B773 /* ORKAmslerGridContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA95AA9D20ACD0E700E7FF8E /* ORKAmslerGridContentView.m */; }; + CA2B8F9B28A16EF90025B773 /* ORKAmslerGridStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA95AA9920ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.m */; }; + CA2B8F9C28A16EFC0025B773 /* ORKAmslerGridStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA95AA9820ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8F9D28A16F010025B773 /* ORKAmslerGridContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA95AA9C20ACD0E700E7FF8E /* ORKAmslerGridContentView.h */; }; + CA2B8F9E28A16F270025B773 /* ORKTouchAnywhereStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E67B1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m */; }; + CA2B8F9F28A16F310025B773 /* ORKTouchAnywhereStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9550E67A1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FA328A16F730025B773 /* ORKActiveStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AD910E1AB7B8A600361FEB /* ORKActiveStepView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B8FA428A16F7B0025B773 /* ORKActiveStepQuantityView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40AFA1A8D7C5B00081FAC /* ORKActiveStepQuantityView.h */; }; + CA2B8FA528A16F7F0025B773 /* ORKActiveStepTimerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B351A8D7C5B00081FAC /* ORKActiveStepTimerView.h */; }; + CA2B8FA628A16F930025B773 /* ORKCountdownStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B051A8D7C5B00081FAC /* ORKCountdownStepViewController.m */; }; + CA2B8FA728A16F9A0025B773 /* ORKCountdownStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B041A8D7C5B00081FAC /* ORKCountdownStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FA928A175360025B773 /* ORKAudioGraphView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8071001FB0E6BE00E4FC7F /* ORKAudioGraphView.m */; }; + CA2B8FAA28A175360025B773 /* ORKAudioStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B011A8D7C5B00081FAC /* ORKAudioStepViewController.m */; }; + CA2B8FAB28A175360025B773 /* ORKAudioMeteringView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D1CE45923FC85F4004CB416 /* ORKAudioMeteringView.m */; }; + CA2B8FAC28A175360025B773 /* ORKAudioContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40AFD1A8D7C5B00081FAC /* ORKAudioContentView.m */; }; + CA2B8FAD28A1753C0025B773 /* ORKAudioMeteringView.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D1CE45823FC85F3004CB416 /* ORKAudioMeteringView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B8FAF28A175450025B773 /* ORKAudioGraphView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8071011FB0E6BE00E4FC7F /* ORKAudioGraphView.h */; }; + CA2B8FB028A175490025B773 /* ORKAudioStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B001A8D7C5B00081FAC /* ORKAudioStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FB128A1754D0025B773 /* ORKAudioContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40AFC1A8D7C5B00081FAC /* ORKAudioContentView.h */; }; + CA2B8FB228A175660025B773 /* ORKSpeechRecognitionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070F31FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.m */; }; + CA2B8FB328A175660025B773 /* ORKSpeechRecognitionContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070FE1FAD256A00E4FC7F /* ORKSpeechRecognitionContentView.m */; }; + CA2B8FB428A175700025B773 /* ORKSpeechRecognitionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070F41FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FB528A175750025B773 /* ORKSpeechRecognitionContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070FD1FAD255000E4FC7F /* ORKSpeechRecognitionContentView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B8FB628A175870025B773 /* ORKAudioFitnessStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 03057F382515771800C4EC5B /* ORKAudioFitnessStepViewController.m */; }; + CA2B8FB728A175870025B773 /* ORKFitnessStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B0B1A8D7C5B00081FAC /* ORKFitnessStepViewController.m */; }; + CA2B8FB828A175870025B773 /* ORKFitnessContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B071A8D7C5B00081FAC /* ORKFitnessContentView.m */; }; + CA2B8FB928A1758B0025B773 /* ORKFitnessStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B0A1A8D7C5B00081FAC /* ORKFitnessStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FBA28A175900025B773 /* ORKAudioFitnessStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 03057F372515771800C4EC5B /* ORKAudioFitnessStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FBB28A175940025B773 /* ORKFitnessContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B061A8D7C5B00081FAC /* ORKFitnessContentView.h */; }; + CA2B8FBC28A175B40025B773 /* ORKHolePegTestPlacePegView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2A91B690FD7004EACF2 /* ORKHolePegTestPlacePegView.m */; }; + CA2B8FBD28A175B40025B773 /* ORKHolePegTestPlaceStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2A11B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.m */; }; + CA2B8FBE28A175B40025B773 /* ORKHolePegTestPlaceContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2A51B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.m */; }; + CA2B8FBF28A175B40025B773 /* ORKHolePegTestPlaceHoleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2B31B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.m */; }; + CA2B8FC028A175B60025B773 /* ORKHolePegTestPlaceStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2A01B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FC128A175BD0025B773 /* ORKHolePegTestPlaceContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2A41B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.h */; }; + CA2B8FC228A175C40025B773 /* ORKHolePegTestPlacePegView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2A81B690FD7004EACF2 /* ORKHolePegTestPlacePegView.h */; }; + CA2B8FC328A175C90025B773 /* ORKHolePegTestPlaceHoleView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2B21B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.h */; }; + CA2B8FC428A175E80025B773 /* ORKHolePegTestRemoveContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9ACE1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.m */; }; + CA2B8FC528A175E80025B773 /* ORKHolePegTestRemoveStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9ACA1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.m */; }; + CA2B8FC628A175E80025B773 /* ORKHolePegTestRemovePegView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9AD21B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.m */; }; + CA2B8FC728A175EA0025B773 /* ORKHolePegTestRemoveStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AC91B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FC828A175F00025B773 /* ORKHolePegTestRemoveContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9ACD1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.h */; }; + CA2B8FC928A175F40025B773 /* ORKHolePegTestRemovePegView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AD11B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.h */; }; + CA2B8FCA28A176120025B773 /* ORKPSATStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C991B27146B000F4158 /* ORKPSATStepViewController.m */; }; + CA2B8FCB28A176120025B773 /* ORKPSATContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C9B1B27146B000F4158 /* ORKPSATContentView.m */; }; + CA2B8FCC28A176120025B773 /* ORKPSATKeyboardView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C9D1B27146B000F4158 /* ORKPSATKeyboardView.m */; }; + CA2B8FCD28A176140025B773 /* ORKPSATStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C981B27146B000F4158 /* ORKPSATStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FCE28A176190025B773 /* ORKPSATContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C9A1B27146B000F4158 /* ORKPSATContentView.h */; }; + CA2B8FCF28A1761C0025B773 /* ORKPSATKeyboardView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C9C1B27146B000F4158 /* ORKPSATKeyboardView.h */; }; + CA2B8FD028A176AA0025B773 /* ORKShoulderRangeOfMotionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 95E11E541D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.m */; }; + CA2B8FD128A176B40025B773 /* ORKRangeOfMotionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFF1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m */; }; + CA2B8FD228A176B70025B773 /* ORKRangeOfMotionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFE1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FD328A176BC0025B773 /* ORKShoulderRangeOfMotionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E11E531D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FD428A176D70025B773 /* ORKReactionTimeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC09A1AFBD8B300F3D63B /* ORKReactionTimeViewController.m */; }; + CA2B8FD528A176D70025B773 /* ORKReactionTimeContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC09E1AFBD92D00F3D63B /* ORKReactionTimeContentView.m */; }; + CA2B8FD628A176D70025B773 /* ORKReactionTimeStimulusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC0A21AFBDD2700F3D63B /* ORKReactionTimeStimulusView.m */; }; + CA2B8FD728A176DC0025B773 /* ORKReactionTimeViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC0991AFBD8B300F3D63B /* ORKReactionTimeViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FD828A176E50025B773 /* ORKReactionTimeContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC09D1AFBD92D00F3D63B /* ORKReactionTimeContentView.h */; }; + CA2B8FD928A176E80025B773 /* ORKReactionTimeStimulusView.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC0A11AFBDD2700F3D63B /* ORKReactionTimeStimulusView.h */; }; + CA2B8FDA28A177070025B773 /* ORKSpatialSpanTargetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B171A8D7C5B00081FAC /* ORKSpatialSpanTargetView.m */; }; + CA2B8FDB28A177070025B773 /* ORKSpatialSpanMemoryStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B151A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.m */; }; + CA2B8FDC28A177070025B773 /* ORKSpatialSpanMemoryContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B111A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.m */; }; + CA2B8FDD28A1770A0025B773 /* ORKSpatialSpanMemoryStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B141A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FDE28A177110025B773 /* ORKSpatialSpanMemoryContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B101A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.h */; }; + CA2B8FDF28A177150025B773 /* ORKSpatialSpanTargetView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B161A8D7C5B00081FAC /* ORKSpatialSpanTargetView.h */; }; + CA2B8FE028A1772D0025B773 /* ORKStroopContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA0AA68F1EAEC0B600671ACE /* ORKStroopContentView.m */; }; + CA2B8FE128A1772D0025B773 /* ORKStroopStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA0AA6931EAEC0B600671ACE /* ORKStroopStepViewController.m */; }; + CA2B8FE228A1772D0025B773 /* UIColor+String.m in Sources */ = {isa = PBXBuildFile; fileRef = A659C545262E0F5600E920DA /* UIColor+String.m */; }; + CA2B8FE328A1772D0025B773 /* ORKAccuracyStroopStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A659C53D262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.m */; }; + CA2B8FE428A177330025B773 /* ORKStroopContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA0AA68E1EAEC0B600671ACE /* ORKStroopContentView.h */; }; + CA2B8FE528A177360025B773 /* ORKStroopStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA0AA6921EAEC0B600671ACE /* ORKStroopStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FE628A1773A0025B773 /* ORKAccuracyStroopStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A659C53C262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FE728A1773E0025B773 /* UIColor+String.h in Headers */ = {isa = PBXBuildFile; fileRef = A659C544262E0F5600E920DA /* UIColor+String.h */; }; + CA2B8FEA28A1776B0025B773 /* ORKTappingIntervalStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B1D1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.m */; }; + CA2B8FEB28A1776B0025B773 /* ORKTappingContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B191A8D7C5B00081FAC /* ORKTappingContentView.m */; }; + CA2B8FEC28A177790025B773 /* ORKTappingContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B181A8D7C5B00081FAC /* ORKTappingContentView.h */; }; + CA2B8FED28A1777D0025B773 /* ORKTappingIntervalStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B1C1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FEE28A177950025B773 /* ORKToneAudiometryContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503B21AEE807C004B17F3 /* ORKToneAudiometryContentView.m */; }; + CA2B8FEF28A177950025B773 /* ORKToneAudiometryStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503B61AEE807C004B17F3 /* ORKToneAudiometryStepViewController.m */; }; + CA2B8FF028A177990025B773 /* ORKToneAudiometryContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503B11AEE807C004B17F3 /* ORKToneAudiometryContentView.h */; }; + CA2B8FF128A1779D0025B773 /* ORKToneAudiometryStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503B51AEE807C004B17F3 /* ORKToneAudiometryStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FF228A177AC0025B773 /* ORKTowerOfHanoiTowerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 257FCE1E1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.m */; }; + CA2B8FF328A177AC0025B773 /* ORKTowerOfHanoiStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 250F94071B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.m */; }; + CA2B8FF428A177AE0025B773 /* ORKTowerOfHanoiStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 250F94061B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FF528A177B10025B773 /* ORKTowerOfHanoiTowerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 257FCE1D1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.h */; }; + CA2B8FF628A177BF0025B773 /* ORKTrailmakingStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 781D540F1DF886AB00223305 /* ORKTrailmakingStepViewController.m */; }; + CA2B8FF728A177BF0025B773 /* ORKTrailmakingContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 781D540B1DF886AB00223305 /* ORKTrailmakingContentView.m */; }; + CA2B8FF828A177C10025B773 /* ORKTrailmakingContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 781D540A1DF886AB00223305 /* ORKTrailmakingContentView.h */; }; + CA2B8FF928A177C30025B773 /* ORKTrailmakingStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 781D540E1DF886AB00223305 /* ORKTrailmakingStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B8FFA28A177DE0025B773 /* ORKWalkingTaskStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B211A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.m */; }; + CA2B8FFB28A177E40025B773 /* ORKWalkingTaskStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B201A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B900928A17AD90025B773 /* ORKActiveStep_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B321A8D7C5B00081FAC /* ORKActiveStep_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B900A28A17ADE0025B773 /* ORKActiveStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B311A8D7C5B00081FAC /* ORKActiveStep.m */; }; + CA2B900B28A17AE10025B773 /* ORKActiveStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B301A8D7C5B00081FAC /* ORKActiveStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B901028A17BEE0025B773 /* ORKActiveTaskResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A261E81A87B005C2A1E /* ORKActiveTaskResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B901128A17D120025B773 /* ORKFileResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A391E81AF1D005C2A1E /* ORKFileResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B901228A17D170025B773 /* ORKFileResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A3A1E81AF1D005C2A1E /* ORKFileResult.m */; }; + CA2B901628A1802C0025B773 /* ORKOrderedTask+ORKPredefinedActiveTask.m in Sources */ = {isa = PBXBuildFile; fileRef = FF154FB31E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.m */; }; + CA2B901728A180480025B773 /* ORKOrderedTask+ORKPredefinedActiveTask.h in Headers */ = {isa = PBXBuildFile; fileRef = FF154FB21E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B901F28A1864A0025B773 /* ORKRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B471A8D7C5B00081FAC /* ORKRecorder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B902028A186500025B773 /* ORKRecorder_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B491A8D7C5B00081FAC /* ORKRecorder_Internal.h */; }; + CA2B902128A186550025B773 /* ORKRecorder_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4A1A8D7C5B00081FAC /* ORKRecorder_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B902228A1867E0025B773 /* ORKRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B481A8D7C5B00081FAC /* ORKRecorder.m */; }; + CA2B902328A186A80025B773 /* ORKDataLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B3C1A8D7C5B00081FAC /* ORKDataLogger.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B902428A186AF0025B773 /* ORKDataLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B3D1A8D7C5B00081FAC /* ORKDataLogger.m */; }; + CA2B902628A187390025B773 /* ORKTask_Util.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2B902528A187390025B773 /* ORKTask_Util.m */; }; + CA2B902728A18EA60025B773 /* ORKActiveStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B381A8D7C5B00081FAC /* ORKActiveStepViewController.m */; }; + CA2B902828A18EAD0025B773 /* ORKActiveStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B391A8D7C5B00081FAC /* ORKActiveStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA2B902928A18EB10025B773 /* ORKActiveStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B371A8D7C5B00081FAC /* ORKActiveStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B902B28A18EEF0025B773 /* ORKFrontFacingCameraStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 51751461245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA2B902C28A18EF40025B773 /* ORKFrontFacingCameraStepContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51751465245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.h */; }; + CA2B902D28A18EFE0025B773 /* ORKFrontFacingCameraStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 51751462245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.m */; }; + CA2B902E28A18F000025B773 /* ORKFrontFacingCameraStepContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51751466245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.m */; }; + CA2B902F28A18F860025B773 /* ORKActiveStepTimerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B361A8D7C5B00081FAC /* ORKActiveStepTimerView.m */; }; + CA2BBB2128AB06D300DD6C64 /* ORKLearnMoreItem.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8C5020226FFB04001896D0 /* ORKLearnMoreItem.m */; }; + CA4B673328A1CCBA00FAE01F /* ResearchKitActiveTask.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CAD08967289DD747007B2A98 /* ResearchKitActiveTask.framework */; }; + CA6A0D7E288B51D30048C1EF /* ORKSkin.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB71A8D7C5C00081FAC /* ORKSkin.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA6A0D7F288B51D30048C1EF /* ORKSkin.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB81A8D7C5C00081FAC /* ORKSkin.m */; }; + CA6A0D81288B54650048C1EF /* ORKConsentReviewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BEC1A8D7C5C00081FAC /* ORKConsentReviewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA6A0D82288B54650048C1EF /* ORKConsentReviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BED1A8D7C5C00081FAC /* ORKConsentReviewController.m */; }; + CA6A0D83288B5B370048C1EF /* ORKHTMLPDFWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B8E1A8D7C5C00081FAC /* ORKHTMLPDFWriter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CA6A0D84288B5B370048C1EF /* ORKHTMLPDFPageRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 8DE27B3E1D5BC072009A26E3 /* ORKHTMLPDFPageRenderer.h */; }; + CA6A0D85288B5B370048C1EF /* ORKHTMLPDFPageRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8DE27B3F1D5BC0B9009A26E3 /* ORKHTMLPDFPageRenderer.m */; }; + CA6A0D86288B5B370048C1EF /* ORKHTMLPDFWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B8F1A8D7C5C00081FAC /* ORKHTMLPDFWriter.m */; }; + CA6A0D9E288F1CA20048C1EF /* ResearchKitUI_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = CA6A0D9D288F1BDC0048C1EF /* ResearchKitUI_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CA6A0DA0288F2C1C0048C1EF /* ResearchKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA1C7A5A288B0C68004DAB3A /* ResearchKitUI.framework */; }; + CA954B6E28AD8A8C0020A35C /* ORKStep+ResearchKitActiveTask.m in Sources */ = {isa = PBXBuildFile; fileRef = CA954B6D28AD8A8C0020A35C /* ORKStep+ResearchKitActiveTask.m */; }; + CA954B6F28AD8DA50020A35C /* ORKStep+ResearchKitUI.m in Sources */ = {isa = PBXBuildFile; fileRef = CA08054328AD7EBA001695EF /* ORKStep+ResearchKitUI.m */; }; + CA994D5628AB08410019DEA4 /* ORKDeprecated.m in Sources */ = {isa = PBXBuildFile; fileRef = BC94EF301E962F7400143081 /* ORKDeprecated.m */; }; + CAA20D4E288B3D5700EDC764 /* ORKRecordButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D43C5CF24217393006F4084 /* ORKRecordButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D4F288B3D5700EDC764 /* ORKRecordButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D43C5D024217393006F4084 /* ORKRecordButton.m */; }; + CAA20D50288B3D6400EDC764 /* ORKCheckmarkView.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD6FAAF2332A2FD006647E7 /* ORKCheckmarkView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D51288B3D6400EDC764 /* ORKCheckmarkView.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD6FAB02332A2FD006647E7 /* ORKCheckmarkView.m */; }; + CAA20D52288B3D6B00EDC764 /* ORKReviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA2645E52301571800D00B73 /* ORKReviewViewController.m */; }; + CAA20D53288B3D6B00EDC764 /* ORKReviewIncompleteCell.m in Sources */ = {isa = PBXBuildFile; fileRef = AEFE0AC0230DB857004D0519 /* ORKReviewIncompleteCell.m */; }; + CAA20D54288B3D6B00EDC764 /* ORKReviewViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2645E42301571800D00B73 /* ORKReviewViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D55288B3D6B00EDC764 /* ORKReviewIncompleteCell.h in Headers */ = {isa = PBXBuildFile; fileRef = AEFE0ABF230DB857004D0519 /* ORKReviewIncompleteCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D56288B3D6F00EDC764 /* ORKPlaybackButton.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8C067722EEB84B00ACDE6B /* ORKPlaybackButton.m */; }; + CAA20D57288B3D6F00EDC764 /* ORKPlaybackButton_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D58800A24007140005B3D91 /* ORKPlaybackButton_Internal.h */; }; + CAA20D58288B3D6F00EDC764 /* ORKPlaybackButton.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8C067622EEB84B00ACDE6B /* ORKPlaybackButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D59288B3D7600EDC764 /* ORKRingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA87E26B20A79FA100B375A9 /* ORKRingView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D5A288B3D7600EDC764 /* ORKRingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA87E26C20A79FA100B375A9 /* ORKRingView.m */; }; + CAA20D5B288B3D9100EDC764 /* ORKScaleSliderView.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D11A71AA691BB003C98A7 /* ORKScaleSliderView.h */; }; + CAA20D5C288B3D9100EDC764 /* ORKWeightPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B4B95B71F5F012E006B629F /* ORKWeightPicker.m */; }; + CAA20D5D288B3D9100EDC764 /* ORKSurveyAnswerCellForImageSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC51A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D5E288B3D9100EDC764 /* ORKHeightPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = BC1C032B1CA301E300869355 /* ORKHeightPicker.m */; }; + CAA20D5F288B3D9100EDC764 /* ORKSurveyAnswerCellForPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 865EA16B1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.m */; }; + CAA20D60288B3D9100EDC764 /* ORKFormTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B871A8D7C5C00081FAC /* ORKFormTextView.m */; }; + CAA20D61288B3D9100EDC764 /* ORKScaleSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BAE1A8D7C5C00081FAC /* ORKScaleSlider.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D62288B3D9100EDC764 /* ORKFormItemCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B561A8D7C5B00081FAC /* ORKFormItemCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D63288B3D9100EDC764 /* ORKMultipleValuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = FFF65AB61E318F2D0043FB40 /* ORKMultipleValuePicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D64288B3D9100EDC764 /* ORKTimeIntervalPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 86B781B81AA668ED00688151 /* ORKTimeIntervalPicker.m */; }; + CAA20D65288B3D9100EDC764 /* ORKSurveyAnswerCellForNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BC81A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.m */; }; + CAA20D66288B3D9100EDC764 /* ORKScaleSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BAF1A8D7C5C00081FAC /* ORKScaleSlider.m */; }; + CAA20D67288B3D9100EDC764 /* ORKDateTimePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 865EA1601AB8DF750037C68E /* ORKDateTimePicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D68288B3D9100EDC764 /* ORKImageSelectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B581A8D7C5B00081FAC /* ORKImageSelectionView.h */; }; + CAA20D69288B3D9100EDC764 /* ORKMultipleValuePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = FFF65AB71E318F2D0043FB40 /* ORKMultipleValuePicker.m */; }; + CAA20D6A288B3D9100EDC764 /* ORKSurveyAnswerCellForLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD34A581BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D6B288B3D9100EDC764 /* ORKSurveyAnswerCellForScale.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC91A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D6C288B3D9100EDC764 /* ORKSurveyAnswerCellForScale.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BCA1A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.m */; }; + CAA20D6D288B3D9100EDC764 /* ORKSurveyCardHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB19C2093299A00CB29E5 /* ORKSurveyCardHeaderView.m */; }; + CAA20D6E288B3D9100EDC764 /* ORKWeightPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1B4B95B91F5F014E006B629F /* ORKWeightPicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D6F288B3D9100EDC764 /* ORKFormSectionTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B811A8D7C5C00081FAC /* ORKFormSectionTitleLabel.m */; }; + CAA20D70288B3D9100EDC764 /* ORKLocationSelectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = CBD34A541BB1FB9000F204EA /* ORKLocationSelectionView.h */; }; + CAA20D71288B3D9100EDC764 /* ORKFormTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B861A8D7C5C00081FAC /* ORKFormTextView.h */; }; + CAA20D72288B3D9100EDC764 /* ORKSurveyAnswerCellForText.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BCE1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.m */; }; + CAA20D73288B3D9100EDC764 /* ORKValuePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 86B781BA1AA668ED00688151 /* ORKValuePicker.m */; }; + CAA20D74288B3D9100EDC764 /* ORKImageSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B591A8D7C5B00081FAC /* ORKImageSelectionView.m */; }; + CAA20D75288B3D9100EDC764 /* ORKSESSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = BAC2B65A22F25A2E0079304E /* ORKSESSelectionView.m */; }; + CAA20D76288B3D9100EDC764 /* ORKSurveyAnswerCellForPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 865EA16A1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D77288B3D9100EDC764 /* ORKDateTimePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 865EA1611AB8DF750037C68E /* ORKDateTimePicker.m */; }; + CAA20D78288B3D9100EDC764 /* ORKSESSelectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC2B65922F25A2E0079304E /* ORKSESSelectionView.h */; }; + CAA20D79288B3D9100EDC764 /* ORKAnswerTextField.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B671A8D7C5B00081FAC /* ORKAnswerTextField.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D7A288B3D9100EDC764 /* ORKTextChoiceCellGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 861D11B31AA7D073003C98A7 /* ORKTextChoiceCellGroup.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D7B288B3D9100EDC764 /* ORKSurveyAnswerCellForImageSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BC61A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.m */; }; + CAA20D7C288B3D9100EDC764 /* ORKSurveyAnswerCellForSES.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC2B65522F252F70079304E /* ORKSurveyAnswerCellForSES.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D7D288B3D9100EDC764 /* ORKSurveyCardHeaderView.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB19B2093299A00CB29E5 /* ORKSurveyCardHeaderView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D7E288B3D9100EDC764 /* ORKPicker.m in Sources */ = {isa = PBXBuildFile; fileRef = 865EA1671ABA1AA10037C68E /* ORKPicker.m */; }; + CAA20D7F288B3D9100EDC764 /* SwiftUIViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519C298026D027AB00FD5F44 /* SwiftUIViewFactory.swift */; }; + CAA20D80288B3D9100EDC764 /* ORKFormSectionTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B801A8D7C5C00081FAC /* ORKFormSectionTitleLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D81288B3D9100EDC764 /* ORKSurveyAnswerCellForNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC71A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D82288B3D9100EDC764 /* ORKTimeIntervalPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B781B71AA668ED00688151 /* ORKTimeIntervalPicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D83288B3D9100EDC764 /* ORKHeightPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1C032A1CA301E300869355 /* ORKHeightPicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D84288B3D9100EDC764 /* ORKAnswerTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B6A1A8D7C5B00081FAC /* ORKAnswerTextView.m */; }; + CAA20D85288B3D9100EDC764 /* ORKAnswerTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B691A8D7C5B00081FAC /* ORKAnswerTextView.h */; }; + CAA20D86288B3D9100EDC764 /* TextChoiceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 519C298D26D027E500FD5F44 /* TextChoiceView.swift */; }; + CAA20D87288B3D9100EDC764 /* ORKLocationSelectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD34A551BB1FB9000F204EA /* ORKLocationSelectionView.m */; }; + CAA20D88288B3D9100EDC764 /* ORKPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 865EA1661ABA1AA10037C68E /* ORKPicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D89288B3D9100EDC764 /* ORKValuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B781B91AA668ED00688151 /* ORKValuePicker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D8A288B3D9100EDC764 /* ORKScaleSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D11A81AA691BB003C98A7 /* ORKScaleSliderView.m */; }; + CAA20D8B288B3D9100EDC764 /* ORKFormItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B571A8D7C5B00081FAC /* ORKFormItemCell.m */; }; + CAA20D8C288B3D9100EDC764 /* ORKSurveyAnswerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 866F86001A96CBF3007B282C /* ORKSurveyAnswerCell.m */; }; + CAA20D8D288B3D9100EDC764 /* ORKAnswerTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B681A8D7C5B00081FAC /* ORKAnswerTextField.m */; }; + CAA20D8E288B3D9100EDC764 /* ORKSurveyAnswerCellForText.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BCD1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D8F288B3D9100EDC764 /* ORKSurveyAnswerCellForLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = CBD34A591BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.m */; }; + CAA20D90288B3D9100EDC764 /* ORKTextChoiceCellGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = 861D11B41AA7D073003C98A7 /* ORKTextChoiceCellGroup.m */; }; + CAA20D91288B3D9100EDC764 /* ORKSurveyAnswerCellForSES.m in Sources */ = {isa = PBXBuildFile; fileRef = BAC2B65622F252F70079304E /* ORKSurveyAnswerCellForSES.m */; }; + CAA20D92288B3D9100EDC764 /* ORKSurveyAnswerCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC21A8D7C5C00081FAC /* ORKSurveyAnswerCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20D93288B3D9C00EDC764 /* ORKStepHeaderView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B89ABD1AB3BFDB001626A4 /* ORKStepHeaderView_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D94288B3D9C00EDC764 /* ORKNavigationContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AD91081AB7AD1E00361FEB /* ORKNavigationContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D95288B3D9C00EDC764 /* ORKStepContainerView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BAB3942E22601CAB00E59B0B /* ORKStepContainerView_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D96288B3D9C00EDC764 /* ORKStepContentView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BA43CCA622722C6E00F2A2D2 /* ORKStepContentView_Private.h */; }; + CAA20D97288B3D9C00EDC764 /* ORKStepContentView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA43CCA22271741C00F2A2D2 /* ORKStepContentView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D98288B3D9C00EDC764 /* ORKStepContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8078F2224AC8AA0013B554 /* ORKStepContainerView.m */; }; + CAA20D99288B3D9C00EDC764 /* ORKBodyContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA473FE1224DAFEF00A362E3 /* ORKBodyContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D9A288B3D9C00EDC764 /* ORKTableContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B5C1A8D7C5B00081FAC /* ORKTableContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D9B288B3D9C00EDC764 /* ORKLearnMoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA473FEC224DBA3700A362E3 /* ORKLearnMoreView.m */; }; + CAA20D9C288B3D9C00EDC764 /* ORKTableContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B5D1A8D7C5B00081FAC /* ORKTableContainerView.m */; }; + CAA20D9D288B3D9C00EDC764 /* ORKVerticalContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE11A8D7C5C00081FAC /* ORKVerticalContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20D9E288B3D9C00EDC764 /* ORKVerticalContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BE21A8D7C5C00081FAC /* ORKVerticalContainerView.m */; }; + CAA20D9F288B3D9C00EDC764 /* ORKBodyContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA473FE2224DAFEF00A362E3 /* ORKBodyContainerView.m */; }; + CAA20DA0288B3D9C00EDC764 /* ORKStepContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8078F1224AC8AA0013B554 /* ORKStepContainerView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DA1288B3D9C00EDC764 /* ORKNavigationContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86AD91091AB7AD1E00361FEB /* ORKNavigationContainerView.m */; }; + CAA20DA2288B3D9C00EDC764 /* ORKVerticalContainerView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE31A8D7C5C00081FAC /* ORKVerticalContainerView_Internal.h */; }; + CAA20DA3288B3D9C00EDC764 /* ORKNavigationContainerView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86AD910C1AB7AE4100361FEB /* ORKNavigationContainerView_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20DA4288B3D9C00EDC764 /* ORKStepContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA43CCA32271741C00F2A2D2 /* ORKStepContentView.m */; }; + CAA20DA5288B3D9C00EDC764 /* ORKStepHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86B89ABA1AB3BECC001626A4 /* ORKStepHeaderView.m */; }; + CAA20DA6288B3D9C00EDC764 /* ORKLearnMoreView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA473FEB224DBA3700A362E3 /* ORKLearnMoreView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20DA7288B3D9C00EDC764 /* ORKStepHeaderView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86B89AB91AB3BECC001626A4 /* ORKStepHeaderView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20DA8288B3DA300EDC764 /* ORKObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4194271AE8453A00073D6B /* ORKObserver.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DA9288B3DA300EDC764 /* ORKObserver.m in Sources */ = {isa = PBXBuildFile; fileRef = BC4194281AE8453A00073D6B /* ORKObserver.m */; }; + CAA20DAE288B3DB300EDC764 /* ORKBorderedButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B6D1A8D7C5B00081FAC /* ORKBorderedButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DAF288B3DB300EDC764 /* ORKDefaultFont.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B7A1A8D7C5C00081FAC /* ORKDefaultFont.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DB0288B3DB300EDC764 /* ORKSelectionSubTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB31A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.m */; }; + CAA20DB1288B3DB300EDC764 /* ORKTapCountLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD31A8D7C5C00081FAC /* ORKTapCountLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DB2288B3DB300EDC764 /* ORKTextFieldView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B5E1A8D7C5B00081FAC /* ORKTextFieldView.h */; }; + CAA20DB3288B3DB300EDC764 /* ORKTextButton_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC37323122B76D190021F665 /* ORKTextButton_Internal.h */; }; + CAA20DB4288B3DB300EDC764 /* ORKTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8078E2224A8D6E0013B554 /* ORKTitleLabel.m */; }; + CAA20DB5288B3DB300EDC764 /* ORKBodyLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B6C1A8D7C5B00081FAC /* ORKBodyLabel.m */; }; + CAA20DB6288B3DB300EDC764 /* ORKTagLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = AE2CF2C023231C5A00FDD733 /* ORKTagLabel.m */; }; + CAA20DB7288B3DB300EDC764 /* ORKIconButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BF30BC247B330900E2E669 /* ORKIconButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DB8288B3DB300EDC764 /* ORKChoiceViewCell_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BA3D7E722223F8B90023FE3A /* ORKChoiceViewCell_Internal.h */; }; + CAA20DB9288B3DB300EDC764 /* ORKLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B981A8D7C5C00081FAC /* ORKLabel.m */; }; + CAA20DBA288B3DB300EDC764 /* ORKSeparatorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9AD61B7A045E00ECB5B4 /* ORKSeparatorView.m */; }; + CAA20DBB288B3DB300EDC764 /* ORKTextButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BDB1A8D7C5C00081FAC /* ORKTextButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DBC288B3DB300EDC764 /* ORKHeadlineLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B891A8D7C5C00081FAC /* ORKHeadlineLabel.m */; }; + CAA20DBD288B3DB300EDC764 /* ORKTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD11A8D7C5C00081FAC /* ORKTableViewCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DBE288B3DB300EDC764 /* ORKFootnoteLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = FFAE713F1DAEC66200AE82B4 /* ORKFootnoteLabel.m */; }; + CAA20DBF288B3DB300EDC764 /* ORKTintedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B611A8D7C5B00081FAC /* ORKTintedImageView.m */; }; + CAA20DC0288B3DB300EDC764 /* ORKImageChoiceLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B911A8D7C5C00081FAC /* ORKImageChoiceLabel.m */; }; + CAA20DC1288B3DB400EDC764 /* ORKCountdownLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B751A8D7C5C00081FAC /* ORKCountdownLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DC2288B3DB400EDC764 /* ORKIconButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 51BF30BD247B330900E2E669 /* ORKIconButton.m */; }; + CAA20DC3288B3DB400EDC764 /* ORKSubheadlineLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BC01A8D7C5C00081FAC /* ORKSubheadlineLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DC4288B3DB400EDC764 /* ORKDirectionView.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF2AC1B6FACA8004EACF2 /* ORKDirectionView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20DC5288B3DB400EDC764 /* ORKUnitLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BDE1A8D7C5C00081FAC /* ORKUnitLabel.m */; }; + CAA20DC6288B3DB400EDC764 /* ORKSelectionSubTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB21A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DC7288B3DB400EDC764 /* ORKScaleRangeImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 24898B0C1B7186C000B0E7E7 /* ORKScaleRangeImageView.m */; }; + CAA20DC8288B3DB400EDC764 /* ORKRoundTappingButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BAA1A8D7C5C00081FAC /* ORKRoundTappingButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DC9288B3DB400EDC764 /* ORKScaleRangeLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BAD1A8D7C5C00081FAC /* ORKScaleRangeLabel.m */; }; + CAA20DCA288B3DB400EDC764 /* ORKSeparatorView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AD51B7A045E00ECB5B4 /* ORKSeparatorView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20DCB288B3DB400EDC764 /* ORKDontKnowButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 515310CE233570CF007BCA58 /* ORKDontKnowButton.m */; }; + CAA20DCC288B3DB400EDC764 /* ORKTextFieldView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B5F1A8D7C5B00081FAC /* ORKTextFieldView.m */; }; + CAA20DCD288B3DB400EDC764 /* ORKScaleValueLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB11A8D7C5C00081FAC /* ORKScaleValueLabel.m */; }; + CAA20DCE288B3DB400EDC764 /* ORKTintedImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B601A8D7C5B00081FAC /* ORKTintedImageView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20DCF288B3DB400EDC764 /* ORKImageChoiceLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B901A8D7C5C00081FAC /* ORKImageChoiceLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DD0288B3DB400EDC764 /* ORKSelectionTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BB51A8D7C5C00081FAC /* ORKSelectionTitleLabel.m */; }; + CAA20DD1288B3DB400EDC764 /* ORKUnitLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BDD1A8D7C5C00081FAC /* ORKUnitLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DD2288B3DB400EDC764 /* ORKContinueButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B731A8D7C5C00081FAC /* ORKContinueButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DD3288B3DB400EDC764 /* ORKSelectionTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB41A8D7C5C00081FAC /* ORKSelectionTitleLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DD4288B3DB400EDC764 /* ORKProgressView.h in Headers */ = {isa = PBXBuildFile; fileRef = 10BAA2C81B5FCB4F004FE478 /* ORKProgressView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20DD5288B3DB400EDC764 /* ORKTitleLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8078E1224A8D6E0013B554 /* ORKTitleLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DD7288B3DB400EDC764 /* ORKChoiceViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B721A8D7C5C00081FAC /* ORKChoiceViewCell.m */; }; + CAA20DD8288B3DB400EDC764 /* ORKBodyLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B6B1A8D7C5B00081FAC /* ORKBodyLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DD9288B3DB400EDC764 /* ORKScaleValueLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BB01A8D7C5C00081FAC /* ORKScaleValueLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DDA288B3DB400EDC764 /* ORKTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BD21A8D7C5C00081FAC /* ORKTableViewCell.m */; }; + CAA20DDC288B3DB400EDC764 /* ORKCaption1Label.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B701A8D7C5C00081FAC /* ORKCaption1Label.m */; }; + CAA20DDD288B3DB400EDC764 /* ORKTextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BDC1A8D7C5C00081FAC /* ORKTextButton.m */; }; + CAA20DDE288B3DB400EDC764 /* ORKTintedImageView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC01B0FA1B0EB99700863803 /* ORKTintedImageView_Internal.h */; }; + CAA20DDF288B3DB400EDC764 /* ORKChoiceViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B711A8D7C5C00081FAC /* ORKChoiceViewCell.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DE0288B3DB400EDC764 /* ORKCountdownLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B761A8D7C5C00081FAC /* ORKCountdownLabel.m */; }; + CAA20DE1288B3DB400EDC764 /* ORKLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B971A8D7C5C00081FAC /* ORKLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DE2288B3DB400EDC764 /* ORKRoundTappingButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BAB1A8D7C5C00081FAC /* ORKRoundTappingButton.m */; }; + CAA20DE3288B3DB400EDC764 /* ORKDontKnowButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 515310CD233570CF007BCA58 /* ORKDontKnowButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DE4288B3DB400EDC764 /* ORKProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 10BAA2C91B5FCB4F004FE478 /* ORKProgressView.m */; }; + CAA20DE5288B3DB400EDC764 /* ORKContinueButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B741A8D7C5C00081FAC /* ORKContinueButton.m */; }; + CAA20DE6288B3DB400EDC764 /* ORKBorderedButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B6E1A8D7C5C00081FAC /* ORKBorderedButton.m */; }; + CAA20DE7288B3DB400EDC764 /* ORKScaleRangeLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BAC1A8D7C5C00081FAC /* ORKScaleRangeLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DE8288B3DB400EDC764 /* ORKScaleRangeDescriptionLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = B8760F291AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DE9288B3DB400EDC764 /* ORKTapCountLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BD41A8D7C5C00081FAC /* ORKTapCountLabel.m */; }; + CAA20DEA288B3DB400EDC764 /* ORKTagLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = AE2CF2BF23231C5A00FDD733 /* ORKTagLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DEB288B3DB400EDC764 /* ORKSubheadlineLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BC11A8D7C5C00081FAC /* ORKSubheadlineLabel.m */; }; + CAA20DEC288B3DB400EDC764 /* ORKHeadlineLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B881A8D7C5C00081FAC /* ORKHeadlineLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DED288B3DB400EDC764 /* ORKScaleRangeDescriptionLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = B8760F2A1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.m */; }; + CAA20DEE288B3DB400EDC764 /* ORKDirectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF2AD1B6FACA8004EACF2 /* ORKDirectionView.m */; }; + CAA20DEF288B3DB400EDC764 /* ORKCaption1Label.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B6F1A8D7C5C00081FAC /* ORKCaption1Label.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DF0288B3DB400EDC764 /* ORKFootnoteLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = FFAE713E1DAEC66200AE82B4 /* ORKFootnoteLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DF1288B3DB400EDC764 /* ORKScaleRangeImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = 24898B0B1B7186C000B0E7E7 /* ORKScaleRangeImageView.h */; }; + CAA20DF3288B3E8100EDC764 /* ORKPDFViewerStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB1B02097E16700CB29E5 /* ORKPDFViewerStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DF4288B3E8100EDC764 /* ORKWebViewStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8419D6711FB73EC60088D7E5 /* ORKWebViewStepViewController.m */; }; + CAA20DF5288B3E8100EDC764 /* ORKCompletionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B551A8D7C5B00081FAC /* ORKCompletionStepViewController.m */; }; + CAA20DF6288B3E8100EDC764 /* ORKStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD65E492284EFF9008A5DCE /* ORKStepView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DF8288B3E8100EDC764 /* ORKFormStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B851A8D7C5C00081FAC /* ORKFormStepViewController.m */; }; + CAA20DF9288B3E8100EDC764 /* ORKLearnMoreStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD9E9142255E9CE0014FA29 /* ORKLearnMoreStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DFB288B3E8100EDC764 /* ORKPDFViewerStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB1B42097E58300CB29E5 /* ORKPDFViewerStepView.h */; }; + CAA20DFC288B3E8100EDC764 /* ORKFreehandDrawingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB1B92097EF3800CB29E5 /* ORKFreehandDrawingView.m */; }; + CAA20DFE288B3E8100EDC764 /* ORKTableStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = FF36A49A1D1A15FC00DE8470 /* ORKTableStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20DFF288B3E8100EDC764 /* ORKCustomSignatureFooterView.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EC216424787338000C1F46 /* ORKCustomSignatureFooterView.h */; }; + CAA20E00288B3E8100EDC764 /* ORKCustomStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B781A8D7C5C00081FAC /* ORKCustomStepView.m */; }; + CAA20E01288B3E8100EDC764 /* ORKRequestPermissionsStepContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 51D823042472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.m */; }; + CAA20E02288B3E8100EDC764 /* ORKPasscodeStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24A4DA171B8D13FE009C797A /* ORKPasscodeStepViewController.m */; }; + CAA20E03288B3E8100EDC764 /* ORKImageCaptureStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D442397C1AF17F7600559D96 /* ORKImageCaptureStepViewController.m */; }; + CAA20E04288B3E8200EDC764 /* ORKPasscodeViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2441034D1B966D4C00EEAB0C /* ORKPasscodeViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E05288B3E8200EDC764 /* ORKVideoInstructionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BF1D43871D4905FC007EE90B /* ORKVideoInstructionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E06288B3E8200EDC764 /* ORKPageStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF5E3CCA1D23444400ECE4B7 /* ORKPageStepViewController.m */; }; + CAA20E08288B3E8200EDC764 /* ORKPDFViewerStepView_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BA6E1EB5209E9A3F00DA9D55 /* ORKPDFViewerStepView_Internal.h */; }; + CAA20E09288B3E8200EDC764 /* ORKStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BBD1A8D7C5C00081FAC /* ORKStepViewController.m */; }; + CAA20E0A288B3E8200EDC764 /* ORKWaitStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155A51BDE8DA9007FA459 /* ORKWaitStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E0B288B3E8200EDC764 /* ORKFreehandDrawingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BABBB1B82097EF3800CB29E5 /* ORKFreehandDrawingView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E0C288B3E8200EDC764 /* ORKVideoCaptureStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2489F7AC1D65214D008DEF20 /* ORKVideoCaptureStepViewController.m */; }; + CAA20E0D288B3E8200EDC764 /* ORKRequestPermissionsStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 511987C62463316E004FC2C7 /* ORKRequestPermissionsStepViewController.m */; }; + CAA20E0E288B3E8200EDC764 /* ORKPasscodeStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A4DA0E1B8D0F21009C797A /* ORKPasscodeStepView.h */; }; + CAA20E0F288B3E8200EDC764 /* ORKReviewStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF91559A1BDE8D7D007FA459 /* ORKReviewStepViewController.m */; }; + CAA20E10288B3E8200EDC764 /* ORKCustomSignatureFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EC216524787338000C1F46 /* ORKCustomSignatureFooterView.m */; }; + CAA20E12288B3E8200EDC764 /* ORKPasscodeStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 24A4DA0F1B8D0F21009C797A /* ORKPasscodeStepView.m */; }; + CAA20E13288B3E8200EDC764 /* ORKWebViewStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 8419D6701FB73EC60088D7E5 /* ORKWebViewStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E14288B3E8200EDC764 /* ORKInstructionStepContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = BADA2F25225DA54B005D2255 /* ORKInstructionStepContainerView.m */; }; + CAA20E15288B3E8200EDC764 /* ORKCompletionCheckmarkView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2CFBAE2342935800B71919 /* ORKCompletionCheckmarkView.h */; }; + CAA20E16288B3E8200EDC764 /* ORKStepView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BAD65E4F2284F266008A5DCE /* ORKStepView_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E18288B3E8200EDC764 /* ORKFormStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 249F44E31BCD9EAC0000D57E /* ORKFormStepViewController_Internal.h */; }; + CAA20E19288B3E8200EDC764 /* ORKReviewStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155981BDE8D7D007FA459 /* ORKReviewStepViewController_Internal.h */; }; + CAA20E1B288B3E8200EDC764 /* ORKImageCaptureView.h in Headers */ = {isa = PBXBuildFile; fileRef = D42FEFB61AF7557000A124F8 /* ORKImageCaptureView.h */; }; + CAA20E1C288B3E8200EDC764 /* ORKInstructionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B951A8D7C5C00081FAC /* ORKInstructionStepViewController.m */; }; + CAA20E1D288B3E8200EDC764 /* ORKImageCaptureCameraPreviewView.h in Headers */ = {isa = PBXBuildFile; fileRef = D45852081AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.h */; }; + CAA20E1E288B3E8200EDC764 /* ORKCustomStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 00C266882302244300337E0B /* ORKCustomStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E1F288B3E8200EDC764 /* ORKPasscodeStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 24A4DA161B8D13FE009C797A /* ORKPasscodeStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E20288B3E8200EDC764 /* ORKSignatureStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BEF1A8D7C5C00081FAC /* ORKSignatureStepViewController.m */; }; + CAA20E21288B3E8200EDC764 /* ORKCustomSignatureFooterView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = F7C022F8248EEAAC00782A61 /* ORKCustomSignatureFooterView_Private.h */; }; + CAA20E22288B3E8200EDC764 /* ORKSignatureStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BEE1A8D7C5C00081FAC /* ORKSignatureStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E23288B3E8200EDC764 /* ORKPDFViewerStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB1B52097E58300CB29E5 /* ORKPDFViewerStepView.m */; }; + CAA20E24288B3E8200EDC764 /* ORKCompletionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B541A8D7C5B00081FAC /* ORKCompletionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E25288B3E8200EDC764 /* ORKSignatureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40C081A8D7C5C00081FAC /* ORKSignatureView.m */; }; + CAA20E26288B3E8200EDC764 /* ORKPageStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = FF5E3CC91D23444400ECE4B7 /* ORKPageStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E27288B3E8200EDC764 /* ORKWaitStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155A31BDE8DA9007FA459 /* ORKWaitStepView.h */; }; + CAA20E28288B3E8200EDC764 /* ORKImageCaptureStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = D442397B1AF17F7600559D96 /* ORKImageCaptureStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E29288B3E8200EDC764 /* ORKCustomStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B771A8D7C5C00081FAC /* ORKCustomStepView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E2A288B3E8200EDC764 /* ORKStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD65E4A2284EFF9008A5DCE /* ORKStepView.m */; }; + CAA20E2B288B3E8200EDC764 /* ORKInstructionStepContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = BADA2F24225DA54B005D2255 /* ORKInstructionStepContainerView.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E2C288B3E8200EDC764 /* ORKFormStepViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = BC37323522B76DC70021F665 /* ORKFormStepViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E2D288B3E8200EDC764 /* ORKInstructionStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B961A8D7C5C00081FAC /* ORKInstructionStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E2F288B3E8200EDC764 /* ORKWaitStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9155A61BDE8DA9007FA459 /* ORKWaitStepViewController.m */; }; + CAA20E30288B3E8200EDC764 /* ORKSecondaryTaskStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BA8C066D22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E31288B3E8200EDC764 /* ORKStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BBC1A8D7C5C00081FAC /* ORKStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E33288B3E8200EDC764 /* ORKVideoCaptureStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2489F7AB1D65214D008DEF20 /* ORKVideoCaptureStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E34288B3E8200EDC764 /* ORKSignatureView.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40C071A8D7C5C00081FAC /* ORKSignatureView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E35288B3E8200EDC764 /* ORKPasscodeStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 241A2E861B94FD8800ED3B39 /* ORKPasscodeStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E37288B3E8200EDC764 /* ORKRequestPermissionsStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 511987C52463316E004FC2C7 /* ORKRequestPermissionsStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E38288B3E8200EDC764 /* ORKInstructionStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B941A8D7C5C00081FAC /* ORKInstructionStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E39288B3E8200EDC764 /* ORKFormStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B841A8D7C5C00081FAC /* ORKFormStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E3A288B3E8200EDC764 /* ORKImageCaptureView.m in Sources */ = {isa = PBXBuildFile; fileRef = D42FEFB71AF7557000A124F8 /* ORKImageCaptureView.m */; }; + CAA20E3B288B3E8200EDC764 /* ORKCompletionCheckmarkView.m in Sources */ = {isa = PBXBuildFile; fileRef = BA2CFBAF2342935800B71919 /* ORKCompletionCheckmarkView.m */; }; + CAA20E3E288B3E8200EDC764 /* ORKVideoCaptureCameraPreviewView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2489F7A71D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.h */; }; + CAA20E3F288B3E8200EDC764 /* ORKStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BBE1A8D7C5C00081FAC /* ORKStepViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E40288B3E8200EDC764 /* ORKVideoInstructionStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF1D43881D4905FC007EE90B /* ORKVideoInstructionStepViewController.m */; }; + CAA20E41288B3E8200EDC764 /* ORKVideoCaptureCameraPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2489F7A81D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.m */; }; + CAA20E42288B3E8200EDC764 /* ORKVideoCaptureView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2489F7AD1D65214D008DEF20 /* ORKVideoCaptureView.h */; }; + CAA20E43288B3E8200EDC764 /* ORKVideoCaptureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2489F7AE1D65214D008DEF20 /* ORKVideoCaptureView.m */; }; + CAA20E44288B3E8200EDC764 /* ORKTableStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = FF36A4991D1A15FC00DE8470 /* ORKTableStepViewController_Internal.h */; }; + CAA20E45288B3E8200EDC764 /* ORKPDFViewerStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BABBB1B12097E16700CB29E5 /* ORKPDFViewerStepViewController.m */; }; + CAA20E46288B3E8200EDC764 /* ORKWaitStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = BF9155A41BDE8DA9007FA459 /* ORKWaitStepView.m */; }; + CAA20E47288B3E8200EDC764 /* ORKCustomStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C266892302244300337E0B /* ORKCustomStepViewController.m */; }; + CAA20E49288B3E8200EDC764 /* ORKLearnMoreStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BAD9E9152255E9CE0014FA29 /* ORKLearnMoreStepViewController.m */; }; + CAA20E4A288B3E8200EDC764 /* ORKTableStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF36A49B1D1A15FC00DE8470 /* ORKTableStepViewController.m */; }; + CAA20E4B288B3E8200EDC764 /* ORKSecondaryTaskStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BA8C066E22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.m */; }; + CAA20E4D288B3E8200EDC764 /* ORKRequestPermissionsStepContainerView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D823032472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.h */; }; + CAA20E4E288B3E8200EDC764 /* ORKReviewStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BF9155991BDE8D7D007FA459 /* ORKReviewStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E4F288B3E8200EDC764 /* ORKImageCaptureCameraPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = D45852091AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.m */; }; + CAA20E50288B3E8200EDC764 /* ORKPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2441034E1B966D4C00EEAB0C /* ORKPasscodeViewController.m */; }; + CAA20E52288B3E9200EDC764 /* ORKTaskViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BD81A8D7C5C00081FAC /* ORKTaskViewController.m */; }; + CAA20E53288B3E9200EDC764 /* ORKTaskViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD91A8D7C5C00081FAC /* ORKTaskViewController_Internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E55288B3E9200EDC764 /* ORKTaskViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BD71A8D7C5C00081FAC /* ORKTaskViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E56288B3E9200EDC764 /* ORKTaskReviewViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = BAC6F1A722AF535100E31C22 /* ORKTaskReviewViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E58288B3E9200EDC764 /* ORKTaskReviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BAC6F1A822AF535100E31C22 /* ORKTaskReviewViewController.m */; }; + CAA20E59288B3E9200EDC764 /* ORKTaskViewController_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BDA1A8D7C5C00081FAC /* ORKTaskViewController_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAA20E5A288B3E9900EDC764 /* UIResponder+ResearchKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE91A8D7C5C00081FAC /* UIResponder+ResearchKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E5B288B3E9900EDC764 /* UIImage+ResearchKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 805685771C90C19500BF437A /* UIImage+ResearchKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E5C288B3E9900EDC764 /* UIImage+ResearchKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 805685781C90C19500BF437A /* UIImage+ResearchKit.m */; }; + CAA20E5D288B3E9900EDC764 /* UIResponder+ResearchKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BEA1A8D7C5C00081FAC /* UIResponder+ResearchKit.m */; }; + CAA20E5E288B3E9900EDC764 /* UIBarButtonItem+ORKBarButtonItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BE71A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20E5F288B3E9900EDC764 /* UIBarButtonItem+ORKBarButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BE81A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.m */; }; + CAA20F2A288B3F5B00EDC764 /* ORKConsentSharingStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B11C549C1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F2E288B3F5B00EDC764 /* ORKConsentReviewStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40BFA1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.m */; }; + CAA20F30288B3F5B00EDC764 /* ORKConsentSharingStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B11C549D1A9EF4A700265E61 /* ORKConsentSharingStepViewController.m */; }; + CAA20F31288B3F5B00EDC764 /* ORKConsentReviewStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40BF91A8D7C5C00081FAC /* ORKConsentReviewStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F34288B3F6700EDC764 /* ORKVerificationStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 242C9E0B1BBE03F90088B7F4 /* ORKVerificationStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F35288B3F6700EDC764 /* ORKVerificationStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 242C9E0C1BBE03F90088B7F4 /* ORKVerificationStepViewController.m */; }; + CAA20F36288B3F6700EDC764 /* ORKLoginStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 24850E181BCDA9C7006E91FB /* ORKLoginStepViewController.m */; }; + CAA20F37288B3F6700EDC764 /* ORKVerificationStepView.h in Headers */ = {isa = PBXBuildFile; fileRef = 242C9E0F1BBE06DE0088B7F4 /* ORKVerificationStepView.h */; }; + CAA20F38288B3F6700EDC764 /* ORKVerificationStepView.m in Sources */ = {isa = PBXBuildFile; fileRef = 242C9E101BBE06DE0088B7F4 /* ORKVerificationStepView.m */; }; + CAA20F39288B3F6700EDC764 /* ORKLoginStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 24850E171BCDA9C7006E91FB /* ORKLoginStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F3A288B3F6D00EDC764 /* ORKAccessibilityFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 618DA04A1A93D0D600E63AA8 /* ORKAccessibilityFunctions.m */; }; + CAA20F3B288B3F6D00EDC764 /* UIView+ORKAccessibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 618DA04B1A93D0D600E63AA8 /* UIView+ORKAccessibility.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F3C288B3F6D00EDC764 /* ORKAccessibility.h in Headers */ = {isa = PBXBuildFile; fileRef = 618DA0481A93D0D600E63AA8 /* ORKAccessibility.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F3D288B3F6D00EDC764 /* ORKGraphChartAccessibilityElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 6146D0A11B84A91E0068491D /* ORKGraphChartAccessibilityElement.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F3E288B3F6D00EDC764 /* ORKAccessibilityFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 618DA0491A93D0D600E63AA8 /* ORKAccessibilityFunctions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAA20F3F288B3F6D00EDC764 /* ORKGraphChartAccessibilityElement.m in Sources */ = {isa = PBXBuildFile; fileRef = 6146D0A21B84A91E0068491D /* ORKGraphChartAccessibilityElement.m */; }; + CAA20F40288B3F6D00EDC764 /* UIView+ORKAccessibility.m in Sources */ = {isa = PBXBuildFile; fileRef = 618DA04C1A93D0D600E63AA8 /* UIView+ORKAccessibility.m */; }; + CAD0896A289DD747007B2A98 /* ResearchKitActiveTask.h in Headers */ = {isa = PBXBuildFile; fileRef = CAD08969289DD747007B2A98 /* ResearchKitActiveTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD089BA289DE347007B2A98 /* ORKSpeechInNoiseStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118AC7320BF6A7800D7A6BB /* ORKSpeechInNoiseStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD089BB289DE34C007B2A98 /* ORKSpeechInNoiseStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 7118AC7220BF6A7800D7A6BB /* ORKSpeechInNoiseStep.m */; }; + CAD089BC289DE351007B2A98 /* ORKSpeechInNoiseResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D5880372410394E005B3D91 /* ORKSpeechInNoiseResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD089BD289DE356007B2A98 /* ORKSpeechInNoiseResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D5880382410394E005B3D91 /* ORKSpeechInNoiseResult.m */; }; + CAD089ED289DE454007B2A98 /* ORK3DModelManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 51198799245FC33C004FC2C7 /* ORK3DModelManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD089EE289DE45C007B2A98 /* ORK3DModelManager_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D26E77724997EA200E53D27 /* ORK3DModelManager_Internal.h */; }; + CAD089EF289DE462007B2A98 /* ORK3DModelManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5119879A245FC33C004FC2C7 /* ORK3DModelManager.m */; }; + CAD089F0289DE466007B2A98 /* ORK3DModelStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 5175144C2459EBF0009E8FFC /* ORK3DModelStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD089F1289DE486007B2A98 /* ORK3DModelStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 5175144D2459EBF0009E8FFC /* ORK3DModelStep.m */; }; + CAD089F2289DE48A007B2A98 /* ORKEnvironmentSPLMeterStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 71BD9EA320969BE1007B436E /* ORKEnvironmentSPLMeterStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD089F3289DE48F007B2A98 /* ORKEnvironmentSPLMeterStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 71BD9EA420969BE1007B436E /* ORKEnvironmentSPLMeterStep.m */; }; + CAD089F6289DE494007B2A98 /* ORKEnvironmentSPLMeterResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 716B126220A78C6B00590264 /* ORKEnvironmentSPLMeterResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD089F7289DE499007B2A98 /* ORKEnvironmentSPLMeterResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 716B126320A78C6B00590264 /* ORKEnvironmentSPLMeterResult.m */; }; + CAD08A0A289DE4D2007B2A98 /* ORKAudiometryProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 224CD4FC283540FF0029B820 /* ORKAudiometryProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A0B289DE4D6007B2A98 /* ORKAudiometryStimulus.h in Headers */ = {isa = PBXBuildFile; fileRef = 226565512847FD1D00E916FF /* ORKAudiometryStimulus.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A0C289DE4DB007B2A98 /* ORKAudiometryStimulus.m in Sources */ = {isa = PBXBuildFile; fileRef = 226565522847FD1D00E916FF /* ORKAudiometryStimulus.m */; }; + CAD08A0D289DE4DE007B2A98 /* ORKAudiometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2295B21F282AF92700A5D9E0 /* ORKAudiometry.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A0E289DE4E2007B2A98 /* ORKAudiometry.m in Sources */ = {isa = PBXBuildFile; fileRef = 2295B220282AF92700A5D9E0 /* ORKAudiometry.m */; }; + CAD08A10289DE4F1007B2A98 /* ORKdBHLToneAudiometryResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E2720880C4500A19914 /* ORKdBHLToneAudiometryResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A11289DE4F5007B2A98 /* ORKdBHLToneAudiometryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E2820880C4500A19914 /* ORKdBHLToneAudiometryResult.m */; }; + CAD08A12289DE4F8007B2A98 /* ORKdBHLToneAudiometryOnboardingStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E2B208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A13289DE4FC007B2A98 /* ORKdBHLToneAudiometryOnboardingStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E2C208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m */; }; + CAD08A14289DE4FF007B2A98 /* ORKdBHLToneAudiometryStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 71769E3720882CED00A19914 /* ORKdBHLToneAudiometryStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A15289DE503007B2A98 /* ORKdBHLToneAudiometryStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 71769E3820882CED00A19914 /* ORKdBHLToneAudiometryStep.m */; }; + CAD08A17289DE512007B2A98 /* ORKAmslerGridStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BA95AA9420ACD07A00E7FF8E /* ORKAmslerGridStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A18289DE516007B2A98 /* ORKAmslerGridStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BA95AA9520ACD07A00E7FF8E /* ORKAmslerGridStep.m */; }; + CAD08A19289DE519007B2A98 /* ORKAmslerGridResult.h in Headers */ = {isa = PBXBuildFile; fileRef = BA2FE3EC20B109C600AAC231 /* ORKAmslerGridResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A1A289DE51D007B2A98 /* ORKAmslerGridResult.m in Sources */ = {isa = PBXBuildFile; fileRef = BA2FE3ED20B109C600AAC231 /* ORKAmslerGridResult.m */; }; + CAD08A1B289DE523007B2A98 /* ORKTouchAnywhereStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 9550E6711D58DBCF00C691B8 /* ORKTouchAnywhereStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A1C289DE527007B2A98 /* ORKTouchAnywhereStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 9550E6721D58DBCF00C691B8 /* ORKTouchAnywhereStep.m */; }; + CAD08A20289DE554007B2A98 /* ORKActiveStepTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B331A8D7C5B00081FAC /* ORKActiveStepTimer.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A21289DE559007B2A98 /* ORKActiveStepTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B341A8D7C5B00081FAC /* ORKActiveStepTimer.m */; }; + CAD08A22289DE55D007B2A98 /* ORKVoiceEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4D1A8D7C5B00081FAC /* ORKVoiceEngine.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A23289DE561007B2A98 /* ORKVoiceEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B4E1A8D7C5B00081FAC /* ORKVoiceEngine.m */; }; + CAD08A24289DE563007B2A98 /* ORKVoiceEngine_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EBFE11E1AE1B68800CB8254 /* ORKVoiceEngine_Internal.h */; }; + CAD08A25289DE58A007B2A98 /* ORKCountdownStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B021A8D7C5B00081FAC /* ORKCountdownStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A26289DE58E007B2A98 /* ORKCountdownStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B031A8D7C5B00081FAC /* ORKCountdownStep.m */; }; + CAD08A2D289DE5C2007B2A98 /* ORKAccelerometerRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B2E1A8D7C5B00081FAC /* ORKAccelerometerRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A2E289DE5C7007B2A98 /* ORKAccelerometerRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B2F1A8D7C5B00081FAC /* ORKAccelerometerRecorder.m */; }; + CAD08A2F289DE5CA007B2A98 /* CMAccelerometerData+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B241A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.h */; }; + CAD08A30289DE5CD007B2A98 /* CMAccelerometerData+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B251A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.m */; }; + CAD08A31289DE5D1007B2A98 /* ORKAudioRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B3A1A8D7C5B00081FAC /* ORKAudioRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A32289DE5D5007B2A98 /* ORKAudioRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B3B1A8D7C5B00081FAC /* ORKAudioRecorder.m */; }; + CAD08A33289DE5D7007B2A98 /* ORKStreamingAudioRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E80C1A81FA2A6E500399A0C /* ORKStreamingAudioRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A34289DE5DB007B2A98 /* ORKStreamingAudioRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E80C1A91FA2AA8D00399A0C /* ORKStreamingAudioRecorder.m */; }; + CAD08A35289DE5DE007B2A98 /* ORKAudioStreamer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D3800692437E53500E7D2BD /* ORKAudioStreamer.h */; }; + CAD08A36289DE5E1007B2A98 /* ORKAudioStreamer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D38006A2437E53500E7D2BD /* ORKAudioStreamer.m */; }; + CAD08A37289DE5E7007B2A98 /* ORKDeviceMotionRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B3F1A8D7C5B00081FAC /* ORKDeviceMotionRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A38289DE5EC007B2A98 /* ORKDeviceMotionRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B401A8D7C5B00081FAC /* ORKDeviceMotionRecorder.m */; }; + CAD08A39289DE5F0007B2A98 /* CMDeviceMotion+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B261A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.h */; }; + CAD08A3A289DE5F3007B2A98 /* CMDeviceMotion+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B271A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.m */; }; + CAD08A3D289DE609007B2A98 /* ORKHealthClinicalTypeRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 71D8EF1520B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A3E289DE60E007B2A98 /* ORKHealthClinicalTypeRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 71D8EF1620B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.m */; }; + CAD08A3F289DE611007B2A98 /* ORKHealthQuantityTypeRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B411A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A40289DE615007B2A98 /* ORKHealthQuantityTypeRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B421A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.m */; }; + CAD08A43289DE620007B2A98 /* ORKLocationRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B431A8D7C5B00081FAC /* ORKLocationRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A44289DE623007B2A98 /* ORKLocationRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B441A8D7C5B00081FAC /* ORKLocationRecorder.m */; }; + CAD08A45289DE626007B2A98 /* CLLocation+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B221A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.h */; }; + CAD08A46289DE628007B2A98 /* CLLocation+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B231A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.m */; }; + CAD08A47289DE62C007B2A98 /* ORKPedometerRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B451A8D7C5B00081FAC /* ORKPedometerRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A48289DE630007B2A98 /* ORKPedometerRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B461A8D7C5B00081FAC /* ORKPedometerRecorder.m */; }; + CAD08A49289DE634007B2A98 /* CMPedometerData+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B2A1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.h */; }; + CAD08A4A289DE637007B2A98 /* CMPedometerData+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B2B1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.m */; }; + CAD08A4B289DE63B007B2A98 /* ORKTouchRecorder.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4B1A8D7C5B00081FAC /* ORKTouchRecorder.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A4C289DE63F007B2A98 /* ORKTouchRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B4C1A8D7C5B00081FAC /* ORKTouchRecorder.m */; }; + CAD08A4D289DE641007B2A98 /* UITouch+ORKJSONDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B4F1A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.h */; }; + CAD08A4E289DE644007B2A98 /* UITouch+ORKJSONDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B501A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.m */; }; + CAD08A51289DE65E007B2A98 /* ORKAudioStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40AFE1A8D7C5B00081FAC /* ORKAudioStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A52289DE662007B2A98 /* ORKAudioStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40AFF1A8D7C5B00081FAC /* ORKAudioStep.m */; }; + CAD08A53289DE665007B2A98 /* ORKAudioLevelNavigationRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FF36A48B1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A54289DE669007B2A98 /* ORKAudioLevelNavigationRule.m in Sources */ = {isa = PBXBuildFile; fileRef = FF36A48C1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.m */; }; + CAD08A55289DE66E007B2A98 /* ORKSpeechRecognitionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070F51FAD217400E4FC7F /* ORKSpeechRecognitionStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A56289DE672007B2A98 /* ORKSpeechRecognitionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070F61FAD217400E4FC7F /* ORKSpeechRecognitionStep.m */; }; + CAD08A57289DE675007B2A98 /* ORKSpeechRecognizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E8070F11FAD217400E4FC7F /* ORKSpeechRecognizer.h */; }; + CAD08A58289DE678007B2A98 /* ORKSpeechRecognizer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2E8070F21FAD217400E4FC7F /* ORKSpeechRecognizer.m */; }; + CAD08A59289DE67C007B2A98 /* ORKSpeechRecognitionError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3408C92028E13B0027D6B8 /* ORKSpeechRecognitionError.h */; }; + CAD08A5A289DE67F007B2A98 /* ORKSpeechRecognitionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = BA5B9205204F5D9A007C2F9D /* ORKSpeechRecognitionResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A5B289DE683007B2A98 /* ORKSpeechRecognitionResult.m in Sources */ = {isa = PBXBuildFile; fileRef = BA5B9206204F5D9A007C2F9D /* ORKSpeechRecognitionResult.m */; }; + CAD08A5C289DE689007B2A98 /* ORKFitnessStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B081A8D7C5B00081FAC /* ORKFitnessStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A5D289DE68D007B2A98 /* ORKFitnessStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B091A8D7C5B00081FAC /* ORKFitnessStep.m */; }; + CAD08A5E289DE690007B2A98 /* ORKAudioFitnessStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 03057F3B2515772E00C4EC5B /* ORKAudioFitnessStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A5F289DE693007B2A98 /* ORKAudioFitnessStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 03057F3C2515772E00C4EC5B /* ORKAudioFitnessStep.m */; }; + CAD08A60289DE69A007B2A98 /* ORKHolePegTestPlaceStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 106FF29C1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A61289DE69E007B2A98 /* ORKHolePegTestPlaceStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 106FF29D1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.m */; }; + CAD08A62289DE6A2007B2A98 /* ORKHolePegTestRemoveStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 10FF9AC11B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A63289DE6A6007B2A98 /* ORKHolePegTestRemoveStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 10FF9AC21B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.m */; }; + CAD08A64289DE6A8007B2A98 /* ORKHolePegTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A451E81BA3D005C2A1E /* ORKHolePegTestResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A65289DE6AC007B2A98 /* ORKHolePegTestResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A461E81BA3D005C2A1E /* ORKHolePegTestResult.m */; }; + CAD08A66289DE6B0007B2A98 /* ORKPSATResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A411E81B904005C2A1E /* ORKPSATResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A67289DE6B4007B2A98 /* ORKPSATResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A421E81B904005C2A1E /* ORKPSATResult.m */; }; + CAD08A68289DE6B6007B2A98 /* ORKPSATStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 10864C961B27146B000F4158 /* ORKPSATStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A69289DE6BA007B2A98 /* ORKPSATStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 10864C971B27146B000F4158 /* ORKPSATStep.m */; }; + CAD08A6A289DE6BF007B2A98 /* ORKShoulderRangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2C0B1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A6B289DE6C3007B2A98 /* ORKShoulderRangeOfMotionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2C0C1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.m */; }; + CAD08A6C289DE6CD007B2A98 /* ORKRangeOfMotionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A281E81A94B005C2A1E /* ORKRangeOfMotionResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A6D289DE6D2007B2A98 /* ORKRangeOfMotionResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A291E81A94B005C2A1E /* ORKRangeOfMotionResult.m */; }; + CAD08A6E289DE6D4007B2A98 /* ORKRangeOfMotionStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 959A2BFA1D68B98700841B04 /* ORKRangeOfMotionStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A6F289DE6D9007B2A98 /* ORKRangeOfMotionStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 959A2BFB1D68B98700841B04 /* ORKRangeOfMotionStep.m */; }; + CAD08A70289DE6DE007B2A98 /* ORKReactionTimeResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A3D1E81AFEF005C2A1E /* ORKReactionTimeResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A71289DE6E2007B2A98 /* ORKReactionTimeResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A3E1E81AFEF005C2A1E /* ORKReactionTimeResult.m */; }; + CAD08A72289DE6E5007B2A98 /* ORKReactionTimeStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 25ECC0931AFBD68300F3D63B /* ORKReactionTimeStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A73289DE6E9007B2A98 /* ORKReactionTimeStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 25ECC0941AFBD68300F3D63B /* ORKReactionTimeStep.m */; }; + CAD08A74289DE6ED007B2A98 /* ORKSpatialSpanMemoryResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A341E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A75289DE6F1007B2A98 /* ORKSpatialSpanMemoryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A351E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.m */; }; + CAD08A76289DE6F3007B2A98 /* ORKSpatialSpanMemoryStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B121A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A77289DE6F7007B2A98 /* ORKSpatialSpanMemoryStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B131A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.m */; }; + CAD08A78289DE6F9007B2A98 /* ORKSpatialSpanGame.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B0C1A8D7C5B00081FAC /* ORKSpatialSpanGame.h */; }; + CAD08A79289DE6FC007B2A98 /* ORKSpatialSpanGame.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B0D1A8D7C5B00081FAC /* ORKSpatialSpanGame.m */; }; + CAD08A7A289DE6FE007B2A98 /* ORKSpatialSpanGameState.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B0E1A8D7C5B00081FAC /* ORKSpatialSpanGameState.h */; }; + CAD08A7B289DE703007B2A98 /* ORKSpatialSpanGameState.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B0F1A8D7C5B00081FAC /* ORKSpatialSpanGameState.m */; }; + CAD08A7C289DE709007B2A98 /* ORKStroopResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF72B1ED1F5F10CD004C6F15 /* ORKStroopResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A7D289DE70D007B2A98 /* ORKStroopResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF72B1EE1F5F10CD004C6F15 /* ORKStroopResult.m */; }; + CAD08A7E289DE710007B2A98 /* ORKStroopStep.h in Headers */ = {isa = PBXBuildFile; fileRef = BA0AA6901EAEC0B600671ACE /* ORKStroopStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A7F289DE714007B2A98 /* ORKStroopStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BA0AA6911EAEC0B600671ACE /* ORKStroopStep.m */; }; + CAD08A80289DE716007B2A98 /* ORKAccuracyStroopStep.h in Headers */ = {isa = PBXBuildFile; fileRef = A659C538262E0A3200E920DA /* ORKAccuracyStroopStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A81289DE71A007B2A98 /* ORKAccuracyStroopStep.m in Sources */ = {isa = PBXBuildFile; fileRef = A659C539262E0A3200E920DA /* ORKAccuracyStroopStep.m */; }; + CAD08A82289DE71D007B2A98 /* ORKAccuracyStroopResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D003D9F26377E7400A6439B /* ORKAccuracyStroopResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A83289DE721007B2A98 /* ORKAccuracyStroopResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D003DA026377E7400A6439B /* ORKAccuracyStroopResult.m */; }; + CAD08A88289DE762007B2A98 /* ORKTappingIntervalResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A201E81A56F005C2A1E /* ORKTappingIntervalResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A89289DE766007B2A98 /* ORKTappingIntervalResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A211E81A56F005C2A1E /* ORKTappingIntervalResult.m */; }; + CAD08A8A289DE769007B2A98 /* ORKTappingIntervalStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B1A1A8D7C5B00081FAC /* ORKTappingIntervalStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A8B289DE76D007B2A98 /* ORKTappingIntervalStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B1B1A8D7C5B00081FAC /* ORKTappingIntervalStep.m */; }; + CAD08A8C289DE772007B2A98 /* ORKAudioGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503AD1AEE8071004B17F3 /* ORKAudioGenerator.h */; }; + CAD08A8D289DE775007B2A98 /* ORKAudioGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503AE1AEE8071004B17F3 /* ORKAudioGenerator.m */; }; + CAD08A8E289DE777007B2A98 /* ORKToneAudiometryResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A301E81AC26005C2A1E /* ORKToneAudiometryResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A8F289DE77B007B2A98 /* ORKToneAudiometryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A311E81AC26005C2A1E /* ORKToneAudiometryResult.m */; }; + CAD08A90289DE77E007B2A98 /* ORKToneAudiometryStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 147503B31AEE807C004B17F3 /* ORKToneAudiometryStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A91289DE784007B2A98 /* ORKToneAudiometryStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 147503B41AEE807C004B17F3 /* ORKToneAudiometryStep.m */; }; + CAD08A92289DE788007B2A98 /* ORKTowerOfHanoiStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 250F94021B4C5A6600FA23EB /* ORKTowerOfHanoiStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A93289DE78D007B2A98 /* ORKTowerOfHanoiStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 250F94031B4C5A6600FA23EB /* ORKTowerOfHanoiStep.m */; }; + CAD08A94289DE790007B2A98 /* ORKTowerOfHanoiTower.h in Headers */ = {isa = PBXBuildFile; fileRef = 257FCE211B4D37A80001EF06 /* ORKTowerOfHanoiTower.h */; }; + CAD08A95289DE793007B2A98 /* ORKTowerOfHanoiTower.m in Sources */ = {isa = PBXBuildFile; fileRef = 257FCE221B4D37A80001EF06 /* ORKTowerOfHanoiTower.m */; }; + CAD08A96289DE796007B2A98 /* ORKTowerOfHanoiResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A2C1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A97289DE79A007B2A98 /* ORKTowerOfHanoiResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A2D1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.m */; }; + CAD08A98289DE79F007B2A98 /* ORKTrailmakingResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A4D1E81BD05005C2A1E /* ORKTrailmakingResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A99289DE7A4007B2A98 /* ORKTrailmakingResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A4E1E81BD05005C2A1E /* ORKTrailmakingResult.m */; }; + CAD08A9A289DE7A7007B2A98 /* ORKTrailmakingStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 781D540C1DF886AB00223305 /* ORKTrailmakingStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A9B289DE7AB007B2A98 /* ORKTrailmakingStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 781D540D1DF886AB00223305 /* ORKTrailmakingStep.m */; }; + CAD08A9C289DE7B1007B2A98 /* ORKWalkingTaskStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C40B1E1A8D7C5B00081FAC /* ORKWalkingTaskStep.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAD08A9D289DE7B5007B2A98 /* ORKWalkingTaskStep.m in Sources */ = {isa = PBXBuildFile; fileRef = 86C40B1F1A8D7C5B00081FAC /* ORKWalkingTaskStep.m */; }; + CAD08A9E289DE7B8007B2A98 /* ORKTimedWalkResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A491E81BB7E005C2A1E /* ORKTimedWalkResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CAD08A9F289DE7BD007B2A98 /* ORKTimedWalkResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A4A1E81BB7E005C2A1E /* ORKTimedWalkResult.m */; }; + CAFAA6C228A198BD0010BBDE /* ResearchKitActiveTask_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = CAFAA6C128A198BD0010BBDE /* ResearchKitActiveTask_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + CAFAA6C428A19E200010BBDE /* ResearchKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B183A5951A8535D100C76870 /* ResearchKit.framework */; }; + CAFAA6C528A19E260010BBDE /* ResearchKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA1C7A5A288B0C68004DAB3A /* ResearchKitUI.framework */; }; D44239791AF17F5100559D96 /* ORKImageCaptureStep.h in Headers */ = {isa = PBXBuildFile; fileRef = D44239771AF17F5100559D96 /* ORKImageCaptureStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; D442397A1AF17F5100559D96 /* ORKImageCaptureStep.m in Sources */ = {isa = PBXBuildFile; fileRef = D44239781AF17F5100559D96 /* ORKImageCaptureStep.m */; }; - D442397D1AF17F7600559D96 /* ORKImageCaptureStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = D442397B1AF17F7600559D96 /* ORKImageCaptureStepViewController.h */; settings = {ATTRIBUTES = (Private, ); }; }; - D442397E1AF17F7600559D96 /* ORKImageCaptureStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D442397C1AF17F7600559D96 /* ORKImageCaptureStepViewController.m */; }; - D458520A1AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.h in Headers */ = {isa = PBXBuildFile; fileRef = D45852081AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.h */; }; - D458520B1AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.m in Sources */ = {isa = PBXBuildFile; fileRef = D45852091AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.m */; }; - E26E32D622E75FB7004F42EC /* Noise.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC5920BF6A0000D7A6BB /* Noise.wav */; }; - E26E32D722E75FBF004F42EC /* Window.wav in Resources */ = {isa = PBXBuildFile; fileRef = 7118AC5B20BF6A1200D7A6BB /* Window.wav */; }; - E29189B923855B97001AFF0F /* frequency_dBSPL_AIRPODSPRO.plist in Resources */ = {isa = PBXBuildFile; fileRef = E29189B823855B96001AFF0F /* frequency_dBSPL_AIRPODSPRO.plist */; }; - E29189BB23855BA2001AFF0F /* volume_curve_AIRPODSPRO.plist in Resources */ = {isa = PBXBuildFile; fileRef = E29189BA23855BA2001AFF0F /* volume_curve_AIRPODSPRO.plist */; }; - E29189BD23855BAE001AFF0F /* retspl_AIRPODSPRO.plist in Resources */ = {isa = PBXBuildFile; fileRef = E29189BC23855BAE001AFF0F /* retspl_AIRPODSPRO.plist */; }; - E293655E25757CC700092A7C /* frequency_dBSPL_AIRPODSMAX.plist in Resources */ = {isa = PBXBuildFile; fileRef = E293655D25757CC700092A7C /* frequency_dBSPL_AIRPODSMAX.plist */; }; - E293656025757E6100092A7C /* retspl_AIRPODSMAX.plist in Resources */ = {isa = PBXBuildFile; fileRef = E293655F25757E6100092A7C /* retspl_AIRPODSMAX.plist */; }; - E293656225757E7700092A7C /* volume_curve_AIRPODSMAX.plist in Resources */ = {isa = PBXBuildFile; fileRef = E293656125757E7700092A7C /* volume_curve_AIRPODSMAX.plist */; }; - E293668525EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.h in Headers */ = {isa = PBXBuildFile; fileRef = E293668325EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.h */; }; - E293668625EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = E293668425EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.m */; }; - E2EE530022E7735700F34987 /* VolumeCalibration.wav in Resources */ = {isa = PBXBuildFile; fileRef = E2EE52FF22E7735600F34987 /* VolumeCalibration.wav */; }; - F7EC216624787338000C1F46 /* ORKCustomSignatureFooterView.h in Headers */ = {isa = PBXBuildFile; fileRef = F7EC216424787338000C1F46 /* ORKCustomSignatureFooterView.h */; }; - F7EC216724787338000C1F46 /* ORKCustomSignatureFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7EC216524787338000C1F46 /* ORKCustomSignatureFooterView.m */; }; FA7A9D2B1B082688005A2BEA /* ORKConsentDocumentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = FA7A9D2A1B082688005A2BEA /* ORKConsentDocumentTests.m */; }; FA7A9D2F1B083DD3005A2BEA /* ORKConsentSectionFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7A9D2D1B083DD3005A2BEA /* ORKConsentSectionFormatter.h */; }; FA7A9D301B083DD3005A2BEA /* ORKConsentSectionFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = FA7A9D2E1B083DD3005A2BEA /* ORKConsentSectionFormatter.m */; }; @@ -938,13 +999,6 @@ FA7A9D391B0969A7005A2BEA /* ORKConsentSignatureFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = FA7A9D381B0969A7005A2BEA /* ORKConsentSignatureFormatterTests.m */; }; FF0CB38A1FD5C4C3002D838C /* ORKWebViewStepResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF0CB3881FD5C4C3002D838C /* ORKWebViewStepResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; FF0CB38B1FD5C4C3002D838C /* ORKWebViewStepResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF0CB3891FD5C4C3002D838C /* ORKWebViewStepResult.m */; }; - FF154FB41E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.h in Headers */ = {isa = PBXBuildFile; fileRef = FF154FB21E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF154FB51E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.m in Sources */ = {isa = PBXBuildFile; fileRef = FF154FB31E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.m */; }; - FF36A48D1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.h in Headers */ = {isa = PBXBuildFile; fileRef = FF36A48B1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.h */; settings = {ATTRIBUTES = (Private, ); }; }; - FF36A48E1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.m in Sources */ = {isa = PBXBuildFile; fileRef = FF36A48C1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.m */; }; - FF36A49C1D1A15FC00DE8470 /* ORKTableStepViewController_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = FF36A4991D1A15FC00DE8470 /* ORKTableStepViewController_Internal.h */; }; - FF36A49D1D1A15FC00DE8470 /* ORKTableStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = FF36A49A1D1A15FC00DE8470 /* ORKTableStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF36A49E1D1A15FC00DE8470 /* ORKTableStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF36A49B1D1A15FC00DE8470 /* ORKTableStepViewController.m */; }; FF5051ED1D668FF80065E677 /* ORKPageStep_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FF5051EC1D668FF80065E677 /* ORKPageStep_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; FF5051F01D66908C0065E677 /* ORKNavigablePageStep.h in Headers */ = {isa = PBXBuildFile; fileRef = FF5051EE1D66908C0065E677 /* ORKNavigablePageStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; FF5051F11D66908C0065E677 /* ORKNavigablePageStep.m in Sources */ = {isa = PBXBuildFile; fileRef = FF5051EF1D66908C0065E677 /* ORKNavigablePageStep.m */; }; @@ -952,33 +1006,6 @@ FF5CA6131D2C2670001660A3 /* ORKTableStep.m in Sources */ = {isa = PBXBuildFile; fileRef = FF5CA6111D2C2670001660A3 /* ORKTableStep.m */; }; FF5CA61B1D2C6453001660A3 /* ORKSignatureStep.h in Headers */ = {isa = PBXBuildFile; fileRef = FF5CA6191D2C6453001660A3 /* ORKSignatureStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; FF5CA61C1D2C6453001660A3 /* ORKSignatureStep.m in Sources */ = {isa = PBXBuildFile; fileRef = FF5CA61A1D2C6453001660A3 /* ORKSignatureStep.m */; }; - FF5E3CCB1D23444400ECE4B7 /* ORKPageStepViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = FF5E3CC91D23444400ECE4B7 /* ORKPageStepViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF5E3CCC1D23444400ECE4B7 /* ORKPageStepViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FF5E3CCA1D23444400ECE4B7 /* ORKPageStepViewController.m */; }; - FF72B1EF1F5F10CD004C6F15 /* ORKStroopResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF72B1ED1F5F10CD004C6F15 /* ORKStroopResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF72B1F01F5F10CD004C6F15 /* ORKStroopResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF72B1EE1F5F10CD004C6F15 /* ORKStroopResult.m */; }; - FF919A221E81A56F005C2A1E /* ORKTappingIntervalResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A201E81A56F005C2A1E /* ORKTappingIntervalResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A231E81A56F005C2A1E /* ORKTappingIntervalResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A211E81A56F005C2A1E /* ORKTappingIntervalResult.m */; }; - FF919A271E81A87B005C2A1E /* ORKActiveTaskResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A261E81A87B005C2A1E /* ORKActiveTaskResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A2A1E81A94B005C2A1E /* ORKRangeOfMotionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A281E81A94B005C2A1E /* ORKRangeOfMotionResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A2B1E81A94B005C2A1E /* ORKRangeOfMotionResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A291E81A94B005C2A1E /* ORKRangeOfMotionResult.m */; }; - FF919A2E1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A2C1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A2F1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A2D1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.m */; }; - FF919A321E81AC26005C2A1E /* ORKToneAudiometryResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A301E81AC26005C2A1E /* ORKToneAudiometryResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A331E81AC26005C2A1E /* ORKToneAudiometryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A311E81AC26005C2A1E /* ORKToneAudiometryResult.m */; }; - FF919A361E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A341E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A371E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A351E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.m */; }; - FF919A3B1E81AF1D005C2A1E /* ORKFileResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A391E81AF1D005C2A1E /* ORKFileResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A3C1E81AF1D005C2A1E /* ORKFileResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A3A1E81AF1D005C2A1E /* ORKFileResult.m */; }; - FF919A3F1E81AFEF005C2A1E /* ORKReactionTimeResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A3D1E81AFEF005C2A1E /* ORKReactionTimeResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A401E81AFEF005C2A1E /* ORKReactionTimeResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A3E1E81AFEF005C2A1E /* ORKReactionTimeResult.m */; }; - FF919A431E81B904005C2A1E /* ORKPSATResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A411E81B904005C2A1E /* ORKPSATResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A441E81B904005C2A1E /* ORKPSATResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A421E81B904005C2A1E /* ORKPSATResult.m */; }; - FF919A471E81BA3D005C2A1E /* ORKHolePegTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A451E81BA3D005C2A1E /* ORKHolePegTestResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A481E81BA3D005C2A1E /* ORKHolePegTestResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A461E81BA3D005C2A1E /* ORKHolePegTestResult.m */; }; - FF919A4B1E81BB7E005C2A1E /* ORKTimedWalkResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A491E81BB7E005C2A1E /* ORKTimedWalkResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A4C1E81BB7E005C2A1E /* ORKTimedWalkResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A4A1E81BB7E005C2A1E /* ORKTimedWalkResult.m */; }; - FF919A4F1E81BD05005C2A1E /* ORKTrailmakingResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A4D1E81BD05005C2A1E /* ORKTrailmakingResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FF919A501E81BD05005C2A1E /* ORKTrailmakingResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A4E1E81BD05005C2A1E /* ORKTrailmakingResult.m */; }; FF919A531E81BEB5005C2A1E /* ORKCollectionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A511E81BEB5005C2A1E /* ORKCollectionResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; FF919A541E81BEB5005C2A1E /* ORKCollectionResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A521E81BEB5005C2A1E /* ORKCollectionResult.m */; }; FF919A561E81BEE0005C2A1E /* ORKCollectionResult_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A551E81BEDD005C2A1E /* ORKCollectionResult_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -994,15 +1021,32 @@ FF919A6A1E81D255005C2A1E /* ORKConsentSignatureResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A681E81D255005C2A1E /* ORKConsentSignatureResult.m */; }; FF919A6D1E81D3B0005C2A1E /* ORKPasscodeResult.h in Headers */ = {isa = PBXBuildFile; fileRef = FF919A6B1E81D3B0005C2A1E /* ORKPasscodeResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; FF919A6E1E81D3B0005C2A1E /* ORKPasscodeResult.m in Sources */ = {isa = PBXBuildFile; fileRef = FF919A6C1E81D3B0005C2A1E /* ORKPasscodeResult.m */; }; - FFAE71401DAEC66200AE82B4 /* ORKFootnoteLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = FFAE713E1DAEC66200AE82B4 /* ORKFootnoteLabel.h */; settings = {ATTRIBUTES = (Private, ); }; }; - FFAE71411DAEC66200AE82B4 /* ORKFootnoteLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = FFAE713F1DAEC66200AE82B4 /* ORKFootnoteLabel.m */; }; FFDDD8491D3555EA00446806 /* ORKPageStep.h in Headers */ = {isa = PBXBuildFile; fileRef = FFDDD8471D3555EA00446806 /* ORKPageStep.h */; settings = {ATTRIBUTES = (Public, ); }; }; FFDDD84A1D3555EA00446806 /* ORKPageStep.m in Sources */ = {isa = PBXBuildFile; fileRef = FFDDD8481D3555EA00446806 /* ORKPageStep.m */; }; - FFF65AB81E318F2D0043FB40 /* ORKMultipleValuePicker.h in Headers */ = {isa = PBXBuildFile; fileRef = FFF65AB61E318F2D0043FB40 /* ORKMultipleValuePicker.h */; }; - FFF65AB91E318F2D0043FB40 /* ORKMultipleValuePicker.m in Sources */ = {isa = PBXBuildFile; fileRef = FFF65AB71E318F2D0043FB40 /* ORKMultipleValuePicker.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + 0BC672DF2BD9C541005798AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3FFF18351829DB1D00167070 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B183A4731A8535D100C76870; + remoteInfo = ResearchKit; + }; + 0BC672E12BD9C541005798AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3FFF18351829DB1D00167070 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CAD08966289DD747007B2A98; + remoteInfo = ResearchKitActiveTask; + }; + 0BC672E52BD9C541005798AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3FFF18351829DB1D00167070 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CA1C7A40288B0C68004DAB3A; + remoteInfo = "ResearchKitUI (iOS)"; + }; 86CC8EA11AC09332001CCD89 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 3FFF18351829DB1D00167070 /* Project object */; @@ -1010,15 +1054,56 @@ remoteGlobalIDString = B183A4731A8535D100C76870; remoteInfo = OpenResearchKit; }; - B11DF3B01AA10795009E76D2 /* PBXContainerItemProxy */ = { + CA1C7A5E288B0CA2004DAB3A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 3FFF18351829DB1D00167070 /* Project object */; proxyType = 1; remoteGlobalIDString = B183A4731A8535D100C76870; - remoteInfo = OpenResearchKit; + remoteInfo = ResearchKit; + }; + CA4B673428A1CD5700FAE01F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3FFF18351829DB1D00167070 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CAD08966289DD747007B2A98; + remoteInfo = ResearchKitActiveTask; + }; + CAF8D2B9288F2DCB001E6992 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3FFF18351829DB1D00167070 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CA1C7A40288B0C68004DAB3A; + remoteInfo = "ResearchKitUI (iOS)"; + }; + CAFAA6C628A19E2F0010BBDE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3FFF18351829DB1D00167070 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B183A4731A8535D100C76870; + remoteInfo = ResearchKit; + }; + CAFAA6C828A19E330010BBDE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3FFF18351829DB1D00167070 /* Project object */; + proxyType = 1; + remoteGlobalIDString = CA1C7A40288B0C68004DAB3A; + remoteInfo = "ResearchKitUI (iOS)"; }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + CA1C7A60288B0CA2004DAB3A /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 00B1F7842241503900D022FE /* Speech.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Speech.framework; path = System/Library/Frameworks/Speech.framework; sourceTree = SDKROOT; }; 00C266882302244300337E0B /* ORKCustomStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKCustomStepViewController.h; sourceTree = ""; }; @@ -1040,18 +1125,21 @@ 03EDD57E24CA6B1D006245E9 /* ORKNotificationPermissionType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKNotificationPermissionType.h; sourceTree = ""; }; 03EDD57F24CA6B1D006245E9 /* ORKNotificationPermissionType.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKNotificationPermissionType.m; sourceTree = ""; }; 05F3765923C797930068E166 /* ResearchKit.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = ResearchKit.xctestplan; sourceTree = ""; }; + 0B0852732BD872C400149963 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 0B0852752BD872D800149963 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 0B0852772BD872EA00149963 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 0B53DA632BD0595100227126 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ResearchKitUI.strings; sourceTree = ""; }; 0B59A6BD28C1738D005035B4 /* ORKPickerTestDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKPickerTestDelegate.h; sourceTree = ""; }; 0B59A6BE28C1738D005035B4 /* ORKPickerTestDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKPickerTestDelegate.m; sourceTree = ""; }; - 0BAF9796291088ED00EF138A /* ORKNormalizedReactionTimeResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKNormalizedReactionTimeResult.h; sourceTree = ""; }; - 0BAF9797291088EE00EF138A /* ORKNormalizedReactionTimeStimulusView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKNormalizedReactionTimeStimulusView.h; sourceTree = ""; }; - 0BAF9798291088EE00EF138A /* ORKNormalizedReactionTimeContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKNormalizedReactionTimeContentView.h; sourceTree = ""; }; - 0BAF9799291088EE00EF138A /* ORKNormalizedReactionTimeStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKNormalizedReactionTimeStep.h; sourceTree = ""; }; - 0BAF979A291088EF00EF138A /* ORKNormalizedReactionTimeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKNormalizedReactionTimeViewController.m; sourceTree = ""; }; - 0BAF979B291088EF00EF138A /* ORKNormalizedReactionTimeStimulusView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKNormalizedReactionTimeStimulusView.m; sourceTree = ""; }; - 0BAF979C291088F000EF138A /* ORKNormalizedReactionTimeContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKNormalizedReactionTimeContentView.m; sourceTree = ""; }; - 0BAF979D291088F000EF138A /* ORKNormalizedReactionTimeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKNormalizedReactionTimeViewController.h; sourceTree = ""; }; - 0BAF979E291088F100EF138A /* ORKNormalizedReactionTimeResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKNormalizedReactionTimeResult.m; sourceTree = ""; }; - 0BAF979F291088F200EF138A /* ORKNormalizedReactionTimeStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKNormalizedReactionTimeStep.m; sourceTree = ""; }; + 0B8444632A79C25000292DEA /* ORKChoiceViewCell+ORKTextChoice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ORKChoiceViewCell+ORKTextChoice.h"; sourceTree = ""; }; + 0B8444642A79C25000292DEA /* ORKChoiceViewCell+ORKTextChoice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ORKChoiceViewCell+ORKTextChoice.m"; sourceTree = ""; }; + 0B9A990D2A8AC47500D64C40 /* NSObject+TestingSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+TestingSupport.h"; sourceTree = ""; }; + 0B9A990E2A8AC47500D64C40 /* NSObject+TestingSupport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+TestingSupport.m"; sourceTree = ""; }; + 0B9CC5652A68C02C00080E29 /* UIImageView+ResearchKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImageView+ResearchKit.h"; sourceTree = ""; }; + 0B9CC5662A68C02C00080E29 /* UIImageView+ResearchKit.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+ResearchKit.m"; sourceTree = ""; }; + 0BA1D93A2BD1DF5A00BB79DB /* ResearchKit.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = ResearchKit.podspec; sourceTree = ""; }; + 0BE9D5242947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ORKConsentDocument+ORKInstructionStep.h"; sourceTree = ""; }; + 0BE9D5252947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ORKConsentDocument+ORKInstructionStep.m"; sourceTree = ""; }; 106FF29C1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKHolePegTestPlaceStep.h; sourceTree = ""; }; 106FF29D1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKHolePegTestPlaceStep.m; sourceTree = ""; }; 106FF2A01B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKHolePegTestPlaceStepViewController.h; sourceTree = ""; }; @@ -1109,7 +1197,6 @@ 14A92C6922444F93007547F2 /* ORKPasscodeViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKPasscodeViewControllerTests.swift; sourceTree = ""; }; 14A92C6D224531A2007547F2 /* ORKActiveTaskResultTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKActiveTaskResultTests.swift; sourceTree = ""; }; 14D3F09B225BCA8100A3962D /* ORKBorderedButtonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKBorderedButtonTests.swift; sourceTree = ""; }; - 14E7903F226A5F72009D8083 /* ORKStepViewControllerHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKStepViewControllerHelpers.swift; sourceTree = ""; }; 14F7AC8A2269035200D52F41 /* ORKStepViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKStepViewControllerTests.swift; sourceTree = ""; }; 168EEAAF230B6F9E003FD2FA /* find_headers.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = find_headers.rb; sourceTree = ""; }; 1B4B95B71F5F012E006B629F /* ORKWeightPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKWeightPicker.m; sourceTree = ""; }; @@ -1117,11 +1204,11 @@ 2246E5122749350200261D5A /* frequency_dBSPL_AIRPODSV3.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = frequency_dBSPL_AIRPODSV3.plist; sourceTree = ""; }; 2246E5132749350200261D5A /* retspl_AIRPODSV3.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = retspl_AIRPODSV3.plist; sourceTree = ""; }; 2246E5142749350200261D5A /* volume_curve_AIRPODSV3.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = volume_curve_AIRPODSV3.plist; sourceTree = ""; }; - 224CD4FC283540FF0029B820 /* ORKAudiometryProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKAudiometryProtocol.h; path = ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryProtocol.h; sourceTree = ""; }; - 226565512847FD1D00E916FF /* ORKAudiometryStimulus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKAudiometryStimulus.h; path = ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryStimulus.h; sourceTree = ""; }; - 226565522847FD1D00E916FF /* ORKAudiometryStimulus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKAudiometryStimulus.m; path = ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryStimulus.m; sourceTree = ""; }; - 2295B21F282AF92700A5D9E0 /* ORKAudiometry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKAudiometry.h; path = ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.h; sourceTree = ""; }; - 2295B220282AF92700A5D9E0 /* ORKAudiometry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKAudiometry.m; path = ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.m; sourceTree = ""; }; + 224CD4FC283540FF0029B820 /* ORKAudiometryProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKAudiometryProtocol.h; sourceTree = ""; }; + 226565512847FD1D00E916FF /* ORKAudiometryStimulus.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKAudiometryStimulus.h; sourceTree = ""; }; + 226565522847FD1D00E916FF /* ORKAudiometryStimulus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKAudiometryStimulus.m; sourceTree = ""; }; + 2295B21F282AF92700A5D9E0 /* ORKAudiometry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKAudiometry.h; sourceTree = ""; }; + 2295B220282AF92700A5D9E0 /* ORKAudiometry.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKAudiometry.m; sourceTree = ""; }; 22ED1845285290250052406B /* ORKAudiometryTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKAudiometryTests.m; sourceTree = ""; }; 22ED1846285290250052406B /* ORKAudiometryTestData.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ORKAudiometryTestData.plist; sourceTree = ""; }; 241A2E861B94FD8800ED3B39 /* ORKPasscodeStepViewController_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKPasscodeStepViewController_Internal.h; sourceTree = ""; }; @@ -1129,17 +1216,17 @@ 2429D5711BBB5397003A512F /* ORKRegistrationStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKRegistrationStep.m; path = Onboarding/ORKRegistrationStep.m; sourceTree = ""; }; 242C9E031BBDFDAC0088B7F4 /* ORKVerificationStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKVerificationStep.h; path = Onboarding/ORKVerificationStep.h; sourceTree = ""; }; 242C9E041BBDFDAC0088B7F4 /* ORKVerificationStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKVerificationStep.m; path = Onboarding/ORKVerificationStep.m; sourceTree = ""; }; - 242C9E0B1BBE03F90088B7F4 /* ORKVerificationStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKVerificationStepViewController.h; path = Onboarding/ORKVerificationStepViewController.h; sourceTree = ""; }; - 242C9E0C1BBE03F90088B7F4 /* ORKVerificationStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKVerificationStepViewController.m; path = Onboarding/ORKVerificationStepViewController.m; sourceTree = ""; }; - 242C9E0F1BBE06DE0088B7F4 /* ORKVerificationStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKVerificationStepView.h; path = Onboarding/ORKVerificationStepView.h; sourceTree = ""; }; - 242C9E101BBE06DE0088B7F4 /* ORKVerificationStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKVerificationStepView.m; path = Onboarding/ORKVerificationStepView.m; sourceTree = ""; }; + 242C9E0B1BBE03F90088B7F4 /* ORKVerificationStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKVerificationStepViewController.h; sourceTree = ""; }; + 242C9E0C1BBE03F90088B7F4 /* ORKVerificationStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKVerificationStepViewController.m; sourceTree = ""; }; + 242C9E0F1BBE06DE0088B7F4 /* ORKVerificationStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKVerificationStepView.h; sourceTree = ""; }; + 242C9E101BBE06DE0088B7F4 /* ORKVerificationStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKVerificationStepView.m; sourceTree = ""; }; 2433C9E11B9A506F0052D375 /* ORKKeychainWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKKeychainWrapper.h; sourceTree = ""; }; 2433C9E21B9A506F0052D375 /* ORKKeychainWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKKeychainWrapper.m; sourceTree = ""; }; 2441034D1B966D4C00EEAB0C /* ORKPasscodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKPasscodeViewController.h; sourceTree = ""; }; 2441034E1B966D4C00EEAB0C /* ORKPasscodeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKPasscodeViewController.m; sourceTree = ""; }; 244EFAD11BCEFD83001850D9 /* ORKAnswerFormat_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKAnswerFormat_Private.h; sourceTree = ""; }; - 24850E171BCDA9C7006E91FB /* ORKLoginStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKLoginStepViewController.h; path = Onboarding/ORKLoginStepViewController.h; sourceTree = ""; }; - 24850E181BCDA9C7006E91FB /* ORKLoginStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKLoginStepViewController.m; path = Onboarding/ORKLoginStepViewController.m; sourceTree = ""; }; + 24850E171BCDA9C7006E91FB /* ORKLoginStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKLoginStepViewController.h; sourceTree = ""; }; + 24850E181BCDA9C7006E91FB /* ORKLoginStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKLoginStepViewController.m; sourceTree = ""; }; 248604051B4C98760010C8A0 /* ORKAnswerFormatTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKAnswerFormatTests.m; sourceTree = ""; }; 24898B0B1B7186C000B0E7E7 /* ORKScaleRangeImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKScaleRangeImageView.h; sourceTree = ""; }; 24898B0C1B7186C000B0E7E7 /* ORKScaleRangeImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKScaleRangeImageView.m; sourceTree = ""; }; @@ -1204,88 +1291,89 @@ 511987C2246330CA004FC2C7 /* ORKRequestPermissionsStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKRequestPermissionsStep.m; sourceTree = ""; }; 511987C52463316E004FC2C7 /* ORKRequestPermissionsStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKRequestPermissionsStepViewController.h; sourceTree = ""; }; 511987C62463316E004FC2C7 /* ORKRequestPermissionsStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKRequestPermissionsStepViewController.m; sourceTree = ""; }; - 511A7890294D67F80011D85D /* ORKTextButtonTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKTextButtonTests.swift; sourceTree = ""; }; - 511A78992950D7030011D85D /* ResearchKit-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKit-Release.xcconfig"; sourceTree = ""; }; - 511B8A8F293A757E00049947 /* ORKTouchAbilityContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityContentView.h; sourceTree = ""; }; - 511B8A90293A757E00049947 /* ORKTouchAbilityContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityContentView.m; sourceTree = ""; }; - 511B8A93293A759200049947 /* ORKTouchAbilityArrowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityArrowView.h; sourceTree = ""; }; - 511B8A94293A759300049947 /* ORKTouchAbilityArrowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityArrowView.m; sourceTree = ""; }; - 511B8A97293A75B900049947 /* ORKTouchAbilityTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTouch.h; sourceTree = ""; }; - 511B8A98293A75B900049947 /* ORKTouchAbilityTouch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTouch.m; sourceTree = ""; }; - 511B8A9B293A75F300049947 /* ORKTouchAbilityTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrack.h; sourceTree = ""; }; - 511B8A9C293A75F300049947 /* ORKTouchAbilityTrack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTrack.m; sourceTree = ""; }; - 511B8A9F293A760A00049947 /* ORKTouchAbilityTrack_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrack_Internal.h; sourceTree = ""; }; - 511B8AA1293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityGestureRecoginzerEvent.m; sourceTree = ""; }; - 511B8AA2293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityGestureRecoginzerEvent.h; sourceTree = ""; }; - 511B8AA5293A764900049947 /* ORKTouchAbilityTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrial.h; sourceTree = ""; }; - 511B8AA6293A764900049947 /* ORKTouchAbilityTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTrial.m; sourceTree = ""; }; - 511B8AA9293A766300049947 /* ORKTouchAbilityTrial_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrial_Internal.h; sourceTree = ""; }; - 511B8AAB293A767C00049947 /* ORKTouchAbilityTouchTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTouchTracker.m; sourceTree = ""; }; - 511B8AAC293A767C00049947 /* ORKTouchAbilityTouchTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTouchTracker.h; sourceTree = ""; }; - 511B8AAF293A76A100049947 /* ORKTouchAbilityTapStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapStep.m; sourceTree = ""; }; - 511B8AB0293A76A100049947 /* ORKTouchAbilityTapStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapStep.h; sourceTree = ""; }; - 511B8AB3293A76B200049947 /* ORKTouchAbilityTapStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapStepViewController.m; sourceTree = ""; }; - 511B8AB4293A76B200049947 /* ORKTouchAbilityTapStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapStepViewController.h; sourceTree = ""; }; - 511B8AB7293A76DE00049947 /* ORKTouchAbilityTapContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapContentView.h; sourceTree = ""; }; - 511B8AB8293A76DE00049947 /* ORKTouchAbilityTapContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapContentView.m; sourceTree = ""; }; - 511B8ABB293A770D00049947 /* ORKTouchAbilityTapTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapTrial.m; sourceTree = ""; }; - 511B8ABC293A770D00049947 /* ORKTouchAbilityTapTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapTrial.h; sourceTree = ""; }; - 511B8ABF293A772400049947 /* ORKTouchAbilityTapResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapResult.h; sourceTree = ""; }; - 511B8AC0293A772400049947 /* ORKTouchAbilityTapResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapResult.m; sourceTree = ""; }; - 511B8AC4293A777400049947 /* ORKTouchAbilityLongPressStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressStep.h; sourceTree = ""; }; - 511B8AC5293A777400049947 /* ORKTouchAbilityLongPressStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressStep.m; sourceTree = ""; }; - 511B8AC6293A777400049947 /* ORKTouchAbilityLongPressStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressStepViewController.m; sourceTree = ""; }; - 511B8AC7293A777400049947 /* ORKTouchAbilityLongPressStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressStepViewController.h; sourceTree = ""; }; - 511B8ACC293A779200049947 /* ORKTouchAbilityLongPressContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressContentView.m; sourceTree = ""; }; - 511B8ACD293A779200049947 /* ORKTouchAbilityLongPressContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressContentView.h; sourceTree = ""; }; - 511B8AD0293A77AA00049947 /* ORKTouchAbilityLongPressTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressTrial.h; sourceTree = ""; }; - 511B8AD1293A77AA00049947 /* ORKTouchAbilityLongPressTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressTrial.m; sourceTree = ""; }; - 511B8AD4293A77BE00049947 /* ORKTouchAbilityLongPressResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressResult.h; sourceTree = ""; }; - 511B8AD5293A77BE00049947 /* ORKTouchAbilityLongPressResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressResult.m; sourceTree = ""; }; - 511B8AD9293A781000049947 /* ORKTouchAbilitySwipeStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeStep.h; sourceTree = ""; }; - 511B8ADA293A781000049947 /* ORKTouchAbilitySwipeStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeStep.m; sourceTree = ""; }; - 511B8ADD293A782800049947 /* ORKTouchAbilitySwipeStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeStepViewController.h; sourceTree = ""; }; - 511B8ADE293A782800049947 /* ORKTouchAbilitySwipeStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeStepViewController.m; sourceTree = ""; }; - 511B8AE1293A783B00049947 /* ORKTouchAbilitySwipeContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeContentView.h; sourceTree = ""; }; - 511B8AE2293A783B00049947 /* ORKTouchAbilitySwipeContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeContentView.m; sourceTree = ""; }; - 511B8AE9293A785900049947 /* ORKTouchAbilitySwipeTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeTrial.m; sourceTree = ""; }; - 511B8AEA293A785900049947 /* ORKTouchAbilitySwipeTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeTrial.h; sourceTree = ""; }; - 511B8AEB293A785900049947 /* ORKTouchAbilitySwipeResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeResult.h; sourceTree = ""; }; - 511B8AEC293A785900049947 /* ORKTouchAbilitySwipeResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeResult.m; sourceTree = ""; }; - 511B8AF2293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollStepViewController.m; sourceTree = ""; }; - 511B8AF3293A78BB00049947 /* ORKTouchAbilityScrollStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollStep.m; sourceTree = ""; }; - 511B8AF4293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollStepViewController.h; sourceTree = ""; }; - 511B8AF5293A78BB00049947 /* ORKTouchAbilityScrollStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollStep.h; sourceTree = ""; }; - 511B8AFA293A78CF00049947 /* ORKTouchAbilityScrollContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollContentView.h; sourceTree = ""; }; - 511B8AFB293A78CF00049947 /* ORKTouchAbilityScrollContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollContentView.m; sourceTree = ""; }; - 511B8AFE293A78EF00049947 /* ORKTouchAbilityScrollTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollTrial.h; sourceTree = ""; }; - 511B8AFF293A78EF00049947 /* ORKTouchAbilityScrollTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollTrial.m; sourceTree = ""; }; - 511B8B02293A791B00049947 /* ORKTouchAbilityScrollResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollResult.h; sourceTree = ""; }; - 511B8B03293A791B00049947 /* ORKTouchAbilityScrollResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollResult.m; sourceTree = ""; }; - 511B8B07293A794D00049947 /* ORKTouchAbilityPinchStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchStep.m; sourceTree = ""; }; - 511B8B08293A794D00049947 /* ORKTouchAbilityPinchStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchStep.h; sourceTree = ""; }; - 511B8B0B293A795800049947 /* ORKTouchAbilityPinchStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchStepViewController.h; sourceTree = ""; }; - 511B8B0C293A795900049947 /* ORKTouchAbilityPinchStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchStepViewController.m; sourceTree = ""; }; - 511B8B0F293A796600049947 /* ORKTouchAbilityPinchContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchContentView.h; sourceTree = ""; }; - 511B8B10293A796600049947 /* ORKTouchAbilityPinchContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchContentView.m; sourceTree = ""; }; - 511B8B13293A797C00049947 /* ORKTouchAbilityPinchGuideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchGuideView.m; sourceTree = ""; }; - 511B8B14293A797C00049947 /* ORKTouchAbilityPinchGuideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchGuideView.h; sourceTree = ""; }; - 511B8B17293A798D00049947 /* ORKTouchAbilityPinchTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchTrial.h; sourceTree = ""; }; - 511B8B18293A798D00049947 /* ORKTouchAbilityPinchTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchTrial.m; sourceTree = ""; }; - 511B8B1B293A799800049947 /* ORKTouchAbilityPinchResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchResult.m; sourceTree = ""; }; - 511B8B1C293A799800049947 /* ORKTouchAbilityPinchResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchResult.h; sourceTree = ""; }; - 511B8B20293A79C000049947 /* ORKTouchAbilityRotationStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationStepViewController.m; sourceTree = ""; }; - 511B8B21293A79C000049947 /* ORKTouchAbilityRotationStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationStepViewController.h; sourceTree = ""; }; - 511B8B22293A79C000049947 /* ORKTouchAbilityRotationStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationStep.h; sourceTree = ""; }; - 511B8B23293A79C000049947 /* ORKTouchAbilityRotationStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationStep.m; sourceTree = ""; }; - 511B8B28293A79E400049947 /* ORKTouchAbilityRotationContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationContentView.h; sourceTree = ""; }; - 511B8B29293A79E400049947 /* ORKTouchAbilityRotationContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationContentView.m; sourceTree = ""; }; - 511B8B2C293A79FF00049947 /* ORKTouchAbilityRotationTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationTrial.m; sourceTree = ""; }; - 511B8B2D293A79FF00049947 /* ORKTouchAbilityRotationTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationTrial.h; sourceTree = ""; }; - 511B8B30293A7A0B00049947 /* ORKTouchAbilityRotationResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationResult.m; sourceTree = ""; }; - 511B8B31293A7A0B00049947 /* ORKTouchAbilityRotationResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationResult.h; sourceTree = ""; }; + 511BB022298DCCC200936EC0 /* ORKSpeechRecognitionStepViewController_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKSpeechRecognitionStepViewController_Private.h; sourceTree = ""; }; + 511E8D602995C20E00A384A5 /* ORKEnvironmentSPLMeterStepViewController_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKEnvironmentSPLMeterStepViewController_Private.h; sourceTree = ""; }; + 512741262B1557220045A449 /* ResearchKit.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = ResearchKit.docc; sourceTree = ""; }; 515310CD233570CF007BCA58 /* ORKDontKnowButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKDontKnowButton.h; sourceTree = ""; }; 515310CE233570CF007BCA58 /* ORKDontKnowButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKDontKnowButton.m; sourceTree = ""; }; + 5156C9C12B7E426900983535 /* ORKTouchAbilityArrowView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityArrowView.h; sourceTree = ""; }; + 5156C9C22B7E426900983535 /* ORKTouchAbilityContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityContentView.m; sourceTree = ""; }; + 5156C9C32B7E426900983535 /* ORKTouchAbilityContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityContentView.h; sourceTree = ""; }; + 5156C9C42B7E426900983535 /* ORKTouchAbilityArrowView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityArrowView.m; sourceTree = ""; }; + 5156C9CA2B7E42C100983535 /* ORKTouchAbilityTouchTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTouchTracker.h; sourceTree = ""; }; + 5156C9CB2B7E42C100983535 /* ORKTouchAbilityTrack_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrack_Internal.h; sourceTree = ""; }; + 5156C9CC2B7E42C100983535 /* ORKTouchAbilityGestureRecoginzerEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityGestureRecoginzerEvent.m; sourceTree = ""; }; + 5156C9CD2B7E42C100983535 /* ORKTouchAbilityTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTouch.h; sourceTree = ""; }; + 5156C9CE2B7E42C100983535 /* ORKTouchAbilityTrial_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrial_Internal.h; sourceTree = ""; }; + 5156C9CF2B7E42C100983535 /* ORKTouchAbilityTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrack.h; sourceTree = ""; }; + 5156C9D02B7E42C100983535 /* ORKTouchAbilityTouch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTouch.m; sourceTree = ""; }; + 5156C9D12B7E42C100983535 /* ORKTouchAbilityTouchTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTouchTracker.m; sourceTree = ""; }; + 5156C9D22B7E42C100983535 /* ORKTouchAbilityTrack.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTrack.m; sourceTree = ""; }; + 5156C9D32B7E42C200983535 /* ORKTouchAbilityTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTrial.h; sourceTree = ""; }; + 5156C9D42B7E42C200983535 /* ORKTouchAbilityTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTrial.m; sourceTree = ""; }; + 5156C9D52B7E42C200983535 /* ORKTouchAbilityGestureRecoginzerEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityGestureRecoginzerEvent.h; sourceTree = ""; }; + 5156C9E32B7E437A00983535 /* ORKTouchAbilityTapStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapStepViewController.h; sourceTree = ""; }; + 5156C9E42B7E437A00983535 /* ORKTouchAbilityTapStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapStepViewController.m; sourceTree = ""; }; + 5156C9E52B7E437A00983535 /* ORKTouchAbilityTapResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapResult.h; sourceTree = ""; }; + 5156C9E62B7E437A00983535 /* ORKTouchAbilityTapStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapStep.h; sourceTree = ""; }; + 5156C9E72B7E437A00983535 /* ORKTouchAbilityTapContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapContentView.m; sourceTree = ""; }; + 5156C9E82B7E437A00983535 /* ORKTouchAbilityTapContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapContentView.h; sourceTree = ""; }; + 5156C9E92B7E437A00983535 /* ORKTouchAbilityTapTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapTrial.m; sourceTree = ""; }; + 5156C9EA2B7E437A00983535 /* ORKTouchAbilityTapTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityTapTrial.h; sourceTree = ""; }; + 5156C9EB2B7E437A00983535 /* ORKTouchAbilityTapResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapResult.m; sourceTree = ""; }; + 5156C9EC2B7E437A00983535 /* ORKTouchAbilityTapStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityTapStep.m; sourceTree = ""; }; + 5156C9F82B7E440A00983535 /* ORKTouchAbilityLongPressTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressTrial.m; sourceTree = ""; }; + 5156C9F92B7E440A00983535 /* ORKTouchAbilityLongPressContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressContentView.m; sourceTree = ""; }; + 5156C9FA2B7E440A00983535 /* ORKTouchAbilityLongPressStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressStep.m; sourceTree = ""; }; + 5156C9FB2B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressStepViewController.h; sourceTree = ""; }; + 5156C9FC2B7E440A00983535 /* ORKTouchAbilityLongPressResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressResult.m; sourceTree = ""; }; + 5156C9FD2B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityLongPressStepViewController.m; sourceTree = ""; }; + 5156C9FE2B7E440A00983535 /* ORKTouchAbilityLongPressContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressContentView.h; sourceTree = ""; }; + 5156C9FF2B7E440A00983535 /* ORKTouchAbilityLongPressStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressStep.h; sourceTree = ""; }; + 5156CA002B7E440A00983535 /* ORKTouchAbilityLongPressTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressTrial.h; sourceTree = ""; }; + 5156CA012B7E440A00983535 /* ORKTouchAbilityLongPressResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityLongPressResult.h; sourceTree = ""; }; + 5156CA0D2B7E448600983535 /* ORKTouchAbilitySwipeContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeContentView.h; sourceTree = ""; }; + 5156CA0E2B7E448600983535 /* ORKTouchAbilitySwipeStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeStep.h; sourceTree = ""; }; + 5156CA0F2B7E448600983535 /* ORKTouchAbilitySwipeTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeTrial.h; sourceTree = ""; }; + 5156CA102B7E448600983535 /* ORKTouchAbilitySwipeStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeStep.m; sourceTree = ""; }; + 5156CA112B7E448600983535 /* ORKTouchAbilitySwipeContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeContentView.m; sourceTree = ""; }; + 5156CA122B7E448600983535 /* ORKTouchAbilitySwipeResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeResult.m; sourceTree = ""; }; + 5156CA132B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeStepViewController.m; sourceTree = ""; }; + 5156CA142B7E448600983535 /* ORKTouchAbilitySwipeResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeResult.h; sourceTree = ""; }; + 5156CA152B7E448600983535 /* ORKTouchAbilitySwipeTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilitySwipeTrial.m; sourceTree = ""; }; + 5156CA162B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilitySwipeStepViewController.h; sourceTree = ""; }; + 5156CA222B7E451B00983535 /* ORKTouchAbilityScrollStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollStep.h; sourceTree = ""; }; + 5156CA232B7E451B00983535 /* ORKTouchAbilityScrollContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollContentView.h; sourceTree = ""; }; + 5156CA242B7E451B00983535 /* ORKTouchAbilityScrollStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollStep.m; sourceTree = ""; }; + 5156CA252B7E451B00983535 /* ORKTouchAbilityScrollStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollStepViewController.h; sourceTree = ""; }; + 5156CA262B7E451B00983535 /* ORKTouchAbilityScrollStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollStepViewController.m; sourceTree = ""; }; + 5156CA272B7E451B00983535 /* ORKTouchAbilityScrollResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollResult.h; sourceTree = ""; }; + 5156CA282B7E451B00983535 /* ORKTouchAbilityScrollResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollResult.m; sourceTree = ""; }; + 5156CA292B7E451B00983535 /* ORKTouchAbilityScrollTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityScrollTrial.h; sourceTree = ""; }; + 5156CA2A2B7E451B00983535 /* ORKTouchAbilityScrollContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollContentView.m; sourceTree = ""; }; + 5156CA2B2B7E451C00983535 /* ORKTouchAbilityScrollTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityScrollTrial.m; sourceTree = ""; }; + 5156CA372B7E45AE00983535 /* ORKTouchAbilityPinchResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchResult.h; sourceTree = ""; }; + 5156CA382B7E45AE00983535 /* ORKTouchAbilityPinchTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchTrial.m; sourceTree = ""; }; + 5156CA392B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchGuideView.h; sourceTree = ""; }; + 5156CA3A2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchContentView.m; sourceTree = ""; }; + 5156CA3B2B7E45AE00983535 /* ORKTouchAbilityPinchStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchStep.h; sourceTree = ""; }; + 5156CA3C2B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchGuideView.m; sourceTree = ""; }; + 5156CA3D2B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchStepViewController.h; sourceTree = ""; }; + 5156CA3E2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchContentView.h; sourceTree = ""; }; + 5156CA3F2B7E45AE00983535 /* ORKTouchAbilityPinchResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchResult.m; sourceTree = ""; }; + 5156CA402B7E45AE00983535 /* ORKTouchAbilityPinchTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityPinchTrial.h; sourceTree = ""; }; + 5156CA412B7E45AE00983535 /* ORKTouchAbilityPinchStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchStep.m; sourceTree = ""; }; + 5156CA422B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityPinchStepViewController.m; sourceTree = ""; }; + 5156CA502B7E465400983535 /* ORKTouchAbilityRotationStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationStepViewController.h; sourceTree = ""; }; + 5156CA512B7E465400983535 /* ORKTouchAbilityRotationContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationContentView.m; sourceTree = ""; }; + 5156CA522B7E465500983535 /* ORKTouchAbilityRotationStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationStep.h; sourceTree = ""; }; + 5156CA532B7E465500983535 /* ORKTouchAbilityRotationResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationResult.m; sourceTree = ""; }; + 5156CA542B7E465500983535 /* ORKTouchAbilityRotationContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationContentView.h; sourceTree = ""; }; + 5156CA552B7E465500983535 /* ORKTouchAbilityRotationTrial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationTrial.h; sourceTree = ""; }; + 5156CA562B7E465500983535 /* ORKTouchAbilityRotationStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationStepViewController.m; sourceTree = ""; }; + 5156CA572B7E465500983535 /* ORKTouchAbilityRotationTrial.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationTrial.m; sourceTree = ""; }; + 5156CA582B7E465500983535 /* ORKTouchAbilityRotationStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTouchAbilityRotationStep.m; sourceTree = ""; }; + 5156CA592B7E465500983535 /* ORKTouchAbilityRotationResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTouchAbilityRotationResult.h; sourceTree = ""; }; 5166E49D247355D500151C57 /* ORKUSDZModelManagerResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKUSDZModelManagerResult.h; sourceTree = ""; }; 5166E49E247355D500151C57 /* ORKUSDZModelManagerResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKUSDZModelManagerResult.m; sourceTree = ""; }; 5170009B254A191F00CACE12 /* ORKRequestPermissionButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKRequestPermissionButton.h; sourceTree = ""; }; @@ -1296,48 +1384,140 @@ 517514512459EF5D009E8FFC /* ORK3DModelStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORK3DModelStepViewController.m; sourceTree = ""; }; 517514542459F0BE009E8FFC /* ORK3DModelStepContentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORK3DModelStepContentView.h; sourceTree = ""; }; 517514552459F0BE009E8FFC /* ORK3DModelStepContentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORK3DModelStepContentView.m; sourceTree = ""; }; - 5175145C245A4FF1009E8FFC /* ORKFrontFacingCameraStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKFrontFacingCameraStep.h; sourceTree = ""; }; - 5175145D245A4FF1009E8FFC /* ORKFrontFacingCameraStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKFrontFacingCameraStep.m; sourceTree = ""; }; 51751461245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKFrontFacingCameraStepViewController.h; sourceTree = ""; }; 51751462245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKFrontFacingCameraStepViewController.m; sourceTree = ""; }; 51751465245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKFrontFacingCameraStepContentView.h; sourceTree = ""; }; 51751466245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKFrontFacingCameraStepContentView.m; sourceTree = ""; }; - 5190141724759E6800E3A418 /* ORKFrontFacingCameraStepResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKFrontFacingCameraStepResult.h; sourceTree = ""; }; - 5190141824759E6800E3A418 /* ORKFrontFacingCameraStepResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKFrontFacingCameraStepResult.m; sourceTree = ""; }; - 51906C4D291D790700FF4185 /* ORKLandoltCStepContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKLandoltCStepContentView.swift; sourceTree = ""; }; - 51906C4E291D790700FF4185 /* ORKLandoltCStepViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKLandoltCStepViewController.swift; sourceTree = ""; }; - 51906C4F291D790700FF4185 /* ORKLandoltCStep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKLandoltCStep.swift; sourceTree = ""; }; - 51906C50291D790700FF4185 /* ORKLandoltCResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKLandoltCResult.swift; sourceTree = ""; }; - 51906C55291D791900FF4185 /* ExtensionModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExtensionModel.swift; sourceTree = ""; }; - 51906C58291D794400FF4185 /* TrackLayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TrackLayer.swift; sourceTree = ""; }; - 51906C5A291D796600FF4185 /* Math.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Math.swift; sourceTree = ""; }; - 51906C5B291D796600FF4185 /* CircleSlider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CircleSlider.swift; sourceTree = ""; }; - 51906C5C291D796600FF4185 /* EyeActivitySlider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EyeActivitySlider.swift; sourceTree = ""; }; - 51906C61291D7A5A00FF4185 /* ORKSwiftStroopStep.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKSwiftStroopStep.swift; sourceTree = ""; }; - 51906C62291D7A5A00FF4185 /* ORKSwiftStroopResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKSwiftStroopResult.swift; sourceTree = ""; }; - 51906C63291D7A5A00FF4185 /* ORKSwiftStroopContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKSwiftStroopContentView.swift; sourceTree = ""; }; - 51906C64291D7A5A00FF4185 /* ORKSwiftStroopStepViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKSwiftStroopStepViewController.swift; sourceTree = ""; }; + 5192BEE42AE043A2006E43FB /* ORKTimedWalkStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTimedWalkStep.h; sourceTree = ""; }; + 5192BEE52AE043A2006E43FB /* ORKTimedWalkStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTimedWalkStep.m; sourceTree = ""; }; + 5192BEE82AE043D3006E43FB /* ORKTimedWalkContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTimedWalkContentView.m; sourceTree = ""; }; + 5192BEE92AE043D3006E43FB /* ORKTimedWalkStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTimedWalkStepViewController.h; sourceTree = ""; }; + 5192BEEA2AE043D3006E43FB /* ORKTimedWalkContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTimedWalkContentView.h; sourceTree = ""; }; + 5192BEEB2AE043D3006E43FB /* ORKTimedWalkStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTimedWalkStepViewController.m; sourceTree = ""; }; + 5192BF4D2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKPredicateFormItemVisibilityRule.h; sourceTree = ""; }; + 5192BF4E2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKPredicateFormItemVisibilityRule.m; sourceTree = ""; }; + 5192BF4F2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKPredicateFormItemVisibilityRule_Private.h; sourceTree = ""; }; + 5192BF572AE09793006E43FB /* ORKFormItemVisibilityRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFormItemVisibilityRule.h; sourceTree = ""; }; + 5192BF582AE09794006E43FB /* ORKFormItemVisibilityRule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKFormItemVisibilityRule.m; sourceTree = ""; }; + 5192BF5C2AE19036006E43FB /* frequency_dBSPL_AIRPODSPROV2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = frequency_dBSPL_AIRPODSPROV2.plist; sourceTree = ""; }; + 5192BF7C2AE1A87D006E43FB /* retspl_AIRPODSPROV2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = retspl_AIRPODSPROV2.plist; sourceTree = ""; }; + 5192BF7E2AE1A9BA006E43FB /* volume_curve_AIRPODSPROV2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = volume_curve_AIRPODSPROV2.plist; sourceTree = ""; }; + 5192BF802AE1BA47006E43FB /* ORKFrontFacingCameraStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKFrontFacingCameraStep.h; path = ResearchKit/Common/ORKFrontFacingCameraStep.h; sourceTree = SOURCE_ROOT; }; + 5192BF812AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKFrontFacingCameraStepResult.m; path = ResearchKit/Common/ORKFrontFacingCameraStepResult.m; sourceTree = SOURCE_ROOT; }; + 5192BF822AE1BA47006E43FB /* ORKFrontFacingCameraStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKFrontFacingCameraStep.m; path = ResearchKit/Common/ORKFrontFacingCameraStep.m; sourceTree = SOURCE_ROOT; }; + 5192BF832AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKFrontFacingCameraStepResult.h; path = ResearchKit/Common/ORKFrontFacingCameraStepResult.h; sourceTree = SOURCE_ROOT; }; + 5192BF882AE1BBB0006E43FB /* ORKSecondaryTaskStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKSecondaryTaskStep.m; path = ResearchKit/Common/ORKSecondaryTaskStep.m; sourceTree = SOURCE_ROOT; }; + 5192BF892AE1BBB0006E43FB /* ORKSecondaryTaskStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKSecondaryTaskStep.h; path = ResearchKit/Common/ORKSecondaryTaskStep.h; sourceTree = SOURCE_ROOT; }; + 5192BF8D2AE1C051006E43FB /* ORKAgePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKAgePicker.h; sourceTree = ""; }; + 5192BF8E2AE1C051006E43FB /* ORKAgePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKAgePicker.m; sourceTree = ""; }; + 5192BF912AE1C2F7006E43FB /* ORKChoiceViewCell+ORKColorChoice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ORKChoiceViewCell+ORKColorChoice.h"; sourceTree = ""; }; + 5192BF922AE1C2F7006E43FB /* ORKChoiceViewCell+ORKColorChoice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ORKChoiceViewCell+ORKColorChoice.m"; sourceTree = ""; }; + 5192BF952AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ORKAnswerFormat+FormStepViewControllerAdditions.h"; sourceTree = ""; }; + 5192BF962AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "ORKAnswerFormat+FormStepViewControllerAdditions.m"; sourceTree = ""; }; + 5192BF9B2AE1DE62006E43FB /* ORKColorChoiceCellGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKColorChoiceCellGroup.m; sourceTree = ""; }; + 5192BF9C2AE1DE62006E43FB /* ORKColorChoiceCellGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKColorChoiceCellGroup.h; sourceTree = ""; }; 519C298026D027AB00FD5F44 /* SwiftUIViewFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIViewFactory.swift; sourceTree = ""; }; 519C298D26D027E500FD5F44 /* TextChoiceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextChoiceView.swift; sourceTree = ""; }; + 519CE8162C6582BD003BB584 /* ORKHealthCondition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKHealthCondition.m; sourceTree = ""; }; + 519CE8172C6582BD003BB584 /* ORKFamilyHistoryStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKFamilyHistoryStep.m; sourceTree = ""; }; + 519CE8182C6582BD003BB584 /* ORKHealthCondition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKHealthCondition.h; sourceTree = ""; }; + 519CE8192C6582BD003BB584 /* ORKFamilyHistoryResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFamilyHistoryResult.h; sourceTree = ""; }; + 519CE81A2C6582BD003BB584 /* ORKRelatedPerson.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKRelatedPerson.m; sourceTree = ""; }; + 519CE81B2C6582BD003BB584 /* ORKRelativeGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKRelativeGroup.h; sourceTree = ""; }; + 519CE81C2C6582BD003BB584 /* ORKRelativeGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKRelativeGroup.m; sourceTree = ""; }; + 519CE81D2C6582BE003BB584 /* ORKConditionStepConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKConditionStepConfiguration.m; sourceTree = ""; }; + 519CE81E2C6582BE003BB584 /* ORKConditionStepConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConditionStepConfiguration.h; sourceTree = ""; }; + 519CE81F2C6582BE003BB584 /* ORKFamilyHistoryStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFamilyHistoryStep.h; sourceTree = ""; }; + 519CE8202C6582BE003BB584 /* ORKRelatedPerson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKRelatedPerson.h; sourceTree = ""; }; + 519CE8212C6582BE003BB584 /* ORKFamilyHistoryResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKFamilyHistoryResult.m; sourceTree = ""; }; + 519CE8302C658617003BB584 /* ORKFamilyHistoryStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFamilyHistoryStepViewController.h; sourceTree = ""; }; + 519CE8332C658617003BB584 /* ORKFamilyHistoryStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKFamilyHistoryStepViewController.m; sourceTree = ""; }; + 519CE83B2C658653003BB584 /* ORKFamilyHistoryRelatedPersonCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFamilyHistoryRelatedPersonCell.h; sourceTree = ""; }; + 519CE83C2C658653003BB584 /* ORKFamilyHistoryRelatedPersonCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKFamilyHistoryRelatedPersonCell.m; sourceTree = ""; }; + 519CE83D2C658653003BB584 /* ORKFamilyHistoryTableFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFamilyHistoryTableFooterView.h; sourceTree = ""; }; + 519CE83E2C658654003BB584 /* ORKFamilyHistoryTableFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKFamilyHistoryTableFooterView.m; sourceTree = ""; }; + 519CE83F2C658654003BB584 /* ORKFamilyHistoryTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFamilyHistoryTableHeaderView.h; sourceTree = ""; }; + 519CE8402C658654003BB584 /* ORKFamilyHistoryTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKFamilyHistoryTableHeaderView.m; sourceTree = ""; }; + 519CE85B2C6AD858003BB584 /* ORKFamilyHistoryStepViewController_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFamilyHistoryStepViewController_Private.h; sourceTree = ""; }; + 519CE85E2C6BC1DB003BB584 /* ORKFamilyHistoryResultTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKFamilyHistoryResultTests.swift; sourceTree = ""; }; + 51A11F132BD08D5D0060C07E /* HKSample+ORKJSONDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HKSample+ORKJSONDictionary.h"; sourceTree = ""; }; + 51A11F142BD08D5D0060C07E /* CMMotionActivity+ORKJSONDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CMMotionActivity+ORKJSONDictionary.m"; sourceTree = ""; }; + 51A11F152BD08D5D0060C07E /* HKSample+ORKJSONDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HKSample+ORKJSONDictionary.m"; sourceTree = ""; }; + 51A11F162BD08D5E0060C07E /* CMMotionActivity+ORKJSONDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CMMotionActivity+ORKJSONDictionary.h"; sourceTree = ""; }; + 51A11F202BD152660060C07E /* ORKActiveStepCustomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKActiveStepCustomView.h; sourceTree = ""; }; + 51A11F212BD152660060C07E /* ORKActiveStepCustomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKActiveStepCustomView.m; sourceTree = ""; }; + 51AEAAA62B743FA500F4D107 /* ORKQuestionStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKQuestionStepViewController.m; sourceTree = ""; }; + 51AEAAA72B743FA500F4D107 /* ORKQuestionStepViewController_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStepViewController_Private.h; sourceTree = ""; }; + 51AEAAA82B743FA500F4D107 /* ORKQuestionStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStepViewController.h; sourceTree = ""; }; + 51AEAAAE2B7446F400F4D107 /* ORKQuestionStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStepView.h; sourceTree = ""; }; + 51AEAAAF2B7446F400F4D107 /* ORKQuestionStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKQuestionStepView.m; sourceTree = ""; }; + 51AF19522B583BB900D3B399 /* ORKESerialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKESerialization.h; sourceTree = ""; }; + 51AF19532B583BB900D3B399 /* ORKDataCollectionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKDataCollectionTests.m; sourceTree = ""; }; + 51AF19542B583BB900D3B399 /* samples.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = samples.bundle; sourceTree = ""; }; + 51AF19552B583BB900D3B399 /* ORKESerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKESerialization.m; sourceTree = ""; }; + 51AF19562B583BBA00D3B399 /* ORKJSONSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKJSONSerializationTests.m; sourceTree = ""; }; + 51AF1B132B67F30500D3B399 /* ORKSignatureFormatter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKSignatureFormatter.h; sourceTree = ""; }; + 51AF1B142B67F30500D3B399 /* ORKSignatureFormatter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKSignatureFormatter.m; sourceTree = ""; }; + 51AF1B1F2B683C3400D3B399 /* ORKWebViewStepResult_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKWebViewStepResult_Private.h; sourceTree = ""; }; + 51AF1B212B69803A00D3B399 /* Window.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Window.wav; sourceTree = ""; }; + 51AF1B222B69803A00D3B399 /* Noise.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Noise.wav; sourceTree = ""; }; + 51B76DFA2CB5B5A30061698A /* ResearchKitActiveTask.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = ResearchKitActiveTask.docc; sourceTree = ""; }; + 51B76DFC2CB5C73C0061698A /* ResearchKitUI.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = ResearchKitUI.docc; sourceTree = ""; }; + 51B94DBC2B311E810039B0E7 /* CLLocationManager+ResearchKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CLLocationManager+ResearchKit.h"; sourceTree = ""; }; + 51B94DC62B3254FD0039B0E7 /* CLLocationManager+ResearchKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CLLocationManager+ResearchKit.m"; sourceTree = ""; }; 51BF30BC247B330900E2E669 /* ORKIconButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKIconButton.h; sourceTree = ""; }; 51BF30BD247B330900E2E669 /* ORKIconButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKIconButton.m; sourceTree = ""; }; + 51CB80D52AFEBE7E00A1F410 /* ORKFormStepViewControllerConditionalFormItemsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKFormStepViewControllerConditionalFormItemsTests.swift; sourceTree = ""; }; + 51CB80D72AFEBEC600A1F410 /* ORKPredicateFormItemVisibilityRuleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKPredicateFormItemVisibilityRuleTests.swift; sourceTree = ""; }; + 51CB80D92AFEBF3800A1F410 /* ORKFormItemVisibilityRuleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKFormItemVisibilityRuleTests.swift; sourceTree = ""; }; + 51CB80DB2AFEBF7A00A1F410 /* ORKFormStepViewController+TestingSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ORKFormStepViewController+TestingSupport.h"; sourceTree = ""; }; 51D823032472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKRequestPermissionsStepContainerView.h; sourceTree = ""; }; 51D823042472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKRequestPermissionsStepContainerView.m; sourceTree = ""; }; - 51DB3847293E811C0089C82C /* ResearchKit_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResearchKit_Private.h; sourceTree = ""; }; 51E03D6124919711008F8406 /* ORKPermissionType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKPermissionType.h; sourceTree = ""; }; 51E03D6224919711008F8406 /* ORKPermissionType.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKPermissionType.m; sourceTree = ""; }; 51E03D662491A601008F8406 /* ORKHealthKitPermissionType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKHealthKitPermissionType.h; sourceTree = ""; }; 51E03D672491A601008F8406 /* ORKHealthKitPermissionType.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKHealthKitPermissionType.m; sourceTree = ""; }; 51E03D6B2491B6DB008F8406 /* ORKRequestPermissionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKRequestPermissionView.h; sourceTree = ""; }; 51E03D6C2491B6DB008F8406 /* ORKRequestPermissionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKRequestPermissionView.m; sourceTree = ""; }; + 51EB9A512B8408D50064A515 /* ORKInstructionStepHTMLFormatter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKInstructionStepHTMLFormatter.h; sourceTree = ""; }; + 51EB9A522B8408D50064A515 /* ORKInstructionStepHTMLFormatter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKInstructionStepHTMLFormatter.m; sourceTree = ""; }; + 51EB9A5D2B8D3BA70064A515 /* ORKInstructionStepHTMLFormatterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKInstructionStepHTMLFormatterTests.m; sourceTree = ""; }; + 51F716B7297E288900D8ACF7 /* ORKNormalizedReactionTimeStimulusView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKNormalizedReactionTimeStimulusView.m; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStimulusView.m"; sourceTree = SOURCE_ROOT; }; + 51F716B8297E288900D8ACF7 /* ORKNormalizedReactionTimeStimulusView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKNormalizedReactionTimeStimulusView.h; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStimulusView.h"; sourceTree = SOURCE_ROOT; }; + 51F716B9297E288900D8ACF7 /* ORKNormalizedReactionTimeContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKNormalizedReactionTimeContentView.m; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.m"; sourceTree = SOURCE_ROOT; }; + 51F716BA297E288900D8ACF7 /* ORKNormalizedReactionTimeStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKNormalizedReactionTimeStep.h; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStep.h"; sourceTree = SOURCE_ROOT; }; + 51F716BB297E288900D8ACF7 /* ORKNormalizedReactionTimeResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKNormalizedReactionTimeResult.h; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.h"; sourceTree = SOURCE_ROOT; }; + 51F716BC297E288900D8ACF7 /* ORKNormalizedReactionTimeResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKNormalizedReactionTimeResult.m; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.m"; sourceTree = SOURCE_ROOT; }; + 51F716BD297E288900D8ACF7 /* ORKNormalizedReactionTimeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKNormalizedReactionTimeViewController.m; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.m"; sourceTree = SOURCE_ROOT; }; + 51F716BE297E288900D8ACF7 /* ORKNormalizedReactionTimeStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKNormalizedReactionTimeStep.m; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStep.m"; sourceTree = SOURCE_ROOT; }; + 51F716BF297E288A00D8ACF7 /* ORKNormalizedReactionTimeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKNormalizedReactionTimeViewController.h; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.h"; sourceTree = SOURCE_ROOT; }; + 51F716C0297E288A00D8ACF7 /* ORKNormalizedReactionTimeContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKNormalizedReactionTimeContentView.h; path = "ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.h"; sourceTree = SOURCE_ROOT; }; + 51F716CD297E2CB600D8ACF7 /* ORKConsentLearnMoreViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKConsentLearnMoreViewController.h; path = ResearchKitUI/Stale/ORKConsentLearnMoreViewController.h; sourceTree = SOURCE_ROOT; }; + 51F716CE297E2CB600D8ACF7 /* ORKConsentLearnMoreViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKConsentLearnMoreViewController.m; path = ResearchKitUI/Stale/ORKConsentLearnMoreViewController.m; sourceTree = SOURCE_ROOT; }; + 51F716E82981AF1200D8ACF7 /* ORKSpeechInNoiseStepViewController_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKSpeechInNoiseStepViewController_Private.h; sourceTree = ""; }; + 51FBAC572BC85C7A009CA28F /* ResearchKit_Private.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = ResearchKit_Private.modulemap; sourceTree = ""; }; + 51FBAC582BC86E6E009CA28F /* ResearchKitUI_Private.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = ResearchKitUI_Private.modulemap; sourceTree = ""; }; + 51FBAC592BC998D8009CA28F /* ResearchKitActiveTask_Private.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = ResearchKitActiveTask_Private.modulemap; sourceTree = ""; }; + 51FBAC5C2BC9CE4A009CA28F /* ORKBorderedButton_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKBorderedButton_Internal.h; sourceTree = ""; }; + 51FBAC7D2BC9EBA7009CA28F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5D000EC22620F27100E5442A /* ResearchKit-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKit-Debug.xcconfig"; sourceTree = ""; }; 5D000EC42620F27100E5442A /* ResearchKit-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKit-Shared.xcconfig"; sourceTree = ""; }; + 5D000EC62620F27100E5442A /* ResearchKit-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKit-Release.xcconfig"; sourceTree = ""; }; + 5D000ECA2620F27100E5442A /* docs-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "docs-Shared.xcconfig"; sourceTree = ""; }; + 5D000ECC2620F27100E5442A /* Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Release.xcconfig"; sourceTree = ""; }; + 5D000ECE2620F27100E5442A /* Project-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Shared.xcconfig"; sourceTree = ""; }; + 5D000ED12620F27100E5442A /* Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Debug.xcconfig"; sourceTree = ""; }; + 5D000ED52620F27100E5442A /* ResearchKitTests-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKitTests-Release.xcconfig"; sourceTree = ""; }; + 5D000ED62620F27100E5442A /* ResearchKitTests-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKitTests-Shared.xcconfig"; sourceTree = ""; }; + 5D000ED72620F27100E5442A /* ResearchKitTests-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKitTests-Debug.xcconfig"; sourceTree = ""; }; 5D003D9F26377E7400A6439B /* ORKAccuracyStroopResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKAccuracyStroopResult.h; sourceTree = ""; }; 5D003DA026377E7400A6439B /* ORKAccuracyStroopResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKAccuracyStroopResult.m; sourceTree = ""; }; 5D04884B25EF4CC30006C68B /* ORKQuestionStep_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStep_Private.h; sourceTree = ""; }; 5D04885525F19A7A0006C68B /* ORKDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKDevice.h; sourceTree = ""; }; 5D04885625F19A7A0006C68B /* ORKDevice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKDevice.m; sourceTree = ""; }; 5D04885B25F1B3AB0006C68B /* ORKDevice_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKDevice_Private.h; sourceTree = ""; }; + 5D06632F24FEF272005D9B40 /* ResearchKitUI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResearchKitUI.h; sourceTree = ""; }; + 5D06633024FEF272005D9B40 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5D1CE45823FC85F3004CB416 /* ORKAudioMeteringView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKAudioMeteringView.h; sourceTree = ""; }; 5D1CE45923FC85F4004CB416 /* ORKAudioMeteringView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKAudioMeteringView.m; sourceTree = ""; }; 5D26E77724997EA200E53D27 /* ORK3DModelManager_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORK3DModelManager_Internal.h; sourceTree = ""; }; @@ -1350,6 +1530,7 @@ 5D5880372410394E005B3D91 /* ORKSpeechInNoiseResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKSpeechInNoiseResult.h; sourceTree = ""; }; 5D5880382410394E005B3D91 /* ORKSpeechInNoiseResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKSpeechInNoiseResult.m; sourceTree = ""; }; 5DABE5AD24DA16E600570C57 /* ResearchKit_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResearchKit_Prefix.pch; sourceTree = ""; }; + 5E6AB7DE2BC86900009ED0D5 /* ORKTaskViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKTaskViewControllerTests.swift; sourceTree = ""; }; 6146D0A11B84A91E0068491D /* ORKGraphChartAccessibilityElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKGraphChartAccessibilityElement.h; sourceTree = ""; }; 6146D0A21B84A91E0068491D /* ORKGraphChartAccessibilityElement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKGraphChartAccessibilityElement.m; sourceTree = ""; }; 618DA0481A93D0D600E63AA8 /* ORKAccessibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKAccessibility.h; sourceTree = ""; }; @@ -1357,11 +1538,7 @@ 618DA04A1A93D0D600E63AA8 /* ORKAccessibilityFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKAccessibilityFunctions.m; sourceTree = ""; }; 618DA04B1A93D0D600E63AA8 /* UIView+ORKAccessibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "UIView+ORKAccessibility.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 618DA04C1A93D0D600E63AA8 /* UIView+ORKAccessibility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "UIView+ORKAccessibility.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 62DF9F4428CA87D300D13018 /* retspl_AIRPODSPROV2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = retspl_AIRPODSPROV2.plist; sourceTree = ""; }; - 62DF9F4628CA87DE00D13018 /* frequency_dBSPL_AIRPODSPROV2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = frequency_dBSPL_AIRPODSPROV2.plist; sourceTree = ""; }; - 62DF9F4828CA87E800D13018 /* volume_curve_AIRPODSPROV2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = volume_curve_AIRPODSPROV2.plist; sourceTree = ""; }; - 7118AC5920BF6A0000D7A6BB /* Noise.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Noise.wav; sourceTree = ""; }; - 7118AC5B20BF6A1200D7A6BB /* Window.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Window.wav; sourceTree = ""; }; + 6227743F2C5CF7DC00F2E741 /* retspl_dBFS_AIRPODSPROV2.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = retspl_dBFS_AIRPODSPROV2.plist; sourceTree = ""; }; 7118AC6020BF6A3900D7A6BB /* Sentence7.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Sentence7.wav; sourceTree = ""; }; 7118AC6120BF6A3A00D7A6BB /* Sentence4.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Sentence4.wav; sourceTree = ""; }; 7118AC6220BF6A3A00D7A6BB /* Sentence6.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = Sentence6.wav; sourceTree = ""; }; @@ -1383,20 +1560,20 @@ 7167D027231B1EAA00AAB4DD /* ORKFormStep_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKFormStep_Internal.h; sourceTree = ""; }; 716B126220A78C6B00590264 /* ORKEnvironmentSPLMeterResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKEnvironmentSPLMeterResult.h; sourceTree = ""; }; 716B126320A78C6B00590264 /* ORKEnvironmentSPLMeterResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKEnvironmentSPLMeterResult.m; sourceTree = ""; }; - 716B126620A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKdBHLToneAudiometryAudioGenerator.h; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.h; sourceTree = ""; }; - 716B126720A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKdBHLToneAudiometryAudioGenerator.m; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.m; sourceTree = ""; }; - 71769E2720880C4500A19914 /* ORKdBHLToneAudiometryResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKdBHLToneAudiometryResult.h; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryResult.h; sourceTree = ""; }; - 71769E2820880C4500A19914 /* ORKdBHLToneAudiometryResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKdBHLToneAudiometryResult.m; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryResult.m; sourceTree = ""; }; - 71769E2B208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKdBHLToneAudiometryOnboardingStep.h; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStep.h; sourceTree = ""; }; - 71769E2C208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKdBHLToneAudiometryOnboardingStep.m; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStep.m; sourceTree = ""; }; - 71769E2F2088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKdBHLToneAudiometryOnboardingStepViewController.h; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.h; sourceTree = ""; }; - 71769E302088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKdBHLToneAudiometryOnboardingStepViewController.m; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.m; sourceTree = ""; }; - 71769E332088291B00A19914 /* ORKdBHLToneAudiometryContentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKdBHLToneAudiometryContentView.h; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.h; sourceTree = ""; }; - 71769E342088291B00A19914 /* ORKdBHLToneAudiometryContentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKdBHLToneAudiometryContentView.m; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.m; sourceTree = ""; }; - 71769E3720882CED00A19914 /* ORKdBHLToneAudiometryStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKdBHLToneAudiometryStep.h; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.h; sourceTree = ""; }; - 71769E3820882CED00A19914 /* ORKdBHLToneAudiometryStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKdBHLToneAudiometryStep.m; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.m; sourceTree = ""; }; - 71769E3B20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ORKdBHLToneAudiometryStepViewController.h; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.h; sourceTree = ""; }; - 71769E3C20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ORKdBHLToneAudiometryStepViewController.m; path = ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.m; sourceTree = ""; }; + 716B126620A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKdBHLToneAudiometryAudioGenerator.h; sourceTree = ""; }; + 716B126720A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKdBHLToneAudiometryAudioGenerator.m; sourceTree = ""; }; + 71769E2720880C4500A19914 /* ORKdBHLToneAudiometryResult.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKdBHLToneAudiometryResult.h; sourceTree = ""; }; + 71769E2820880C4500A19914 /* ORKdBHLToneAudiometryResult.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKdBHLToneAudiometryResult.m; sourceTree = ""; }; + 71769E2B208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKdBHLToneAudiometryOnboardingStep.h; sourceTree = ""; }; + 71769E2C208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKdBHLToneAudiometryOnboardingStep.m; sourceTree = ""; }; + 71769E2F2088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKdBHLToneAudiometryOnboardingStepViewController.h; sourceTree = ""; }; + 71769E302088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKdBHLToneAudiometryOnboardingStepViewController.m; sourceTree = ""; }; + 71769E332088291B00A19914 /* ORKdBHLToneAudiometryContentView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKdBHLToneAudiometryContentView.h; sourceTree = ""; }; + 71769E342088291B00A19914 /* ORKdBHLToneAudiometryContentView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKdBHLToneAudiometryContentView.m; sourceTree = ""; }; + 71769E3720882CED00A19914 /* ORKdBHLToneAudiometryStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKdBHLToneAudiometryStep.h; sourceTree = ""; }; + 71769E3820882CED00A19914 /* ORKdBHLToneAudiometryStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKdBHLToneAudiometryStep.m; sourceTree = ""; }; + 71769E3B20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKdBHLToneAudiometryStepViewController.h; sourceTree = ""; }; + 71769E3C20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKdBHLToneAudiometryStepViewController.m; sourceTree = ""; }; 71B7B4D420AA91D300C5768A /* retspl_AIRPODS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = retspl_AIRPODS.plist; sourceTree = ""; }; 71B7B4D820AA91D400C5768A /* frequency_dBSPL_AIRPODS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = frequency_dBSPL_AIRPODS.plist; sourceTree = ""; }; 71B7B4D920AA91D400C5768A /* volume_curve_AIRPODS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = volume_curve_AIRPODS.plist; sourceTree = ""; }; @@ -1428,12 +1605,6 @@ 861D11AC1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKChoiceAnswerFormatHelper.m; sourceTree = ""; }; 861D11B31AA7D073003C98A7 /* ORKTextChoiceCellGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTextChoiceCellGroup.h; sourceTree = ""; }; 861D11B41AA7D073003C98A7 /* ORKTextChoiceCellGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKTextChoiceCellGroup.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 861D2AE61B840991008C4CD0 /* ORKTimedWalkStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKTimedWalkStep.h; path = ResearchKit/ActiveTasks/ORKTimedWalkStep.h; sourceTree = SOURCE_ROOT; }; - 861D2AE71B840991008C4CD0 /* ORKTimedWalkStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKTimedWalkStep.m; path = ResearchKit/ActiveTasks/ORKTimedWalkStep.m; sourceTree = SOURCE_ROOT; }; - 861D2AEA1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKTimedWalkStepViewController.h; path = ResearchKit/ActiveTasks/ORKTimedWalkStepViewController.h; sourceTree = SOURCE_ROOT; }; - 861D2AEB1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKTimedWalkStepViewController.m; path = ResearchKit/ActiveTasks/ORKTimedWalkStepViewController.m; sourceTree = SOURCE_ROOT; }; - 861D2AEE1B8409D9008C4CD0 /* ORKTimedWalkContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKTimedWalkContentView.h; path = ResearchKit/ActiveTasks/ORKTimedWalkContentView.h; sourceTree = SOURCE_ROOT; }; - 861D2AEF1B8409D9008C4CD0 /* ORKTimedWalkContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKTimedWalkContentView.m; path = ResearchKit/ActiveTasks/ORKTimedWalkContentView.m; sourceTree = SOURCE_ROOT; }; 865EA1601AB8DF750037C68E /* ORKDateTimePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKDateTimePicker.h; sourceTree = ""; }; 865EA1611AB8DF750037C68E /* ORKDateTimePicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKDateTimePicker.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 865EA1661ABA1AA10037C68E /* ORKPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKPicker.h; sourceTree = ""; }; @@ -1456,10 +1627,8 @@ 86AD91081AB7AD1E00361FEB /* ORKNavigationContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKNavigationContainerView.h; sourceTree = ""; }; 86AD91091AB7AD1E00361FEB /* ORKNavigationContainerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKNavigationContainerView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86AD910C1AB7AE4100361FEB /* ORKNavigationContainerView_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKNavigationContainerView_Internal.h; sourceTree = ""; }; - 86AD910E1AB7B8A600361FEB /* ORKActiveStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKActiveStepView.h; path = ../Common/ORKActiveStepView.h; sourceTree = ""; }; - 86AD910F1AB7B8A600361FEB /* ORKActiveStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ORKActiveStepView.m; path = ../Common/ORKActiveStepView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 86AD91121AB7B97E00361FEB /* ORKQuestionStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStepView.h; sourceTree = ""; }; - 86AD91131AB7B97E00361FEB /* ORKQuestionStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKQuestionStepView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 86AD910E1AB7B8A600361FEB /* ORKActiveStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKActiveStepView.h; sourceTree = ""; }; + 86AD910F1AB7B8A600361FEB /* ORKActiveStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKActiveStepView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86B781B71AA668ED00688151 /* ORKTimeIntervalPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTimeIntervalPicker.h; sourceTree = ""; }; 86B781B81AA668ED00688151 /* ORKTimeIntervalPicker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTimeIntervalPicker.m; sourceTree = ""; }; 86B781B91AA668ED00688151 /* ORKValuePicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKValuePicker.h; sourceTree = ""; }; @@ -1513,12 +1682,8 @@ 86C40B251A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "CMAccelerometerData+ORKJSONDictionary.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40B261A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "CMDeviceMotion+ORKJSONDictionary.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 86C40B271A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "CMDeviceMotion+ORKJSONDictionary.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 86C40B281A8D7C5B00081FAC /* CMMotionActivity+ORKJSONDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "CMMotionActivity+ORKJSONDictionary.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 86C40B291A8D7C5B00081FAC /* CMMotionActivity+ORKJSONDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "CMMotionActivity+ORKJSONDictionary.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40B2A1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "CMPedometerData+ORKJSONDictionary.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 86C40B2B1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "CMPedometerData+ORKJSONDictionary.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 86C40B2C1A8D7C5B00081FAC /* HKSample+ORKJSONDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "HKSample+ORKJSONDictionary.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 86C40B2D1A8D7C5B00081FAC /* HKSample+ORKJSONDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "HKSample+ORKJSONDictionary.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40B2E1A8D7C5B00081FAC /* ORKAccelerometerRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ORKAccelerometerRecorder.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 86C40B2F1A8D7C5B00081FAC /* ORKAccelerometerRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKAccelerometerRecorder.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40B301A8D7C5B00081FAC /* ORKActiveStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKActiveStep.h; sourceTree = ""; }; @@ -1561,8 +1726,6 @@ 86C40B571A8D7C5B00081FAC /* ORKFormItemCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKFormItemCell.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40B581A8D7C5B00081FAC /* ORKImageSelectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKImageSelectionView.h; sourceTree = ""; }; 86C40B591A8D7C5B00081FAC /* ORKImageSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKImageSelectionView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 86C40B5A1A8D7C5B00081FAC /* ORKInstructionStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKInstructionStepView.h; sourceTree = ""; }; - 86C40B5B1A8D7C5B00081FAC /* ORKInstructionStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKInstructionStepView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40B5C1A8D7C5B00081FAC /* ORKTableContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTableContainerView.h; sourceTree = ""; }; 86C40B5D1A8D7C5B00081FAC /* ORKTableContainerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKTableContainerView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40B5E1A8D7C5B00081FAC /* ORKTextFieldView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTextFieldView.h; sourceTree = ""; }; @@ -1590,7 +1753,6 @@ 86C40B761A8D7C5C00081FAC /* ORKCountdownLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKCountdownLabel.m; sourceTree = ""; }; 86C40B771A8D7C5C00081FAC /* ORKCustomStepView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKCustomStepView.h; sourceTree = ""; }; 86C40B781A8D7C5C00081FAC /* ORKCustomStepView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKCustomStepView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 86C40B791A8D7C5C00081FAC /* ORKCustomStepView_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKCustomStepView_Internal.h; sourceTree = ""; }; 86C40B7A1A8D7C5C00081FAC /* ORKDefaultFont.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKDefaultFont.h; sourceTree = ""; }; 86C40B7B1A8D7C5C00081FAC /* ORKDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKDefines.h; sourceTree = ""; }; 86C40B7C1A8D7C5C00081FAC /* ORKHelpers_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKHelpers_Private.h; sourceTree = ""; }; @@ -1627,9 +1789,6 @@ 86C40BA11A8D7C5C00081FAC /* ORKQuestionStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStep.h; sourceTree = ""; }; 86C40BA21A8D7C5C00081FAC /* ORKQuestionStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKQuestionStep.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40BA31A8D7C5C00081FAC /* ORKQuestionStep_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStep_Internal.h; sourceTree = ""; }; - 86C40BA41A8D7C5C00081FAC /* ORKQuestionStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStepViewController.h; sourceTree = ""; }; - 86C40BA51A8D7C5C00081FAC /* ORKQuestionStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKQuestionStepViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 86C40BA61A8D7C5C00081FAC /* ORKQuestionStepViewController_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKQuestionStepViewController_Private.h; sourceTree = ""; }; 86C40BA71A8D7C5C00081FAC /* ORKResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKResult.h; sourceTree = ""; }; 86C40BA81A8D7C5C00081FAC /* ORKResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKResult.m; sourceTree = ""; }; 86C40BA91A8D7C5C00081FAC /* ORKResult_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKResult_Private.h; sourceTree = ""; }; @@ -1688,13 +1847,9 @@ 86C40BED1A8D7C5C00081FAC /* ORKConsentReviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKConsentReviewController.m; sourceTree = ""; }; 86C40BEE1A8D7C5C00081FAC /* ORKSignatureStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKSignatureStepViewController.h; sourceTree = ""; }; 86C40BEF1A8D7C5C00081FAC /* ORKSignatureStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKSignatureStepViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 86C40BF01A8D7C5C00081FAC /* MovieTintShader.fsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = MovieTintShader.fsh; sourceTree = ""; }; - 86C40BF11A8D7C5C00081FAC /* MovieTintShader.vsh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = MovieTintShader.vsh; sourceTree = ""; }; 86C40BF21A8D7C5C00081FAC /* ORKConsentDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentDocument.h; sourceTree = ""; }; 86C40BF31A8D7C5C00081FAC /* ORKConsentDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKConsentDocument.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40BF41A8D7C5C00081FAC /* ORKConsentDocument_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ORKConsentDocument_Internal.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 86C40BF51A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentLearnMoreViewController.h; sourceTree = ""; }; - 86C40BF61A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKConsentLearnMoreViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40BF71A8D7C5C00081FAC /* ORKConsentReviewStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentReviewStep.h; sourceTree = ""; }; 86C40BF81A8D7C5C00081FAC /* ORKConsentReviewStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKConsentReviewStep.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 86C40BF91A8D7C5C00081FAC /* ORKConsentReviewStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentReviewStepViewController.h; sourceTree = ""; }; @@ -1704,8 +1859,6 @@ 86C40C011A8D7C5C00081FAC /* ORKConsentSection_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentSection_Private.h; sourceTree = ""; }; 86C40C021A8D7C5C00081FAC /* ORKConsentSignature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentSignature.h; sourceTree = ""; }; 86C40C031A8D7C5C00081FAC /* ORKConsentSignature.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKConsentSignature.m; sourceTree = ""; }; - 86C40C051A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKEAGLMoviePlayerView.h; sourceTree = ""; }; - 86C40C061A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKEAGLMoviePlayerView.m; sourceTree = ""; }; 86C40C071A8D7C5C00081FAC /* ORKSignatureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKSignatureView.h; sourceTree = ""; }; 86C40C081A8D7C5C00081FAC /* ORKSignatureView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKSignatureView.m; sourceTree = ""; }; 86C40C101A8D7C5C00081FAC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1750,25 +1903,10 @@ B11C54971A9EEF8800265E61 /* ORKConsentSharingStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKConsentSharingStep.m; sourceTree = ""; }; B11C549C1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentSharingStepViewController.h; sourceTree = ""; }; B11C549D1A9EF4A700265E61 /* ORKConsentSharingStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ORKConsentSharingStepViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - B11DF3B31AA109C8009E76D2 /* AppledocSettings.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = AppledocSettings.plist; sourceTree = ""; }; B11DF4C21AA10D70009E76D2 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/ResearchKit.strings; sourceTree = ""; }; B14660481AA10DD7002F95C2 /* zh_TW */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; name = zh_TW; path = zh_TW.lproj/ResearchKit.strings; sourceTree = ""; }; B183A5951A8535D100C76870 /* ResearchKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ResearchKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B18AABE01A9F08D9003871B5 /* ResearchKit.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = ResearchKit.modulemap; sourceTree = ""; }; - B1A860DB1A9693C400EA57B7 /* consent_01@2x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_01@2x.m4v"; sourceTree = ""; }; - B1A860DC1A9693C400EA57B7 /* consent_02@2x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_02@2x.m4v"; sourceTree = ""; }; - B1A860DD1A9693C400EA57B7 /* consent_03@2x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_03@2x.m4v"; sourceTree = ""; }; - B1A860DE1A9693C400EA57B7 /* consent_04@2x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_04@2x.m4v"; sourceTree = ""; }; - B1A860DF1A9693C400EA57B7 /* consent_05@2x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_05@2x.m4v"; sourceTree = ""; }; - B1A860E01A9693C400EA57B7 /* consent_06@2x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_06@2x.m4v"; sourceTree = ""; }; - B1A860E11A9693C400EA57B7 /* consent_07@2x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_07@2x.m4v"; sourceTree = ""; }; - B1A860E31A9693C400EA57B7 /* consent_01@3x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_01@3x.m4v"; sourceTree = ""; }; - B1A860E41A9693C400EA57B7 /* consent_02@3x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_02@3x.m4v"; sourceTree = ""; }; - B1A860E51A9693C400EA57B7 /* consent_03@3x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_03@3x.m4v"; sourceTree = ""; }; - B1A860E61A9693C400EA57B7 /* consent_04@3x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_04@3x.m4v"; sourceTree = ""; }; - B1A860E71A9693C400EA57B7 /* consent_05@3x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_05@3x.m4v"; sourceTree = ""; }; - B1A860E81A9693C400EA57B7 /* consent_06@3x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_06@3x.m4v"; sourceTree = ""; }; - B1A860E91A9693C400EA57B7 /* consent_07@3x.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = "consent_07@3x.m4v"; sourceTree = ""; }; B1B349E41AA10DED005FAD66 /* zh_HK */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; name = zh_HK; path = zh_HK.lproj/ResearchKit.strings; sourceTree = ""; }; B1B349E51AA10DF8005FAD66 /* zh_CN */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; name = zh_CN; path = zh_CN.lproj/ResearchKit.strings; sourceTree = ""; }; B1B349E61AA10E02005FAD66 /* vi */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; name = vi; path = vi.lproj/ResearchKit.strings; sourceTree = ""; }; @@ -1803,6 +1941,7 @@ B1B34A041AA10EDA005FAD66 /* cs */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; name = cs; path = cs.lproj/ResearchKit.strings; sourceTree = ""; }; B1B34A051AA10EDF005FAD66 /* ca */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; name = ca; path = ca.lproj/ResearchKit.strings; sourceTree = ""; }; B1B34A061AA10EE4005FAD66 /* ar */ = {isa = PBXFileReference; explicitFileType = text.plist.strings; name = ar; path = ar.lproj/ResearchKit.strings; sourceTree = ""; }; + B1B894391A00345200C5CF2D /* ResearchKit_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ResearchKit_Private.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; B1C0F4E21A9BA65F0022C153 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ResearchKit.strings; sourceTree = ""; }; B1C1DE4F196F541F00F75544 /* ResearchKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResearchKit.h; sourceTree = ""; }; B1C7955D1A9FBF04007279BA /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; @@ -1840,8 +1979,6 @@ BA8078F2224AC8AA0013B554 /* ORKStepContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKStepContainerView.m; sourceTree = ""; }; BA87E26B20A79FA100B375A9 /* ORKRingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKRingView.h; sourceTree = ""; }; BA87E26C20A79FA100B375A9 /* ORKRingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKRingView.m; sourceTree = ""; }; - BA8C066922ECF7C200ACDE6B /* ORKSecondaryTaskStep.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKSecondaryTaskStep.h; sourceTree = ""; }; - BA8C066A22ECF7C200ACDE6B /* ORKSecondaryTaskStep.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKSecondaryTaskStep.m; sourceTree = ""; }; BA8C066D22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKSecondaryTaskStepViewController.h; sourceTree = ""; }; BA8C066E22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKSecondaryTaskStepViewController.m; sourceTree = ""; }; BA8C067622EEB84B00ACDE6B /* ORKPlaybackButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKPlaybackButton.h; sourceTree = ""; }; @@ -1897,10 +2034,7 @@ BC37323522B76DC70021F665 /* ORKFormStepViewController_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKFormStepViewController_Private.h; sourceTree = ""; }; BC4194271AE8453A00073D6B /* ORKObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKObserver.h; sourceTree = ""; }; BC4194281AE8453A00073D6B /* ORKObserver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKObserver.m; sourceTree = ""; }; - BC4A213D1C85FC0000BFC271 /* ORKBarGraphChartView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKBarGraphChartView.h; path = Charts/ORKBarGraphChartView.h; sourceTree = ""; }; - BC4A213E1C85FC0000BFC271 /* ORKBarGraphChartView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKBarGraphChartView.m; path = Charts/ORKBarGraphChartView.m; sourceTree = ""; }; - BC5FAF821C6901A200057CF1 /* ORKChartTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKChartTypes.h; path = Charts/ORKChartTypes.h; sourceTree = ""; }; - BC5FAF831C6901A200057CF1 /* ORKChartTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKChartTypes.m; path = Charts/ORKChartTypes.m; sourceTree = ""; }; + BC4D521E27B326EA0099DC18 /* ORKSecureCodingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKSecureCodingTests.swift; sourceTree = ""; }; BC94EF2F1E962F7400143081 /* ORKDeprecated.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKDeprecated.h; sourceTree = ""; }; BC94EF301E962F7400143081 /* ORKDeprecated.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKDeprecated.m; sourceTree = ""; }; BC94EF351E96394C00143081 /* ORKRegistrationStep_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKRegistrationStep_Internal.h; path = Onboarding/ORKRegistrationStep_Internal.h; sourceTree = ""; }; @@ -1908,33 +2042,9 @@ BCA5C0341AEC05F20092AC8D /* ORKStepNavigationRule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKStepNavigationRule.m; sourceTree = ""; }; BCAD50E71B0201EE0034806A /* ORKTaskTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKTaskTests.m; sourceTree = ""; }; BCB080A01B83EFB900A3F400 /* ORKStepNavigationRule.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ORKStepNavigationRule.swift; sourceTree = ""; }; - BCB6E6481B7D531C000D5B34 /* ORKPieChartView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKPieChartView.h; path = Charts/ORKPieChartView.h; sourceTree = ""; }; - BCB6E6491B7D531C000D5B34 /* ORKPieChartView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKPieChartView.m; path = Charts/ORKPieChartView.m; sourceTree = ""; }; - BCB6E64C1B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKPieChartLegendCollectionViewLayout.h; path = Charts/ORKPieChartLegendCollectionViewLayout.h; sourceTree = ""; }; - BCB6E64D1B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKPieChartLegendCollectionViewLayout.m; path = Charts/ORKPieChartLegendCollectionViewLayout.m; sourceTree = ""; }; - BCB6E64E1B7D533B000D5B34 /* ORKPieChartLegendCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKPieChartLegendCell.h; path = Charts/ORKPieChartLegendCell.h; sourceTree = ""; }; - BCB6E64F1B7D533B000D5B34 /* ORKPieChartLegendCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKPieChartLegendCell.m; path = Charts/ORKPieChartLegendCell.m; sourceTree = ""; }; - BCB6E6541B7D534C000D5B34 /* ORKDiscreteGraphChartView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKDiscreteGraphChartView.h; path = Charts/ORKDiscreteGraphChartView.h; sourceTree = ""; }; - BCB6E6551B7D534C000D5B34 /* ORKDiscreteGraphChartView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKDiscreteGraphChartView.m; path = Charts/ORKDiscreteGraphChartView.m; sourceTree = ""; }; - BCB6E6561B7D534C000D5B34 /* ORKGraphChartView_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKGraphChartView_Internal.h; path = Charts/ORKGraphChartView_Internal.h; sourceTree = ""; }; - BCB6E6571B7D534C000D5B34 /* ORKGraphChartView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKGraphChartView.h; path = Charts/ORKGraphChartView.h; sourceTree = ""; }; - BCB6E6581B7D534C000D5B34 /* ORKGraphChartView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKGraphChartView.m; path = Charts/ORKGraphChartView.m; sourceTree = ""; }; - BCB6E6591B7D534C000D5B34 /* ORKLineGraphChartView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKLineGraphChartView.h; path = Charts/ORKLineGraphChartView.h; sourceTree = ""; }; - BCB6E65A1B7D534C000D5B34 /* ORKLineGraphChartView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ORKLineGraphChartView.m; path = Charts/ORKLineGraphChartView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - BCB6E6621B7D535F000D5B34 /* ORKXAxisView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKXAxisView.h; path = Charts/ORKXAxisView.h; sourceTree = ""; }; - BCB6E6631B7D535F000D5B34 /* ORKXAxisView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKXAxisView.m; path = Charts/ORKXAxisView.m; sourceTree = ""; }; BCB8133B1C98367A00346561 /* ORKTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKTypes.h; sourceTree = ""; }; BCB96C121B19C0EC002A0B96 /* ORKStepTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKStepTests.m; sourceTree = ""; }; - BCC1CD981B7ED64F00D86886 /* ORKYAxisView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKYAxisView.h; path = Charts/ORKYAxisView.h; sourceTree = ""; }; - BCC1CD991B7ED64F00D86886 /* ORKYAxisView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ORKYAxisView.m; path = Charts/ORKYAxisView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; BCCE9EC021104B2200B809F8 /* ORKConsentDocument_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKConsentDocument_Private.h; sourceTree = ""; }; - BCD192DD1B81240400FCC08A /* ORKPieChartPieView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKPieChartPieView.h; path = Charts/ORKPieChartPieView.h; sourceTree = ""; }; - BCD192DE1B81240400FCC08A /* ORKPieChartPieView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKPieChartPieView.m; path = Charts/ORKPieChartPieView.m; sourceTree = ""; }; - BCD192E51B81243900FCC08A /* ORKPieChartLegendView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKPieChartLegendView.h; path = Charts/ORKPieChartLegendView.h; sourceTree = ""; }; - BCD192E61B81243900FCC08A /* ORKPieChartLegendView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKPieChartLegendView.m; path = Charts/ORKPieChartLegendView.m; sourceTree = ""; }; - BCD192E91B81245500FCC08A /* ORKPieChartTitleTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKPieChartTitleTextView.h; path = Charts/ORKPieChartTitleTextView.h; sourceTree = ""; }; - BCD192EA1B81245500FCC08A /* ORKPieChartTitleTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ORKPieChartTitleTextView.m; path = Charts/ORKPieChartTitleTextView.m; sourceTree = ""; }; - BCD192ED1B81255F00FCC08A /* ORKPieChartView_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ORKPieChartView_Internal.h; path = Charts/ORKPieChartView_Internal.h; sourceTree = ""; }; BCFF24BC1B0798D10044EC35 /* ORKResultPredicate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKResultPredicate.m; sourceTree = ""; }; BF1D43831D4904C6007EE90B /* ORKVideoInstructionStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKVideoInstructionStep.h; sourceTree = ""; }; BF1D43841D4904C6007EE90B /* ORKVideoInstructionStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKVideoInstructionStep.m; sourceTree = ""; }; @@ -1954,6 +2064,26 @@ BF9155A61BDE8DA9007FA459 /* ORKWaitStepViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKWaitStepViewController.m; sourceTree = ""; }; C72B9DF1235695DC00B982B7 /* no */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = no; path = no.lproj/ResearchKit.strings; sourceTree = ""; }; C72B9DF42356960F00B982B7 /* pt_BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt_BR; path = pt_BR.lproj/ResearchKit.strings; sourceTree = ""; }; + CA08053F28AD7CC8001695EF /* ORKViewControllerProviding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKViewControllerProviding.h; sourceTree = ""; }; + CA08054328AD7EBA001695EF /* ORKStep+ResearchKitUI.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ORKStep+ResearchKitUI.m"; sourceTree = ""; }; + CA0AC56828BD4FAB00E80040 /* ORKStepViewControllerHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ORKStepViewControllerHelpers.swift; sourceTree = ""; }; + CA1C7A5A288B0C68004DAB3A /* ResearchKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ResearchKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CA1C7A5B288B0C69004DAB3A /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = ""; }; + CA23A31C2899941700EC6E91 /* ORKSkin_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKSkin_Private.h; sourceTree = ""; }; + CA2B902528A187390025B773 /* ORKTask_Util.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKTask_Util.m; sourceTree = ""; }; + CA481E8128CBD6D9001C4D49 /* ResearchKitUI-iOS-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKitUI-iOS-Shared.xcconfig"; sourceTree = ""; }; + CA481E8228CBD79B001C4D49 /* ResearchKitUI-iOS-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKitUI-iOS-Debug.xcconfig"; sourceTree = ""; }; + CA481E8428CBD835001C4D49 /* ResearchKitUI-iOS-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ResearchKitUI-iOS-Release.xcconfig"; sourceTree = ""; }; + CA481E8C28CBD9F1001C4D49 /* ResearchKitActiveTask-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ResearchKitActiveTask-Release.xcconfig"; sourceTree = ""; }; + CA481E8D28CBD9F1001C4D49 /* ResearchKitActiveTask-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ResearchKitActiveTask-Debug.xcconfig"; sourceTree = ""; }; + CA481E8E28CBD9F1001C4D49 /* ResearchKitActiveTask-Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ResearchKitActiveTask-Shared.xcconfig"; sourceTree = ""; }; + CA6A0D9D288F1BDC0048C1EF /* ResearchKitUI_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResearchKitUI_Private.h; sourceTree = ""; }; + CA6A0D9F288F1F3C0048C1EF /* ResearchKitUI.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = ResearchKitUI.modulemap; sourceTree = ""; }; + CA954B6D28AD8A8C0020A35C /* ORKStep+ResearchKitActiveTask.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ORKStep+ResearchKitActiveTask.m"; sourceTree = ""; }; + CAD08967289DD747007B2A98 /* ResearchKitActiveTask.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ResearchKitActiveTask.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CAD08969289DD747007B2A98 /* ResearchKitActiveTask.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResearchKitActiveTask.h; sourceTree = ""; }; + CAFAA6C128A198BD0010BBDE /* ResearchKitActiveTask_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResearchKitActiveTask_Private.h; sourceTree = ""; }; + CAFAA6C328A199950010BBDE /* ResearchKitActiveTask.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = ResearchKitActiveTask.modulemap; sourceTree = ""; }; CBD34A541BB1FB9000F204EA /* ORKLocationSelectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKLocationSelectionView.h; sourceTree = ""; }; CBD34A551BB1FB9000F204EA /* ORKLocationSelectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKLocationSelectionView.m; sourceTree = ""; }; CBD34A581BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ORKSurveyAnswerCellForLocation.h; sourceTree = ""; }; @@ -1974,7 +2104,6 @@ E293656125757E7700092A7C /* volume_curve_AIRPODSMAX.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = volume_curve_AIRPODSMAX.plist; sourceTree = ""; }; E293668325EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKEnvironmentSPLMeterBarView.h; sourceTree = ""; }; E293668425EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKEnvironmentSPLMeterBarView.m; sourceTree = ""; }; - E2EE52FF22E7735600F34987 /* VolumeCalibration.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = VolumeCalibration.wav; sourceTree = ""; }; F7C022F8248EEAAC00782A61 /* ORKCustomSignatureFooterView_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKCustomSignatureFooterView_Private.h; sourceTree = ""; }; F7EC216424787338000C1F46 /* ORKCustomSignatureFooterView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKCustomSignatureFooterView.h; sourceTree = ""; }; F7EC216524787338000C1F46 /* ORKCustomSignatureFooterView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKCustomSignatureFooterView.m; sourceTree = ""; }; @@ -2056,6 +2185,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + CA4B673328A1CCBA00FAE01F /* ResearchKitActiveTask.framework in Frameworks */, + CA6A0DA0288F2C1C0048C1EF /* ResearchKitUI.framework in Frameworks */, BC40696121104DDF00A4100C /* ResearchKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2069,6 +2200,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + CA1C7A50288B0C68004DAB3A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CA1C7A5C288B0CA2004DAB3A /* ResearchKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CAD08964289DD747007B2A98 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + CAFAA6C528A19E260010BBDE /* ResearchKitUI.framework in Frameworks */, + CAFAA6C428A19E200010BBDE /* ResearchKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -2077,156 +2225,28 @@ children = ( 00C2668C23022CD400337E0B /* ORKCustomStep.h */, 00C2668D23022CD400337E0B /* ORKCustomStep.m */, - 00C266882302244300337E0B /* ORKCustomStepViewController.h */, - 00C266892302244300337E0B /* ORKCustomStepViewController.m */, ); name = "Custom Step"; sourceTree = ""; }; - 0BAF947D2910887D00EF138A /* Shake */ = { - isa = PBXGroup; - children = ( - FF919A3D1E81AFEF005C2A1E /* ORKReactionTimeResult.h */, - FF919A3E1E81AFEF005C2A1E /* ORKReactionTimeResult.m */, - 25ECC0931AFBD68300F3D63B /* ORKReactionTimeStep.h */, - 25ECC0941AFBD68300F3D63B /* ORKReactionTimeStep.m */, - 25ECC0991AFBD8B300F3D63B /* ORKReactionTimeViewController.h */, - 25ECC09A1AFBD8B300F3D63B /* ORKReactionTimeViewController.m */, - 25ECC09D1AFBD92D00F3D63B /* ORKReactionTimeContentView.h */, - 25ECC09E1AFBD92D00F3D63B /* ORKReactionTimeContentView.m */, - 25ECC0A11AFBDD2700F3D63B /* ORKReactionTimeStimulusView.h */, - 25ECC0A21AFBDD2700F3D63B /* ORKReactionTimeStimulusView.m */, - ); - name = Shake; - sourceTree = ""; - }; - 0BAF947E2910888900EF138A /* Normalized */ = { - isa = PBXGroup; - children = ( - 0BAF9798291088EE00EF138A /* ORKNormalizedReactionTimeContentView.h */, - 0BAF979C291088F000EF138A /* ORKNormalizedReactionTimeContentView.m */, - 0BAF9796291088ED00EF138A /* ORKNormalizedReactionTimeResult.h */, - 0BAF979E291088F100EF138A /* ORKNormalizedReactionTimeResult.m */, - 0BAF9799291088EE00EF138A /* ORKNormalizedReactionTimeStep.h */, - 0BAF979F291088F200EF138A /* ORKNormalizedReactionTimeStep.m */, - 0BAF9797291088EE00EF138A /* ORKNormalizedReactionTimeStimulusView.h */, - 0BAF979B291088EF00EF138A /* ORKNormalizedReactionTimeStimulusView.m */, - 0BAF979D291088F000EF138A /* ORKNormalizedReactionTimeViewController.h */, - 0BAF979A291088EF00EF138A /* ORKNormalizedReactionTimeViewController.m */, - ); - name = Normalized; - sourceTree = ""; - }; - 106FF29B1B663F5C004EACF2 /* Hole Peg Test */ = { - isa = PBXGroup; - children = ( - 10FF9A851B74ADB400ECB5B4 /* Place Step */, - 10FF9A861B74B24500ECB5B4 /* Remove Step */, - FF919A451E81BA3D005C2A1E /* ORKHolePegTestResult.h */, - FF919A461E81BA3D005C2A1E /* ORKHolePegTestResult.m */, - ); - name = "Hole Peg Test"; - sourceTree = ""; - }; - 10864C951B271456000F4158 /* PSAT */ = { - isa = PBXGroup; - children = ( - FF919A411E81B904005C2A1E /* ORKPSATResult.h */, - FF919A421E81B904005C2A1E /* ORKPSATResult.m */, - 10864C961B27146B000F4158 /* ORKPSATStep.h */, - 10864C971B27146B000F4158 /* ORKPSATStep.m */, - 10864C981B27146B000F4158 /* ORKPSATStepViewController.h */, - 10864C991B27146B000F4158 /* ORKPSATStepViewController.m */, - 10864C9A1B27146B000F4158 /* ORKPSATContentView.h */, - 10864C9B1B27146B000F4158 /* ORKPSATContentView.m */, - 10864C9C1B27146B000F4158 /* ORKPSATKeyboardView.h */, - 10864C9D1B27146B000F4158 /* ORKPSATKeyboardView.m */, - ); - name = PSAT; - sourceTree = ""; - }; - 10BAA2CC1B5FCDB1004FE478 /* Walking */ = { - isa = PBXGroup; - children = ( - B12EFF601AB2178B00A80147 /* Short Walk */, - 10BAA2CD1B5FCDFB004FE478 /* Timed Walk */, - ); - name = Walking; - sourceTree = ""; - }; - 10BAA2CD1B5FCDFB004FE478 /* Timed Walk */ = { - isa = PBXGroup; - children = ( - 861D2AEE1B8409D9008C4CD0 /* ORKTimedWalkContentView.h */, - 861D2AEF1B8409D9008C4CD0 /* ORKTimedWalkContentView.m */, - FF919A491E81BB7E005C2A1E /* ORKTimedWalkResult.h */, - FF919A4A1E81BB7E005C2A1E /* ORKTimedWalkResult.m */, - 861D2AEA1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.h */, - 861D2AEB1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.m */, - 861D2AE61B840991008C4CD0 /* ORKTimedWalkStep.h */, - 861D2AE71B840991008C4CD0 /* ORKTimedWalkStep.m */, - ); - name = "Timed Walk"; - sourceTree = ""; - }; - 10FF9A851B74ADB400ECB5B4 /* Place Step */ = { - isa = PBXGroup; - children = ( - 106FF29C1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.h */, - 106FF29D1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.m */, - 106FF2A01B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.h */, - 106FF2A11B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.m */, - 106FF2A41B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.h */, - 106FF2A51B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.m */, - 106FF2A81B690FD7004EACF2 /* ORKHolePegTestPlacePegView.h */, - 106FF2A91B690FD7004EACF2 /* ORKHolePegTestPlacePegView.m */, - 106FF2B21B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.h */, - 106FF2B31B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.m */, - ); - name = "Place Step"; - sourceTree = ""; - }; - 10FF9A861B74B24500ECB5B4 /* Remove Step */ = { - isa = PBXGroup; - children = ( - 10FF9AC11B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.h */, - 10FF9AC21B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.m */, - 10FF9AC91B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.h */, - 10FF9ACA1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.m */, - 10FF9ACD1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.h */, - 10FF9ACE1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.m */, - 10FF9AD11B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.h */, - 10FF9AD21B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.m */, - ); - name = "Remove Step"; - sourceTree = ""; - }; - 147503AC1AEE8058004B17F3 /* Tone Audiometry */ = { + 0B53DA612BD0590700227126 /* Localized */ = { isa = PBXGroup; children = ( - 147503AD1AEE8071004B17F3 /* ORKAudioGenerator.h */, - 147503AE1AEE8071004B17F3 /* ORKAudioGenerator.m */, - 147503B11AEE807C004B17F3 /* ORKToneAudiometryContentView.h */, - 147503B21AEE807C004B17F3 /* ORKToneAudiometryContentView.m */, - FF919A301E81AC26005C2A1E /* ORKToneAudiometryResult.h */, - FF919A311E81AC26005C2A1E /* ORKToneAudiometryResult.m */, - 147503B31AEE807C004B17F3 /* ORKToneAudiometryStep.h */, - 147503B41AEE807C004B17F3 /* ORKToneAudiometryStep.m */, - 147503B51AEE807C004B17F3 /* ORKToneAudiometryStepViewController.h */, - 147503B61AEE807C004B17F3 /* ORKToneAudiometryStepViewController.m */, + 0B53DA622BD0595100227126 /* ResearchKitUI.strings */, ); - name = "Tone Audiometry"; + name = Localized; + path = Accessibility/Localized; sourceTree = ""; }; 1490DCF2224D3B71003FEEDA /* ORKResultTests */ = { isa = PBXGroup; children = ( + 14A92C6D224531A2007547F2 /* ORKActiveTaskResultTests.swift */, + 1490DCFB224D4867003FEEDA /* ORKEnvironmentSPLMeterResultTests.swift */, 1490DCF3224D3C20003FEEDA /* ORKPasscodeResultTests.swift */, - 1490DCF9224D46E3003FEEDA /* ORKWebViewStepResultTests.swift */, - 1490DCF7224D4550003FEEDA /* ORKVideoInstructionStepResultTests.swift */, 1490DCF5224D426B003FEEDA /* ORKSignatureResultTests.swift */, - 1490DCFB224D4867003FEEDA /* ORKEnvironmentSPLMeterResultTests.swift */, - 14A92C6D224531A2007547F2 /* ORKActiveTaskResultTests.swift */, + 1490DCF7224D4550003FEEDA /* ORKVideoInstructionStepResultTests.swift */, + 1490DCF9224D46E3003FEEDA /* ORKWebViewStepResultTests.swift */, ); name = ORKResultTests; sourceTree = ""; @@ -2237,6 +2257,7 @@ 14A92C6922444F93007547F2 /* ORKPasscodeViewControllerTests.swift */, 148E58BC227B36DB00EEF915 /* ORKCompletionStepViewControllerTests.swift */, 0324C1D725439E1800BBE77B /* ORKVideoInstructionStepViewControllerTests.swift */, + 5E6AB7DE2BC86900009ED0D5 /* ORKTaskViewControllerTests.swift */, ); name = ORKViewControllerTests; sourceTree = ""; @@ -2258,26 +2279,6 @@ path = scripts; sourceTree = ""; }; - 226565552847FF9D00E916FF /* ORKAudiometry */ = { - isa = PBXGroup; - children = ( - 22CFBEBE2881B07B0035A74A /* MathUtilities */, - 224CD4FC283540FF0029B820 /* ORKAudiometryProtocol.h */, - 226565512847FD1D00E916FF /* ORKAudiometryStimulus.h */, - 226565522847FD1D00E916FF /* ORKAudiometryStimulus.m */, - 2295B21F282AF92700A5D9E0 /* ORKAudiometry.h */, - 2295B220282AF92700A5D9E0 /* ORKAudiometry.m */, - ); - name = ORKAudiometry; - sourceTree = ""; - }; - 22CFBEBE2881B07B0035A74A /* MathUtilities */ = { - isa = PBXGroup; - children = ( - ); - name = MathUtilities; - sourceTree = ""; - }; 22ED184428528FF50052406B /* ORKAudiometryTests */ = { isa = PBXGroup; children = ( @@ -2304,15 +2305,9 @@ 242C9E031BBDFDAC0088B7F4 /* ORKVerificationStep.h */, 242C9E041BBDFDAC0088B7F4 /* ORKVerificationStep.m */, 24C296741BD052F800B42EF1 /* ORKVerificationStep_Internal.h */, - 242C9E0B1BBE03F90088B7F4 /* ORKVerificationStepViewController.h */, - 242C9E0C1BBE03F90088B7F4 /* ORKVerificationStepViewController.m */, - 242C9E0F1BBE06DE0088B7F4 /* ORKVerificationStepView.h */, - 242C9E101BBE06DE0088B7F4 /* ORKVerificationStepView.m */, 24BC5CEC1BC345D900846B43 /* ORKLoginStep.h */, 24BC5CED1BC345D900846B43 /* ORKLoginStep.m */, 24C296761BD055B800B42EF1 /* ORKLoginStep_Internal.h */, - 24850E171BCDA9C7006E91FB /* ORKLoginStepViewController.h */, - 24850E181BCDA9C7006E91FB /* ORKLoginStepViewController.m */, ); name = Account; sourceTree = ""; @@ -2322,12 +2317,6 @@ children = ( 2489F7A91D65214D008DEF20 /* ORKVideoCaptureStep.h */, 2489F7AA1D65214D008DEF20 /* ORKVideoCaptureStep.m */, - 2489F7AB1D65214D008DEF20 /* ORKVideoCaptureStepViewController.h */, - 2489F7AC1D65214D008DEF20 /* ORKVideoCaptureStepViewController.m */, - 2489F7A71D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.h */, - 2489F7A81D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.m */, - 2489F7AD1D65214D008DEF20 /* ORKVideoCaptureView.h */, - 2489F7AE1D65214D008DEF20 /* ORKVideoCaptureView.m */, ); name = "Video Capture Step"; sourceTree = ""; @@ -2339,13 +2328,6 @@ FF919A6C1E81D3B0005C2A1E /* ORKPasscodeResult.m */, 24A4DA121B8D1115009C797A /* ORKPasscodeStep.h */, 24A4DA131B8D1115009C797A /* ORKPasscodeStep.m */, - 241A2E861B94FD8800ED3B39 /* ORKPasscodeStepViewController_Internal.h */, - 24A4DA161B8D13FE009C797A /* ORKPasscodeStepViewController.h */, - 24A4DA171B8D13FE009C797A /* ORKPasscodeStepViewController.m */, - 24A4DA0E1B8D0F21009C797A /* ORKPasscodeStepView.h */, - 24A4DA0F1B8D0F21009C797A /* ORKPasscodeStepView.m */, - 2441034D1B966D4C00EEAB0C /* ORKPasscodeViewController.h */, - 2441034E1B966D4C00EEAB0C /* ORKPasscodeViewController.m */, ); name = "Passcode Step"; sourceTree = ""; @@ -2353,6 +2335,8 @@ 24B3535D1BB21137009ED6F8 /* Utilities */ = { isa = PBXGroup; children = ( + 51B94DBC2B311E810039B0E7 /* CLLocationManager+ResearchKit.h */, + 51B94DC62B3254FD0039B0E7 /* CLLocationManager+ResearchKit.m */, 2433C9E11B9A506F0052D375 /* ORKKeychainWrapper.h */, 2433C9E21B9A506F0052D375 /* ORKKeychainWrapper.m */, 86C40B8C1A8D7C5C00081FAC /* ORKHelpers_Internal.h */, @@ -2365,470 +2349,394 @@ name = Utilities; sourceTree = ""; }; - 259E76FB1AFFAEAC0070F786 /* Charts */ = { + 3FFF18341829DB1D00167070 = { isa = PBXGroup; children = ( - 25BD76671B00B37100478C5D /* Pie */, - 25BD76601B00A5CF00478C5D /* Graphs */, + 0BA1D93A2BD1DF5A00BB79DB /* ResearchKit.podspec */, + 05F3765923C797930068E166 /* ResearchKit.xctestplan */, + 168EEAAE230B6F9E003FD2FA /* scripts */, + 86B623AF19520B770074CD3C /* ResearchKit */, + 86CC8EA61AC09383001CCD89 /* ResearchKitTests */, + 5D06632E24FEF272005D9B40 /* ResearchKitUI */, + CAD08968289DD747007B2A98 /* ResearchKitActiveTask */, + 3FFF183F1829DB1D00167070 /* Frameworks */, + 3FFF183E1829DB1D00167070 /* Products */, ); - name = Charts; sourceTree = ""; }; - 25BD76601B00A5CF00478C5D /* Graphs */ = { + 3FFF183E1829DB1D00167070 /* Products */ = { isa = PBXGroup; children = ( - 25BD76611B00A5E700478C5D /* Components */, - BC4A213D1C85FC0000BFC271 /* ORKBarGraphChartView.h */, - BC4A213E1C85FC0000BFC271 /* ORKBarGraphChartView.m */, - BCB6E6541B7D534C000D5B34 /* ORKDiscreteGraphChartView.h */, - BCB6E6551B7D534C000D5B34 /* ORKDiscreteGraphChartView.m */, - BC5FAF821C6901A200057CF1 /* ORKChartTypes.h */, - BC5FAF831C6901A200057CF1 /* ORKChartTypes.m */, - BCB6E6561B7D534C000D5B34 /* ORKGraphChartView_Internal.h */, - BCB6E6571B7D534C000D5B34 /* ORKGraphChartView.h */, - BCB6E6581B7D534C000D5B34 /* ORKGraphChartView.m */, - BCB6E6591B7D534C000D5B34 /* ORKLineGraphChartView.h */, - BCB6E65A1B7D534C000D5B34 /* ORKLineGraphChartView.m */, + B183A5951A8535D100C76870 /* ResearchKit.framework */, + 86CC8E9A1AC09332001CCD89 /* ResearchKitTests.xctest */, + CA1C7A5A288B0C68004DAB3A /* ResearchKitUI.framework */, + CAD08967289DD747007B2A98 /* ResearchKitActiveTask.framework */, ); - name = Graphs; + name = Products; sourceTree = ""; }; - 25BD76611B00A5E700478C5D /* Components */ = { + 3FFF183F1829DB1D00167070 /* Frameworks */ = { isa = PBXGroup; children = ( - BCC1CD981B7ED64F00D86886 /* ORKYAxisView.h */, - BCC1CD991B7ED64F00D86886 /* ORKYAxisView.m */, - BCB6E6621B7D535F000D5B34 /* ORKXAxisView.h */, - BCB6E6631B7D535F000D5B34 /* ORKXAxisView.m */, + 00B1F7842241503900D022FE /* Speech.framework */, + B1C7955D1A9FBF04007279BA /* HealthKit.framework */, ); - name = Components; + name = Frameworks; sourceTree = ""; }; - 25BD76671B00B37100478C5D /* Pie */ = { + 511987C024632E33004FC2C7 /* Request Permissions Step */ = { isa = PBXGroup; children = ( - 25C17CBB1B2058D4001ADDD2 /* Components */, - BCD192ED1B81255F00FCC08A /* ORKPieChartView_Internal.h */, - BCB6E6481B7D531C000D5B34 /* ORKPieChartView.h */, - BCB6E6491B7D531C000D5B34 /* ORKPieChartView.m */, + 51E03D60249196E0008F8406 /* Permission Types */, + 511987C1246330CA004FC2C7 /* ORKRequestPermissionsStep.h */, + 511987C2246330CA004FC2C7 /* ORKRequestPermissionsStep.m */, ); - name = Pie; + name = "Request Permissions Step"; sourceTree = ""; }; - 25C17CBB1B2058D4001ADDD2 /* Components */ = { + 5156C9BF2B7E421400983535 /* Touch Ability */ = { isa = PBXGroup; children = ( - BCB6E64C1B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.h */, - BCB6E64D1B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.m */, - BCB6E64E1B7D533B000D5B34 /* ORKPieChartLegendCell.h */, - BCB6E64F1B7D533B000D5B34 /* ORKPieChartLegendCell.m */, - BCD192DD1B81240400FCC08A /* ORKPieChartPieView.h */, - BCD192DE1B81240400FCC08A /* ORKPieChartPieView.m */, - BCD192E51B81243900FCC08A /* ORKPieChartLegendView.h */, - BCD192E61B81243900FCC08A /* ORKPieChartLegendView.m */, - BCD192E91B81245500FCC08A /* ORKPieChartTitleTextView.h */, - BCD192EA1B81245500FCC08A /* ORKPieChartTitleTextView.m */, + 5156C9F72B7E43E300983535 /* Long Press Step */, + 5156CA362B7E457B00983535 /* Pinch Step */, + 5156CA4F2B7E462000983535 /* Rotation Step */, + 5156CA212B7E44F200983535 /* Scroll Step */, + 5156C9C92B7E428A00983535 /* Shared Models */, + 5156C9C02B7E422D00983535 /* Shared Views */, + 5156CA0C2B7E446A00983535 /* Swipe Step */, + 5156C9E22B7E435A00983535 /* Tap Step */, ); - name = Components; + path = "Touch Ability"; sourceTree = ""; }; - 25ECC0921AFBD64800F3D63B /* Reaction Time */ = { + 5156C9C02B7E422D00983535 /* Shared Views */ = { isa = PBXGroup; children = ( - 0BAF947E2910888900EF138A /* Normalized */, - 0BAF947D2910887D00EF138A /* Shake */, + 5156C9C12B7E426900983535 /* ORKTouchAbilityArrowView.h */, + 5156C9C42B7E426900983535 /* ORKTouchAbilityArrowView.m */, + 5156C9C32B7E426900983535 /* ORKTouchAbilityContentView.h */, + 5156C9C22B7E426900983535 /* ORKTouchAbilityContentView.m */, ); - name = "Reaction Time"; + name = "Shared Views"; sourceTree = ""; }; - 25F5CEDC1B4C3F1D0031E2A4 /* TowerOfHanoi */ = { + 5156C9C92B7E428A00983535 /* Shared Models */ = { isa = PBXGroup; children = ( - 250F94021B4C5A6600FA23EB /* ORKTowerOfHanoiStep.h */, - 250F94031B4C5A6600FA23EB /* ORKTowerOfHanoiStep.m */, - 250F94061B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.h */, - 250F94071B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.m */, - 257FCE1D1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.h */, - 257FCE1E1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.m */, - 257FCE211B4D37A80001EF06 /* ORKTowerOfHanoiTower.h */, - 257FCE221B4D37A80001EF06 /* ORKTowerOfHanoiTower.m */, - FF919A2C1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.h */, - FF919A2D1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.m */, + 5156C9D52B7E42C200983535 /* ORKTouchAbilityGestureRecoginzerEvent.h */, + 5156C9CC2B7E42C100983535 /* ORKTouchAbilityGestureRecoginzerEvent.m */, + 5156C9CD2B7E42C100983535 /* ORKTouchAbilityTouch.h */, + 5156C9D02B7E42C100983535 /* ORKTouchAbilityTouch.m */, + 5156C9CA2B7E42C100983535 /* ORKTouchAbilityTouchTracker.h */, + 5156C9D12B7E42C100983535 /* ORKTouchAbilityTouchTracker.m */, + 5156C9CB2B7E42C100983535 /* ORKTouchAbilityTrack_Internal.h */, + 5156C9CF2B7E42C100983535 /* ORKTouchAbilityTrack.h */, + 5156C9D22B7E42C100983535 /* ORKTouchAbilityTrack.m */, + 5156C9CE2B7E42C100983535 /* ORKTouchAbilityTrial_Internal.h */, + 5156C9D32B7E42C200983535 /* ORKTouchAbilityTrial.h */, + 5156C9D42B7E42C200983535 /* ORKTouchAbilityTrial.m */, ); - name = TowerOfHanoi; + name = "Shared Models"; sourceTree = ""; }; - 2E80C1AB1FA2B2CC00399A0C /* SpeechRecognition */ = { + 5156C9E22B7E435A00983535 /* Tap Step */ = { isa = PBXGroup; children = ( - 2E8070F51FAD217400E4FC7F /* ORKSpeechRecognitionStep.h */, - 2E8070F61FAD217400E4FC7F /* ORKSpeechRecognitionStep.m */, - 2E8070F41FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.h */, - 2E8070F31FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.m */, - 2E8070F11FAD217400E4FC7F /* ORKSpeechRecognizer.h */, - 2E8070F21FAD217400E4FC7F /* ORKSpeechRecognizer.m */, - 2E8070FD1FAD255000E4FC7F /* ORKSpeechRecognitionContentView.h */, - 2E8070FE1FAD256A00E4FC7F /* ORKSpeechRecognitionContentView.m */, - 2E3408C92028E13B0027D6B8 /* ORKSpeechRecognitionError.h */, - BA5B9205204F5D9A007C2F9D /* ORKSpeechRecognitionResult.h */, - BA5B9206204F5D9A007C2F9D /* ORKSpeechRecognitionResult.m */, + 5156C9E62B7E437A00983535 /* ORKTouchAbilityTapStep.h */, + 5156C9EC2B7E437A00983535 /* ORKTouchAbilityTapStep.m */, + 5156C9E32B7E437A00983535 /* ORKTouchAbilityTapStepViewController.h */, + 5156C9E42B7E437A00983535 /* ORKTouchAbilityTapStepViewController.m */, + 5156C9E82B7E437A00983535 /* ORKTouchAbilityTapContentView.h */, + 5156C9E72B7E437A00983535 /* ORKTouchAbilityTapContentView.m */, + 5156C9EA2B7E437A00983535 /* ORKTouchAbilityTapTrial.h */, + 5156C9E92B7E437A00983535 /* ORKTouchAbilityTapTrial.m */, + 5156C9E52B7E437A00983535 /* ORKTouchAbilityTapResult.h */, + 5156C9EB2B7E437A00983535 /* ORKTouchAbilityTapResult.m */, ); - name = SpeechRecognition; + name = "Tap Step"; sourceTree = ""; }; - 3FFF18341829DB1D00167070 = { + 5156C9F72B7E43E300983535 /* Long Press Step */ = { isa = PBXGroup; children = ( - 05F3765923C797930068E166 /* ResearchKit.xctestplan */, - 168EEAAE230B6F9E003FD2FA /* scripts */, - B11DF3B21AA109C8009E76D2 /* docs */, - 86B623AF19520B770074CD3C /* ResearchKit */, - 86CC8EA61AC09383001CCD89 /* ResearchKitTests */, - 3FFF183F1829DB1D00167070 /* Frameworks */, - 3FFF183E1829DB1D00167070 /* Products */, + 5156C9FF2B7E440A00983535 /* ORKTouchAbilityLongPressStep.h */, + 5156C9FA2B7E440A00983535 /* ORKTouchAbilityLongPressStep.m */, + 5156C9FB2B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.h */, + 5156C9FD2B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.m */, + 5156C9FE2B7E440A00983535 /* ORKTouchAbilityLongPressContentView.h */, + 5156C9F92B7E440A00983535 /* ORKTouchAbilityLongPressContentView.m */, + 5156CA002B7E440A00983535 /* ORKTouchAbilityLongPressTrial.h */, + 5156C9F82B7E440A00983535 /* ORKTouchAbilityLongPressTrial.m */, + 5156CA012B7E440A00983535 /* ORKTouchAbilityLongPressResult.h */, + 5156C9FC2B7E440A00983535 /* ORKTouchAbilityLongPressResult.m */, ); + name = "Long Press Step"; sourceTree = ""; }; - 3FFF183E1829DB1D00167070 /* Products */ = { + 5156CA0C2B7E446A00983535 /* Swipe Step */ = { isa = PBXGroup; children = ( - B183A5951A8535D100C76870 /* ResearchKit.framework */, - 86CC8E9A1AC09332001CCD89 /* ResearchKitTests.xctest */, + 5156CA0E2B7E448600983535 /* ORKTouchAbilitySwipeStep.h */, + 5156CA102B7E448600983535 /* ORKTouchAbilitySwipeStep.m */, + 5156CA162B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.h */, + 5156CA132B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.m */, + 5156CA0D2B7E448600983535 /* ORKTouchAbilitySwipeContentView.h */, + 5156CA112B7E448600983535 /* ORKTouchAbilitySwipeContentView.m */, + 5156CA0F2B7E448600983535 /* ORKTouchAbilitySwipeTrial.h */, + 5156CA152B7E448600983535 /* ORKTouchAbilitySwipeTrial.m */, + 5156CA142B7E448600983535 /* ORKTouchAbilitySwipeResult.h */, + 5156CA122B7E448600983535 /* ORKTouchAbilitySwipeResult.m */, ); - name = Products; + name = "Swipe Step"; sourceTree = ""; }; - 3FFF183F1829DB1D00167070 /* Frameworks */ = { + 5156CA212B7E44F200983535 /* Scroll Step */ = { isa = PBXGroup; children = ( - 00B1F7842241503900D022FE /* Speech.framework */, - B1C7955D1A9FBF04007279BA /* HealthKit.framework */, + 5156CA222B7E451B00983535 /* ORKTouchAbilityScrollStep.h */, + 5156CA242B7E451B00983535 /* ORKTouchAbilityScrollStep.m */, + 5156CA252B7E451B00983535 /* ORKTouchAbilityScrollStepViewController.h */, + 5156CA262B7E451B00983535 /* ORKTouchAbilityScrollStepViewController.m */, + 5156CA232B7E451B00983535 /* ORKTouchAbilityScrollContentView.h */, + 5156CA2A2B7E451B00983535 /* ORKTouchAbilityScrollContentView.m */, + 5156CA292B7E451B00983535 /* ORKTouchAbilityScrollTrial.h */, + 5156CA2B2B7E451C00983535 /* ORKTouchAbilityScrollTrial.m */, + 5156CA272B7E451B00983535 /* ORKTouchAbilityScrollResult.h */, + 5156CA282B7E451B00983535 /* ORKTouchAbilityScrollResult.m */, ); - name = Frameworks; + name = "Scroll Step"; sourceTree = ""; }; - 51198798245FC31C004FC2C7 /* 3D Model Manager */ = { + 5156CA362B7E457B00983535 /* Pinch Step */ = { isa = PBXGroup; children = ( - 51198799245FC33C004FC2C7 /* ORK3DModelManager.h */, - 5D26E77724997EA200E53D27 /* ORK3DModelManager_Internal.h */, - 5119879A245FC33C004FC2C7 /* ORK3DModelManager.m */, + 5156CA3B2B7E45AE00983535 /* ORKTouchAbilityPinchStep.h */, + 5156CA412B7E45AE00983535 /* ORKTouchAbilityPinchStep.m */, + 5156CA3D2B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.h */, + 5156CA422B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.m */, + 5156CA3E2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.h */, + 5156CA3A2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.m */, + 5156CA392B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.h */, + 5156CA3C2B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.m */, + 5156CA402B7E45AE00983535 /* ORKTouchAbilityPinchTrial.h */, + 5156CA382B7E45AE00983535 /* ORKTouchAbilityPinchTrial.m */, + 5156CA372B7E45AE00983535 /* ORKTouchAbilityPinchResult.h */, + 5156CA3F2B7E45AE00983535 /* ORKTouchAbilityPinchResult.m */, ); - name = "3D Model Manager"; + name = "Pinch Step"; sourceTree = ""; }; - 511987B624612C95004FC2C7 /* USDZ Model Manager */ = { + 5156CA4F2B7E462000983535 /* Rotation Step */ = { isa = PBXGroup; children = ( - 51198767245CA50D004FC2C7 /* ORKUSDZModelManagerScene.h */, - 51198768245CA50D004FC2C7 /* ORKUSDZModelManagerScene.m */, - 5119879D245FE68D004FC2C7 /* ORKUSDZModelManager.h */, - 5119879E245FE68D004FC2C7 /* ORKUSDZModelManager.m */, - 5166E49D247355D500151C57 /* ORKUSDZModelManagerResult.h */, - 5166E49E247355D500151C57 /* ORKUSDZModelManagerResult.m */, - ); - name = "USDZ Model Manager"; - sourceTree = ""; - }; - 511987C024632E33004FC2C7 /* Request Permissions Step */ = { - isa = PBXGroup; - children = ( - 51E03D60249196E0008F8406 /* Permission Types */, - 511987C1246330CA004FC2C7 /* ORKRequestPermissionsStep.h */, - 511987C2246330CA004FC2C7 /* ORKRequestPermissionsStep.m */, - 511987C52463316E004FC2C7 /* ORKRequestPermissionsStepViewController.h */, - 511987C62463316E004FC2C7 /* ORKRequestPermissionsStepViewController.m */, - 51D823032472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.h */, - 51D823042472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.m */, - 51E03D6B2491B6DB008F8406 /* ORKRequestPermissionView.h */, - 51E03D6C2491B6DB008F8406 /* ORKRequestPermissionView.m */, - 5170009B254A191F00CACE12 /* ORKRequestPermissionButton.h */, - 5170009C254A197300CACE12 /* ORKRequestPermissionButton.m */, - ); - name = "Request Permissions Step"; - sourceTree = ""; - }; - 511B8A8B293A728200049947 /* Touch Ability */ = { - isa = PBXGroup; - children = ( - 511B8A8C293A753800049947 /* Shared Views */, - 511B8A8D293A754100049947 /* Shared Models */, - 511B8A8E293A755800049947 /* Tap Step */, - 511B8AC3293A773600049947 /* Long Press Step */, - 511B8AD8293A77E900049947 /* Swipe Step */, - 511B8AF1293A788900049947 /* Scroll Step */, - 511B8B06293A792B00049947 /* Pinch Step */, - 511B8B1F293A79A000049947 /* Rotation Step */, - ); - name = "Touch Ability"; - sourceTree = ""; - }; - 511B8A8C293A753800049947 /* Shared Views */ = { - isa = PBXGroup; - children = ( - 511B8A8F293A757E00049947 /* ORKTouchAbilityContentView.h */, - 511B8A90293A757E00049947 /* ORKTouchAbilityContentView.m */, - 511B8A93293A759200049947 /* ORKTouchAbilityArrowView.h */, - 511B8A94293A759300049947 /* ORKTouchAbilityArrowView.m */, - ); - name = "Shared Views"; - sourceTree = ""; - }; - 511B8A8D293A754100049947 /* Shared Models */ = { - isa = PBXGroup; - children = ( - 511B8A97293A75B900049947 /* ORKTouchAbilityTouch.h */, - 511B8A98293A75B900049947 /* ORKTouchAbilityTouch.m */, - 511B8A9B293A75F300049947 /* ORKTouchAbilityTrack.h */, - 511B8A9C293A75F300049947 /* ORKTouchAbilityTrack.m */, - 511B8A9F293A760A00049947 /* ORKTouchAbilityTrack_Internal.h */, - 511B8AA2293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.h */, - 511B8AA1293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.m */, - 511B8AA5293A764900049947 /* ORKTouchAbilityTrial.h */, - 511B8AA6293A764900049947 /* ORKTouchAbilityTrial.m */, - 511B8AA9293A766300049947 /* ORKTouchAbilityTrial_Internal.h */, - 511B8AAC293A767C00049947 /* ORKTouchAbilityTouchTracker.h */, - 511B8AAB293A767C00049947 /* ORKTouchAbilityTouchTracker.m */, - ); - name = "Shared Models"; - sourceTree = ""; - }; - 511B8A8E293A755800049947 /* Tap Step */ = { - isa = PBXGroup; - children = ( - 511B8AB0293A76A100049947 /* ORKTouchAbilityTapStep.h */, - 511B8AAF293A76A100049947 /* ORKTouchAbilityTapStep.m */, - 511B8AB4293A76B200049947 /* ORKTouchAbilityTapStepViewController.h */, - 511B8AB3293A76B200049947 /* ORKTouchAbilityTapStepViewController.m */, - 511B8AB7293A76DE00049947 /* ORKTouchAbilityTapContentView.h */, - 511B8AB8293A76DE00049947 /* ORKTouchAbilityTapContentView.m */, - 511B8ABC293A770D00049947 /* ORKTouchAbilityTapTrial.h */, - 511B8ABB293A770D00049947 /* ORKTouchAbilityTapTrial.m */, - 511B8ABF293A772400049947 /* ORKTouchAbilityTapResult.h */, - 511B8AC0293A772400049947 /* ORKTouchAbilityTapResult.m */, - ); - name = "Tap Step"; - sourceTree = ""; - }; - 511B8AC3293A773600049947 /* Long Press Step */ = { - isa = PBXGroup; - children = ( - 511B8AC4293A777400049947 /* ORKTouchAbilityLongPressStep.h */, - 511B8AC5293A777400049947 /* ORKTouchAbilityLongPressStep.m */, - 511B8AC7293A777400049947 /* ORKTouchAbilityLongPressStepViewController.h */, - 511B8AC6293A777400049947 /* ORKTouchAbilityLongPressStepViewController.m */, - 511B8ACD293A779200049947 /* ORKTouchAbilityLongPressContentView.h */, - 511B8ACC293A779200049947 /* ORKTouchAbilityLongPressContentView.m */, - 511B8AD0293A77AA00049947 /* ORKTouchAbilityLongPressTrial.h */, - 511B8AD1293A77AA00049947 /* ORKTouchAbilityLongPressTrial.m */, - 511B8AD4293A77BE00049947 /* ORKTouchAbilityLongPressResult.h */, - 511B8AD5293A77BE00049947 /* ORKTouchAbilityLongPressResult.m */, + 5156CA522B7E465500983535 /* ORKTouchAbilityRotationStep.h */, + 5156CA582B7E465500983535 /* ORKTouchAbilityRotationStep.m */, + 5156CA502B7E465400983535 /* ORKTouchAbilityRotationStepViewController.h */, + 5156CA562B7E465500983535 /* ORKTouchAbilityRotationStepViewController.m */, + 5156CA542B7E465500983535 /* ORKTouchAbilityRotationContentView.h */, + 5156CA512B7E465400983535 /* ORKTouchAbilityRotationContentView.m */, + 5156CA552B7E465500983535 /* ORKTouchAbilityRotationTrial.h */, + 5156CA572B7E465500983535 /* ORKTouchAbilityRotationTrial.m */, + 5156CA592B7E465500983535 /* ORKTouchAbilityRotationResult.h */, + 5156CA532B7E465500983535 /* ORKTouchAbilityRotationResult.m */, ); - name = "Long Press Step"; + name = "Rotation Step"; sourceTree = ""; }; - 511B8AD8293A77E900049947 /* Swipe Step */ = { + 5175145B245A4FCA009E8FFC /* Front Facing Camera */ = { isa = PBXGroup; children = ( - 511B8AD9293A781000049947 /* ORKTouchAbilitySwipeStep.h */, - 511B8ADA293A781000049947 /* ORKTouchAbilitySwipeStep.m */, - 511B8ADD293A782800049947 /* ORKTouchAbilitySwipeStepViewController.h */, - 511B8ADE293A782800049947 /* ORKTouchAbilitySwipeStepViewController.m */, - 511B8AE1293A783B00049947 /* ORKTouchAbilitySwipeContentView.h */, - 511B8AE2293A783B00049947 /* ORKTouchAbilitySwipeContentView.m */, - 511B8AEB293A785900049947 /* ORKTouchAbilitySwipeResult.h */, - 511B8AEC293A785900049947 /* ORKTouchAbilitySwipeResult.m */, - 511B8AEA293A785900049947 /* ORKTouchAbilitySwipeTrial.h */, - 511B8AE9293A785900049947 /* ORKTouchAbilitySwipeTrial.m */, + 5192BF802AE1BA47006E43FB /* ORKFrontFacingCameraStep.h */, + 5192BF822AE1BA47006E43FB /* ORKFrontFacingCameraStep.m */, + 5192BF832AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.h */, + 5192BF812AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.m */, ); - name = "Swipe Step"; + name = "Front Facing Camera"; + path = ../ActiveTasks; sourceTree = ""; }; - 511B8AF1293A788900049947 /* Scroll Step */ = { + 5192BF782AE1A523006E43FB /* Normalized */ = { isa = PBXGroup; children = ( - 511B8AF5293A78BB00049947 /* ORKTouchAbilityScrollStep.h */, - 511B8AF3293A78BB00049947 /* ORKTouchAbilityScrollStep.m */, - 511B8AF4293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.h */, - 511B8AF2293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.m */, - 511B8AFA293A78CF00049947 /* ORKTouchAbilityScrollContentView.h */, - 511B8AFB293A78CF00049947 /* ORKTouchAbilityScrollContentView.m */, - 511B8AFE293A78EF00049947 /* ORKTouchAbilityScrollTrial.h */, - 511B8AFF293A78EF00049947 /* ORKTouchAbilityScrollTrial.m */, - 511B8B02293A791B00049947 /* ORKTouchAbilityScrollResult.h */, - 511B8B03293A791B00049947 /* ORKTouchAbilityScrollResult.m */, + 51F716C0297E288A00D8ACF7 /* ORKNormalizedReactionTimeContentView.h */, + 51F716B9297E288900D8ACF7 /* ORKNormalizedReactionTimeContentView.m */, + 51F716BB297E288900D8ACF7 /* ORKNormalizedReactionTimeResult.h */, + 51F716BC297E288900D8ACF7 /* ORKNormalizedReactionTimeResult.m */, + 51F716BA297E288900D8ACF7 /* ORKNormalizedReactionTimeStep.h */, + 51F716BE297E288900D8ACF7 /* ORKNormalizedReactionTimeStep.m */, + 51F716B8297E288900D8ACF7 /* ORKNormalizedReactionTimeStimulusView.h */, + 51F716B7297E288900D8ACF7 /* ORKNormalizedReactionTimeStimulusView.m */, + 51F716BF297E288A00D8ACF7 /* ORKNormalizedReactionTimeViewController.h */, + 51F716BD297E288900D8ACF7 /* ORKNormalizedReactionTimeViewController.m */, ); - name = "Scroll Step"; + path = Normalized; sourceTree = ""; }; - 511B8B06293A792B00049947 /* Pinch Step */ = { + 519CE8152C6582A0003BB584 /* Family History */ = { isa = PBXGroup; children = ( - 511B8B08293A794D00049947 /* ORKTouchAbilityPinchStep.h */, - 511B8B07293A794D00049947 /* ORKTouchAbilityPinchStep.m */, - 511B8B0B293A795800049947 /* ORKTouchAbilityPinchStepViewController.h */, - 511B8B0C293A795900049947 /* ORKTouchAbilityPinchStepViewController.m */, - 511B8B0F293A796600049947 /* ORKTouchAbilityPinchContentView.h */, - 511B8B10293A796600049947 /* ORKTouchAbilityPinchContentView.m */, - 511B8B14293A797C00049947 /* ORKTouchAbilityPinchGuideView.h */, - 511B8B13293A797C00049947 /* ORKTouchAbilityPinchGuideView.m */, - 511B8B17293A798D00049947 /* ORKTouchAbilityPinchTrial.h */, - 511B8B18293A798D00049947 /* ORKTouchAbilityPinchTrial.m */, - 511B8B1C293A799800049947 /* ORKTouchAbilityPinchResult.h */, - 511B8B1B293A799800049947 /* ORKTouchAbilityPinchResult.m */, + 519CE81E2C6582BE003BB584 /* ORKConditionStepConfiguration.h */, + 519CE81D2C6582BE003BB584 /* ORKConditionStepConfiguration.m */, + 519CE8192C6582BD003BB584 /* ORKFamilyHistoryResult.h */, + 519CE8212C6582BE003BB584 /* ORKFamilyHistoryResult.m */, + 519CE81F2C6582BE003BB584 /* ORKFamilyHistoryStep.h */, + 519CE8172C6582BD003BB584 /* ORKFamilyHistoryStep.m */, + 519CE8182C6582BD003BB584 /* ORKHealthCondition.h */, + 519CE8162C6582BD003BB584 /* ORKHealthCondition.m */, + 519CE8202C6582BE003BB584 /* ORKRelatedPerson.h */, + 519CE81A2C6582BD003BB584 /* ORKRelatedPerson.m */, + 519CE81B2C6582BD003BB584 /* ORKRelativeGroup.h */, + 519CE81C2C6582BD003BB584 /* ORKRelativeGroup.m */, ); - name = "Pinch Step"; + name = "Family History"; sourceTree = ""; }; - 511B8B1F293A79A000049947 /* Rotation Step */ = { + 519CE82F2C6585DF003BB584 /* Family History */ = { isa = PBXGroup; children = ( - 511B8B22293A79C000049947 /* ORKTouchAbilityRotationStep.h */, - 511B8B23293A79C000049947 /* ORKTouchAbilityRotationStep.m */, - 511B8B21293A79C000049947 /* ORKTouchAbilityRotationStepViewController.h */, - 511B8B20293A79C000049947 /* ORKTouchAbilityRotationStepViewController.m */, - 511B8B28293A79E400049947 /* ORKTouchAbilityRotationContentView.h */, - 511B8B29293A79E400049947 /* ORKTouchAbilityRotationContentView.m */, - 511B8B2D293A79FF00049947 /* ORKTouchAbilityRotationTrial.h */, - 511B8B2C293A79FF00049947 /* ORKTouchAbilityRotationTrial.m */, - 511B8B31293A7A0B00049947 /* ORKTouchAbilityRotationResult.h */, - 511B8B30293A7A0B00049947 /* ORKTouchAbilityRotationResult.m */, + 519CE83A2C65862E003BB584 /* Family History TableView Views */, + 519CE8302C658617003BB584 /* ORKFamilyHistoryStepViewController.h */, + 519CE8332C658617003BB584 /* ORKFamilyHistoryStepViewController.m */, + 519CE85B2C6AD858003BB584 /* ORKFamilyHistoryStepViewController_Private.h */, ); - name = "Rotation Step"; + path = "Family History"; sourceTree = ""; }; - 515A1676293FE1120077CE38 /* PrivateHeaders */ = { + 519CE83A2C65862E003BB584 /* Family History TableView Views */ = { isa = PBXGroup; children = ( - 51DB3847293E811C0089C82C /* ResearchKit_Private.h */, + 519CE83B2C658653003BB584 /* ORKFamilyHistoryRelatedPersonCell.h */, + 519CE83C2C658653003BB584 /* ORKFamilyHistoryRelatedPersonCell.m */, + 519CE83D2C658653003BB584 /* ORKFamilyHistoryTableFooterView.h */, + 519CE83E2C658654003BB584 /* ORKFamilyHistoryTableFooterView.m */, + 519CE83F2C658654003BB584 /* ORKFamilyHistoryTableHeaderView.h */, + 519CE8402C658654003BB584 /* ORKFamilyHistoryTableHeaderView.m */, ); - path = PrivateHeaders; + path = "Family History TableView Views"; sourceTree = ""; }; - 5175144B2459EBD3009E8FFC /* 3D Model */ = { + 519CE85D2C6BC1C5003BB584 /* Family History */ = { isa = PBXGroup; children = ( - 511987B624612C95004FC2C7 /* USDZ Model Manager */, - 51198798245FC31C004FC2C7 /* 3D Model Manager */, - 5175144C2459EBF0009E8FFC /* ORK3DModelStep.h */, - 5175144D2459EBF0009E8FFC /* ORK3DModelStep.m */, - 517514502459EF5D009E8FFC /* ORK3DModelStepViewController.h */, - 517514512459EF5D009E8FFC /* ORK3DModelStepViewController.m */, - 517514542459F0BE009E8FFC /* ORK3DModelStepContentView.h */, - 517514552459F0BE009E8FFC /* ORK3DModelStepContentView.m */, + 519CE85E2C6BC1DB003BB584 /* ORKFamilyHistoryResultTests.swift */, ); - name = "3D Model"; + name = "Family History"; sourceTree = ""; }; - 5175145B245A4FCA009E8FFC /* Front Facing Camera */ = { + 51A11F1B2BD094A00060C07E /* Custom View */ = { isa = PBXGroup; children = ( - 5175145C245A4FF1009E8FFC /* ORKFrontFacingCameraStep.h */, - 5175145D245A4FF1009E8FFC /* ORKFrontFacingCameraStep.m */, - 51751461245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.h */, - 51751462245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.m */, - 51751465245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.h */, - 51751466245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.m */, - 5190141724759E6800E3A418 /* ORKFrontFacingCameraStepResult.h */, - 5190141824759E6800E3A418 /* ORKFrontFacingCameraStepResult.m */, + 51A11F202BD152660060C07E /* ORKActiveStepCustomView.h */, + 51A11F212BD152660060C07E /* ORKActiveStepCustomView.m */, ); - name = "Front Facing Camera"; - path = ../ActiveTasks; + path = "Custom View"; sourceTree = ""; }; - 51814E6726432CFA009E8C98 /* ORKSpeechInNoise */ = { + 51AEAAA02B74296800F4D107 /* Stale */ = { isa = PBXGroup; children = ( - 51814F3D264359BC009E8C98 /* Sentences */, - 7118AC7120BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.h */, - 7118AC7020BF6A7700D7A6BB /* ORKSpeechInNoiseContentView.m */, - 7118AC7320BF6A7800D7A6BB /* ORKSpeechInNoiseStep.h */, - 7118AC7220BF6A7800D7A6BB /* ORKSpeechInNoiseStep.m */, - 7118AC6F20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.h */, - 7118AC6E20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.m */, - E2EE52FF22E7735600F34987 /* VolumeCalibration.wav */, - 7118AC5920BF6A0000D7A6BB /* Noise.wav */, - 7118AC5B20BF6A1200D7A6BB /* Window.wav */, - 5D5880372410394E005B3D91 /* ORKSpeechInNoiseResult.h */, - 5D5880382410394E005B3D91 /* ORKSpeechInNoiseResult.m */, + 51AEAAA32B742C1800F4D107 /* Question Step */, + 51AEAAA12B742BBC00F4D107 /* Consent */, ); - path = ORKSpeechInNoise; + path = Stale; sourceTree = ""; }; - 51814F3D264359BC009E8C98 /* Sentences */ = { + 51AEAAA12B742BBC00F4D107 /* Consent */ = { isa = PBXGroup; children = ( - BA22F76C20C4F884006E6E11 /* SentencesList.txt */, - 7118AC6620BF6A3A00D7A6BB /* Sentence1.wav */, - 7118AC6520BF6A3A00D7A6BB /* Sentence2.wav */, - 7118AC6420BF6A3A00D7A6BB /* Sentence3.wav */, - 7118AC6120BF6A3A00D7A6BB /* Sentence4.wav */, - 7118AC6320BF6A3A00D7A6BB /* Sentence5.wav */, - 7118AC6220BF6A3A00D7A6BB /* Sentence6.wav */, - 7118AC6020BF6A3900D7A6BB /* Sentence7.wav */, + FA7A9D2D1B083DD3005A2BEA /* ORKConsentSectionFormatter.h */, + FA7A9D2E1B083DD3005A2BEA /* ORKConsentSectionFormatter.m */, + FA7A9D311B0843A9005A2BEA /* ORKConsentSignatureFormatter.h */, + FA7A9D321B0843A9005A2BEA /* ORKConsentSignatureFormatter.m */, + BCCE9EC021104B2200B809F8 /* ORKConsentDocument_Private.h */, + 86C40BF21A8D7C5C00081FAC /* ORKConsentDocument.h */, + 86C40BF31A8D7C5C00081FAC /* ORKConsentDocument.m */, + 0BE9D5242947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.h */, + 0BE9D5252947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.m */, + 86C40BF41A8D7C5C00081FAC /* ORKConsentDocument_Internal.h */, + 86C40BFF1A8D7C5C00081FAC /* ORKConsentSection.h */, + 86C40C001A8D7C5C00081FAC /* ORKConsentSection.m */, + 86C40C011A8D7C5C00081FAC /* ORKConsentSection_Private.h */, + 86C40C021A8D7C5C00081FAC /* ORKConsentSignature.h */, + 86C40C031A8D7C5C00081FAC /* ORKConsentSignature.m */, + B11C54961A9EEF8800265E61 /* ORKConsentSharingStep.h */, + B11C54971A9EEF8800265E61 /* ORKConsentSharingStep.m */, + 86C40BF71A8D7C5C00081FAC /* ORKConsentReviewStep.h */, + 86C40BF81A8D7C5C00081FAC /* ORKConsentReviewStep.m */, + FF919A671E81D255005C2A1E /* ORKConsentSignatureResult.h */, + FF919A681E81D255005C2A1E /* ORKConsentSignatureResult.m */, ); - name = Sentences; + name = Consent; sourceTree = ""; }; - 51906C4B291D78B000FF4185 /* Vision Tasks */ = { + 51AEAAA32B742C1800F4D107 /* Question Step */ = { isa = PBXGroup; children = ( - 51906C4C291D78C400FF4185 /* Landolt C */, - BA95AA9320ACD05100E7FF8E /* AmslerGrid */, + 86C40BA11A8D7C5C00081FAC /* ORKQuestionStep.h */, + 86C40BA21A8D7C5C00081FAC /* ORKQuestionStep.m */, + 86C40BA31A8D7C5C00081FAC /* ORKQuestionStep_Internal.h */, + 5D04884B25EF4CC30006C68B /* ORKQuestionStep_Private.h */, ); - name = "Vision Tasks"; + name = "Question Step"; sourceTree = ""; }; - 51906C4C291D78C400FF4185 /* Landolt C */ = { + 51AEAAA52B743EE000F4D107 /* Stale */ = { isa = PBXGroup; children = ( - 51906C57291D792400FF4185 /* Custom Vision View */, - 51906C50291D790700FF4185 /* ORKLandoltCResult.swift */, - 51906C4F291D790700FF4185 /* ORKLandoltCStep.swift */, - 51906C55291D791900FF4185 /* ExtensionModel.swift */, - 51906C4D291D790700FF4185 /* ORKLandoltCStepContentView.swift */, - 51906C4E291D790700FF4185 /* ORKLandoltCStepViewController.swift */, + 51DFB6302B7C1862004000C1 /* Consent */, + 51AEAAC12B75442600F4D107 /* Question Step View Controller */, ); - name = "Landolt C"; + path = Stale; sourceTree = ""; }; - 51906C57291D792400FF4185 /* Custom Vision View */ = { + 51AEAAC12B75442600F4D107 /* Question Step View Controller */ = { isa = PBXGroup; children = ( - 51906C5B291D796600FF4185 /* CircleSlider.swift */, - 51906C5C291D796600FF4185 /* EyeActivitySlider.swift */, - 51906C5A291D796600FF4185 /* Math.swift */, - 51906C58291D794400FF4185 /* TrackLayer.swift */, + 51AEAAAE2B7446F400F4D107 /* ORKQuestionStepView.h */, + 51AEAAAF2B7446F400F4D107 /* ORKQuestionStepView.m */, + 51AEAAA72B743FA500F4D107 /* ORKQuestionStepViewController_Private.h */, + 51AEAAA82B743FA500F4D107 /* ORKQuestionStepViewController.h */, + 51AEAAA62B743FA500F4D107 /* ORKQuestionStepViewController.m */, ); - name = "Custom Vision View"; + name = "Question Step View Controller"; sourceTree = ""; }; - 51906C60291D7A3C00FF4185 /* Swift Stroop */ = { + 51AF19512B583B5B00D3B399 /* ORKESerializationTests */ = { isa = PBXGroup; children = ( - 51906C63291D7A5A00FF4185 /* ORKSwiftStroopContentView.swift */, - 51906C62291D7A5A00FF4185 /* ORKSwiftStroopResult.swift */, - 51906C61291D7A5A00FF4185 /* ORKSwiftStroopStep.swift */, - 51906C64291D7A5A00FF4185 /* ORKSwiftStroopStepViewController.swift */, + 51AF19522B583BB900D3B399 /* ORKESerialization.h */, + 51AF19552B583BB900D3B399 /* ORKESerialization.m */, + 51AF19542B583BB900D3B399 /* samples.bundle */, + 51AF19532B583BB900D3B399 /* ORKDataCollectionTests.m */, + 51AF19562B583BBA00D3B399 /* ORKJSONSerializationTests.m */, ); - name = "Swift Stroop"; + name = ORKESerializationTests; sourceTree = ""; }; - 519C297F26D0278A00FD5F44 /* SwiftUI Views */ = { + 51CB80D42AFEBE4800A1F410 /* ConditionalFormItems */ = { isa = PBXGroup; children = ( - 519C298C26D027B000FD5F44 /* Factory */, - 519C298D26D027E500FD5F44 /* TextChoiceView.swift */, + 51CB80D92AFEBF3800A1F410 /* ORKFormItemVisibilityRuleTests.swift */, + 51CB80D72AFEBEC600A1F410 /* ORKPredicateFormItemVisibilityRuleTests.swift */, + 51CB80D52AFEBE7E00A1F410 /* ORKFormStepViewControllerConditionalFormItemsTests.swift */, + 51CB80DB2AFEBF7A00A1F410 /* ORKFormStepViewController+TestingSupport.h */, ); - name = "SwiftUI Views"; + name = ConditionalFormItems; sourceTree = ""; }; - 519C298C26D027B000FD5F44 /* Factory */ = { + 51DFB6302B7C1862004000C1 /* Consent */ = { isa = PBXGroup; children = ( - 519C298026D027AB00FD5F44 /* SwiftUIViewFactory.swift */, + 51F716CD297E2CB600D8ACF7 /* ORKConsentLearnMoreViewController.h */, + 51F716CE297E2CB600D8ACF7 /* ORKConsentLearnMoreViewController.m */, + B11C549C1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h */, + B11C549D1A9EF4A700265E61 /* ORKConsentSharingStepViewController.m */, + 86C40BEC1A8D7C5C00081FAC /* ORKConsentReviewController.h */, + 86C40BED1A8D7C5C00081FAC /* ORKConsentReviewController.m */, + 86C40BF91A8D7C5C00081FAC /* ORKConsentReviewStepViewController.h */, + 86C40BFA1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.m */, ); - name = Factory; + name = Consent; sourceTree = ""; }; 51E03D60249196E0008F8406 /* Permission Types */ = { @@ -2858,25 +2766,23 @@ name = "HealthKit Permission Type"; sourceTree = ""; }; - 51EAFC10289B116300CFA3EB /* Configuration */ = { + 51EB9A592B8D1CB80064A515 /* FormatterTests */ = { isa = PBXGroup; children = ( - 51EAFC11289B117500CFA3EB /* ResearchKit */, + 51EB9A5D2B8D3BA70064A515 /* ORKInstructionStepHTMLFormatterTests.m */, ); - path = Configuration; - sourceTree = ""; - }; - 51EAFC11289B117500CFA3EB /* ResearchKit */ = { - isa = PBXGroup; - children = ( - ); - path = ResearchKit; + name = FormatterTests; sourceTree = ""; }; 5D000EC02620F27100E5442A /* Configuration */ = { isa = PBXGroup; children = ( 5D000EC12620F27100E5442A /* ResearchKit */, + 5D000EC92620F27100E5442A /* docs */, + 5D000ECB2620F27100E5442A /* Project */, + 5D000ED32620F27100E5442A /* ResearchKitTests */, + CA481E8028CBD6B7001C4D49 /* ResearchKitUI-iOS */, + CA481E8B28CBD9F1001C4D49 /* ResearchKitActiveTask */, ); path = Configuration; sourceTree = ""; @@ -2886,105 +2792,57 @@ children = ( 5D000EC22620F27100E5442A /* ResearchKit-Debug.xcconfig */, 5D000EC42620F27100E5442A /* ResearchKit-Shared.xcconfig */, - 511A78992950D7030011D85D /* ResearchKit-Release.xcconfig */, + 5D000EC62620F27100E5442A /* ResearchKit-Release.xcconfig */, ); path = ResearchKit; sourceTree = ""; }; - 5D43C5CE2421736D006F4084 /* ORKRecordButton */ = { - isa = PBXGroup; - children = ( - 5D43C5CF24217393006F4084 /* ORKRecordButton.h */, - 5D43C5D024217393006F4084 /* ORKRecordButton.m */, - ); - name = ORKRecordButton; - sourceTree = ""; - }; - 618DA0471A93D0D600E63AA8 /* Accessibility */ = { + 5D000EC92620F27100E5442A /* docs */ = { isa = PBXGroup; children = ( - 618DA0481A93D0D600E63AA8 /* ORKAccessibility.h */, - 618DA0491A93D0D600E63AA8 /* ORKAccessibilityFunctions.h */, - 618DA04A1A93D0D600E63AA8 /* ORKAccessibilityFunctions.m */, - 618DA04B1A93D0D600E63AA8 /* UIView+ORKAccessibility.h */, - 618DA04C1A93D0D600E63AA8 /* UIView+ORKAccessibility.m */, - 6146D0A11B84A91E0068491D /* ORKGraphChartAccessibilityElement.h */, - 6146D0A21B84A91E0068491D /* ORKGraphChartAccessibilityElement.m */, + 5D000ECA2620F27100E5442A /* docs-Shared.xcconfig */, ); - path = Accessibility; + path = docs; sourceTree = ""; }; - 71769E2620880BA800A19914 /* dBHL Tone Audiometry */ = { + 5D000ECB2620F27100E5442A /* Project */ = { isa = PBXGroup; children = ( - 226565552847FF9D00E916FF /* ORKAudiometry */, - 71769E2720880C4500A19914 /* ORKdBHLToneAudiometryResult.h */, - 71769E2820880C4500A19914 /* ORKdBHLToneAudiometryResult.m */, - 71769E2B208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h */, - 71769E2C208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m */, - 71769E2F2088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h */, - 71769E302088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m */, - 716B126620A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h */, - 716B126720A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m */, - 71769E332088291B00A19914 /* ORKdBHLToneAudiometryContentView.h */, - 71769E342088291B00A19914 /* ORKdBHLToneAudiometryContentView.m */, - 71769E3720882CED00A19914 /* ORKdBHLToneAudiometryStep.h */, - 71769E3820882CED00A19914 /* ORKdBHLToneAudiometryStep.m */, - 71769E3B20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h */, - 71769E3C20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m */, - E293655D25757CC700092A7C /* frequency_dBSPL_AIRPODSMAX.plist */, - E29189B823855B96001AFF0F /* frequency_dBSPL_AIRPODSPRO.plist */, - 62DF9F4628CA87DE00D13018 /* frequency_dBSPL_AIRPODSPROV2.plist */, - 71B7B4D820AA91D400C5768A /* frequency_dBSPL_AIRPODS.plist */, - 2246E5122749350200261D5A /* frequency_dBSPL_AIRPODSV3.plist */, - 713D4B1B20FE5464002BE28D /* frequency_dBSPL_EARPODS.plist */, - E293655F25757E6100092A7C /* retspl_AIRPODSMAX.plist */, - E29189BC23855BAE001AFF0F /* retspl_AIRPODSPRO.plist */, - 62DF9F4428CA87D300D13018 /* retspl_AIRPODSPROV2.plist */, - 71B7B4D420AA91D300C5768A /* retspl_AIRPODS.plist */, - 2246E5132749350200261D5A /* retspl_AIRPODSV3.plist */, - 713D4B1D20FE5480002BE28D /* retspl_EARPODS.plist */, - E293656125757E7700092A7C /* volume_curve_AIRPODSMAX.plist */, - E29189BA23855BA2001AFF0F /* volume_curve_AIRPODSPRO.plist */, - 62DF9F4828CA87E800D13018 /* volume_curve_AIRPODSPROV2.plist */, - 71B7B4D920AA91D400C5768A /* volume_curve_AIRPODS.plist */, - 2246E5142749350200261D5A /* volume_curve_AIRPODSV3.plist */, - 713D4B0F20FE4702002BE28D /* volume_curve_WIRED.plist */, + 5D000ECC2620F27100E5442A /* Project-Release.xcconfig */, + 5D000ECE2620F27100E5442A /* Project-Shared.xcconfig */, + 5D000ED12620F27100E5442A /* Project-Debug.xcconfig */, ); - name = "dBHL Tone Audiometry"; + path = Project; sourceTree = ""; }; - 71BD9EA220969AD3007B436E /* evironmentSPLMeter */ = { + 5D000ED32620F27100E5442A /* ResearchKitTests */ = { isa = PBXGroup; children = ( - 71BD9EA320969BE1007B436E /* ORKEnvironmentSPLMeterStep.h */, - 71BD9EA420969BE1007B436E /* ORKEnvironmentSPLMeterStep.m */, - 71BD9EA720969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.h */, - 71BD9EA820969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.m */, - 716B126220A78C6B00590264 /* ORKEnvironmentSPLMeterResult.h */, - 716B126320A78C6B00590264 /* ORKEnvironmentSPLMeterResult.m */, - E293668325EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.h */, - E293668425EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.m */, - 71BD9EAB2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.h */, - 71BD9EAC2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.m */, - 71F3B27F21001DEC00FB1C41 /* splMeter_sensitivity_offset.plist */, + 5D000ED52620F27100E5442A /* ResearchKitTests-Release.xcconfig */, + 5D000ED62620F27100E5442A /* ResearchKitTests-Shared.xcconfig */, + 5D000ED72620F27100E5442A /* ResearchKitTests-Debug.xcconfig */, ); - name = evironmentSPLMeter; + path = ResearchKitTests; sourceTree = ""; }; - 781D54091DF884C400223305 /* Trailmaking */ = { + 5D06632E24FEF272005D9B40 /* ResearchKitUI */ = { isa = PBXGroup; children = ( - 781D540A1DF886AB00223305 /* ORKTrailmakingContentView.h */, - 781D540B1DF886AB00223305 /* ORKTrailmakingContentView.m */, - FF919A4D1E81BD05005C2A1E /* ORKTrailmakingResult.h */, - FF919A4E1E81BD05005C2A1E /* ORKTrailmakingResult.m */, - 781D540C1DF886AB00223305 /* ORKTrailmakingStep.h */, - 781D540D1DF886AB00223305 /* ORKTrailmakingStep.m */, - 781D540E1DF886AB00223305 /* ORKTrailmakingStepViewController.h */, - 781D540F1DF886AB00223305 /* ORKTrailmakingStepViewController.m */, + 0B53DA612BD0590700227126 /* Localized */, + 51AEAAA52B743EE000F4D107 /* Stale */, + CA1C7A6F288B18B8004DAB3A /* Common */, + CA1C7ABE288B3786004DAB3A /* Onboarding */, + CA1C7AC0288B3AC1004DAB3A /* Accessibility */, + 5D06632F24FEF272005D9B40 /* ResearchKitUI.h */, + CA6A0D9F288F1F3C0048C1EF /* ResearchKitUI.modulemap */, + CA6A0D9D288F1BDC0048C1EF /* ResearchKitUI_Private.h */, + 0B0852752BD872D800149963 /* PrivacyInfo.xcprivacy */, + 5D06633024FEF272005D9B40 /* Info.plist */, + CA1C7A5B288B0C69004DAB3A /* Info-iOS.plist */, + 51FBAC582BC86E6E009CA28F /* ResearchKitUI_Private.modulemap */, + 51B76DFC2CB5C73C0061698A /* ResearchKitUI.docc */, ); - name = Trailmaking; + path = ResearchKitUI; sourceTree = ""; }; 8419D66B1FB73C800088D7E5 /* WebView Step */ = { @@ -2994,8 +2852,7 @@ 8419D66D1FB73CC80088D7E5 /* ORKWebViewStep.m */, FF0CB3881FD5C4C3002D838C /* ORKWebViewStepResult.h */, FF0CB3891FD5C4C3002D838C /* ORKWebViewStepResult.m */, - 8419D6701FB73EC60088D7E5 /* ORKWebViewStepViewController.h */, - 8419D6711FB73EC60088D7E5 /* ORKWebViewStepViewController.m */, + 51AF1B1F2B683C3400D3B399 /* ORKWebViewStepResult_Private.h */, ); name = "WebView Step"; sourceTree = ""; @@ -3003,6 +2860,10 @@ 866DA5121D63D01C00C9AF3F /* DataCollection */ = { isa = PBXGroup; children = ( + 51A11F162BD08D5E0060C07E /* CMMotionActivity+ORKJSONDictionary.h */, + 51A11F142BD08D5D0060C07E /* CMMotionActivity+ORKJSONDictionary.m */, + 51A11F132BD08D5D0060C07E /* HKSample+ORKJSONDictionary.h */, + 51A11F152BD08D5D0060C07E /* HKSample+ORKJSONDictionary.m */, 866DA5131D63D04700C9AF3F /* ORKCollector_Internal.h */, 866DA5141D63D04700C9AF3F /* ORKCollector.h */, 866DA5151D63D04700C9AF3F /* ORKCollector.m */, @@ -3022,65 +2883,30 @@ 86B623AF19520B770074CD3C /* ResearchKit */ = { isa = PBXGroup; children = ( - 515A1676293FE1120077CE38 /* PrivateHeaders */, + 51AEAAA02B74296800F4D107 /* Stale */, + 512741262B1557220045A449 /* ResearchKit.docc */, 5D000EC02620F27100E5442A /* Configuration */, 5DABE5AD24DA16E600570C57 /* ResearchKit_Prefix.pch */, B1C1DE4F196F541F00F75544 /* ResearchKit.h */, + B1B894391A00345200C5CF2D /* ResearchKit_Private.h */, BC94EF2F1E962F7400143081 /* ORKDeprecated.h */, BC94EF301E962F7400143081 /* ORKDeprecated.m */, - 51EAFC10289B116300CFA3EB /* Configuration */, 86C40B511A8D7C5B00081FAC /* Common */, - 86C40AF91A8D7C5B00081FAC /* Active Tasks */, - 259E76FB1AFFAEAC0070F786 /* Charts */, - 86C40BEB1A8D7C5C00081FAC /* Consent */, + FA7A9D2C1B083D90005A2BEA /* Formatters */, 2429D56D1BBB52E4003A512F /* Onboarding */, - 618DA0471A93D0D600E63AA8 /* Accessibility */, - B1A860D91A9693C400EA57B7 /* Animations */, - 861610BF1A8D8EDD00245F7A /* Artwork.xcassets */, B1C0F4E01A9BA65F0022C153 /* Localized */, 86C40C101A8D7C5C00081FAC /* Info.plist */, B18AABE01A9F08D9003871B5 /* ResearchKit.modulemap */, + 51FBAC572BC85C7A009CA28F /* ResearchKit_Private.modulemap */, + 0B0852732BD872C400149963 /* PrivacyInfo.xcprivacy */, + 861610BF1A8D8EDD00245F7A /* Artwork.xcassets */, ); path = ResearchKit; sourceTree = ""; }; - 86C40AF91A8D7C5B00081FAC /* Active Tasks */ = { - isa = PBXGroup; - children = ( - 511B8A8B293A728200049947 /* Touch Ability */, - 51906C4B291D78B000FF4185 /* Vision Tasks */, - 51814E6726432CFA009E8C98 /* ORKSpeechInNoise */, - 5175144B2459EBD3009E8FFC /* 3D Model */, - 71BD9EA220969AD3007B436E /* evironmentSPLMeter */, - 71769E2620880BA800A19914 /* dBHL Tone Audiometry */, - B12EFF4F1AB2165B00A80147 /* Common */, - B12EFF4E1AB2161500A80147 /* Audio */, - 2E80C1AB1FA2B2CC00399A0C /* SpeechRecognition */, - B12EFF5D1AB2177700A80147 /* Fitness */, - 106FF29B1B663F5C004EACF2 /* Hole Peg Test */, - 10864C951B271456000F4158 /* PSAT */, - 95E25CF71D39FB240089C0B8 /* Range of Motion */, - 25ECC0921AFBD64800F3D63B /* Reaction Time */, - B12EFF5E1AB2177D00A80147 /* Spatial Span Memory */, - BA0AA68D1EAEC06A00671ACE /* Stroop */, - B12EFF5F1AB2178500A80147 /* Tapping */, - 147503AC1AEE8058004B17F3 /* Tone Audiometry */, - 25F5CEDC1B4C3F1D0031E2A4 /* TowerOfHanoi */, - 781D54091DF884C400223305 /* Trailmaking */, - 10BAA2CC1B5FCDB1004FE478 /* Walking */, - ); - name = "Active Tasks"; - path = ActiveTasks; - sourceTree = ""; - }; 86C40B511A8D7C5B00081FAC /* Common */ = { isa = PBXGroup; children = ( - 5D43C5CE2421736D006F4084 /* ORKRecordButton */, - BAD6FAAE2332A2B6006647E7 /* CheckmarkView */, - BA2645E3230156C200D00B73 /* Review */, - BA8C067522EEB7FD00ACDE6B /* Playback Button */, - BA87E26A20A79F5F00B375A9 /* Ring View */, B12EFF3B1AB211E000A80147 /* Answer Format */, B12EFF3A1AB211CC00A80147 /* Container Views */, B12EFF3D1AB2121000A80147 /* Definitions */, @@ -3090,28 +2916,19 @@ B12EFF311AB2100400A80147 /* Skin */, B12EFF341AB2111200A80147 /* Step */, B12EFF331AB2110300A80147 /* Task */, - B12EFF321AB2106F00A80147 /* UIKitCategories */, 866DA5121D63D01C00C9AF3F /* DataCollection */, 24B3535D1BB21137009ED6F8 /* Utilities */, ); path = Common; sourceTree = ""; }; - 86C40BEB1A8D7C5C00081FAC /* Consent */ = { - isa = PBXGroup; - children = ( - FA7A9D2C1B083D90005A2BEA /* Formatters */, - B12EFF451AB214E000A80147 /* Model */, - B12EFF461AB2150C00A80147 /* Visual */, - B12EFF481AB2152D00A80147 /* Sharing */, - B12EFF471AB2151B00A80147 /* Review */, - ); - path = Consent; - sourceTree = ""; - }; 86CC8EA61AC09383001CCD89 /* ResearchKitTests */ = { isa = PBXGroup; children = ( + 519CE85D2C6BC1C5003BB584 /* Family History */, + 51EB9A592B8D1CB80064A515 /* FormatterTests */, + 51AF19512B583B5B00D3B399 /* ORKESerializationTests */, + 51CB80D42AFEBE4800A1F410 /* ConditionalFormItems */, 22ED184428528FF50052406B /* ORKAudiometryTests */, BAB96753226E5D21006AAC56 /* Views */, 14A92C6822444F30007547F2 /* ORKViewControllerTests */, @@ -3136,217 +2953,78 @@ 2EBFE11C1AE1B32D00CB8254 /* ORKUIViewAccessibilityTests.m */, 2EBFE11F1AE1B74100CB8254 /* ORKVoiceEngineTests.m */, 03057F482518ECDC00C4EC5B /* ORKAudioStepViewControllerTests.m */, - 511A7890294D67F80011D85D /* ORKTextButtonTests.swift */, 1483DBB4220125BE004C26B6 /* ORKActiveStepTests.swift */, 1483DBB3220125BE004C26B6 /* ResearchKitTests-Bridging-Header.h */, 1490DD01224D6A21003FEEDA /* ORKResultPredicateTests.swift */, + 0B9A990D2A8AC47500D64C40 /* NSObject+TestingSupport.h */, + 0B9A990E2A8AC47500D64C40 /* NSObject+TestingSupport.m */, 1490DD03224D6A61003FEEDA /* ORKTestResultPredicateType.swift */, 14F7AC8A2269035200D52F41 /* ORKStepViewControllerTests.swift */, - 14E7903F226A5F72009D8083 /* ORKStepViewControllerHelpers.swift */, + CA0AC56828BD4FAB00E80040 /* ORKStepViewControllerHelpers.swift */, + BC4D521E27B326EA0099DC18 /* ORKSecureCodingTests.swift */, ); path = ResearchKitTests; sourceTree = ""; }; - 9550E6701D58DB9A00C691B8 /* Touch Anywhere Step */ = { - isa = PBXGroup; - children = ( - 9550E6711D58DBCF00C691B8 /* ORKTouchAnywhereStep.h */, - 9550E6721D58DBCF00C691B8 /* ORKTouchAnywhereStep.m */, - 9550E67A1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h */, - 9550E67B1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m */, - ); - name = "Touch Anywhere Step"; - sourceTree = ""; - }; - 959A2C0A1D68C8F100841B04 /* Shoulder */ = { + AE75433524E32C8A00E4C7CF /* Early Termination */ = { isa = PBXGroup; children = ( - 959A2C0B1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.h */, - 959A2C0C1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.m */, - 95E11E531D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.h */, - 95E11E541D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.m */, + AE75433824E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.h */, + AE75433924E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.m */, ); - name = Shoulder; + name = "Early Termination"; sourceTree = ""; }; - 95E25CF71D39FB240089C0B8 /* Range of Motion */ = { + B12EFF301AB20E7500A80147 /* Completion Step */ = { isa = PBXGroup; children = ( - 959A2C0A1D68C8F100841B04 /* Shoulder */, - FF919A281E81A94B005C2A1E /* ORKRangeOfMotionResult.h */, - FF919A291E81A94B005C2A1E /* ORKRangeOfMotionResult.m */, - 959A2BFA1D68B98700841B04 /* ORKRangeOfMotionStep.h */, - 959A2BFB1D68B98700841B04 /* ORKRangeOfMotionStep.m */, - 959A2BFE1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h */, - 959A2BFF1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m */, + 86C40B521A8D7C5B00081FAC /* ORKCompletionStep.h */, + 86C40B531A8D7C5B00081FAC /* ORKCompletionStep.m */, ); - name = "Range of Motion"; + name = "Completion Step"; sourceTree = ""; }; - AE75433524E32C8A00E4C7CF /* Early Termination */ = { + B12EFF311AB2100400A80147 /* Skin */ = { isa = PBXGroup; children = ( - AE75433824E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.h */, - AE75433924E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.m */, + 86C40BB71A8D7C5C00081FAC /* ORKSkin.h */, + CA23A31C2899941700EC6E91 /* ORKSkin_Private.h */, + 86C40BB81A8D7C5C00081FAC /* ORKSkin.m */, ); - name = "Early Termination"; + name = Skin; sourceTree = ""; }; - B11DF3B21AA109C8009E76D2 /* docs */ = { + B12EFF331AB2110300A80147 /* Task */ = { isa = PBXGroup; children = ( - B11DF3B31AA109C8009E76D2 /* AppledocSettings.plist */, + BC13CE371B0660220044153C /* ORKNavigableOrderedTask.h */, + BC13CE381B0660220044153C /* ORKNavigableOrderedTask.m */, + 10FF9AD91B7BA78400ECB5B4 /* ORKOrderedTask_Private.h */, + 86C40B9D1A8D7C5C00081FAC /* ORKOrderedTask.h */, + 86C40B9E1A8D7C5C00081FAC /* ORKOrderedTask.m */, + 86C40BD51A8D7C5C00081FAC /* ORKTask.h */, + CA2B902528A187390025B773 /* ORKTask_Util.m */, ); - path = docs; + name = Task; sourceTree = ""; }; - B12EFF301AB20E7500A80147 /* Completion Step */ = { - isa = PBXGroup; - children = ( - 86C40B521A8D7C5B00081FAC /* ORKCompletionStep.h */, - 86C40B531A8D7C5B00081FAC /* ORKCompletionStep.m */, - 86C40B541A8D7C5B00081FAC /* ORKCompletionStepViewController.h */, - 86C40B551A8D7C5B00081FAC /* ORKCompletionStepViewController.m */, - BA2CFBAE2342935800B71919 /* ORKCompletionCheckmarkView.h */, - BA2CFBAF2342935800B71919 /* ORKCompletionCheckmarkView.m */, - ); - name = "Completion Step"; - sourceTree = ""; - }; - B12EFF311AB2100400A80147 /* Skin */ = { - isa = PBXGroup; - children = ( - 86C40B6B1A8D7C5B00081FAC /* ORKBodyLabel.h */, - 86C40B6C1A8D7C5B00081FAC /* ORKBodyLabel.m */, - BA8078E1224A8D6E0013B554 /* ORKTitleLabel.h */, - BA8078E2224A8D6E0013B554 /* ORKTitleLabel.m */, - 86C40B6D1A8D7C5B00081FAC /* ORKBorderedButton.h */, - 86C40B6E1A8D7C5C00081FAC /* ORKBorderedButton.m */, - 86C40B6F1A8D7C5C00081FAC /* ORKCaption1Label.h */, - 86C40B701A8D7C5C00081FAC /* ORKCaption1Label.m */, - BA3D7E722223F8B90023FE3A /* ORKChoiceViewCell_Internal.h */, - 86C40B711A8D7C5C00081FAC /* ORKChoiceViewCell.h */, - 86C40B721A8D7C5C00081FAC /* ORKChoiceViewCell.m */, - 86C40B731A8D7C5C00081FAC /* ORKContinueButton.h */, - 86C40B741A8D7C5C00081FAC /* ORKContinueButton.m */, - 86C40B751A8D7C5C00081FAC /* ORKCountdownLabel.h */, - 86C40B761A8D7C5C00081FAC /* ORKCountdownLabel.m */, - 86C40B7A1A8D7C5C00081FAC /* ORKDefaultFont.h */, - 106FF2AC1B6FACA8004EACF2 /* ORKDirectionView.h */, - 106FF2AD1B6FACA8004EACF2 /* ORKDirectionView.m */, - FFAE713E1DAEC66200AE82B4 /* ORKFootnoteLabel.h */, - FFAE713F1DAEC66200AE82B4 /* ORKFootnoteLabel.m */, - 86C40B881A8D7C5C00081FAC /* ORKHeadlineLabel.h */, - 86C40B891A8D7C5C00081FAC /* ORKHeadlineLabel.m */, - 86C40B901A8D7C5C00081FAC /* ORKImageChoiceLabel.h */, - 86C40B911A8D7C5C00081FAC /* ORKImageChoiceLabel.m */, - 86C40B971A8D7C5C00081FAC /* ORKLabel.h */, - 86C40B981A8D7C5C00081FAC /* ORKLabel.m */, - 10BAA2C81B5FCB4F004FE478 /* ORKProgressView.h */, - 10BAA2C91B5FCB4F004FE478 /* ORKProgressView.m */, - 86C40BAA1A8D7C5C00081FAC /* ORKRoundTappingButton.h */, - 86C40BAB1A8D7C5C00081FAC /* ORKRoundTappingButton.m */, - B8760F291AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.h */, - B8760F2A1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.m */, - 24898B0B1B7186C000B0E7E7 /* ORKScaleRangeImageView.h */, - 24898B0C1B7186C000B0E7E7 /* ORKScaleRangeImageView.m */, - 86C40BAC1A8D7C5C00081FAC /* ORKScaleRangeLabel.h */, - 86C40BAD1A8D7C5C00081FAC /* ORKScaleRangeLabel.m */, - 86C40BB01A8D7C5C00081FAC /* ORKScaleValueLabel.h */, - 86C40BB11A8D7C5C00081FAC /* ORKScaleValueLabel.m */, - 86C40BB21A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.h */, - 86C40BB31A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.m */, - 86C40BB41A8D7C5C00081FAC /* ORKSelectionTitleLabel.h */, - 86C40BB51A8D7C5C00081FAC /* ORKSelectionTitleLabel.m */, - 10FF9AD51B7A045E00ECB5B4 /* ORKSeparatorView.h */, - 10FF9AD61B7A045E00ECB5B4 /* ORKSeparatorView.m */, - 86C40BB71A8D7C5C00081FAC /* ORKSkin.h */, - 86C40BB81A8D7C5C00081FAC /* ORKSkin.m */, - 86C40BC01A8D7C5C00081FAC /* ORKSubheadlineLabel.h */, - 86C40BC11A8D7C5C00081FAC /* ORKSubheadlineLabel.m */, - 86C40BD11A8D7C5C00081FAC /* ORKTableViewCell.h */, - 86C40BD21A8D7C5C00081FAC /* ORKTableViewCell.m */, - 86C40BD31A8D7C5C00081FAC /* ORKTapCountLabel.h */, - 86C40BD41A8D7C5C00081FAC /* ORKTapCountLabel.m */, - 86C40BDB1A8D7C5C00081FAC /* ORKTextButton.h */, - 86C40BDC1A8D7C5C00081FAC /* ORKTextButton.m */, - BC37323122B76D190021F665 /* ORKTextButton_Internal.h */, - 86C40B5E1A8D7C5B00081FAC /* ORKTextFieldView.h */, - 86C40B5F1A8D7C5B00081FAC /* ORKTextFieldView.m */, - BC01B0FA1B0EB99700863803 /* ORKTintedImageView_Internal.h */, - 86C40B601A8D7C5B00081FAC /* ORKTintedImageView.h */, - 86C40B611A8D7C5B00081FAC /* ORKTintedImageView.m */, - 86C40BDD1A8D7C5C00081FAC /* ORKUnitLabel.h */, - 86C40BDE1A8D7C5C00081FAC /* ORKUnitLabel.m */, - AE2CF2BF23231C5A00FDD733 /* ORKTagLabel.h */, - AE2CF2C023231C5A00FDD733 /* ORKTagLabel.m */, - 515310CD233570CF007BCA58 /* ORKDontKnowButton.h */, - 515310CE233570CF007BCA58 /* ORKDontKnowButton.m */, - 51BF30BC247B330900E2E669 /* ORKIconButton.h */, - 51BF30BD247B330900E2E669 /* ORKIconButton.m */, - ); - name = Skin; - sourceTree = ""; - }; - B12EFF321AB2106F00A80147 /* UIKitCategories */ = { - isa = PBXGroup; - children = ( - 86C40BE71A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.h */, - 86C40BE81A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.m */, - 86C40BE91A8D7C5C00081FAC /* UIResponder+ResearchKit.h */, - 86C40BEA1A8D7C5C00081FAC /* UIResponder+ResearchKit.m */, - 805685771C90C19500BF437A /* UIImage+ResearchKit.h */, - 805685781C90C19500BF437A /* UIImage+ResearchKit.m */, - ); - name = UIKitCategories; - sourceTree = ""; - }; - B12EFF331AB2110300A80147 /* Task */ = { - isa = PBXGroup; - children = ( - BC13CE371B0660220044153C /* ORKNavigableOrderedTask.h */, - BC13CE381B0660220044153C /* ORKNavigableOrderedTask.m */, - 10FF9AD91B7BA78400ECB5B4 /* ORKOrderedTask_Private.h */, - 86C40B9D1A8D7C5C00081FAC /* ORKOrderedTask.h */, - 86C40B9E1A8D7C5C00081FAC /* ORKOrderedTask.m */, - FF154FB21E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.h */, - FF154FB31E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.m */, - 86C40BD51A8D7C5C00081FAC /* ORKTask.h */, - BAC6F1A722AF535100E31C22 /* ORKTaskReviewViewController.h */, - BAC6F1A822AF535100E31C22 /* ORKTaskReviewViewController.m */, - 86C40BD91A8D7C5C00081FAC /* ORKTaskViewController_Internal.h */, - 86C40BDA1A8D7C5C00081FAC /* ORKTaskViewController_Private.h */, - 86C40BD71A8D7C5C00081FAC /* ORKTaskViewController.h */, - 86C40BD81A8D7C5C00081FAC /* ORKTaskViewController.m */, - ); - name = Task; - sourceTree = ""; - }; - B12EFF341AB2111200A80147 /* Step */ = { + B12EFF341AB2111200A80147 /* Step */ = { isa = PBXGroup; children = ( + 519CE8152C6582A0003BB584 /* Family History */, 86C40BB91A8D7C5C00081FAC /* ORKStep.h */, 86C40BBA1A8D7C5C00081FAC /* ORKStep.m */, - BAD65E4F2284F266008A5DCE /* ORKStepView_Private.h */, - BAD65E492284EFF9008A5DCE /* ORKStepView.h */, - BAD65E4A2284EFF9008A5DCE /* ORKStepView.m */, 86C40BBB1A8D7C5C00081FAC /* ORKStep_Private.h */, - 86C40BBC1A8D7C5C00081FAC /* ORKStepViewController.h */, - 86C40BBD1A8D7C5C00081FAC /* ORKStepViewController.m */, - 86C40BBE1A8D7C5C00081FAC /* ORKStepViewController_Internal.h */, BCA5C0331AEC05F20092AC8D /* ORKStepNavigationRule.h */, BCA5C0341AEC05F20092AC8D /* ORKStepNavigationRule.m */, BC13CE3B1B0662990044153C /* ORKStepNavigationRule_Private.h */, BC13CE411B066A990044153C /* ORKStepNavigationRule_Internal.h */, BCB080A01B83EFB900A3F400 /* ORKStepNavigationRule.swift */, - 86C40B771A8D7C5C00081FAC /* ORKCustomStepView.h */, - 86C40B781A8D7C5C00081FAC /* ORKCustomStepView.m */, - 86C40B791A8D7C5C00081FAC /* ORKCustomStepView_Internal.h */, + CA2B900828A17ABE0025B773 /* Active Step */, AE75433524E32C8A00E4C7CF /* Early Termination */, 5175145B245A4FCA009E8FFC /* Front Facing Camera */, 511987C024632E33004FC2C7 /* Request Permissions Step */, B12EFF351AB2116400A80147 /* Instruction Step */, - B12EFF361AB2117B00A80147 /* Question Step */, B12EFF3C1AB211FB00A80147 /* Form Step */, D44239761AF17EE700559D96 /* Image Capture Step */, 2489F7A61D65213D008DEF20 /* Video Capture Step */, @@ -3368,35 +3046,14 @@ children = ( BA8C066822ECF4B100ACDE6B /* SecondaryTask */, BAD9E90F2255E94F0014FA29 /* LearnMore Step */, - BADA2F24225DA54B005D2255 /* ORKInstructionStepContainerView.h */, - BADA2F25225DA54B005D2255 /* ORKInstructionStepContainerView.m */, 86C40B921A8D7C5C00081FAC /* ORKInstructionStep.h */, 86C40B931A8D7C5C00081FAC /* ORKInstructionStep.m */, - 86C40B941A8D7C5C00081FAC /* ORKInstructionStepViewController.h */, - 86C40B951A8D7C5C00081FAC /* ORKInstructionStepViewController.m */, - 86C40B961A8D7C5C00081FAC /* ORKInstructionStepViewController_Internal.h */, - 86C40B5A1A8D7C5B00081FAC /* ORKInstructionStepView.h */, - 86C40B5B1A8D7C5B00081FAC /* ORKInstructionStepView.m */, B12EFF301AB20E7500A80147 /* Completion Step */, BF1D43821D490482007EE90B /* Video Instruction Step */, ); name = "Instruction Step"; sourceTree = ""; }; - B12EFF361AB2117B00A80147 /* Question Step */ = { - isa = PBXGroup; - children = ( - 86C40BA11A8D7C5C00081FAC /* ORKQuestionStep.h */, - 86C40BA21A8D7C5C00081FAC /* ORKQuestionStep.m */, - 86C40BA31A8D7C5C00081FAC /* ORKQuestionStep_Internal.h */, - 5D04884B25EF4CC30006C68B /* ORKQuestionStep_Private.h */, - 86C40BA41A8D7C5C00081FAC /* ORKQuestionStepViewController.h */, - 86C40BA51A8D7C5C00081FAC /* ORKQuestionStepViewController.m */, - 86C40BA61A8D7C5C00081FAC /* ORKQuestionStepViewController_Private.h */, - ); - name = "Question Step"; - sourceTree = ""; - }; B12EFF371AB2118500A80147 /* Result */ = { isa = PBXGroup; children = ( @@ -3405,13 +3062,14 @@ 86C40BA91A8D7C5C00081FAC /* ORKResult_Private.h */, BC13CE3F1B0666FD0044153C /* ORKResultPredicate.h */, BCFF24BC1B0798D10044EC35 /* ORKResultPredicate.m */, - FF919A261E81A87B005C2A1E /* ORKActiveTaskResult.h */, FF919A511E81BEB5005C2A1E /* ORKCollectionResult.h */, FF919A521E81BEB5005C2A1E /* ORKCollectionResult.m */, FF919A551E81BEDD005C2A1E /* ORKCollectionResult_Private.h */, FF919A571E81C628005C2A1E /* ORKQuestionResult.h */, FF919A581E81C628005C2A1E /* ORKQuestionResult.m */, FF919A5B1E81C63B005C2A1E /* ORKQuestionResult_Private.h */, + FF919A391E81AF1D005C2A1E /* ORKFileResult.h */, + FF919A3A1E81AF1D005C2A1E /* ORKFileResult.m */, ); name = Result; sourceTree = ""; @@ -3421,25 +3079,6 @@ children = ( BA473FEA224DB9F600A362E3 /* Learn More */, BA473FE5224DB36500A362E3 /* Step Body */, - 86C40B5C1A8D7C5B00081FAC /* ORKTableContainerView.h */, - 86C40B5D1A8D7C5B00081FAC /* ORKTableContainerView.m */, - 86C40BE11A8D7C5C00081FAC /* ORKVerticalContainerView.h */, - 86C40BE21A8D7C5C00081FAC /* ORKVerticalContainerView.m */, - 86C40BE31A8D7C5C00081FAC /* ORKVerticalContainerView_Internal.h */, - BA43CCA622722C6E00F2A2D2 /* ORKStepContentView_Private.h */, - BA43CCA22271741C00F2A2D2 /* ORKStepContentView.h */, - BA43CCA32271741C00F2A2D2 /* ORKStepContentView.m */, - BA8078F1224AC8AA0013B554 /* ORKStepContainerView.h */, - BAB3942E22601CAB00E59B0B /* ORKStepContainerView_Private.h */, - BA8078F2224AC8AA0013B554 /* ORKStepContainerView.m */, - BA473FE1224DAFEF00A362E3 /* ORKBodyContainerView.h */, - BA473FE2224DAFEF00A362E3 /* ORKBodyContainerView.m */, - 86B89AB91AB3BECC001626A4 /* ORKStepHeaderView.h */, - 86B89ABA1AB3BECC001626A4 /* ORKStepHeaderView.m */, - 86B89ABD1AB3BFDB001626A4 /* ORKStepHeaderView_Internal.h */, - 86AD91081AB7AD1E00361FEB /* ORKNavigationContainerView.h */, - 86AD91091AB7AD1E00361FEB /* ORKNavigationContainerView.m */, - 86AD910C1AB7AE4100361FEB /* ORKNavigationContainerView_Internal.h */, ); name = "Container Views"; sourceTree = ""; @@ -3447,19 +3086,13 @@ B12EFF3B1AB211E000A80147 /* Answer Format */ = { isa = PBXGroup; children = ( - 519C297F26D0278A00FD5F44 /* SwiftUI Views */, B12EFF421AB2134100A80147 /* Choice Format Helpers */, - B12EFF411AB212E100A80147 /* Control Views */, - B12EFF3E1AB2123000A80147 /* Form Step Views */, - B12EFF3F1AB2125E00A80147 /* Question Step Views */, 86C40B641A8D7C5B00081FAC /* ORKAnswerFormat.h */, 86C40B651A8D7C5B00081FAC /* ORKAnswerFormat.m */, 86C40B661A8D7C5B00081FAC /* ORKAnswerFormat_Internal.h */, 244EFAD11BCEFD83001850D9 /* ORKAnswerFormat_Private.h */, 86C40B8A1A8D7C5C00081FAC /* ORKHealthAnswerFormat.h */, 86C40B8B1A8D7C5C00081FAC /* ORKHealthAnswerFormat.m */, - BABBB19B2093299A00CB29E5 /* ORKSurveyCardHeaderView.h */, - BABBB19C2093299A00CB29E5 /* ORKSurveyCardHeaderView.m */, ); name = "Answer Format"; sourceTree = ""; @@ -3467,14 +3100,15 @@ B12EFF3C1AB211FB00A80147 /* Form Step */ = { isa = PBXGroup; children = ( + 5192BF572AE09793006E43FB /* ORKFormItemVisibilityRule.h */, + 5192BF582AE09794006E43FB /* ORKFormItemVisibilityRule.m */, + 5192BF4F2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule_Private.h */, + 5192BF4D2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule.h */, + 5192BF4E2AE09672006E43FB /* ORKPredicateFormItemVisibilityRule.m */, 86C40B821A8D7C5C00081FAC /* ORKFormStep.h */, 86C40B831A8D7C5C00081FAC /* ORKFormStep.m */, 86C40B7F1A8D7C5C00081FAC /* ORKFormItem_Internal.h */, 7167D027231B1EAA00AAB4DD /* ORKFormStep_Internal.h */, - 86C40B841A8D7C5C00081FAC /* ORKFormStepViewController.h */, - 86C40B851A8D7C5C00081FAC /* ORKFormStepViewController.m */, - 249F44E31BCD9EAC0000D57E /* ORKFormStepViewController_Internal.h */, - BC37323522B76DC70021F665 /* ORKFormStepViewController_Private.h */, ); name = "Form Step"; sourceTree = ""; @@ -3492,86 +3126,11 @@ name = Definitions; sourceTree = ""; }; - B12EFF3E1AB2123000A80147 /* Form Step Views */ = { - isa = PBXGroup; - children = ( - 86C40B861A8D7C5C00081FAC /* ORKFormTextView.h */, - 86C40B871A8D7C5C00081FAC /* ORKFormTextView.m */, - 86C40B561A8D7C5B00081FAC /* ORKFormItemCell.h */, - 86C40B571A8D7C5B00081FAC /* ORKFormItemCell.m */, - 86C40B801A8D7C5C00081FAC /* ORKFormSectionTitleLabel.h */, - 86C40B811A8D7C5C00081FAC /* ORKFormSectionTitleLabel.m */, - ); - name = "Form Step Views"; - sourceTree = ""; - }; - B12EFF3F1AB2125E00A80147 /* Question Step Views */ = { - isa = PBXGroup; - children = ( - 86AD91121AB7B97E00361FEB /* ORKQuestionStepView.h */, - 86AD91131AB7B97E00361FEB /* ORKQuestionStepView.m */, - 86C40BC21A8D7C5C00081FAC /* ORKSurveyAnswerCell.h */, - 866F86001A96CBF3007B282C /* ORKSurveyAnswerCell.m */, - 86C40BC51A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.h */, - 86C40BC61A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.m */, - 86C40BC71A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.h */, - 86C40BC81A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.m */, - 86C40BC91A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.h */, - 86C40BCA1A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.m */, - 86C40BCD1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.h */, - 86C40BCE1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.m */, - 865EA16A1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.h */, - 865EA16B1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.m */, - CBD34A581BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.h */, - CBD34A591BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.m */, - BAC2B65522F252F70079304E /* ORKSurveyAnswerCellForSES.h */, - BAC2B65622F252F70079304E /* ORKSurveyAnswerCellForSES.m */, - ); - name = "Question Step Views"; - sourceTree = ""; - }; - B12EFF411AB212E100A80147 /* Control Views */ = { - isa = PBXGroup; - children = ( - BC1C032A1CA301E300869355 /* ORKHeightPicker.h */, - BC1C032B1CA301E300869355 /* ORKHeightPicker.m */, - 1B4B95B91F5F014E006B629F /* ORKWeightPicker.h */, - 1B4B95B71F5F012E006B629F /* ORKWeightPicker.m */, - 86B781B71AA668ED00688151 /* ORKTimeIntervalPicker.h */, - 86B781B81AA668ED00688151 /* ORKTimeIntervalPicker.m */, - 86B781B91AA668ED00688151 /* ORKValuePicker.h */, - 86B781BA1AA668ED00688151 /* ORKValuePicker.m */, - 86C40B581A8D7C5B00081FAC /* ORKImageSelectionView.h */, - 86C40B591A8D7C5B00081FAC /* ORKImageSelectionView.m */, - 86C40B671A8D7C5B00081FAC /* ORKAnswerTextField.h */, - 86C40B681A8D7C5B00081FAC /* ORKAnswerTextField.m */, - 86C40B691A8D7C5B00081FAC /* ORKAnswerTextView.h */, - 86C40B6A1A8D7C5B00081FAC /* ORKAnswerTextView.m */, - CBD34A541BB1FB9000F204EA /* ORKLocationSelectionView.h */, - CBD34A551BB1FB9000F204EA /* ORKLocationSelectionView.m */, - 861D11A71AA691BB003C98A7 /* ORKScaleSliderView.h */, - 861D11A81AA691BB003C98A7 /* ORKScaleSliderView.m */, - 86C40BAE1A8D7C5C00081FAC /* ORKScaleSlider.h */, - 86C40BAF1A8D7C5C00081FAC /* ORKScaleSlider.m */, - 865EA1601AB8DF750037C68E /* ORKDateTimePicker.h */, - 865EA1611AB8DF750037C68E /* ORKDateTimePicker.m */, - 865EA1661ABA1AA10037C68E /* ORKPicker.h */, - 865EA1671ABA1AA10037C68E /* ORKPicker.m */, - FFF65AB61E318F2D0043FB40 /* ORKMultipleValuePicker.h */, - FFF65AB71E318F2D0043FB40 /* ORKMultipleValuePicker.m */, - BAC2B65922F25A2E0079304E /* ORKSESSelectionView.h */, - BAC2B65A22F25A2E0079304E /* ORKSESSelectionView.m */, - ); - name = "Control Views"; - sourceTree = ""; - }; B12EFF421AB2134100A80147 /* Choice Format Helpers */ = { isa = PBXGroup; children = ( 861D11AB1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.h */, 861D11AC1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.m */, - 861D11B31AA7D073003C98A7 /* ORKTextChoiceCellGroup.h */, - 861D11B41AA7D073003C98A7 /* ORKTextChoiceCellGroup.m */, ); name = "Choice Format Helpers"; sourceTree = ""; @@ -3587,530 +3146,590 @@ name = PDF; sourceTree = ""; }; - B12EFF441AB214B400A80147 /* Tinted Animations */ = { + B12EFF491AB2155700A80147 /* Signature Step */ = { isa = PBXGroup; children = ( - 86C40C051A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.h */, - 86C40C061A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.m */, - 86C40BF01A8D7C5C00081FAC /* MovieTintShader.fsh */, - 86C40BF11A8D7C5C00081FAC /* MovieTintShader.vsh */, + FF5CA6191D2C6453001660A3 /* ORKSignatureStep.h */, + FF5CA61A1D2C6453001660A3 /* ORKSignatureStep.m */, + FF919A611E81D04D005C2A1E /* ORKSignatureResult.h */, + FF919A621E81D04D005C2A1E /* ORKSignatureResult.m */, + FF919A651E81D164005C2A1E /* ORKSignatureResult_Private.h */, ); - name = "Tinted Animations"; + name = "Signature Step"; sourceTree = ""; }; - B12EFF451AB214E000A80147 /* Model */ = { + B1C0F4E01A9BA65F0022C153 /* Localized */ = { isa = PBXGroup; children = ( - BCCE9EC021104B2200B809F8 /* ORKConsentDocument_Private.h */, - 86C40BF21A8D7C5C00081FAC /* ORKConsentDocument.h */, - 86C40BF31A8D7C5C00081FAC /* ORKConsentDocument.m */, - 86C40BF41A8D7C5C00081FAC /* ORKConsentDocument_Internal.h */, - 86C40BFF1A8D7C5C00081FAC /* ORKConsentSection.h */, - 86C40C001A8D7C5C00081FAC /* ORKConsentSection.m */, - 86C40C011A8D7C5C00081FAC /* ORKConsentSection_Private.h */, - 86C40C021A8D7C5C00081FAC /* ORKConsentSignature.h */, - 86C40C031A8D7C5C00081FAC /* ORKConsentSignature.m */, + B1C0F4E11A9BA65F0022C153 /* ResearchKit.strings */, + 714080D9235FD14700281E04 /* ResearchKit.stringsdict */, ); - name = Model; + path = Localized; sourceTree = ""; }; - B12EFF461AB2150C00A80147 /* Visual */ = { + BA473FE5224DB36500A362E3 /* Step Body */ = { isa = PBXGroup; children = ( - B12EFF4C1AB2158100A80147 /* Consent Views */, - B12EFF4B1AB2157000A80147 /* Learn More */, + BA473FE6224DB38900A362E3 /* ORKBodyItem.h */, + 5D43C5D324255675006F4084 /* ORKBodyItem_Internal.h */, + BA473FE7224DB38900A362E3 /* ORKBodyItem.m */, ); - name = Visual; + name = "Step Body"; sourceTree = ""; }; - B12EFF471AB2151B00A80147 /* Review */ = { + BA473FEA224DB9F600A362E3 /* Learn More */ = { isa = PBXGroup; children = ( - 86C40BF71A8D7C5C00081FAC /* ORKConsentReviewStep.h */, - 86C40BF81A8D7C5C00081FAC /* ORKConsentReviewStep.m */, - 86C40BF91A8D7C5C00081FAC /* ORKConsentReviewStepViewController.h */, - 86C40BFA1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.m */, - FF919A671E81D255005C2A1E /* ORKConsentSignatureResult.h */, - FF919A681E81D255005C2A1E /* ORKConsentSignatureResult.m */, - B12EFF4A1AB2155C00A80147 /* Document Review */, + BA8C501F226FFB04001896D0 /* ORKLearnMoreItem.h */, + BA8C5020226FFB04001896D0 /* ORKLearnMoreItem.m */, ); - name = Review; + name = "Learn More"; sourceTree = ""; }; - B12EFF481AB2152D00A80147 /* Sharing */ = { + BA8C066822ECF4B100ACDE6B /* SecondaryTask */ = { isa = PBXGroup; children = ( - B11C54961A9EEF8800265E61 /* ORKConsentSharingStep.h */, - B11C54971A9EEF8800265E61 /* ORKConsentSharingStep.m */, - B11C549C1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h */, - B11C549D1A9EF4A700265E61 /* ORKConsentSharingStepViewController.m */, + 5192BF892AE1BBB0006E43FB /* ORKSecondaryTaskStep.h */, + 5192BF882AE1BBB0006E43FB /* ORKSecondaryTaskStep.m */, ); - name = Sharing; + name = SecondaryTask; + path = ../ActiveTasks; sourceTree = ""; }; - B12EFF491AB2155700A80147 /* Signature Step */ = { + BAB96753226E5D21006AAC56 /* Views */ = { isa = PBXGroup; children = ( - 86C40BEE1A8D7C5C00081FAC /* ORKSignatureStepViewController.h */, - 86C40BEF1A8D7C5C00081FAC /* ORKSignatureStepViewController.m */, - 86C40C071A8D7C5C00081FAC /* ORKSignatureView.h */, - 86C40C081A8D7C5C00081FAC /* ORKSignatureView.m */, - FF5CA6191D2C6453001660A3 /* ORKSignatureStep.h */, - FF5CA61A1D2C6453001660A3 /* ORKSignatureStep.m */, - FF919A611E81D04D005C2A1E /* ORKSignatureResult.h */, - FF919A621E81D04D005C2A1E /* ORKSignatureResult.m */, - FF919A651E81D164005C2A1E /* ORKSignatureResult_Private.h */, - F7EC216424787338000C1F46 /* ORKCustomSignatureFooterView.h */, - F7EC216524787338000C1F46 /* ORKCustomSignatureFooterView.m */, - F7C022F8248EEAAC00782A61 /* ORKCustomSignatureFooterView_Private.h */, + BAB96754226E5D67006AAC56 /* ORKStepContainerViewTests.m */, ); - name = "Signature Step"; + name = Views; sourceTree = ""; }; - B12EFF4A1AB2155C00A80147 /* Document Review */ = { + BABBB1AB2097D94000CB29E5 /* PDFStep */ = { isa = PBXGroup; children = ( - 86C40BEC1A8D7C5C00081FAC /* ORKConsentReviewController.h */, - 86C40BED1A8D7C5C00081FAC /* ORKConsentReviewController.m */, + BABBB1AC2097D97200CB29E5 /* ORKPDFViewerStep.h */, + BABBB1AD2097D97200CB29E5 /* ORKPDFViewerStep.m */, ); - name = "Document Review"; + name = PDFStep; sourceTree = ""; }; - B12EFF4B1AB2157000A80147 /* Learn More */ = { + BAD9E90F2255E94F0014FA29 /* LearnMore Step */ = { isa = PBXGroup; children = ( - 86C40BF51A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.h */, - 86C40BF61A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.m */, + BAD9E9102255E9750014FA29 /* ORKLearnMoreInstructionStep.h */, + BAD9E9112255E9750014FA29 /* ORKLearnMoreInstructionStep.m */, ); - name = "Learn More"; + name = "LearnMore Step"; sourceTree = ""; }; - B12EFF4C1AB2158100A80147 /* Consent Views */ = { + BC4194261AE8451F00073D6B /* Misc */ = { isa = PBXGroup; children = ( - B12EFF441AB214B400A80147 /* Tinted Animations */, + 03BD9EA1253E62A0008ADBE1 /* ORKBundleAsset.h */, + 03BD9EA2253E62A0008ADBE1 /* ORKBundleAsset.m */, + 86C40B471A8D7C5B00081FAC /* ORKRecorder.h */, + 86C40B481A8D7C5B00081FAC /* ORKRecorder.m */, + 86C40B491A8D7C5B00081FAC /* ORKRecorder_Internal.h */, + 86C40B4A1A8D7C5B00081FAC /* ORKRecorder_Private.h */, + 86C40B3C1A8D7C5B00081FAC /* ORKDataLogger.h */, + 86C40B3D1A8D7C5B00081FAC /* ORKDataLogger.m */, ); - name = "Consent Views"; + name = Misc; sourceTree = ""; }; - B12EFF4E1AB2161500A80147 /* Audio */ = { + BF1D43821D490482007EE90B /* Video Instruction Step */ = { isa = PBXGroup; children = ( - 5D1CE45823FC85F3004CB416 /* ORKAudioMeteringView.h */, - 5D1CE45923FC85F4004CB416 /* ORKAudioMeteringView.m */, - 2E8071011FB0E6BE00E4FC7F /* ORKAudioGraphView.h */, - 2E8071001FB0E6BE00E4FC7F /* ORKAudioGraphView.m */, - 86C40AFE1A8D7C5B00081FAC /* ORKAudioStep.h */, - 86C40AFF1A8D7C5B00081FAC /* ORKAudioStep.m */, - 86C40B001A8D7C5B00081FAC /* ORKAudioStepViewController.h */, - 86C40B011A8D7C5B00081FAC /* ORKAudioStepViewController.m */, - 86C40AFC1A8D7C5B00081FAC /* ORKAudioContentView.h */, - 86C40AFD1A8D7C5B00081FAC /* ORKAudioContentView.m */, - FF36A48B1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.h */, - FF36A48C1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.m */, + BF1D43831D4904C6007EE90B /* ORKVideoInstructionStep.h */, + BF1D43841D4904C6007EE90B /* ORKVideoInstructionStep.m */, + FF919A5D1E81CF07005C2A1E /* ORKVideoInstructionStepResult.h */, + FF919A5E1E81CF07005C2A1E /* ORKVideoInstructionStepResult.m */, ); - name = Audio; + name = "Video Instruction Step"; sourceTree = ""; }; - B12EFF4F1AB2165B00A80147 /* Common */ = { + BF690AD61BAD3DC0009C5ADA /* Review Step */ = { isa = PBXGroup; children = ( - 9550E6701D58DB9A00C691B8 /* Touch Anywhere Step */, - B12EFF501AB2167400A80147 /* Active Step */, - B12EFF5C1AB2175B00A80147 /* Countdown Step */, - B12EFF531AB216AA00A80147 /* Recorders */, - FF919A381E81AEF8005C2A1E /* Results */, + BF9155951BDE8D7D007FA459 /* ORKReviewStep_Internal.h */, + BF9155961BDE8D7D007FA459 /* ORKReviewStep.h */, + BF9155971BDE8D7D007FA459 /* ORKReviewStep.m */, ); - name = Common; + name = "Review Step"; sourceTree = ""; }; - B12EFF501AB2167400A80147 /* Active Step */ = { + BF9D62C41BD244C4000AA6A7 /* Wait Step */ = { isa = PBXGroup; children = ( - 86C40B301A8D7C5B00081FAC /* ORKActiveStep.h */, - 86C40B311A8D7C5B00081FAC /* ORKActiveStep.m */, - 86C40B321A8D7C5B00081FAC /* ORKActiveStep_Internal.h */, - 86C40B371A8D7C5B00081FAC /* ORKActiveStepViewController.h */, - 86C40B381A8D7C5B00081FAC /* ORKActiveStepViewController.m */, - 86C40B391A8D7C5B00081FAC /* ORKActiveStepViewController_Internal.h */, - B12EFF511AB2168100A80147 /* Timing */, - B12EFF611AB217AE00A80147 /* Speech Synthesis */, - B12EFF521AB2168C00A80147 /* Views */, + BF9155A11BDE8DA9007FA459 /* ORKWaitStep.h */, + BF9155A21BDE8DA9007FA459 /* ORKWaitStep.m */, ); - name = "Active Step"; + name = "Wait Step"; sourceTree = ""; }; - B12EFF511AB2168100A80147 /* Timing */ = { + CA1C7A61288B0E74004DAB3A /* ORKCheckmarkButton */ = { isa = PBXGroup; children = ( - 86C40B331A8D7C5B00081FAC /* ORKActiveStepTimer.h */, - 86C40B341A8D7C5B00081FAC /* ORKActiveStepTimer.m */, + 5D43C5CF24217393006F4084 /* ORKRecordButton.h */, + 5D43C5D024217393006F4084 /* ORKRecordButton.m */, ); - name = Timing; + path = ORKCheckmarkButton; sourceTree = ""; }; - B12EFF521AB2168C00A80147 /* Views */ = { + CA1C7A62288B0EEA004DAB3A /* CheckmarkView */ = { isa = PBXGroup; children = ( - 86AD910E1AB7B8A600361FEB /* ORKActiveStepView.h */, - 86AD910F1AB7B8A600361FEB /* ORKActiveStepView.m */, - 86C40AFA1A8D7C5B00081FAC /* ORKActiveStepQuantityView.h */, - 86C40AFB1A8D7C5B00081FAC /* ORKActiveStepQuantityView.m */, - 86C40B351A8D7C5B00081FAC /* ORKActiveStepTimerView.h */, - 86C40B361A8D7C5B00081FAC /* ORKActiveStepTimerView.m */, + BAD6FAAF2332A2FD006647E7 /* ORKCheckmarkView.h */, + BAD6FAB02332A2FD006647E7 /* ORKCheckmarkView.m */, ); - name = Views; + path = CheckmarkView; sourceTree = ""; }; - B12EFF531AB216AA00A80147 /* Recorders */ = { + CA1C7A63288B0F11004DAB3A /* Review */ = { isa = PBXGroup; children = ( - 86C40B471A8D7C5B00081FAC /* ORKRecorder.h */, - 86C40B481A8D7C5B00081FAC /* ORKRecorder.m */, - 86C40B491A8D7C5B00081FAC /* ORKRecorder_Internal.h */, - 86C40B4A1A8D7C5B00081FAC /* ORKRecorder_Private.h */, - 86C40B3C1A8D7C5B00081FAC /* ORKDataLogger.h */, - 86C40B3D1A8D7C5B00081FAC /* ORKDataLogger.m */, - B12EFF551AB216E700A80147 /* Accelerometer */, - B12EFF561AB216EE00A80147 /* Audio */, - B12EFF571AB216FD00A80147 /* Device Motion */, - B12EFF581AB2170A00A80147 /* Health */, - B12EFF591AB2171900A80147 /* Location */, - B12EFF5A1AB2172100A80147 /* Pedometer */, - B12EFF5B1AB2172B00A80147 /* Touch */, + BA2645E42301571800D00B73 /* ORKReviewViewController.h */, + BA2645E52301571800D00B73 /* ORKReviewViewController.m */, + AEFE0ABF230DB857004D0519 /* ORKReviewIncompleteCell.h */, + AEFE0AC0230DB857004D0519 /* ORKReviewIncompleteCell.m */, ); - name = Recorders; + path = Review; sourceTree = ""; }; - B12EFF551AB216E700A80147 /* Accelerometer */ = { + CA1C7A65288B0F5A004DAB3A /* Playback Button */ = { isa = PBXGroup; children = ( - 86C40B2E1A8D7C5B00081FAC /* ORKAccelerometerRecorder.h */, - 86C40B2F1A8D7C5B00081FAC /* ORKAccelerometerRecorder.m */, - 86C40B241A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.h */, - 86C40B251A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.m */, + BA8C067622EEB84B00ACDE6B /* ORKPlaybackButton.h */, + BA8C067722EEB84B00ACDE6B /* ORKPlaybackButton.m */, + 5D58800A24007140005B3D91 /* ORKPlaybackButton_Internal.h */, ); - name = Accelerometer; + path = "Playback Button"; sourceTree = ""; }; - B12EFF561AB216EE00A80147 /* Audio */ = { + CA1C7A66288B0F7D004DAB3A /* Ring View */ = { isa = PBXGroup; children = ( - 86C40B3A1A8D7C5B00081FAC /* ORKAudioRecorder.h */, - 86C40B3B1A8D7C5B00081FAC /* ORKAudioRecorder.m */, - 2E80C1A81FA2A6E500399A0C /* ORKStreamingAudioRecorder.h */, - 2E80C1A91FA2AA8D00399A0C /* ORKStreamingAudioRecorder.m */, - 5D3800692437E53500E7D2BD /* ORKAudioStreamer.h */, - 5D38006A2437E53500E7D2BD /* ORKAudioStreamer.m */, + BA87E26B20A79FA100B375A9 /* ORKRingView.h */, + BA87E26C20A79FA100B375A9 /* ORKRingView.m */, ); - name = Audio; + path = "Ring View"; sourceTree = ""; }; - B12EFF571AB216FD00A80147 /* Device Motion */ = { + CA1C7A67288B0FE7004DAB3A /* Answer Format */ = { isa = PBXGroup; children = ( - 86C40B3F1A8D7C5B00081FAC /* ORKDeviceMotionRecorder.h */, - 86C40B401A8D7C5B00081FAC /* ORKDeviceMotionRecorder.m */, - 86C40B261A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.h */, - 86C40B271A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.m */, - 86C40B281A8D7C5B00081FAC /* CMMotionActivity+ORKJSONDictionary.h */, - 86C40B291A8D7C5B00081FAC /* CMMotionActivity+ORKJSONDictionary.m */, + CA1C7A68288B0FFF004DAB3A /* SwiftUI Views */, + CA1C7A69288B1093004DAB3A /* Choice Format Helpers */, + CA1C7A6A288B1243004DAB3A /* Control Views */, + CA1C7A6B288B140A004DAB3A /* Form Step Views */, + CA1C7A6C288B1438004DAB3A /* Question Step Views */, + BABBB19B2093299A00CB29E5 /* ORKSurveyCardHeaderView.h */, + BABBB19C2093299A00CB29E5 /* ORKSurveyCardHeaderView.m */, ); - name = "Device Motion"; + path = "Answer Format"; sourceTree = ""; }; - B12EFF581AB2170A00A80147 /* Health */ = { + CA1C7A68288B0FFF004DAB3A /* SwiftUI Views */ = { isa = PBXGroup; children = ( - 71D8EF1520B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.h */, - 71D8EF1620B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.m */, - 86C40B411A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.h */, - 86C40B421A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.m */, - 86C40B2C1A8D7C5B00081FAC /* HKSample+ORKJSONDictionary.h */, - 86C40B2D1A8D7C5B00081FAC /* HKSample+ORKJSONDictionary.m */, + 519C298026D027AB00FD5F44 /* SwiftUIViewFactory.swift */, + 519C298D26D027E500FD5F44 /* TextChoiceView.swift */, ); - name = Health; + path = "SwiftUI Views"; sourceTree = ""; }; - B12EFF591AB2171900A80147 /* Location */ = { + CA1C7A69288B1093004DAB3A /* Choice Format Helpers */ = { isa = PBXGroup; children = ( - 86C40B431A8D7C5B00081FAC /* ORKLocationRecorder.h */, - 86C40B441A8D7C5B00081FAC /* ORKLocationRecorder.m */, - 86C40B221A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.h */, - 86C40B231A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.m */, + 5192BF9C2AE1DE62006E43FB /* ORKColorChoiceCellGroup.h */, + 5192BF9B2AE1DE62006E43FB /* ORKColorChoiceCellGroup.m */, + 861D11B31AA7D073003C98A7 /* ORKTextChoiceCellGroup.h */, + 861D11B41AA7D073003C98A7 /* ORKTextChoiceCellGroup.m */, ); - name = Location; + path = "Choice Format Helpers"; sourceTree = ""; }; - B12EFF5A1AB2172100A80147 /* Pedometer */ = { + CA1C7A6A288B1243004DAB3A /* Control Views */ = { isa = PBXGroup; children = ( - 86C40B451A8D7C5B00081FAC /* ORKPedometerRecorder.h */, - 86C40B461A8D7C5B00081FAC /* ORKPedometerRecorder.m */, - 86C40B2A1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.h */, - 86C40B2B1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.m */, + 5192BF8D2AE1C051006E43FB /* ORKAgePicker.h */, + 5192BF8E2AE1C051006E43FB /* ORKAgePicker.m */, + BC1C032A1CA301E300869355 /* ORKHeightPicker.h */, + BC1C032B1CA301E300869355 /* ORKHeightPicker.m */, + 1B4B95B91F5F014E006B629F /* ORKWeightPicker.h */, + 1B4B95B71F5F012E006B629F /* ORKWeightPicker.m */, + 86B781B71AA668ED00688151 /* ORKTimeIntervalPicker.h */, + 86B781B81AA668ED00688151 /* ORKTimeIntervalPicker.m */, + 86B781B91AA668ED00688151 /* ORKValuePicker.h */, + 86B781BA1AA668ED00688151 /* ORKValuePicker.m */, + 86C40B581A8D7C5B00081FAC /* ORKImageSelectionView.h */, + 86C40B591A8D7C5B00081FAC /* ORKImageSelectionView.m */, + 86C40B671A8D7C5B00081FAC /* ORKAnswerTextField.h */, + 86C40B681A8D7C5B00081FAC /* ORKAnswerTextField.m */, + 86C40B691A8D7C5B00081FAC /* ORKAnswerTextView.h */, + 86C40B6A1A8D7C5B00081FAC /* ORKAnswerTextView.m */, + CBD34A541BB1FB9000F204EA /* ORKLocationSelectionView.h */, + CBD34A551BB1FB9000F204EA /* ORKLocationSelectionView.m */, + 861D11A71AA691BB003C98A7 /* ORKScaleSliderView.h */, + 861D11A81AA691BB003C98A7 /* ORKScaleSliderView.m */, + 86C40BAE1A8D7C5C00081FAC /* ORKScaleSlider.h */, + 86C40BAF1A8D7C5C00081FAC /* ORKScaleSlider.m */, + 865EA1601AB8DF750037C68E /* ORKDateTimePicker.h */, + 865EA1611AB8DF750037C68E /* ORKDateTimePicker.m */, + 865EA1661ABA1AA10037C68E /* ORKPicker.h */, + 865EA1671ABA1AA10037C68E /* ORKPicker.m */, + FFF65AB61E318F2D0043FB40 /* ORKMultipleValuePicker.h */, + FFF65AB71E318F2D0043FB40 /* ORKMultipleValuePicker.m */, + BAC2B65922F25A2E0079304E /* ORKSESSelectionView.h */, + BAC2B65A22F25A2E0079304E /* ORKSESSelectionView.m */, ); - name = Pedometer; + path = "Control Views"; sourceTree = ""; }; - B12EFF5B1AB2172B00A80147 /* Touch */ = { + CA1C7A6B288B140A004DAB3A /* Form Step Views */ = { isa = PBXGroup; children = ( - 86C40B4B1A8D7C5B00081FAC /* ORKTouchRecorder.h */, - 86C40B4C1A8D7C5B00081FAC /* ORKTouchRecorder.m */, - 86C40B4F1A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.h */, - 86C40B501A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.m */, + 86C40B861A8D7C5C00081FAC /* ORKFormTextView.h */, + 86C40B871A8D7C5C00081FAC /* ORKFormTextView.m */, + 86C40B561A8D7C5B00081FAC /* ORKFormItemCell.h */, + 86C40B571A8D7C5B00081FAC /* ORKFormItemCell.m */, + 86C40B801A8D7C5C00081FAC /* ORKFormSectionTitleLabel.h */, + 86C40B811A8D7C5C00081FAC /* ORKFormSectionTitleLabel.m */, ); - name = Touch; + path = "Form Step Views"; sourceTree = ""; }; - B12EFF5C1AB2175B00A80147 /* Countdown Step */ = { + CA1C7A6C288B1438004DAB3A /* Question Step Views */ = { isa = PBXGroup; children = ( - 86C40B021A8D7C5B00081FAC /* ORKCountdownStep.h */, - 86C40B031A8D7C5B00081FAC /* ORKCountdownStep.m */, - 86C40B041A8D7C5B00081FAC /* ORKCountdownStepViewController.h */, - 86C40B051A8D7C5B00081FAC /* ORKCountdownStepViewController.m */, + 86C40BC21A8D7C5C00081FAC /* ORKSurveyAnswerCell.h */, + 866F86001A96CBF3007B282C /* ORKSurveyAnswerCell.m */, + 86C40BC51A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.h */, + 86C40BC61A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.m */, + 86C40BC71A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.h */, + 86C40BC81A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.m */, + 86C40BC91A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.h */, + 86C40BCA1A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.m */, + 86C40BCD1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.h */, + 86C40BCE1A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.m */, + 865EA16A1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.h */, + 865EA16B1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.m */, + CBD34A581BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.h */, + CBD34A591BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.m */, + BAC2B65522F252F70079304E /* ORKSurveyAnswerCellForSES.h */, + BAC2B65622F252F70079304E /* ORKSurveyAnswerCellForSES.m */, ); - name = "Countdown Step"; + path = "Question Step Views"; sourceTree = ""; }; - B12EFF5D1AB2177700A80147 /* Fitness */ = { + CA1C7A6D288B17A0004DAB3A /* Container Views */ = { isa = PBXGroup; children = ( - 86C40B081A8D7C5B00081FAC /* ORKFitnessStep.h */, - 86C40B091A8D7C5B00081FAC /* ORKFitnessStep.m */, - 86C40B0A1A8D7C5B00081FAC /* ORKFitnessStepViewController.h */, - 86C40B0B1A8D7C5B00081FAC /* ORKFitnessStepViewController.m */, - 03057F372515771800C4EC5B /* ORKAudioFitnessStepViewController.h */, - 03057F382515771800C4EC5B /* ORKAudioFitnessStepViewController.m */, - 03057F3B2515772E00C4EC5B /* ORKAudioFitnessStep.h */, - 03057F3C2515772E00C4EC5B /* ORKAudioFitnessStep.m */, - 86C40B061A8D7C5B00081FAC /* ORKFitnessContentView.h */, - 86C40B071A8D7C5B00081FAC /* ORKFitnessContentView.m */, + CA1C7A6E288B17A6004DAB3A /* Learn More */, + 86C40B5C1A8D7C5B00081FAC /* ORKTableContainerView.h */, + 86C40B5D1A8D7C5B00081FAC /* ORKTableContainerView.m */, + 86C40BE11A8D7C5C00081FAC /* ORKVerticalContainerView.h */, + 86C40BE21A8D7C5C00081FAC /* ORKVerticalContainerView.m */, + 86C40BE31A8D7C5C00081FAC /* ORKVerticalContainerView_Internal.h */, + BA43CCA622722C6E00F2A2D2 /* ORKStepContentView_Private.h */, + BA43CCA22271741C00F2A2D2 /* ORKStepContentView.h */, + BA43CCA32271741C00F2A2D2 /* ORKStepContentView.m */, + BA8078F1224AC8AA0013B554 /* ORKStepContainerView.h */, + BAB3942E22601CAB00E59B0B /* ORKStepContainerView_Private.h */, + BA8078F2224AC8AA0013B554 /* ORKStepContainerView.m */, + BA473FE1224DAFEF00A362E3 /* ORKBodyContainerView.h */, + BA473FE2224DAFEF00A362E3 /* ORKBodyContainerView.m */, + 86B89AB91AB3BECC001626A4 /* ORKStepHeaderView.h */, + 86B89ABA1AB3BECC001626A4 /* ORKStepHeaderView.m */, + 86B89ABD1AB3BFDB001626A4 /* ORKStepHeaderView_Internal.h */, + 86AD91081AB7AD1E00361FEB /* ORKNavigationContainerView.h */, + 86AD91091AB7AD1E00361FEB /* ORKNavigationContainerView.m */, + 86AD910C1AB7AE4100361FEB /* ORKNavigationContainerView_Internal.h */, ); - name = Fitness; + path = "Container Views"; sourceTree = ""; }; - B12EFF5E1AB2177D00A80147 /* Spatial Span Memory */ = { + CA1C7A6E288B17A6004DAB3A /* Learn More */ = { isa = PBXGroup; children = ( - FF919A341E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.h */, - FF919A351E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.m */, - 86C40B121A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.h */, - 86C40B131A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.m */, - 86C40B141A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.h */, - 86C40B151A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.m */, - 86C40B0C1A8D7C5B00081FAC /* ORKSpatialSpanGame.h */, - 86C40B0D1A8D7C5B00081FAC /* ORKSpatialSpanGame.m */, - 86C40B0E1A8D7C5B00081FAC /* ORKSpatialSpanGameState.h */, - 86C40B0F1A8D7C5B00081FAC /* ORKSpatialSpanGameState.m */, - 86C40B101A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.h */, - 86C40B111A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.m */, - 86C40B161A8D7C5B00081FAC /* ORKSpatialSpanTargetView.h */, - 86C40B171A8D7C5B00081FAC /* ORKSpatialSpanTargetView.m */, - ); - name = "Spatial Span Memory"; - sourceTree = ""; - }; - B12EFF5F1AB2178500A80147 /* Tapping */ = { - isa = PBXGroup; - children = ( - 86C40B181A8D7C5B00081FAC /* ORKTappingContentView.h */, - 86C40B191A8D7C5B00081FAC /* ORKTappingContentView.m */, - FF919A201E81A56F005C2A1E /* ORKTappingIntervalResult.h */, - FF919A211E81A56F005C2A1E /* ORKTappingIntervalResult.m */, - 86C40B1A1A8D7C5B00081FAC /* ORKTappingIntervalStep.h */, - 86C40B1B1A8D7C5B00081FAC /* ORKTappingIntervalStep.m */, - 86C40B1C1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.h */, - 86C40B1D1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.m */, + BA473FEB224DBA3700A362E3 /* ORKLearnMoreView.h */, + BA473FEC224DBA3700A362E3 /* ORKLearnMoreView.m */, ); - name = Tapping; + path = "Learn More"; sourceTree = ""; }; - B12EFF601AB2178B00A80147 /* Short Walk */ = { + CA1C7A6F288B18B8004DAB3A /* Common */ = { isa = PBXGroup; children = ( - 86C40B1E1A8D7C5B00081FAC /* ORKWalkingTaskStep.h */, - 86C40B1F1A8D7C5B00081FAC /* ORKWalkingTaskStep.m */, - 86C40B201A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.h */, - 86C40B211A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.m */, + CA1C7A61288B0E74004DAB3A /* ORKCheckmarkButton */, + CA1C7A62288B0EEA004DAB3A /* CheckmarkView */, + CA1C7A63288B0F11004DAB3A /* Review */, + CA1C7A65288B0F5A004DAB3A /* Playback Button */, + CA1C7A66288B0F7D004DAB3A /* Ring View */, + CA1C7A67288B0FE7004DAB3A /* Answer Format */, + CA1C7A6D288B17A0004DAB3A /* Container Views */, + CA1C7A70288B18CC004DAB3A /* Misc */, + CA1C7A72288B1A75004DAB3A /* Skin */, + CA1C7A73288B1ADD004DAB3A /* Step */, + CA1C7A88288B22B0004DAB3A /* Task */, + CA1C7A8A288B2330004DAB3A /* UIKitCategories */, ); - name = "Short Walk"; + path = Common; sourceTree = ""; }; - B12EFF611AB217AE00A80147 /* Speech Synthesis */ = { + CA1C7A70288B18CC004DAB3A /* Misc */ = { isa = PBXGroup; children = ( - 86C40B4D1A8D7C5B00081FAC /* ORKVoiceEngine.h */, - 86C40B4E1A8D7C5B00081FAC /* ORKVoiceEngine.m */, - 2EBFE11E1AE1B68800CB8254 /* ORKVoiceEngine_Internal.h */, + BC4194271AE8453A00073D6B /* ORKObserver.h */, + BC4194281AE8453A00073D6B /* ORKObserver.m */, ); - name = "Speech Synthesis"; + path = Misc; sourceTree = ""; }; - B1A860D91A9693C400EA57B7 /* Animations */ = { + CA1C7A72288B1A75004DAB3A /* Skin */ = { isa = PBXGroup; children = ( - B1A860DA1A9693C400EA57B7 /* phone@2x */, - B1A860E21A9693C400EA57B7 /* phone@3x */, + 51FBAC5C2BC9CE4A009CA28F /* ORKBorderedButton_Internal.h */, + 5192BF912AE1C2F7006E43FB /* ORKChoiceViewCell+ORKColorChoice.h */, + 5192BF922AE1C2F7006E43FB /* ORKChoiceViewCell+ORKColorChoice.m */, + 0B8444632A79C25000292DEA /* ORKChoiceViewCell+ORKTextChoice.h */, + 0B8444642A79C25000292DEA /* ORKChoiceViewCell+ORKTextChoice.m */, + 86C40B6B1A8D7C5B00081FAC /* ORKBodyLabel.h */, + 86C40B6C1A8D7C5B00081FAC /* ORKBodyLabel.m */, + BA8078E1224A8D6E0013B554 /* ORKTitleLabel.h */, + BA8078E2224A8D6E0013B554 /* ORKTitleLabel.m */, + 86C40B6D1A8D7C5B00081FAC /* ORKBorderedButton.h */, + 86C40B6E1A8D7C5C00081FAC /* ORKBorderedButton.m */, + 86C40B6F1A8D7C5C00081FAC /* ORKCaption1Label.h */, + 86C40B701A8D7C5C00081FAC /* ORKCaption1Label.m */, + BA3D7E722223F8B90023FE3A /* ORKChoiceViewCell_Internal.h */, + 86C40B711A8D7C5C00081FAC /* ORKChoiceViewCell.h */, + 86C40B721A8D7C5C00081FAC /* ORKChoiceViewCell.m */, + 86C40B731A8D7C5C00081FAC /* ORKContinueButton.h */, + 86C40B741A8D7C5C00081FAC /* ORKContinueButton.m */, + 86C40B751A8D7C5C00081FAC /* ORKCountdownLabel.h */, + 86C40B761A8D7C5C00081FAC /* ORKCountdownLabel.m */, + 86C40B7A1A8D7C5C00081FAC /* ORKDefaultFont.h */, + 106FF2AC1B6FACA8004EACF2 /* ORKDirectionView.h */, + 106FF2AD1B6FACA8004EACF2 /* ORKDirectionView.m */, + FFAE713E1DAEC66200AE82B4 /* ORKFootnoteLabel.h */, + FFAE713F1DAEC66200AE82B4 /* ORKFootnoteLabel.m */, + 86C40B881A8D7C5C00081FAC /* ORKHeadlineLabel.h */, + 86C40B891A8D7C5C00081FAC /* ORKHeadlineLabel.m */, + 86C40B901A8D7C5C00081FAC /* ORKImageChoiceLabel.h */, + 86C40B911A8D7C5C00081FAC /* ORKImageChoiceLabel.m */, + 86C40B971A8D7C5C00081FAC /* ORKLabel.h */, + 86C40B981A8D7C5C00081FAC /* ORKLabel.m */, + 10BAA2C81B5FCB4F004FE478 /* ORKProgressView.h */, + 10BAA2C91B5FCB4F004FE478 /* ORKProgressView.m */, + 86C40BAA1A8D7C5C00081FAC /* ORKRoundTappingButton.h */, + 86C40BAB1A8D7C5C00081FAC /* ORKRoundTappingButton.m */, + B8760F291AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.h */, + B8760F2A1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.m */, + 24898B0B1B7186C000B0E7E7 /* ORKScaleRangeImageView.h */, + 24898B0C1B7186C000B0E7E7 /* ORKScaleRangeImageView.m */, + 86C40BAC1A8D7C5C00081FAC /* ORKScaleRangeLabel.h */, + 86C40BAD1A8D7C5C00081FAC /* ORKScaleRangeLabel.m */, + 86C40BB01A8D7C5C00081FAC /* ORKScaleValueLabel.h */, + 86C40BB11A8D7C5C00081FAC /* ORKScaleValueLabel.m */, + 86C40BB21A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.h */, + 86C40BB31A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.m */, + 86C40BB41A8D7C5C00081FAC /* ORKSelectionTitleLabel.h */, + 86C40BB51A8D7C5C00081FAC /* ORKSelectionTitleLabel.m */, + 10FF9AD51B7A045E00ECB5B4 /* ORKSeparatorView.h */, + 10FF9AD61B7A045E00ECB5B4 /* ORKSeparatorView.m */, + 86C40BC01A8D7C5C00081FAC /* ORKSubheadlineLabel.h */, + 86C40BC11A8D7C5C00081FAC /* ORKSubheadlineLabel.m */, + 86C40BD11A8D7C5C00081FAC /* ORKTableViewCell.h */, + 86C40BD21A8D7C5C00081FAC /* ORKTableViewCell.m */, + 86C40BD31A8D7C5C00081FAC /* ORKTapCountLabel.h */, + 86C40BD41A8D7C5C00081FAC /* ORKTapCountLabel.m */, + 86C40BDB1A8D7C5C00081FAC /* ORKTextButton.h */, + 86C40BDC1A8D7C5C00081FAC /* ORKTextButton.m */, + BC37323122B76D190021F665 /* ORKTextButton_Internal.h */, + 86C40B5E1A8D7C5B00081FAC /* ORKTextFieldView.h */, + 86C40B5F1A8D7C5B00081FAC /* ORKTextFieldView.m */, + BC01B0FA1B0EB99700863803 /* ORKTintedImageView_Internal.h */, + 86C40B601A8D7C5B00081FAC /* ORKTintedImageView.h */, + 86C40B611A8D7C5B00081FAC /* ORKTintedImageView.m */, + 86C40BDD1A8D7C5C00081FAC /* ORKUnitLabel.h */, + 86C40BDE1A8D7C5C00081FAC /* ORKUnitLabel.m */, + AE2CF2BF23231C5A00FDD733 /* ORKTagLabel.h */, + AE2CF2C023231C5A00FDD733 /* ORKTagLabel.m */, + 515310CD233570CF007BCA58 /* ORKDontKnowButton.h */, + 515310CE233570CF007BCA58 /* ORKDontKnowButton.m */, + 51BF30BC247B330900E2E669 /* ORKIconButton.h */, + 51BF30BD247B330900E2E669 /* ORKIconButton.m */, ); - path = Animations; + path = Skin; sourceTree = ""; }; - B1A860DA1A9693C400EA57B7 /* phone@2x */ = { + CA1C7A73288B1ADD004DAB3A /* Step */ = { isa = PBXGroup; children = ( - B1A860DB1A9693C400EA57B7 /* consent_01@2x.m4v */, - B1A860DC1A9693C400EA57B7 /* consent_02@2x.m4v */, - B1A860DD1A9693C400EA57B7 /* consent_03@2x.m4v */, - B1A860DE1A9693C400EA57B7 /* consent_04@2x.m4v */, - B1A860DF1A9693C400EA57B7 /* consent_05@2x.m4v */, - B1A860E01A9693C400EA57B7 /* consent_06@2x.m4v */, - B1A860E11A9693C400EA57B7 /* consent_07@2x.m4v */, + 519CE82F2C6585DF003BB584 /* Family History */, + CA08053F28AD7CC8001695EF /* ORKViewControllerProviding.h */, + CA08054328AD7EBA001695EF /* ORKStep+ResearchKitUI.m */, + BAD65E4F2284F266008A5DCE /* ORKStepView_Private.h */, + BAD65E492284EFF9008A5DCE /* ORKStepView.h */, + BAD65E4A2284EFF9008A5DCE /* ORKStepView.m */, + 86C40BBC1A8D7C5C00081FAC /* ORKStepViewController.h */, + 86C40BBD1A8D7C5C00081FAC /* ORKStepViewController.m */, + 86C40BBE1A8D7C5C00081FAC /* ORKStepViewController_Internal.h */, + 86C40B771A8D7C5C00081FAC /* ORKCustomStepView.h */, + 86C40B781A8D7C5C00081FAC /* ORKCustomStepView.m */, + CA1C7A75288B1C41004DAB3A /* Request Permissions Step */, + CA1C7A77288B1CB6004DAB3A /* Instruction Step */, + CA1C7A7C288B1DB2004DAB3A /* Form Step */, + CA1C7A7D288B1DDC004DAB3A /* Image Capture Step */, + CA1C7A7E288B1E2C004DAB3A /* Video Capture Step */, + CA1C7A7F288B1EA9004DAB3A /* Passcode Step */, + CA1C7A80288B1F1F004DAB3A /* Page Step */, + CA1C7A81288B1F41004DAB3A /* PDFStep */, + CA1C7A83288B1FD1004DAB3A /* Wait Step */, + CA1C7A82288B1FB2004DAB3A /* Table Step */, + CA1C7A84288B1FEA004DAB3A /* Review Step */, + CA1C7A85288B207C004DAB3A /* Signature Step */, + CA1C7A86288B20D6004DAB3A /* WebView Step */, + CA1C7A87288B20F9004DAB3A /* Custom Step */, ); - path = "phone@2x"; + path = Step; sourceTree = ""; }; - B1A860E21A9693C400EA57B7 /* phone@3x */ = { + CA1C7A75288B1C41004DAB3A /* Request Permissions Step */ = { isa = PBXGroup; children = ( - B1A860E31A9693C400EA57B7 /* consent_01@3x.m4v */, - B1A860E41A9693C400EA57B7 /* consent_02@3x.m4v */, - B1A860E51A9693C400EA57B7 /* consent_03@3x.m4v */, - B1A860E61A9693C400EA57B7 /* consent_04@3x.m4v */, - B1A860E71A9693C400EA57B7 /* consent_05@3x.m4v */, - B1A860E81A9693C400EA57B7 /* consent_06@3x.m4v */, - B1A860E91A9693C400EA57B7 /* consent_07@3x.m4v */, + 511987C52463316E004FC2C7 /* ORKRequestPermissionsStepViewController.h */, + 511987C62463316E004FC2C7 /* ORKRequestPermissionsStepViewController.m */, + 51D823032472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.h */, + 51D823042472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.m */, + 51E03D6B2491B6DB008F8406 /* ORKRequestPermissionView.h */, + 51E03D6C2491B6DB008F8406 /* ORKRequestPermissionView.m */, + 5170009B254A191F00CACE12 /* ORKRequestPermissionButton.h */, + 5170009C254A197300CACE12 /* ORKRequestPermissionButton.m */, ); - path = "phone@3x"; + path = "Request Permissions Step"; sourceTree = ""; }; - B1C0F4E01A9BA65F0022C153 /* Localized */ = { + CA1C7A77288B1CB6004DAB3A /* Instruction Step */ = { isa = PBXGroup; children = ( - B1C0F4E11A9BA65F0022C153 /* ResearchKit.strings */, - 714080D9235FD14700281E04 /* ResearchKit.stringsdict */, + CA1C7A78288B1CC8004DAB3A /* SecondaryTask */, + CA1C7A79288B1CCE004DAB3A /* LearnMore Step */, + BADA2F24225DA54B005D2255 /* ORKInstructionStepContainerView.h */, + BADA2F25225DA54B005D2255 /* ORKInstructionStepContainerView.m */, + 86C40B941A8D7C5C00081FAC /* ORKInstructionStepViewController.h */, + 86C40B951A8D7C5C00081FAC /* ORKInstructionStepViewController.m */, + 86C40B961A8D7C5C00081FAC /* ORKInstructionStepViewController_Internal.h */, + CA1C7A7A288B1D46004DAB3A /* Completion Step */, + CA1C7A7B288B1D4D004DAB3A /* Video Instruction Step */, ); - path = Localized; + path = "Instruction Step"; sourceTree = ""; }; - BA0AA68D1EAEC06A00671ACE /* Stroop */ = { + CA1C7A78288B1CC8004DAB3A /* SecondaryTask */ = { isa = PBXGroup; children = ( - 51906C60291D7A3C00FF4185 /* Swift Stroop */, - BA0AA68E1EAEC0B600671ACE /* ORKStroopContentView.h */, - BA0AA68F1EAEC0B600671ACE /* ORKStroopContentView.m */, - FF72B1ED1F5F10CD004C6F15 /* ORKStroopResult.h */, - FF72B1EE1F5F10CD004C6F15 /* ORKStroopResult.m */, - BA0AA6901EAEC0B600671ACE /* ORKStroopStep.h */, - BA0AA6911EAEC0B600671ACE /* ORKStroopStep.m */, - BA0AA6921EAEC0B600671ACE /* ORKStroopStepViewController.h */, - BA0AA6931EAEC0B600671ACE /* ORKStroopStepViewController.m */, - A659C538262E0A3200E920DA /* ORKAccuracyStroopStep.h */, - A659C539262E0A3200E920DA /* ORKAccuracyStroopStep.m */, - A659C53C262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.h */, - A659C53D262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.m */, - A659C544262E0F5600E920DA /* UIColor+String.h */, - A659C545262E0F5600E920DA /* UIColor+String.m */, - 5D003D9F26377E7400A6439B /* ORKAccuracyStroopResult.h */, - 5D003DA026377E7400A6439B /* ORKAccuracyStroopResult.m */, + BA8C066D22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.h */, + BA8C066E22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.m */, ); - name = Stroop; + path = SecondaryTask; sourceTree = ""; }; - BA2645E3230156C200D00B73 /* Review */ = { + CA1C7A79288B1CCE004DAB3A /* LearnMore Step */ = { isa = PBXGroup; children = ( - BA2645E42301571800D00B73 /* ORKReviewViewController.h */, - BA2645E52301571800D00B73 /* ORKReviewViewController.m */, - AEFE0ABF230DB857004D0519 /* ORKReviewIncompleteCell.h */, - AEFE0AC0230DB857004D0519 /* ORKReviewIncompleteCell.m */, + BAD9E9142255E9CE0014FA29 /* ORKLearnMoreStepViewController.h */, + BAD9E9152255E9CE0014FA29 /* ORKLearnMoreStepViewController.m */, ); - name = Review; + path = "LearnMore Step"; sourceTree = ""; }; - BA473FE5224DB36500A362E3 /* Step Body */ = { + CA1C7A7A288B1D46004DAB3A /* Completion Step */ = { isa = PBXGroup; children = ( - BA473FE6224DB38900A362E3 /* ORKBodyItem.h */, - 5D43C5D324255675006F4084 /* ORKBodyItem_Internal.h */, - BA473FE7224DB38900A362E3 /* ORKBodyItem.m */, + 86C40B541A8D7C5B00081FAC /* ORKCompletionStepViewController.h */, + 86C40B551A8D7C5B00081FAC /* ORKCompletionStepViewController.m */, + BA2CFBAE2342935800B71919 /* ORKCompletionCheckmarkView.h */, + BA2CFBAF2342935800B71919 /* ORKCompletionCheckmarkView.m */, ); - name = "Step Body"; + path = "Completion Step"; sourceTree = ""; }; - BA473FEA224DB9F600A362E3 /* Learn More */ = { + CA1C7A7B288B1D4D004DAB3A /* Video Instruction Step */ = { isa = PBXGroup; children = ( - BA473FEB224DBA3700A362E3 /* ORKLearnMoreView.h */, - BA473FEC224DBA3700A362E3 /* ORKLearnMoreView.m */, - BA8C501F226FFB04001896D0 /* ORKLearnMoreItem.h */, - BA8C5020226FFB04001896D0 /* ORKLearnMoreItem.m */, + BF1D43871D4905FC007EE90B /* ORKVideoInstructionStepViewController.h */, + BF1D43881D4905FC007EE90B /* ORKVideoInstructionStepViewController.m */, ); - name = "Learn More"; + path = "Video Instruction Step"; sourceTree = ""; }; - BA87E26A20A79F5F00B375A9 /* Ring View */ = { + CA1C7A7C288B1DB2004DAB3A /* Form Step */ = { isa = PBXGroup; children = ( - BA87E26B20A79FA100B375A9 /* ORKRingView.h */, - BA87E26C20A79FA100B375A9 /* ORKRingView.m */, + 5192BF952AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.h */, + 5192BF962AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.m */, + 86C40B841A8D7C5C00081FAC /* ORKFormStepViewController.h */, + 86C40B851A8D7C5C00081FAC /* ORKFormStepViewController.m */, + 249F44E31BCD9EAC0000D57E /* ORKFormStepViewController_Internal.h */, + BC37323522B76DC70021F665 /* ORKFormStepViewController_Private.h */, ); - name = "Ring View"; + path = "Form Step"; sourceTree = ""; }; - BA8C066822ECF4B100ACDE6B /* SecondaryTask */ = { + CA1C7A7D288B1DDC004DAB3A /* Image Capture Step */ = { isa = PBXGroup; children = ( - BA8C066922ECF7C200ACDE6B /* ORKSecondaryTaskStep.h */, - BA8C066A22ECF7C200ACDE6B /* ORKSecondaryTaskStep.m */, - BA8C066D22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.h */, - BA8C066E22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.m */, + D442397B1AF17F7600559D96 /* ORKImageCaptureStepViewController.h */, + D442397C1AF17F7600559D96 /* ORKImageCaptureStepViewController.m */, + D45852081AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.h */, + D45852091AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.m */, + D42FEFB61AF7557000A124F8 /* ORKImageCaptureView.h */, + D42FEFB71AF7557000A124F8 /* ORKImageCaptureView.m */, ); - name = SecondaryTask; - path = ../ActiveTasks; + path = "Image Capture Step"; sourceTree = ""; }; - BA8C067522EEB7FD00ACDE6B /* Playback Button */ = { + CA1C7A7E288B1E2C004DAB3A /* Video Capture Step */ = { isa = PBXGroup; children = ( - BA8C067622EEB84B00ACDE6B /* ORKPlaybackButton.h */, - BA8C067722EEB84B00ACDE6B /* ORKPlaybackButton.m */, - 5D58800A24007140005B3D91 /* ORKPlaybackButton_Internal.h */, + 2489F7AB1D65214D008DEF20 /* ORKVideoCaptureStepViewController.h */, + 2489F7AC1D65214D008DEF20 /* ORKVideoCaptureStepViewController.m */, + 2489F7A71D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.h */, + 2489F7A81D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.m */, + 2489F7AD1D65214D008DEF20 /* ORKVideoCaptureView.h */, + 2489F7AE1D65214D008DEF20 /* ORKVideoCaptureView.m */, ); - name = "Playback Button"; + path = "Video Capture Step"; sourceTree = ""; }; - BA95AA9320ACD05100E7FF8E /* AmslerGrid */ = { + CA1C7A7F288B1EA9004DAB3A /* Passcode Step */ = { isa = PBXGroup; children = ( - BA95AA9420ACD07A00E7FF8E /* ORKAmslerGridStep.h */, - BA95AA9520ACD07A00E7FF8E /* ORKAmslerGridStep.m */, - BA95AA9820ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.h */, - BA95AA9920ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.m */, - BA95AA9C20ACD0E700E7FF8E /* ORKAmslerGridContentView.h */, - BA95AA9D20ACD0E700E7FF8E /* ORKAmslerGridContentView.m */, - BA2FE3EC20B109C600AAC231 /* ORKAmslerGridResult.h */, - BA2FE3ED20B109C600AAC231 /* ORKAmslerGridResult.m */, + 241A2E861B94FD8800ED3B39 /* ORKPasscodeStepViewController_Internal.h */, + 24A4DA161B8D13FE009C797A /* ORKPasscodeStepViewController.h */, + 24A4DA171B8D13FE009C797A /* ORKPasscodeStepViewController.m */, + 24A4DA0E1B8D0F21009C797A /* ORKPasscodeStepView.h */, + 24A4DA0F1B8D0F21009C797A /* ORKPasscodeStepView.m */, + 2441034D1B966D4C00EEAB0C /* ORKPasscodeViewController.h */, + 2441034E1B966D4C00EEAB0C /* ORKPasscodeViewController.m */, ); - name = AmslerGrid; + path = "Passcode Step"; sourceTree = ""; }; - BAB96753226E5D21006AAC56 /* Views */ = { + CA1C7A80288B1F1F004DAB3A /* Page Step */ = { isa = PBXGroup; children = ( - BAB96754226E5D67006AAC56 /* ORKStepContainerViewTests.m */, + FF5E3CC91D23444400ECE4B7 /* ORKPageStepViewController.h */, + FF5E3CCA1D23444400ECE4B7 /* ORKPageStepViewController.m */, ); - name = Views; + path = "Page Step"; sourceTree = ""; }; - BABBB1AB2097D94000CB29E5 /* PDFStep */ = { + CA1C7A81288B1F41004DAB3A /* PDFStep */ = { isa = PBXGroup; children = ( - BABBB1AC2097D97200CB29E5 /* ORKPDFViewerStep.h */, - BABBB1AD2097D97200CB29E5 /* ORKPDFViewerStep.m */, BABBB1B02097E16700CB29E5 /* ORKPDFViewerStepViewController.h */, BABBB1B12097E16700CB29E5 /* ORKPDFViewerStepViewController.m */, BABBB1B42097E58300CB29E5 /* ORKPDFViewerStepView.h */, @@ -4119,77 +3738,847 @@ BABBB1B82097EF3800CB29E5 /* ORKFreehandDrawingView.h */, BABBB1B92097EF3800CB29E5 /* ORKFreehandDrawingView.m */, ); - name = PDFStep; + path = PDFStep; sourceTree = ""; }; - BAD6FAAE2332A2B6006647E7 /* CheckmarkView */ = { + CA1C7A82288B1FB2004DAB3A /* Table Step */ = { isa = PBXGroup; children = ( - BAD6FAAF2332A2FD006647E7 /* ORKCheckmarkView.h */, - BAD6FAB02332A2FD006647E7 /* ORKCheckmarkView.m */, + FF36A49A1D1A15FC00DE8470 /* ORKTableStepViewController.h */, + FF36A49B1D1A15FC00DE8470 /* ORKTableStepViewController.m */, + FF36A4991D1A15FC00DE8470 /* ORKTableStepViewController_Internal.h */, ); - name = CheckmarkView; + path = "Table Step"; sourceTree = ""; }; - BAD9E90F2255E94F0014FA29 /* LearnMore Step */ = { + CA1C7A83288B1FD1004DAB3A /* Wait Step */ = { isa = PBXGroup; children = ( - BAD9E9102255E9750014FA29 /* ORKLearnMoreInstructionStep.h */, - BAD9E9112255E9750014FA29 /* ORKLearnMoreInstructionStep.m */, - BAD9E9142255E9CE0014FA29 /* ORKLearnMoreStepViewController.h */, - BAD9E9152255E9CE0014FA29 /* ORKLearnMoreStepViewController.m */, + BF9155A31BDE8DA9007FA459 /* ORKWaitStepView.h */, + BF9155A41BDE8DA9007FA459 /* ORKWaitStepView.m */, + BF9155A51BDE8DA9007FA459 /* ORKWaitStepViewController.h */, + BF9155A61BDE8DA9007FA459 /* ORKWaitStepViewController.m */, ); - name = "LearnMore Step"; + path = "Wait Step"; sourceTree = ""; }; - BC4194261AE8451F00073D6B /* Misc */ = { + CA1C7A84288B1FEA004DAB3A /* Review Step */ = { isa = PBXGroup; children = ( - BC4194271AE8453A00073D6B /* ORKObserver.h */, - BC4194281AE8453A00073D6B /* ORKObserver.m */, - 03BD9EA1253E62A0008ADBE1 /* ORKBundleAsset.h */, - 03BD9EA2253E62A0008ADBE1 /* ORKBundleAsset.m */, + BF9155981BDE8D7D007FA459 /* ORKReviewStepViewController_Internal.h */, + BF9155991BDE8D7D007FA459 /* ORKReviewStepViewController.h */, + BF91559A1BDE8D7D007FA459 /* ORKReviewStepViewController.m */, + ); + path = "Review Step"; + sourceTree = ""; + }; + CA1C7A85288B207C004DAB3A /* Signature Step */ = { + isa = PBXGroup; + children = ( + 86C40BEE1A8D7C5C00081FAC /* ORKSignatureStepViewController.h */, + 86C40BEF1A8D7C5C00081FAC /* ORKSignatureStepViewController.m */, + 86C40C071A8D7C5C00081FAC /* ORKSignatureView.h */, + 86C40C081A8D7C5C00081FAC /* ORKSignatureView.m */, + F7EC216424787338000C1F46 /* ORKCustomSignatureFooterView.h */, + F7EC216524787338000C1F46 /* ORKCustomSignatureFooterView.m */, + F7C022F8248EEAAC00782A61 /* ORKCustomSignatureFooterView_Private.h */, + ); + path = "Signature Step"; + sourceTree = ""; + }; + CA1C7A86288B20D6004DAB3A /* WebView Step */ = { + isa = PBXGroup; + children = ( + 8419D6701FB73EC60088D7E5 /* ORKWebViewStepViewController.h */, + 8419D6711FB73EC60088D7E5 /* ORKWebViewStepViewController.m */, + ); + path = "WebView Step"; + sourceTree = ""; + }; + CA1C7A87288B20F9004DAB3A /* Custom Step */ = { + isa = PBXGroup; + children = ( + 00C266882302244300337E0B /* ORKCustomStepViewController.h */, + 00C266892302244300337E0B /* ORKCustomStepViewController.m */, + ); + path = "Custom Step"; + sourceTree = ""; + }; + CA1C7A88288B22B0004DAB3A /* Task */ = { + isa = PBXGroup; + children = ( + BAC6F1A722AF535100E31C22 /* ORKTaskReviewViewController.h */, + BAC6F1A822AF535100E31C22 /* ORKTaskReviewViewController.m */, + 86C40BD91A8D7C5C00081FAC /* ORKTaskViewController_Internal.h */, + 86C40BDA1A8D7C5C00081FAC /* ORKTaskViewController_Private.h */, + 86C40BD71A8D7C5C00081FAC /* ORKTaskViewController.h */, + 86C40BD81A8D7C5C00081FAC /* ORKTaskViewController.m */, + ); + path = Task; + sourceTree = ""; + }; + CA1C7A8A288B2330004DAB3A /* UIKitCategories */ = { + isa = PBXGroup; + children = ( + 86C40BE71A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.h */, + 86C40BE81A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.m */, + 86C40BE91A8D7C5C00081FAC /* UIResponder+ResearchKit.h */, + 86C40BEA1A8D7C5C00081FAC /* UIResponder+ResearchKit.m */, + 805685771C90C19500BF437A /* UIImage+ResearchKit.h */, + 805685781C90C19500BF437A /* UIImage+ResearchKit.m */, + 0B9CC5652A68C02C00080E29 /* UIImageView+ResearchKit.h */, + 0B9CC5662A68C02C00080E29 /* UIImageView+ResearchKit.m */, + ); + path = UIKitCategories; + sourceTree = ""; + }; + CA1C7A8E288B2578004DAB3A /* Sentences */ = { + isa = PBXGroup; + children = ( + BA22F76C20C4F884006E6E11 /* SentencesList.txt */, + 7118AC6620BF6A3A00D7A6BB /* Sentence1.wav */, + 7118AC6520BF6A3A00D7A6BB /* Sentence2.wav */, + 7118AC6420BF6A3A00D7A6BB /* Sentence3.wav */, + 7118AC6120BF6A3A00D7A6BB /* Sentence4.wav */, + 7118AC6320BF6A3A00D7A6BB /* Sentence5.wav */, + 7118AC6220BF6A3A00D7A6BB /* Sentence6.wav */, + 7118AC6020BF6A3900D7A6BB /* Sentence7.wav */, + ); + path = Sentences; + sourceTree = ""; + }; + CA1C7A9A288B2960004DAB3A /* USDZ Model Manager */ = { + isa = PBXGroup; + children = ( + 51198767245CA50D004FC2C7 /* ORKUSDZModelManagerScene.h */, + 51198768245CA50D004FC2C7 /* ORKUSDZModelManagerScene.m */, + 5119879D245FE68D004FC2C7 /* ORKUSDZModelManager.h */, + 5119879E245FE68D004FC2C7 /* ORKUSDZModelManager.m */, + 5166E49D247355D500151C57 /* ORKUSDZModelManagerResult.h */, + 5166E49E247355D500151C57 /* ORKUSDZModelManagerResult.m */, + ); + path = "USDZ Model Manager"; + sourceTree = ""; + }; + CA1C7ABE288B3786004DAB3A /* Onboarding */ = { + isa = PBXGroup; + children = ( + CA1C7ABF288B3792004DAB3A /* Account */, + ); + path = Onboarding; + sourceTree = ""; + }; + CA1C7ABF288B3792004DAB3A /* Account */ = { + isa = PBXGroup; + children = ( + 242C9E0B1BBE03F90088B7F4 /* ORKVerificationStepViewController.h */, + 242C9E0C1BBE03F90088B7F4 /* ORKVerificationStepViewController.m */, + 242C9E0F1BBE06DE0088B7F4 /* ORKVerificationStepView.h */, + 242C9E101BBE06DE0088B7F4 /* ORKVerificationStepView.m */, + 24850E171BCDA9C7006E91FB /* ORKLoginStepViewController.h */, + 24850E181BCDA9C7006E91FB /* ORKLoginStepViewController.m */, + ); + path = Account; + sourceTree = ""; + }; + CA1C7AC0288B3AC1004DAB3A /* Accessibility */ = { + isa = PBXGroup; + children = ( + 618DA0481A93D0D600E63AA8 /* ORKAccessibility.h */, + 618DA0491A93D0D600E63AA8 /* ORKAccessibilityFunctions.h */, + 618DA04A1A93D0D600E63AA8 /* ORKAccessibilityFunctions.m */, + 618DA04B1A93D0D600E63AA8 /* UIView+ORKAccessibility.h */, + 618DA04C1A93D0D600E63AA8 /* UIView+ORKAccessibility.m */, + 6146D0A11B84A91E0068491D /* ORKGraphChartAccessibilityElement.h */, + 6146D0A21B84A91E0068491D /* ORKGraphChartAccessibilityElement.m */, + ); + path = Accessibility; + sourceTree = ""; + }; + CA2B900828A17ABE0025B773 /* Active Step */ = { + isa = PBXGroup; + children = ( + 86C40B301A8D7C5B00081FAC /* ORKActiveStep.h */, + 86C40B311A8D7C5B00081FAC /* ORKActiveStep.m */, + 86C40B321A8D7C5B00081FAC /* ORKActiveStep_Internal.h */, + ); + name = "Active Step"; + sourceTree = ""; + }; + CA2B902A28A18ED00025B773 /* Front Facing Camera */ = { + isa = PBXGroup; + children = ( + 51751461245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.h */, + 51751462245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.m */, + 51751465245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.h */, + 51751466245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.m */, + ); + path = "Front Facing Camera"; + sourceTree = ""; + }; + CA481E8028CBD6B7001C4D49 /* ResearchKitUI-iOS */ = { + isa = PBXGroup; + children = ( + CA481E8228CBD79B001C4D49 /* ResearchKitUI-iOS-Debug.xcconfig */, + CA481E8428CBD835001C4D49 /* ResearchKitUI-iOS-Release.xcconfig */, + CA481E8128CBD6D9001C4D49 /* ResearchKitUI-iOS-Shared.xcconfig */, + ); + path = "ResearchKitUI-iOS"; + sourceTree = ""; + }; + CA481E8B28CBD9F1001C4D49 /* ResearchKitActiveTask */ = { + isa = PBXGroup; + children = ( + CA481E8D28CBD9F1001C4D49 /* ResearchKitActiveTask-Debug.xcconfig */, + CA481E8C28CBD9F1001C4D49 /* ResearchKitActiveTask-Release.xcconfig */, + CA481E8E28CBD9F1001C4D49 /* ResearchKitActiveTask-Shared.xcconfig */, + ); + name = ResearchKitActiveTask; + path = ResearchKit/Configuration/ResearchKitActiveTask; + sourceTree = SOURCE_ROOT; + }; + CAD08968289DD747007B2A98 /* ResearchKitActiveTask */ = { + isa = PBXGroup; + children = ( + CAD08969289DD747007B2A98 /* ResearchKitActiveTask.h */, + CAFAA6C128A198BD0010BBDE /* ResearchKitActiveTask_Private.h */, + CAFAA6C328A199950010BBDE /* ResearchKitActiveTask.modulemap */, + 51FBAC592BC998D8009CA28F /* ResearchKitActiveTask_Private.modulemap */, + CA954B6D28AD8A8C0020A35C /* ORKStep+ResearchKitActiveTask.m */, + 5156C9BF2B7E421400983535 /* Touch Ability */, + CA2B902A28A18ED00025B773 /* Front Facing Camera */, + CAD08972289DD790007B2A98 /* ORKSpeechInNoise */, + CAD0897D289DD941007B2A98 /* 3D Model */, + CAD0897F289DD998007B2A98 /* environmentSPLMeter */, + CAD08980289DDA0A007B2A98 /* dBHL Tone Audiometry */, + CAD08985289DDB28007B2A98 /* AmslerGrid */, + CAD08986289DDB46007B2A98 /* Common */, + CAD08996289DDCF8007B2A98 /* Audio */, + CAD08997289DDD5B007B2A98 /* SpeechRecognition */, + CAD08998289DDD73007B2A98 /* Fitness */, + CAD08999289DDD8D007B2A98 /* Hole Peg Test */, + CAD0899C289DDDC4007B2A98 /* PSAT */, + CAD0899D289DDDD9007B2A98 /* Range of Motion */, + CAD0899F289DDE02007B2A98 /* Reaction Time */, + CAD089A0289DDE17007B2A98 /* Spatial Span Memory */, + CAD089A1289DDE2E007B2A98 /* Stroop */, + CAD089A3289DDE57007B2A98 /* Tapping */, + CAD089A4289DDE6B007B2A98 /* Tone Audiometry */, + CAD089A5289DDE87007B2A98 /* TowerOfHanoi */, + CAD089A6289DDE97007B2A98 /* Trailmaking */, + CAD089A7289DDEA8007B2A98 /* Walking */, + 51FBAC7D2BC9EBA7009CA28F /* Info.plist */, + 0B0852772BD872EA00149963 /* PrivacyInfo.xcprivacy */, + 51B76DFA2CB5B5A30061698A /* ResearchKitActiveTask.docc */, + ); + path = ResearchKitActiveTask; + sourceTree = ""; + }; + CAD08972289DD790007B2A98 /* ORKSpeechInNoise */ = { + isa = PBXGroup; + children = ( + 51AF1B222B69803A00D3B399 /* Noise.wav */, + 51AF1B212B69803A00D3B399 /* Window.wav */, + CA1C7A8E288B2578004DAB3A /* Sentences */, + 7118AC7120BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.h */, + 7118AC7020BF6A7700D7A6BB /* ORKSpeechInNoiseContentView.m */, + 7118AC6F20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.h */, + 7118AC6E20BF6A7700D7A6BB /* ORKSpeechInNoiseStepViewController.m */, + 7118AC7320BF6A7800D7A6BB /* ORKSpeechInNoiseStep.h */, + 7118AC7220BF6A7800D7A6BB /* ORKSpeechInNoiseStep.m */, + 5D5880372410394E005B3D91 /* ORKSpeechInNoiseResult.h */, + 5D5880382410394E005B3D91 /* ORKSpeechInNoiseResult.m */, + 51F716E82981AF1200D8ACF7 /* ORKSpeechInNoiseStepViewController_Private.h */, + ); + path = ORKSpeechInNoise; + sourceTree = ""; + }; + CAD0897D289DD941007B2A98 /* 3D Model */ = { + isa = PBXGroup; + children = ( + CAD0897E289DD94E007B2A98 /* 3D Model Manager */, + CA1C7A9A288B2960004DAB3A /* USDZ Model Manager */, + 517514502459EF5D009E8FFC /* ORK3DModelStepViewController.h */, + 517514512459EF5D009E8FFC /* ORK3DModelStepViewController.m */, + 517514542459F0BE009E8FFC /* ORK3DModelStepContentView.h */, + 517514552459F0BE009E8FFC /* ORK3DModelStepContentView.m */, + 5175144C2459EBF0009E8FFC /* ORK3DModelStep.h */, + 5175144D2459EBF0009E8FFC /* ORK3DModelStep.m */, + ); + path = "3D Model"; + sourceTree = ""; + }; + CAD0897E289DD94E007B2A98 /* 3D Model Manager */ = { + isa = PBXGroup; + children = ( + 51198799245FC33C004FC2C7 /* ORK3DModelManager.h */, + 5D26E77724997EA200E53D27 /* ORK3DModelManager_Internal.h */, + 5119879A245FC33C004FC2C7 /* ORK3DModelManager.m */, + ); + path = "3D Model Manager"; + sourceTree = ""; + }; + CAD0897F289DD998007B2A98 /* environmentSPLMeter */ = { + isa = PBXGroup; + children = ( + 71BD9EA720969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.h */, + 71BD9EA820969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.m */, + E293668325EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.h */, + E293668425EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.m */, + 71BD9EAB2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.h */, + 71BD9EAC2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.m */, + 71F3B27F21001DEC00FB1C41 /* splMeter_sensitivity_offset.plist */, + 71BD9EA320969BE1007B436E /* ORKEnvironmentSPLMeterStep.h */, + 71BD9EA420969BE1007B436E /* ORKEnvironmentSPLMeterStep.m */, + 716B126220A78C6B00590264 /* ORKEnvironmentSPLMeterResult.h */, + 716B126320A78C6B00590264 /* ORKEnvironmentSPLMeterResult.m */, + 511E8D602995C20E00A384A5 /* ORKEnvironmentSPLMeterStepViewController_Private.h */, + ); + path = environmentSPLMeter; + sourceTree = ""; + }; + CAD08980289DDA0A007B2A98 /* dBHL Tone Audiometry */ = { + isa = PBXGroup; + children = ( + CAD08981289DDA20007B2A98 /* ORKAudiometry */, + 71769E2720880C4500A19914 /* ORKdBHLToneAudiometryResult.h */, + 71769E2820880C4500A19914 /* ORKdBHLToneAudiometryResult.m */, + 71769E2B208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h */, + 71769E2C208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m */, + 71769E3720882CED00A19914 /* ORKdBHLToneAudiometryStep.h */, + 71769E3820882CED00A19914 /* ORKdBHLToneAudiometryStep.m */, + ); + path = "dBHL Tone Audiometry"; + sourceTree = ""; + }; + CAD08981289DDA20007B2A98 /* ORKAudiometry */ = { + isa = PBXGroup; + children = ( + 5192BF7E2AE1A9BA006E43FB /* volume_curve_AIRPODSPROV2.plist */, + 5192BF7C2AE1A87D006E43FB /* retspl_AIRPODSPROV2.plist */, + 6227743F2C5CF7DC00F2E741 /* retspl_dBFS_AIRPODSPROV2.plist */, + 5192BF5C2AE19036006E43FB /* frequency_dBSPL_AIRPODSPROV2.plist */, + 71769E2F2088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h */, + 71769E302088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m */, + 716B126620A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h */, + 716B126720A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m */, + 71769E332088291B00A19914 /* ORKdBHLToneAudiometryContentView.h */, + 71769E342088291B00A19914 /* ORKdBHLToneAudiometryContentView.m */, + 71769E3B20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h */, + 71769E3C20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m */, + E293655D25757CC700092A7C /* frequency_dBSPL_AIRPODSMAX.plist */, + E29189B823855B96001AFF0F /* frequency_dBSPL_AIRPODSPRO.plist */, + 71B7B4D820AA91D400C5768A /* frequency_dBSPL_AIRPODS.plist */, + 2246E5122749350200261D5A /* frequency_dBSPL_AIRPODSV3.plist */, + 713D4B1B20FE5464002BE28D /* frequency_dBSPL_EARPODS.plist */, + E293655F25757E6100092A7C /* retspl_AIRPODSMAX.plist */, + E29189BC23855BAE001AFF0F /* retspl_AIRPODSPRO.plist */, + 71B7B4D420AA91D300C5768A /* retspl_AIRPODS.plist */, + 2246E5132749350200261D5A /* retspl_AIRPODSV3.plist */, + 713D4B1D20FE5480002BE28D /* retspl_EARPODS.plist */, + E293656125757E7700092A7C /* volume_curve_AIRPODSMAX.plist */, + E29189BA23855BA2001AFF0F /* volume_curve_AIRPODSPRO.plist */, + 71B7B4D920AA91D400C5768A /* volume_curve_AIRPODS.plist */, + 2246E5142749350200261D5A /* volume_curve_AIRPODSV3.plist */, + 713D4B0F20FE4702002BE28D /* volume_curve_WIRED.plist */, + 224CD4FC283540FF0029B820 /* ORKAudiometryProtocol.h */, + 226565512847FD1D00E916FF /* ORKAudiometryStimulus.h */, + 226565522847FD1D00E916FF /* ORKAudiometryStimulus.m */, + 2295B21F282AF92700A5D9E0 /* ORKAudiometry.h */, + 2295B220282AF92700A5D9E0 /* ORKAudiometry.m */, + ); + path = ORKAudiometry; + sourceTree = ""; + }; + CAD08985289DDB28007B2A98 /* AmslerGrid */ = { + isa = PBXGroup; + children = ( + BA95AA9820ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.h */, + BA95AA9920ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.m */, + BA95AA9C20ACD0E700E7FF8E /* ORKAmslerGridContentView.h */, + BA95AA9D20ACD0E700E7FF8E /* ORKAmslerGridContentView.m */, + BA95AA9420ACD07A00E7FF8E /* ORKAmslerGridStep.h */, + BA95AA9520ACD07A00E7FF8E /* ORKAmslerGridStep.m */, + BA2FE3EC20B109C600AAC231 /* ORKAmslerGridResult.h */, + BA2FE3ED20B109C600AAC231 /* ORKAmslerGridResult.m */, + ); + path = AmslerGrid; + sourceTree = ""; + }; + CAD08986289DDB46007B2A98 /* Common */ = { + isa = PBXGroup; + children = ( + 51A11F1B2BD094A00060C07E /* Custom View */, + CAD08987289DDB59007B2A98 /* Touch Anywhere Step */, + CAD08988289DDB80007B2A98 /* Active Step */, + CAD0898C289DDBDC007B2A98 /* Countdown Step */, + CAD0898D289DDBF5007B2A98 /* Recorders */, + FF154FB21E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.h */, + FF154FB31E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.m */, + ); + path = Common; + sourceTree = ""; + }; + CAD08987289DDB59007B2A98 /* Touch Anywhere Step */ = { + isa = PBXGroup; + children = ( + 9550E67A1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h */, + 9550E67B1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m */, + 9550E6711D58DBCF00C691B8 /* ORKTouchAnywhereStep.h */, + 9550E6721D58DBCF00C691B8 /* ORKTouchAnywhereStep.m */, + ); + path = "Touch Anywhere Step"; + sourceTree = ""; + }; + CAD08988289DDB80007B2A98 /* Active Step */ = { + isa = PBXGroup; + children = ( + FF919A261E81A87B005C2A1E /* ORKActiveTaskResult.h */, + 86C40B371A8D7C5B00081FAC /* ORKActiveStepViewController.h */, + 86C40B381A8D7C5B00081FAC /* ORKActiveStepViewController.m */, + 86C40B391A8D7C5B00081FAC /* ORKActiveStepViewController_Internal.h */, + CAD0898B289DDBB1007B2A98 /* Timing */, + CAD0898A289DDBAC007B2A98 /* Speech Synthesis */, + CAD08989289DDB9A007B2A98 /* Views */, + ); + path = "Active Step"; + sourceTree = ""; + }; + CAD08989289DDB9A007B2A98 /* Views */ = { + isa = PBXGroup; + children = ( + 86AD910E1AB7B8A600361FEB /* ORKActiveStepView.h */, + 86AD910F1AB7B8A600361FEB /* ORKActiveStepView.m */, + 86C40AFA1A8D7C5B00081FAC /* ORKActiveStepQuantityView.h */, + 86C40AFB1A8D7C5B00081FAC /* ORKActiveStepQuantityView.m */, + 86C40B351A8D7C5B00081FAC /* ORKActiveStepTimerView.h */, + 86C40B361A8D7C5B00081FAC /* ORKActiveStepTimerView.m */, + ); + path = Views; + sourceTree = ""; + }; + CAD0898A289DDBAC007B2A98 /* Speech Synthesis */ = { + isa = PBXGroup; + children = ( + 86C40B4D1A8D7C5B00081FAC /* ORKVoiceEngine.h */, + 86C40B4E1A8D7C5B00081FAC /* ORKVoiceEngine.m */, + 2EBFE11E1AE1B68800CB8254 /* ORKVoiceEngine_Internal.h */, + ); + path = "Speech Synthesis"; + sourceTree = ""; + }; + CAD0898B289DDBB1007B2A98 /* Timing */ = { + isa = PBXGroup; + children = ( + 86C40B331A8D7C5B00081FAC /* ORKActiveStepTimer.h */, + 86C40B341A8D7C5B00081FAC /* ORKActiveStepTimer.m */, + ); + path = Timing; + sourceTree = ""; + }; + CAD0898C289DDBDC007B2A98 /* Countdown Step */ = { + isa = PBXGroup; + children = ( + 86C40B021A8D7C5B00081FAC /* ORKCountdownStep.h */, + 86C40B031A8D7C5B00081FAC /* ORKCountdownStep.m */, + 86C40B041A8D7C5B00081FAC /* ORKCountdownStepViewController.h */, + 86C40B051A8D7C5B00081FAC /* ORKCountdownStepViewController.m */, + ); + path = "Countdown Step"; + sourceTree = ""; + }; + CAD0898D289DDBF5007B2A98 /* Recorders */ = { + isa = PBXGroup; + children = ( + CAD08994289DDC2D007B2A98 /* Accelerometer */, + CAD08993289DDC29007B2A98 /* Audio */, + CAD08992289DDC25007B2A98 /* Device Motion */, + CAD08991289DDC19007B2A98 /* Health */, + CAD08990289DDC14007B2A98 /* Location */, + CAD0898F289DDC0C007B2A98 /* Pedometer */, + CAD0898E289DDC08007B2A98 /* Touch */, + ); + path = Recorders; + sourceTree = ""; + }; + CAD0898E289DDC08007B2A98 /* Touch */ = { + isa = PBXGroup; + children = ( + 86C40B4B1A8D7C5B00081FAC /* ORKTouchRecorder.h */, + 86C40B4C1A8D7C5B00081FAC /* ORKTouchRecorder.m */, + 86C40B4F1A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.h */, + 86C40B501A8D7C5B00081FAC /* UITouch+ORKJSONDictionary.m */, + ); + path = Touch; + sourceTree = ""; + }; + CAD0898F289DDC0C007B2A98 /* Pedometer */ = { + isa = PBXGroup; + children = ( + 86C40B451A8D7C5B00081FAC /* ORKPedometerRecorder.h */, + 86C40B461A8D7C5B00081FAC /* ORKPedometerRecorder.m */, + 86C40B2A1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.h */, + 86C40B2B1A8D7C5B00081FAC /* CMPedometerData+ORKJSONDictionary.m */, + ); + path = Pedometer; + sourceTree = ""; + }; + CAD08990289DDC14007B2A98 /* Location */ = { + isa = PBXGroup; + children = ( + 86C40B431A8D7C5B00081FAC /* ORKLocationRecorder.h */, + 86C40B441A8D7C5B00081FAC /* ORKLocationRecorder.m */, + 86C40B221A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.h */, + 86C40B231A8D7C5B00081FAC /* CLLocation+ORKJSONDictionary.m */, + ); + path = Location; + sourceTree = ""; + }; + CAD08991289DDC19007B2A98 /* Health */ = { + isa = PBXGroup; + children = ( + 71D8EF1520B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.h */, + 71D8EF1620B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.m */, + 86C40B411A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.h */, + 86C40B421A8D7C5B00081FAC /* ORKHealthQuantityTypeRecorder.m */, + ); + path = Health; + sourceTree = ""; + }; + CAD08992289DDC25007B2A98 /* Device Motion */ = { + isa = PBXGroup; + children = ( + 86C40B3F1A8D7C5B00081FAC /* ORKDeviceMotionRecorder.h */, + 86C40B401A8D7C5B00081FAC /* ORKDeviceMotionRecorder.m */, + 86C40B261A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.h */, + 86C40B271A8D7C5B00081FAC /* CMDeviceMotion+ORKJSONDictionary.m */, + ); + path = "Device Motion"; + sourceTree = ""; + }; + CAD08993289DDC29007B2A98 /* Audio */ = { + isa = PBXGroup; + children = ( + 86C40B3A1A8D7C5B00081FAC /* ORKAudioRecorder.h */, + 86C40B3B1A8D7C5B00081FAC /* ORKAudioRecorder.m */, + 2E80C1A81FA2A6E500399A0C /* ORKStreamingAudioRecorder.h */, + 2E80C1A91FA2AA8D00399A0C /* ORKStreamingAudioRecorder.m */, + 5D3800692437E53500E7D2BD /* ORKAudioStreamer.h */, + 5D38006A2437E53500E7D2BD /* ORKAudioStreamer.m */, + ); + path = Audio; + sourceTree = ""; + }; + CAD08994289DDC2D007B2A98 /* Accelerometer */ = { + isa = PBXGroup; + children = ( + 86C40B2E1A8D7C5B00081FAC /* ORKAccelerometerRecorder.h */, + 86C40B2F1A8D7C5B00081FAC /* ORKAccelerometerRecorder.m */, + 86C40B241A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.h */, + 86C40B251A8D7C5B00081FAC /* CMAccelerometerData+ORKJSONDictionary.m */, + ); + path = Accelerometer; + sourceTree = ""; + }; + CAD08996289DDCF8007B2A98 /* Audio */ = { + isa = PBXGroup; + children = ( + 5D1CE45823FC85F3004CB416 /* ORKAudioMeteringView.h */, + 5D1CE45923FC85F4004CB416 /* ORKAudioMeteringView.m */, + 2E8071011FB0E6BE00E4FC7F /* ORKAudioGraphView.h */, + 2E8071001FB0E6BE00E4FC7F /* ORKAudioGraphView.m */, + 86C40B001A8D7C5B00081FAC /* ORKAudioStepViewController.h */, + 86C40B011A8D7C5B00081FAC /* ORKAudioStepViewController.m */, + 86C40AFC1A8D7C5B00081FAC /* ORKAudioContentView.h */, + 86C40AFD1A8D7C5B00081FAC /* ORKAudioContentView.m */, + 86C40AFE1A8D7C5B00081FAC /* ORKAudioStep.h */, + 86C40AFF1A8D7C5B00081FAC /* ORKAudioStep.m */, + FF36A48B1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.h */, + FF36A48C1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.m */, + ); + path = Audio; + sourceTree = ""; + }; + CAD08997289DDD5B007B2A98 /* SpeechRecognition */ = { + isa = PBXGroup; + children = ( + 2E8070F41FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.h */, + 2E8070F31FAD217400E4FC7F /* ORKSpeechRecognitionStepViewController.m */, + 2E8070FD1FAD255000E4FC7F /* ORKSpeechRecognitionContentView.h */, + 2E8070FE1FAD256A00E4FC7F /* ORKSpeechRecognitionContentView.m */, + 2E8070F51FAD217400E4FC7F /* ORKSpeechRecognitionStep.h */, + 2E8070F61FAD217400E4FC7F /* ORKSpeechRecognitionStep.m */, + 2E8070F11FAD217400E4FC7F /* ORKSpeechRecognizer.h */, + 2E8070F21FAD217400E4FC7F /* ORKSpeechRecognizer.m */, + 2E3408C92028E13B0027D6B8 /* ORKSpeechRecognitionError.h */, + BA5B9205204F5D9A007C2F9D /* ORKSpeechRecognitionResult.h */, + BA5B9206204F5D9A007C2F9D /* ORKSpeechRecognitionResult.m */, + 511BB022298DCCC200936EC0 /* ORKSpeechRecognitionStepViewController_Private.h */, + ); + path = SpeechRecognition; + sourceTree = ""; + }; + CAD08998289DDD73007B2A98 /* Fitness */ = { + isa = PBXGroup; + children = ( + 86C40B0A1A8D7C5B00081FAC /* ORKFitnessStepViewController.h */, + 86C40B0B1A8D7C5B00081FAC /* ORKFitnessStepViewController.m */, + 03057F372515771800C4EC5B /* ORKAudioFitnessStepViewController.h */, + 03057F382515771800C4EC5B /* ORKAudioFitnessStepViewController.m */, + 86C40B061A8D7C5B00081FAC /* ORKFitnessContentView.h */, + 86C40B071A8D7C5B00081FAC /* ORKFitnessContentView.m */, + 86C40B081A8D7C5B00081FAC /* ORKFitnessStep.h */, + 86C40B091A8D7C5B00081FAC /* ORKFitnessStep.m */, + 03057F3B2515772E00C4EC5B /* ORKAudioFitnessStep.h */, + 03057F3C2515772E00C4EC5B /* ORKAudioFitnessStep.m */, + ); + path = Fitness; + sourceTree = ""; + }; + CAD08999289DDD8D007B2A98 /* Hole Peg Test */ = { + isa = PBXGroup; + children = ( + CAD0899B289DDD97007B2A98 /* Place Test */, + CAD0899A289DDD93007B2A98 /* Remove Test */, + FF919A451E81BA3D005C2A1E /* ORKHolePegTestResult.h */, + FF919A461E81BA3D005C2A1E /* ORKHolePegTestResult.m */, + ); + path = "Hole Peg Test"; + sourceTree = ""; + }; + CAD0899A289DDD93007B2A98 /* Remove Test */ = { + isa = PBXGroup; + children = ( + 10FF9AC91B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.h */, + 10FF9ACA1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.m */, + 10FF9ACD1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.h */, + 10FF9ACE1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.m */, + 10FF9AD11B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.h */, + 10FF9AD21B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.m */, + 10FF9AC11B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.h */, + 10FF9AC21B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.m */, + ); + path = "Remove Test"; + sourceTree = ""; + }; + CAD0899B289DDD97007B2A98 /* Place Test */ = { + isa = PBXGroup; + children = ( + 106FF2A01B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.h */, + 106FF2A11B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.m */, + 106FF2A41B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.h */, + 106FF2A51B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.m */, + 106FF2A81B690FD7004EACF2 /* ORKHolePegTestPlacePegView.h */, + 106FF2A91B690FD7004EACF2 /* ORKHolePegTestPlacePegView.m */, + 106FF2B21B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.h */, + 106FF2B31B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.m */, + 106FF29C1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.h */, + 106FF29D1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.m */, + ); + path = "Place Test"; + sourceTree = ""; + }; + CAD0899C289DDDC4007B2A98 /* PSAT */ = { + isa = PBXGroup; + children = ( + 10864C981B27146B000F4158 /* ORKPSATStepViewController.h */, + 10864C991B27146B000F4158 /* ORKPSATStepViewController.m */, + 10864C9A1B27146B000F4158 /* ORKPSATContentView.h */, + 10864C9B1B27146B000F4158 /* ORKPSATContentView.m */, + 10864C9C1B27146B000F4158 /* ORKPSATKeyboardView.h */, + 10864C9D1B27146B000F4158 /* ORKPSATKeyboardView.m */, + FF919A411E81B904005C2A1E /* ORKPSATResult.h */, + FF919A421E81B904005C2A1E /* ORKPSATResult.m */, + 10864C961B27146B000F4158 /* ORKPSATStep.h */, + 10864C971B27146B000F4158 /* ORKPSATStep.m */, + ); + path = PSAT; + sourceTree = ""; + }; + CAD0899D289DDDD9007B2A98 /* Range of Motion */ = { + isa = PBXGroup; + children = ( + CAD0899E289DDDE3007B2A98 /* Shoulder */, + 959A2BFE1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h */, + 959A2BFF1D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m */, + FF919A281E81A94B005C2A1E /* ORKRangeOfMotionResult.h */, + FF919A291E81A94B005C2A1E /* ORKRangeOfMotionResult.m */, + 959A2BFA1D68B98700841B04 /* ORKRangeOfMotionStep.h */, + 959A2BFB1D68B98700841B04 /* ORKRangeOfMotionStep.m */, + ); + path = "Range of Motion"; + sourceTree = ""; + }; + CAD0899E289DDDE3007B2A98 /* Shoulder */ = { + isa = PBXGroup; + children = ( + 95E11E531D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.h */, + 95E11E541D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.m */, + 959A2C0B1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.h */, + 959A2C0C1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.m */, + ); + path = Shoulder; + sourceTree = ""; + }; + CAD0899F289DDE02007B2A98 /* Reaction Time */ = { + isa = PBXGroup; + children = ( + 5192BF782AE1A523006E43FB /* Normalized */, + 25ECC0991AFBD8B300F3D63B /* ORKReactionTimeViewController.h */, + 25ECC09A1AFBD8B300F3D63B /* ORKReactionTimeViewController.m */, + 25ECC09D1AFBD92D00F3D63B /* ORKReactionTimeContentView.h */, + 25ECC09E1AFBD92D00F3D63B /* ORKReactionTimeContentView.m */, + 25ECC0A11AFBDD2700F3D63B /* ORKReactionTimeStimulusView.h */, + 25ECC0A21AFBDD2700F3D63B /* ORKReactionTimeStimulusView.m */, + FF919A3D1E81AFEF005C2A1E /* ORKReactionTimeResult.h */, + FF919A3E1E81AFEF005C2A1E /* ORKReactionTimeResult.m */, + 25ECC0931AFBD68300F3D63B /* ORKReactionTimeStep.h */, + 25ECC0941AFBD68300F3D63B /* ORKReactionTimeStep.m */, + ); + path = "Reaction Time"; + sourceTree = ""; + }; + CAD089A0289DDE17007B2A98 /* Spatial Span Memory */ = { + isa = PBXGroup; + children = ( + 86C40B141A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.h */, + 86C40B151A8D7C5B00081FAC /* ORKSpatialSpanMemoryStepViewController.m */, + 86C40B101A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.h */, + 86C40B111A8D7C5B00081FAC /* ORKSpatialSpanMemoryContentView.m */, + 86C40B161A8D7C5B00081FAC /* ORKSpatialSpanTargetView.h */, + 86C40B171A8D7C5B00081FAC /* ORKSpatialSpanTargetView.m */, + FF919A341E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.h */, + FF919A351E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.m */, + 86C40B121A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.h */, + 86C40B131A8D7C5B00081FAC /* ORKSpatialSpanMemoryStep.m */, + 86C40B0C1A8D7C5B00081FAC /* ORKSpatialSpanGame.h */, + 86C40B0D1A8D7C5B00081FAC /* ORKSpatialSpanGame.m */, + 86C40B0E1A8D7C5B00081FAC /* ORKSpatialSpanGameState.h */, + 86C40B0F1A8D7C5B00081FAC /* ORKSpatialSpanGameState.m */, + ); + path = "Spatial Span Memory"; + sourceTree = ""; + }; + CAD089A1289DDE2E007B2A98 /* Stroop */ = { + isa = PBXGroup; + children = ( + BA0AA68E1EAEC0B600671ACE /* ORKStroopContentView.h */, + BA0AA68F1EAEC0B600671ACE /* ORKStroopContentView.m */, + BA0AA6921EAEC0B600671ACE /* ORKStroopStepViewController.h */, + BA0AA6931EAEC0B600671ACE /* ORKStroopStepViewController.m */, + A659C53C262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.h */, + A659C53D262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.m */, + A659C544262E0F5600E920DA /* UIColor+String.h */, + A659C545262E0F5600E920DA /* UIColor+String.m */, + FF72B1ED1F5F10CD004C6F15 /* ORKStroopResult.h */, + FF72B1EE1F5F10CD004C6F15 /* ORKStroopResult.m */, + BA0AA6901EAEC0B600671ACE /* ORKStroopStep.h */, + BA0AA6911EAEC0B600671ACE /* ORKStroopStep.m */, + A659C538262E0A3200E920DA /* ORKAccuracyStroopStep.h */, + A659C539262E0A3200E920DA /* ORKAccuracyStroopStep.m */, + 5D003D9F26377E7400A6439B /* ORKAccuracyStroopResult.h */, + 5D003DA026377E7400A6439B /* ORKAccuracyStroopResult.m */, + ); + path = Stroop; + sourceTree = ""; + }; + CAD089A3289DDE57007B2A98 /* Tapping */ = { + isa = PBXGroup; + children = ( + 86C40B181A8D7C5B00081FAC /* ORKTappingContentView.h */, + 86C40B191A8D7C5B00081FAC /* ORKTappingContentView.m */, + 86C40B1C1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.h */, + 86C40B1D1A8D7C5B00081FAC /* ORKTappingIntervalStepViewController.m */, + FF919A201E81A56F005C2A1E /* ORKTappingIntervalResult.h */, + FF919A211E81A56F005C2A1E /* ORKTappingIntervalResult.m */, + 86C40B1A1A8D7C5B00081FAC /* ORKTappingIntervalStep.h */, + 86C40B1B1A8D7C5B00081FAC /* ORKTappingIntervalStep.m */, + ); + path = Tapping; + sourceTree = ""; + }; + CAD089A4289DDE6B007B2A98 /* Tone Audiometry */ = { + isa = PBXGroup; + children = ( + 147503B11AEE807C004B17F3 /* ORKToneAudiometryContentView.h */, + 147503B21AEE807C004B17F3 /* ORKToneAudiometryContentView.m */, + 147503B51AEE807C004B17F3 /* ORKToneAudiometryStepViewController.h */, + 147503B61AEE807C004B17F3 /* ORKToneAudiometryStepViewController.m */, + 147503AD1AEE8071004B17F3 /* ORKAudioGenerator.h */, + 147503AE1AEE8071004B17F3 /* ORKAudioGenerator.m */, + FF919A301E81AC26005C2A1E /* ORKToneAudiometryResult.h */, + FF919A311E81AC26005C2A1E /* ORKToneAudiometryResult.m */, + 147503B31AEE807C004B17F3 /* ORKToneAudiometryStep.h */, + 147503B41AEE807C004B17F3 /* ORKToneAudiometryStep.m */, + ); + path = "Tone Audiometry"; + sourceTree = ""; + }; + CAD089A5289DDE87007B2A98 /* TowerOfHanoi */ = { + isa = PBXGroup; + children = ( + 250F94061B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.h */, + 250F94071B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.m */, + 257FCE1D1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.h */, + 257FCE1E1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.m */, + 250F94021B4C5A6600FA23EB /* ORKTowerOfHanoiStep.h */, + 250F94031B4C5A6600FA23EB /* ORKTowerOfHanoiStep.m */, + 257FCE211B4D37A80001EF06 /* ORKTowerOfHanoiTower.h */, + 257FCE221B4D37A80001EF06 /* ORKTowerOfHanoiTower.m */, + FF919A2C1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.h */, + FF919A2D1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.m */, + ); + path = TowerOfHanoi; + sourceTree = ""; + }; + CAD089A6289DDE97007B2A98 /* Trailmaking */ = { + isa = PBXGroup; + children = ( + 781D540A1DF886AB00223305 /* ORKTrailmakingContentView.h */, + 781D540B1DF886AB00223305 /* ORKTrailmakingContentView.m */, + 781D540E1DF886AB00223305 /* ORKTrailmakingStepViewController.h */, + 781D540F1DF886AB00223305 /* ORKTrailmakingStepViewController.m */, + FF919A4D1E81BD05005C2A1E /* ORKTrailmakingResult.h */, + FF919A4E1E81BD05005C2A1E /* ORKTrailmakingResult.m */, + 781D540C1DF886AB00223305 /* ORKTrailmakingStep.h */, + 781D540D1DF886AB00223305 /* ORKTrailmakingStep.m */, ); - name = Misc; + path = Trailmaking; sourceTree = ""; }; - BF1D43821D490482007EE90B /* Video Instruction Step */ = { + CAD089A7289DDEA8007B2A98 /* Walking */ = { isa = PBXGroup; children = ( - BF1D43831D4904C6007EE90B /* ORKVideoInstructionStep.h */, - BF1D43841D4904C6007EE90B /* ORKVideoInstructionStep.m */, - FF919A5D1E81CF07005C2A1E /* ORKVideoInstructionStepResult.h */, - FF919A5E1E81CF07005C2A1E /* ORKVideoInstructionStepResult.m */, - BF1D43871D4905FC007EE90B /* ORKVideoInstructionStepViewController.h */, - BF1D43881D4905FC007EE90B /* ORKVideoInstructionStepViewController.m */, + CAD089A9289DDEB2007B2A98 /* Short Walk */, + CAD089A8289DDEAD007B2A98 /* Timed Walk */, ); - name = "Video Instruction Step"; + path = Walking; sourceTree = ""; }; - BF690AD61BAD3DC0009C5ADA /* Review Step */ = { + CAD089A8289DDEAD007B2A98 /* Timed Walk */ = { isa = PBXGroup; children = ( - BF9155951BDE8D7D007FA459 /* ORKReviewStep_Internal.h */, - BF9155961BDE8D7D007FA459 /* ORKReviewStep.h */, - BF9155971BDE8D7D007FA459 /* ORKReviewStep.m */, - BF9155981BDE8D7D007FA459 /* ORKReviewStepViewController_Internal.h */, - BF9155991BDE8D7D007FA459 /* ORKReviewStepViewController.h */, - BF91559A1BDE8D7D007FA459 /* ORKReviewStepViewController.m */, + 5192BEEA2AE043D3006E43FB /* ORKTimedWalkContentView.h */, + 5192BEE82AE043D3006E43FB /* ORKTimedWalkContentView.m */, + 5192BEE92AE043D3006E43FB /* ORKTimedWalkStepViewController.h */, + 5192BEEB2AE043D3006E43FB /* ORKTimedWalkStepViewController.m */, + FF919A491E81BB7E005C2A1E /* ORKTimedWalkResult.h */, + FF919A4A1E81BB7E005C2A1E /* ORKTimedWalkResult.m */, + 5192BEE42AE043A2006E43FB /* ORKTimedWalkStep.h */, + 5192BEE52AE043A2006E43FB /* ORKTimedWalkStep.m */, ); - name = "Review Step"; + path = "Timed Walk"; sourceTree = ""; }; - BF9D62C41BD244C4000AA6A7 /* Wait Step */ = { + CAD089A9289DDEB2007B2A98 /* Short Walk */ = { isa = PBXGroup; children = ( - BF9155A11BDE8DA9007FA459 /* ORKWaitStep.h */, - BF9155A21BDE8DA9007FA459 /* ORKWaitStep.m */, - BF9155A31BDE8DA9007FA459 /* ORKWaitStepView.h */, - BF9155A41BDE8DA9007FA459 /* ORKWaitStepView.m */, - BF9155A51BDE8DA9007FA459 /* ORKWaitStepViewController.h */, - BF9155A61BDE8DA9007FA459 /* ORKWaitStepViewController.m */, + 86C40B1E1A8D7C5B00081FAC /* ORKWalkingTaskStep.h */, + 86C40B1F1A8D7C5B00081FAC /* ORKWalkingTaskStep.m */, + 86C40B201A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.h */, + 86C40B211A8D7C5B00081FAC /* ORKWalkingTaskStepViewController.m */, ); - name = "Wait Step"; + path = "Short Walk"; sourceTree = ""; }; D44239761AF17EE700559D96 /* Image Capture Step */ = { @@ -4197,12 +4586,6 @@ children = ( D44239771AF17F5100559D96 /* ORKImageCaptureStep.h */, D44239781AF17F5100559D96 /* ORKImageCaptureStep.m */, - D442397B1AF17F7600559D96 /* ORKImageCaptureStepViewController.h */, - D442397C1AF17F7600559D96 /* ORKImageCaptureStepViewController.m */, - D45852081AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.h */, - D45852091AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.m */, - D42FEFB61AF7557000A124F8 /* ORKImageCaptureView.h */, - D42FEFB71AF7557000A124F8 /* ORKImageCaptureView.m */, ); name = "Image Capture Step"; sourceTree = ""; @@ -4210,12 +4593,13 @@ FA7A9D2C1B083D90005A2BEA /* Formatters */ = { isa = PBXGroup; children = ( - FA7A9D2D1B083DD3005A2BEA /* ORKConsentSectionFormatter.h */, - FA7A9D2E1B083DD3005A2BEA /* ORKConsentSectionFormatter.m */, - FA7A9D311B0843A9005A2BEA /* ORKConsentSignatureFormatter.h */, - FA7A9D321B0843A9005A2BEA /* ORKConsentSignatureFormatter.m */, + 51AF1B132B67F30500D3B399 /* ORKSignatureFormatter.h */, + 51AF1B142B67F30500D3B399 /* ORKSignatureFormatter.m */, + 51EB9A512B8408D50064A515 /* ORKInstructionStepHTMLFormatter.h */, + 51EB9A522B8408D50064A515 /* ORKInstructionStepHTMLFormatter.m */, ); name = Formatters; + path = Consent; sourceTree = ""; }; FA7A9D351B09362D005A2BEA /* Consent */ = { @@ -4234,22 +4618,10 @@ children = ( FF5CA6101D2C2670001660A3 /* ORKTableStep.h */, FF5CA6111D2C2670001660A3 /* ORKTableStep.m */, - FF36A49A1D1A15FC00DE8470 /* ORKTableStepViewController.h */, - FF36A49B1D1A15FC00DE8470 /* ORKTableStepViewController.m */, - FF36A4991D1A15FC00DE8470 /* ORKTableStepViewController_Internal.h */, ); name = "Table Step"; sourceTree = ""; }; - FF919A381E81AEF8005C2A1E /* Results */ = { - isa = PBXGroup; - children = ( - FF919A391E81AF1D005C2A1E /* ORKFileResult.h */, - FF919A3A1E81AF1D005C2A1E /* ORKFileResult.m */, - ); - name = Results; - sourceTree = ""; - }; FFDDD8461D3453A200446806 /* Page Step */ = { isa = PBXGroup; children = ( @@ -4258,8 +4630,6 @@ FF5051EC1D668FF80065E677 /* ORKPageStep_Private.h */, FF5051EE1D66908C0065E677 /* ORKNavigablePageStep.h */, FF5051EF1D66908C0065E677 /* ORKNavigablePageStep.m */, - FF5E3CC91D23444400ECE4B7 /* ORKPageStepViewController.h */, - FF5E3CCA1D23444400ECE4B7 /* ORKPageStepViewController.m */, ); name = "Page Step"; sourceTree = ""; @@ -4271,476 +4641,508 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 0BAF97A0291088F200EF138A /* ORKNormalizedReactionTimeResult.h in Headers */, - 0BAF97A3291088F200EF138A /* ORKNormalizedReactionTimeStep.h in Headers */, - D3C8072A21891EBE00F9A231 /* ORKEnvironmentSPLMeterResult.h in Headers */, BF1D43851D4904C6007EE90B /* ORKVideoInstructionStep.h in Headers */, + CA2B900928A17AD90025B773 /* ORKActiveStep_Internal.h in Headers */, BF5161501BE9C53D00174DDD /* ORKWaitStep.h in Headers */, 244EFAD21BCEFD83001850D9 /* ORKAnswerFormat_Private.h in Headers */, + 519CE8252C6582BE003BB584 /* ORKFamilyHistoryResult.h in Headers */, BCA5C0351AEC05F20092AC8D /* ORKStepNavigationRule.h in Headers */, - 2E8070F71FAD217500E4FC7F /* ORKSpeechRecognizer.h in Headers */, + 5192BF592AE09794006E43FB /* ORKFormItemVisibilityRule.h in Headers */, + 5192BF872AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.h in Headers */, BF91559C1BDE8D7D007FA459 /* ORKReviewStep.h in Headers */, BC13CE391B0660220044153C /* ORKNavigableOrderedTask.h in Headers */, - A659C546262E0F5600E920DA /* UIColor+String.h in Headers */, - 71BD9EA920969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.h in Headers */, - 511B8AAA293A766300049947 /* ORKTouchAbilityTrial_Internal.h in Headers */, - 86C40C921A8D7C5C00081FAC /* ORKAudioRecorder.h in Headers */, - BA5B9207204F5D9A007C2F9D /* ORKSpeechRecognitionResult.h in Headers */, - 511B8B0D293A795900049947 /* ORKTouchAbilityPinchStepViewController.h in Headers */, - BCB6E65B1B7D534C000D5B34 /* ORKDiscreteGraphChartView.h in Headers */, 86C40D8E1A8D7C5C00081FAC /* ORKStep.h in Headers */, - 511987C72463316E004FC2C7 /* ORKRequestPermissionsStepViewController.h in Headers */, - 618DA04E1A93D0D600E63AA8 /* ORKAccessibility.h in Headers */, - BA6E1EB6209E9A3F00DA9D55 /* ORKPDFViewerStepView_Internal.h in Headers */, - BAC6F1A922AF535100E31C22 /* ORKTaskReviewViewController.h in Headers */, - FFF65AB81E318F2D0043FB40 /* ORKMultipleValuePicker.h in Headers */, - 5170009E254A255F00CACE12 /* ORKRequestPermissionButton.h in Headers */, - 86B781BB1AA668ED00688151 /* ORKTimeIntervalPicker.h in Headers */, - 511B8A99293A75B900049947 /* ORKTouchAbilityTouch.h in Headers */, 24C296751BD052F800B42EF1 /* ORKVerificationStep_Internal.h in Headers */, - 86C40C6A1A8D7C5C00081FAC /* CMDeviceMotion+ORKJSONDictionary.h in Headers */, - BAD65E502284F266008A5DCE /* ORKStepView_Private.h in Headers */, 86C40CE41A8D7C5C00081FAC /* ORKAnswerFormat.h in Headers */, - 25ECC0951AFBD68300F3D63B /* ORKReactionTimeStep.h in Headers */, - 2E8070FB1FAD217500E4FC7F /* ORKSpeechRecognitionStep.h in Headers */, FF919A531E81BEB5005C2A1E /* ORKCollectionResult.h in Headers */, - 86C40D0A1A8D7C5C00081FAC /* ORKCustomStepView.h in Headers */, - BCD192EE1B81255F00FCC08A /* ORKPieChartView_Internal.h in Headers */, 5D04885725F19A7A0006C68B /* ORKDevice.h in Headers */, - 86C40DCE1A8D7C5C00081FAC /* ORKTaskViewController_Internal.h in Headers */, - 25ECC09F1AFBD92D00F3D63B /* ORKReactionTimeContentView.h in Headers */, - 10FF9AC31B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.h in Headers */, - 86C40C361A8D7C5C00081FAC /* ORKSpatialSpanGame.h in Headers */, - BAB3942F22601CAB00E59B0B /* ORKStepContainerView_Private.h in Headers */, - 511B8B2A293A79E500049947 /* ORKTouchAbilityRotationContentView.h in Headers */, - 2E557D2C2032AB6D007B39D6 /* ORKSpeechRecognitionError.h in Headers */, - 86C40CAC1A8D7C5C00081FAC /* ORKRecorder.h in Headers */, - 03057F3D2515772E00C4EC5B /* ORKAudioFitnessStep.h in Headers */, - 5D003DA126377E7400A6439B /* ORKAccuracyStroopResult.h in Headers */, - 865EA1681ABA1AA10037C68E /* ORKPicker.h in Headers */, - 86C40CC81A8D7C5C00081FAC /* ORKFormItemCell.h in Headers */, - 86C40DF21A8D7C5C00081FAC /* ORKConsentReviewController.h in Headers */, - BAD9E9162255E9CE0014FA29 /* ORKLearnMoreStepViewController.h in Headers */, - 86C40C961A8D7C5C00081FAC /* ORKDataLogger.h in Headers */, BC13CE421B066A990044153C /* ORKStepNavigationRule_Internal.h in Headers */, - 86C40D781A8D7C5C00081FAC /* ORKScaleSlider.h in Headers */, - BA0AA6981EAEC0B600671ACE /* ORKStroopStepViewController.h in Headers */, - 861D2AE81B840991008C4CD0 /* ORKTimedWalkStep.h in Headers */, 036B1E8D25351BAD008483DF /* ORKMotionActivityPermissionType.h in Headers */, - 5119879F245FE68D004FC2C7 /* ORKUSDZModelManager.h in Headers */, - 86C40D241A8D7C5C00081FAC /* ORKFormStepViewController.h in Headers */, - BABBB1B62097E58300CB29E5 /* ORKPDFViewerStepView.h in Headers */, - 959A2C001D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.h in Headers */, 86C40D6A1A8D7C5C00081FAC /* ORKResult.h in Headers */, - FF919A3F1E81AFEF005C2A1E /* ORKReactionTimeResult.h in Headers */, - 86C40DD61A8D7C5C00081FAC /* ORKUnitLabel.h in Headers */, - BABBB1BA2097EF3800CB29E5 /* ORKFreehandDrawingView.h in Headers */, - 10FF9AD71B7A045E00ECB5B4 /* ORKSeparatorView.h in Headers */, - 5D43C5D124217393006F4084 /* ORKRecordButton.h in Headers */, - FF72B1EF1F5F10CD004C6F15 /* ORKStroopResult.h in Headers */, 12F339C026A1F09A000665E4 /* ORKLocationPermissionType.h in Headers */, - 86C40D9C1A8D7C5C00081FAC /* ORKSubheadlineLabel.h in Headers */, - 147503BB1AEE807C004B17F3 /* ORKToneAudiometryStepViewController.h in Headers */, - 5D1CE45A23FC85F4004CB416 /* ORKAudioMeteringView.h in Headers */, - BCD192DF1B81240400FCC08A /* ORKPieChartPieView.h in Headers */, - 86C40D441A8D7C5C00081FAC /* ORKInstructionStepViewController.h in Headers */, - 86C40D841A8D7C5C00081FAC /* ORKSelectionTitleLabel.h in Headers */, 51E03D6324919711008F8406 /* ORKPermissionType.h in Headers */, - 511B8ACB293A777400049947 /* ORKTouchAbilityLongPressStepViewController.h in Headers */, BC13CE3C1B0662990044153C /* ORKStepNavigationRule_Private.h in Headers */, BCB8133C1C98367A00346561 /* ORKTypes.h in Headers */, - 86C40D3C1A8D7C5C00081FAC /* ORKImageChoiceLabel.h in Headers */, - 511B8AB2293A76A100049947 /* ORKTouchAbilityTapStep.h in Headers */, - BC4194291AE8453A00073D6B /* ORKObserver.h in Headers */, 51E03D682491A601008F8406 /* ORKHealthKitPermissionType.h in Headers */, - 10FF9AD31B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.h in Headers */, FF919A5F1E81CF07005C2A1E /* ORKVideoInstructionStepResult.h in Headers */, 866DA5201D63D04700C9AF3F /* ORKCollector.h in Headers */, - BF9155AB1BDE8DA9007FA459 /* ORKWaitStepViewController.h in Headers */, - BF9155A91BDE8DA9007FA459 /* ORKWaitStepView.h in Headers */, - 5D38006B2437E53500E7D2BD /* ORKAudioStreamer.h in Headers */, - 86C40C661A8D7C5C00081FAC /* CMAccelerometerData+ORKJSONDictionary.h in Headers */, - BF91559F1BDE8D7E007FA459 /* ORKReviewStepViewController.h in Headers */, - 7118AC7520BF6A7800D7A6BB /* ORKSpeechInNoiseStepViewController.h in Headers */, + 51A11F1A2BD08D5E0060C07E /* CMMotionActivity+ORKJSONDictionary.h in Headers */, BF91559B1BDE8D7D007FA459 /* ORKReviewStep_Internal.h in Headers */, - BF91559E1BDE8D7E007FA459 /* ORKReviewStepViewController_Internal.h in Headers */, - BA2CFBB02342935800B71919 /* ORKCompletionCheckmarkView.h in Headers */, - FF919A3B1E81AF1D005C2A1E /* ORKFileResult.h in Headers */, FF919A561E81BEE0005C2A1E /* ORKCollectionResult_Private.h in Headers */, - 51751463245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.h in Headers */, FF919A661E81D168005C2A1E /* ORKSignatureResult_Private.h in Headers */, - BA95AA9E20ACD0E700E7FF8E /* ORKAmslerGridContentView.h in Headers */, - FFAE71401DAEC66200AE82B4 /* ORKFootnoteLabel.h in Headers */, FF5CA61B1D2C6453001660A3 /* ORKSignatureStep.h in Headers */, - 71769E312088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.h in Headers */, - AE2CF2C123231C5A00FDD733 /* ORKTagLabel.h in Headers */, - FF919A471E81BA3D005C2A1E /* ORKHolePegTestResult.h in Headers */, - 511B8AFC293A78CF00049947 /* ORKTouchAbilityScrollContentView.h in Headers */, BC081DE224CBC4DE00AD92AA /* ORKTypes_Private.h in Headers */, - 5175144E2459EBF0009E8FFC /* ORK3DModelStep.h in Headers */, - 25ECC0A31AFBDD2700F3D63B /* ORKReactionTimeStimulusView.h in Headers */, - 106FF2AA1B690FD7004EACF2 /* ORKHolePegTestPlacePegView.h in Headers */, - 86C40D701A8D7C5C00081FAC /* ORKRoundTappingButton.h in Headers */, - BCB6E6501B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.h in Headers */, - BF1D43891D4905FC007EE90B /* ORKVideoInstructionStepViewController.h in Headers */, - CBD34A561BB1FB9000F204EA /* ORKLocationSelectionView.h in Headers */, - 71BD9EA520969BE1007B436E /* ORKEnvironmentSPLMeterStep.h in Headers */, - BAD6FAB12332A2FD006647E7 /* ORKCheckmarkView.h in Headers */, - BA8078F3224AC8AA0013B554 /* ORKStepContainerView.h in Headers */, - 865EA1621AB8DF750037C68E /* ORKDateTimePicker.h in Headers */, - 86C40DA01A8D7C5C00081FAC /* ORKSurveyAnswerCell.h in Headers */, - 86C40D941A8D7C5C00081FAC /* ORKStepViewController.h in Headers */, - B8760F2B1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.h in Headers */, - 2E8070FA1FAD217500E4FC7F /* ORKSpeechRecognitionStepViewController.h in Headers */, 5D04885C25F1B3AB0006C68B /* ORKDevice_Private.h in Headers */, - 86C40C221A8D7C5C00081FAC /* ORKCountdownStep.h in Headers */, - 86C40DB61A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.h in Headers */, - 86C40E281A8D7C5C00081FAC /* ORKSignatureView.h in Headers */, - BC37323622B76DC70021F665 /* ORKFormStepViewController_Private.h in Headers */, 00C2668E23022CD400337E0B /* ORKCustomStep.h in Headers */, - 5D5880392410394F005B3D91 /* ORKSpeechInNoiseResult.h in Headers */, - 51751467245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.h in Headers */, - 0B6CD14429119CBA004BC4A0 /* ORKNormalizedReactionTimeContentView.h in Headers */, - 0B6CD14529119CCC004BC4A0 /* ORKNormalizedReactionTimeViewController.h in Headers */, - 0B6CD14329119C7F004BC4A0 /* ORKNormalizedReactionTimeStimulusView.h in Headers */, - 2489F7AF1D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.h in Headers */, - BCB6E65D1B7D534C000D5B34 /* ORKGraphChartView_Internal.h in Headers */, - 86C40C8C1A8D7C5C00081FAC /* ORKActiveStepViewController.h in Headers */, - F7EC216624787338000C1F46 /* ORKCustomSignatureFooterView.h in Headers */, - 511B8ACF293A779200049947 /* ORKTouchAbilityLongPressContentView.h in Headers */, - 511B8AF8293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.h in Headers */, - 618DA0541A93D0D600E63AA8 /* UIView+ORKAccessibility.h in Headers */, - 86C40C3A1A8D7C5C00081FAC /* ORKSpatialSpanGameState.h in Headers */, - 10864CA21B27146B000F4158 /* ORKPSATContentView.h in Headers */, - 618DA0501A93D0D600E63AA8 /* ORKAccessibilityFunctions.h in Headers */, - FF5E3CCB1D23444400ECE4B7 /* ORKPageStepViewController.h in Headers */, - 511B8AC8293A777400049947 /* ORKTouchAbilityLongPressStep.h in Headers */, - 517514562459F0BE009E8FFC /* ORK3DModelStepContentView.h in Headers */, BCCE9EC121104B2200B809F8 /* ORKConsentDocument_Private.h in Headers */, - 86C40C721A8D7C5C00081FAC /* CMPedometerData+ORKJSONDictionary.h in Headers */, - 106FF2A61B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.h in Headers */, - 86C40CA41A8D7C5C00081FAC /* ORKLocationRecorder.h in Headers */, 86C40D201A8D7C5C00081FAC /* ORKFormStep.h in Headers */, - BCD192EB1B81245500FCC08A /* ORKPieChartTitleTextView.h in Headers */, - 249F44E51BCD9EAC0000D57E /* ORKFormStepViewController_Internal.h in Headers */, - 515310CF233570CF007BCA58 /* ORKDontKnowButton.h in Headers */, - 781D54101DF886AB00223305 /* ORKTrailmakingContentView.h in Headers */, - 226565532847FD1D00E916FF /* ORKAudiometryStimulus.h in Headers */, - 86C40C761A8D7C5C00081FAC /* HKSample+ORKJSONDictionary.h in Headers */, - BA0AA6961EAEC0B600671ACE /* ORKStroopStep.h in Headers */, - 71769E2920880C4500A19914 /* ORKdBHLToneAudiometryResult.h in Headers */, - BABBB19D2093299A00CB29E5 /* ORKSurveyCardHeaderView.h in Headers */, - 86C40CEA1A8D7C5C00081FAC /* ORKAnswerTextField.h in Headers */, + CA2B901F28A1864A0025B773 /* ORKRecorder.h in Headers */, BA473FE8224DB38900A362E3 /* ORKBodyItem.h in Headers */, 2429D5721BBB5397003A512F /* ORKRegistrationStep.h in Headers */, + 51B94DBD2B311E810039B0E7 /* CLLocationManager+ResearchKit.h in Headers */, + B183A4A21A8535D100C76870 /* ResearchKit_Private.h in Headers */, + 5192BF842AE1BA47006E43FB /* ORKFrontFacingCameraStep.h in Headers */, + CA2B900B28A17AE10025B773 /* ORKActiveStep.h in Headers */, AE75433A24E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.h in Headers */, - 242C9E111BBE06DE0088B7F4 /* ORKVerificationStepView.h in Headers */, 86C40CE81A8D7C5C00081FAC /* ORKAnswerFormat_Internal.h in Headers */, - 106FF29E1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.h in Headers */, - E293668525EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.h in Headers */, BC94EF361E96394C00143081 /* ORKRegistrationStep_Internal.h in Headers */, - 5119879B245FC33C004FC2C7 /* ORK3DModelManager.h in Headers */, - 86C40D021A8D7C5C00081FAC /* ORKContinueButton.h in Headers */, - 86C40D681A8D7C5C00081FAC /* ORKQuestionStepViewController_Private.h in Headers */, - 511B8AD6293A77BE00049947 /* ORKTouchAbilityLongPressResult.h in Headers */, - BCB6E6661B7D535F000D5B34 /* ORKXAxisView.h in Headers */, 86C40D121A8D7C5C00081FAC /* ORKDefines.h in Headers */, 86C40D401A8D7C5C00081FAC /* ORKInstructionStep.h in Headers */, - 147503B71AEE807C004B17F3 /* ORKToneAudiometryContentView.h in Headers */, - 86C40D981A8D7C5C00081FAC /* ORKStepViewController_Internal.h in Headers */, - 959A2C0D1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.h in Headers */, - 86B89ABB1AB3BECC001626A4 /* ORKStepHeaderView.h in Headers */, - FF154FB41E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.h in Headers */, - FF36A49D1D1A15FC00DE8470 /* ORKTableStepViewController.h in Headers */, - 2489F7B51D65214D008DEF20 /* ORKVideoCaptureView.h in Headers */, FF919A5C1E81C641005C2A1E /* ORKQuestionResult_Private.h in Headers */, - 7118AC7920BF6A7800D7A6BB /* ORKSpeechInNoiseStep.h in Headers */, - D42FEFB81AF7557000A124F8 /* ORKImageCaptureView.h in Headers */, 10FF9ADB1B7BA78400ECB5B4 /* ORKOrderedTask_Private.h in Headers */, - BA43CCA42271741C00F2A2D2 /* ORKStepContentView.h in Headers */, 86C40D1A1A8D7C5C00081FAC /* ORKFormItem_Internal.h in Headers */, - BC5FAF841C6901A200057CF1 /* ORKChartTypes.h in Headers */, 86C40E1C1A8D7C5C00081FAC /* ORKConsentSection_Private.h in Headers */, - 861D2AEC1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.h in Headers */, - 86C40C7A1A8D7C5C00081FAC /* ORKAccelerometerRecorder.h in Headers */, - BAC2B65B22F25A2E0079304E /* ORKSESSelectionView.h in Headers */, 242C9E051BBDFDAC0088B7F4 /* ORKVerificationStep.h in Headers */, - 511B8ABE293A770D00049947 /* ORKTouchAbilityTapTrial.h in Headers */, - 5D26E77824997EA200E53D27 /* ORK3DModelManager_Internal.h in Headers */, + CA2B901128A17D120025B773 /* ORKFileResult.h in Headers */, 86C40D141A8D7C5C00081FAC /* ORKHelpers_Private.h in Headers */, - FF919A2E1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.h in Headers */, - BAC2B65722F252F70079304E /* ORKSurveyAnswerCellForSES.h in Headers */, - 86C40CA81A8D7C5C00081FAC /* ORKPedometerRecorder.h in Headers */, - 86C40CD01A8D7C5C00081FAC /* ORKInstructionStepView.h in Headers */, + CA6A0D7E288B51D30048C1EF /* ORKSkin.h in Headers */, + CA2B902028A186500025B773 /* ORKRecorder_Internal.h in Headers */, + 51F716CB297E2A1100D8ACF7 /* ORKConsentDocument+ORKInstructionStep.h in Headers */, 511987C3246330CA004FC2C7 /* ORKRequestPermissionsStep.h in Headers */, 86C40E021A8D7C5C00081FAC /* ORKConsentDocument_Internal.h in Headers */, - 8DE27B411D5BC9E2009A26E3 /* ORKHTMLPDFPageRenderer.h in Headers */, 86C40E181A8D7C5C00081FAC /* ORKConsentSection.h in Headers */, - 511B8B04293A791B00049947 /* ORKTouchAbilityScrollResult.h in Headers */, - FF919A4F1E81BD05005C2A1E /* ORKTrailmakingResult.h in Headers */, - 5166E49F247355D500151C57 /* ORKUSDZModelManagerResult.h in Headers */, - 86AD910A1AB7AD1E00361FEB /* ORKNavigationContainerView.h in Headers */, - FF919A4B1E81BB7E005C2A1E /* ORKTimedWalkResult.h in Headers */, - 00C2668A2302244300337E0B /* ORKCustomStepViewController.h in Headers */, - 865EA16C1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.h in Headers */, - 86C40C121A8D7C5C00081FAC /* ORKActiveStepQuantityView.h in Headers */, - 86C40CCC1A8D7C5C00081FAC /* ORKImageSelectionView.h in Headers */, - BA2645E62301571800D00B73 /* ORKReviewViewController.h in Headers */, 866DA5251D63D04700C9AF3F /* ORKHealthSampleQueryOperation.h in Headers */, - 511B8ADF293A782800049947 /* ORKTouchAbilitySwipeStepViewController.h in Headers */, - 2441034F1B966D4C00EEAB0C /* ORKPasscodeViewController.h in Headers */, - B11C549F1A9EF4A700265E61 /* ORKConsentSharingStepViewController.h in Headers */, - BC4A213F1C85FC0000BFC271 /* ORKBarGraphChartView.h in Headers */, + 51AF1B152B67F30500D3B399 /* ORKSignatureFormatter.h in Headers */, + 519CE82A2C6582BE003BB584 /* ORKConditionStepConfiguration.h in Headers */, + 51AF1B202B683C3400D3B399 /* ORKWebViewStepResult_Private.h in Headers */, 5D04884C25EF4CC30006C68B /* ORKQuestionStep_Private.h in Headers */, 86C40D621A8D7C5C00081FAC /* ORKQuestionStep_Internal.h in Headers */, - 511B8A9D293A75F300049947 /* ORKTouchAbilityTrack.h in Headers */, - 86C40D641A8D7C5C00081FAC /* ORKQuestionStepViewController.h in Headers */, - 10BAA2CA1B5FCB4F004FE478 /* ORKProgressView.h in Headers */, - BA95AA9620ACD07A00E7FF8E /* ORKAmslerGridStep.h in Headers */, - BCB6E6601B7D534C000D5B34 /* ORKLineGraphChartView.h in Headers */, - 86C40E241A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.h in Headers */, - 7118AC7720BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.h in Headers */, - BA473FED224DBA3700A362E3 /* ORKLearnMoreView.h in Headers */, B183A4DD1A8535D100C76870 /* ResearchKit.h in Headers */, - 95E11E551D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.h in Headers */, - 86C40D101A8D7C5C00081FAC /* ORKDefaultFont.h in Headers */, BAD9E9122255E9750014FA29 /* ORKLearnMoreInstructionStep.h in Headers */, - 86C40DCA1A8D7C5C00081FAC /* ORKTaskViewController.h in Headers */, - 1B4B95BA1F5F014E006B629F /* ORKWeightPicker.h in Headers */, - 86C40C7E1A8D7C5C00081FAC /* ORKActiveStep.h in Headers */, - BCB6E65E1B7D534C000D5B34 /* ORKGraphChartView.h in Headers */, - 86C40DD21A8D7C5C00081FAC /* ORKTextButton.h in Headers */, - BA95AA9A20ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.h in Headers */, - 86C40CD41A8D7C5C00081FAC /* ORKTableContainerView.h in Headers */, - 86C40D0E1A8D7C5C00081FAC /* ORKCustomStepView_Internal.h in Headers */, - 716B126820A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.h in Headers */, 866DA51F1D63D04700C9AF3F /* ORKCollector_Internal.h in Headers */, - 86C40CF21A8D7C5C00081FAC /* ORKBodyLabel.h in Headers */, FF919A691E81D255005C2A1E /* ORKConsentSignatureResult.h in Headers */, 866DA5271D63D04700C9AF3F /* ORKMotionActivityQueryOperation.h in Headers */, 031A0FC124CF4ECD000E4455 /* ORKSensorPermissionType.h in Headers */, - 106FF2B41B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.h in Headers */, - 51BF30BE247B330900E2E669 /* ORKIconButton.h in Headers */, - 03057F392515771800C4EC5B /* ORKAudioFitnessStepViewController.h in Headers */, 86C40D921A8D7C5C00081FAC /* ORKStep_Private.h in Headers */, - 86C40CC41A8D7C5C00081FAC /* ORKCompletionStepViewController.h in Headers */, - FF919A431E81B904005C2A1E /* ORKPSATResult.h in Headers */, - FF36A49C1D1A15FC00DE8470 /* ORKTableStepViewController_Internal.h in Headers */, FF919A631E81D04D005C2A1E /* ORKSignatureResult.h in Headers */, - 51D823052472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.h in Headers */, - 511B8AEE293A785A00049947 /* ORKTouchAbilitySwipeTrial.h in Headers */, - 86C40D7C1A8D7C5C00081FAC /* ORKScaleValueLabel.h in Headers */, - 511B8AC1293A772400049947 /* ORKTouchAbilityTapResult.h in Headers */, 03EDD58024CA6B1D006245E9 /* ORKNotificationPermissionType.h in Headers */, - BAD65E4B2284EFF9008A5DCE /* ORKStepView.h in Headers */, - 250F94081B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.h in Headers */, - 257FCE1F1B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.h in Headers */, - 24A4DA181B8D13FE009C797A /* ORKPasscodeStepViewController.h in Headers */, - BA8C067822EEB84B00ACDE6B /* ORKPlaybackButton.h in Headers */, - 2295B221282AF92700A5D9E0 /* ORKAudiometry.h in Headers */, - 86C40CB81A8D7C5C00081FAC /* ORKVoiceEngine.h in Headers */, + 5192BF8B2AE1BBB0006E43FB /* ORKSecondaryTaskStep.h in Headers */, + 5192BF8C2AE1BF16006E43FB /* (null) in Headers */, 24A4DA141B8D1115009C797A /* ORKPasscodeStep.h in Headers */, - BCB6E6521B7D533B000D5B34 /* ORKPieChartLegendCell.h in Headers */, FA7A9D331B0843A9005A2BEA /* ORKConsentSignatureFormatter.h in Headers */, - 86C40C5A1A8D7C5C00081FAC /* ORKWalkingTaskStep.h in Headers */, - BC1C032C1CA301E300869355 /* ORKHeightPicker.h in Headers */, 5DABE5AE24DA173F00570C57 /* ResearchKit_Prefix.pch in Headers */, 866DA5231D63D04700C9AF3F /* ORKDataCollectionManager.h in Headers */, - 86AD910D1AB7AE4100361FEB /* ORKNavigationContainerView_Internal.h in Headers */, + CA6A0D84288B5B370048C1EF /* ORKHTMLPDFPageRenderer.h in Headers */, 2433C9E31B9A506F0052D375 /* ORKKeychainWrapper.h in Headers */, - 86C40CEE1A8D7C5C00081FAC /* ORKAnswerTextView.h in Headers */, - FF919A271E81A87B005C2A1E /* ORKActiveTaskResult.h in Headers */, - 86C40C421A8D7C5C00081FAC /* ORKSpatialSpanMemoryStep.h in Headers */, - 86C40C6E1A8D7C5C00081FAC /* CMMotionActivity+ORKJSONDictionary.h in Headers */, B11C54991A9EEF8800265E61 /* ORKConsentSharingStep.h in Headers */, - 805685791C90C19500BF437A /* UIImage+ResearchKit.h in Headers */, - 511B8B16293A797C00049947 /* ORKTouchAbilityPinchGuideView.h in Headers */, - 106FF2AE1B6FACA8004EACF2 /* ORKDirectionView.h in Headers */, - 86C40DA61A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.h in Headers */, 86C40D5E1A8D7C5C00081FAC /* ORKQuestionStep.h in Headers */, - 6146D0A31B84A91E0068491D /* ORKGraphChartAccessibilityElement.h in Headers */, - 86C40C841A8D7C5C00081FAC /* ORKActiveStepTimer.h in Headers */, - 511B8A91293A757E00049947 /* ORKTouchAbilityContentView.h in Headers */, - 86B781BD1AA668ED00688151 /* ORKValuePicker.h in Headers */, - BC37323222B76D1A0021F665 /* ORKTextButton_Internal.h in Headers */, - 86C40DE21A8D7C5C00081FAC /* ORKVerticalContainerView_Internal.h in Headers */, - BC01B0FB1B0EB99700863803 /* ORKTintedImageView_Internal.h in Headers */, - A659C53A262E0A3200E920DA /* ORKAccuracyStroopStep.h in Headers */, + 519CE82C2C6582BE003BB584 /* ORKRelatedPerson.h in Headers */, FF919A591E81C628005C2A1E /* ORKQuestionResult.h in Headers */, - 86B89ABE1AB3BFDB001626A4 /* ORKStepHeaderView_Internal.h in Headers */, 8419D66E1FB73CC80088D7E5 /* ORKWebViewStep.h in Headers */, - BC8FC6781CA9B17C00D12768 /* ORKVoiceEngine_Internal.h in Headers */, - 86C40C1E1A8D7C5C00081FAC /* ORKAudioStepViewController.h in Headers */, FFDDD8491D3555EA00446806 /* ORKPageStep.h in Headers */, - 147503AF1AEE8071004B17F3 /* ORKAudioGenerator.h in Headers */, - 71769E352088291B00A19914 /* ORKdBHLToneAudiometryContentView.h in Headers */, - 86AD91141AB7B97E00361FEB /* ORKQuestionStepView.h in Headers */, - 86C40C621A8D7C5C00081FAC /* CLLocation+ORKJSONDictionary.h in Headers */, - 86C40D801A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.h in Headers */, - 511B8AB6293A76B200049947 /* ORKTouchAbilityTapStepViewController.h in Headers */, - D458520A1AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.h in Headers */, D44239791AF17F5100559D96 /* ORKImageCaptureStep.h in Headers */, - 511B8AF9293A78BB00049947 /* ORKTouchAbilityScrollStep.h in Headers */, - 86C40CB21A8D7C5C00081FAC /* ORKRecorder_Private.h in Headers */, - BCD192E71B81243900FCC08A /* ORKPieChartLegendView.h in Headers */, - BABBB1B22097E16700CB29E5 /* ORKPDFViewerStepViewController.h in Headers */, - 86C40C881A8D7C5C00081FAC /* ORKActiveStepTimerView.h in Headers */, - 511B8AA7293A764900049947 /* ORKTouchAbilityTrial.h in Headers */, - 517514522459EF5D009E8FFC /* ORK3DModelStepViewController.h in Headers */, - 86C40C161A8D7C5C00081FAC /* ORKAudioContentView.h in Headers */, - 86C40CB41A8D7C5C00081FAC /* ORKTouchRecorder.h in Headers */, - 86C40DEA1A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.h in Headers */, - BA2FE3EE20B109C600AAC231 /* ORKAmslerGridResult.h in Headers */, - 9550E6731D58DBCF00C691B8 /* ORKTouchAnywhereStep.h in Headers */, - 86C40CF61A8D7C5C00081FAC /* ORKBorderedButton.h in Headers */, - 71769E2D208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.h in Headers */, - BA8C066B22ECF7C200ACDE6B /* ORKSecondaryTaskStep.h in Headers */, FF919A6D1E81D3B0005C2A1E /* ORKPasscodeResult.h in Headers */, - 86C40D4A1A8D7C5C00081FAC /* ORKLabel.h in Headers */, - 250F94041B4C5A6600FA23EB /* ORKTowerOfHanoiStep.h in Headers */, - 861D11A91AA691BB003C98A7 /* ORKScaleSliderView.h in Headers */, - 10FF9ACB1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.h in Headers */, - 10864CA01B27146B000F4158 /* ORKPSATStepViewController.h in Headers */, - 86C40C3E1A8D7C5C00081FAC /* ORKSpatialSpanMemoryContentView.h in Headers */, 24C296771BD055B800B42EF1 /* ORKLoginStep_Internal.h in Headers */, - 257FCE231B4D37A80001EF06 /* ORKTowerOfHanoiTower.h in Headers */, - 511B8B25293A79C000049947 /* ORKTouchAbilityRotationStepViewController.h in Headers */, - 511B8ADB293A781000049947 /* ORKTouchAbilitySwipeStep.h in Headers */, - 511B8B2F293A79FF00049947 /* ORKTouchAbilityRotationTrial.h in Headers */, 86C40CC01A8D7C5C00081FAC /* ORKCompletionStep.h in Headers */, - 86C40DF61A8D7C5C00081FAC /* ORKSignatureStepViewController.h in Headers */, - 86C40CDC1A8D7C5C00081FAC /* ORKTintedImageView.h in Headers */, - 86C40D281A8D7C5C00081FAC /* ORKFormTextView.h in Headers */, + 5192BF502AE09673006E43FB /* ORKPredicateFormItemVisibilityRule.h in Headers */, + 519CE8272C6582BE003BB584 /* ORKRelativeGroup.h in Headers */, 14A92C4822440195007547F2 /* ORKHelpers_Internal.h in Headers */, - BA473FE3224DAFEF00A362E3 /* ORKBodyContainerView.h in Headers */, - 5D58800B24007140005B3D91 /* ORKPlaybackButton_Internal.h in Headers */, - 511B8AD2293A77AA00049947 /* ORKTouchAbilityLongPressTrial.h in Headers */, - FF919A321E81AC26005C2A1E /* ORKToneAudiometryResult.h in Headers */, FF0CB38A1FD5C4C3002D838C /* ORKWebViewStepResult.h in Headers */, - BA87E26D20A79FA100B375A9 /* ORKRingView.h in Headers */, - 511B8B0A293A794D00049947 /* ORKTouchAbilityPinchStep.h in Headers */, - 86C40DEE1A8D7C5C00081FAC /* UIResponder+ResearchKit.h in Headers */, - 86C40E041A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.h in Headers */, - 25ECC09B1AFBD8B300F3D63B /* ORKReactionTimeViewController.h in Headers */, - 86C40D061A8D7C5C00081FAC /* ORKCountdownLabel.h in Headers */, - 86C40C2A1A8D7C5C00081FAC /* ORKFitnessContentView.h in Headers */, 5D43C5D424255675006F4084 /* ORKBodyItem_Internal.h in Headers */, - BA43CCA822722C6E00F2A2D2 /* ORKStepContentView_Private.h in Headers */, - 2E8071031FB0E6BE00E4FC7F /* ORKAudioGraphView.h in Headers */, - 86C40DC21A8D7C5C00081FAC /* ORKTapCountLabel.h in Headers */, 86C40D301A8D7C5C00081FAC /* ORKHealthAnswerFormat.h in Headers */, - 511B8AA4293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.h in Headers */, - 781D54141DF886AB00223305 /* ORKTrailmakingStepViewController.h in Headers */, - 86C40C261A8D7C5C00081FAC /* ORKCountdownStepViewController.h in Headers */, - 51E03D6D2491B6DB008F8406 /* ORKRequestPermissionView.h in Headers */, 7167D028231B1EAA00AAB4DD /* ORKFormStep_Internal.h in Headers */, - FF919A2A1E81A94B005C2A1E /* ORKRangeOfMotionResult.h in Headers */, - 511B8AE3293A783B00049947 /* ORKTouchAbilitySwipeContentView.h in Headers */, - 861D2AF01B8409D9008C4CD0 /* ORKTimedWalkContentView.h in Headers */, - 2489F7B31D65214D008DEF20 /* ORKVideoCaptureStepViewController.h in Headers */, - 86C40E0C1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.h in Headers */, - 511B8AAE293A767C00049947 /* ORKTouchAbilityTouchTracker.h in Headers */, - 86C40C321A8D7C5C00081FAC /* ORKFitnessStepViewController.h in Headers */, FF5CA6121D2C2670001660A3 /* ORKTableStep.h in Headers */, - BCC1CD9A1B7ED64F00D86886 /* ORKYAxisView.h in Headers */, - 86C40DBE1A8D7C5C00081FAC /* ORKTableViewCell.h in Headers */, - BCB6E64A1B7D531C000D5B34 /* ORKPieChartView.h in Headers */, - BA8C066F22ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.h in Headers */, - 86C40C2E1A8D7C5C00081FAC /* ORKFitnessStep.h in Headers */, - 86C40C821A8D7C5C00081FAC /* ORKActiveStep_Internal.h in Headers */, - 86C40D481A8D7C5C00081FAC /* ORKInstructionStepViewController_Internal.h in Headers */, - 71769E3920882CED00A19914 /* ORKdBHLToneAudiometryStep.h in Headers */, - BA0AA6941EAEC0B600671ACE /* ORKStroopContentView.h in Headers */, FA7A9D2F1B083DD3005A2BEA /* ORKConsentSectionFormatter.h in Headers */, - 86C40D381A8D7C5C00081FAC /* ORKHTMLPDFWriter.h in Headers */, - 959A2BFC1D68B98700841B04 /* ORKRangeOfMotionStep.h in Headers */, - 511B8A95293A759300049947 /* ORKTouchAbilityArrowView.h in Headers */, - 511B8B00293A78EF00049947 /* ORKTouchAbilityScrollTrial.h in Headers */, + 51A11F172BD08D5E0060C07E /* HKSample+ORKJSONDictionary.h in Headers */, 86C40D561A8D7C5C00081FAC /* ORKOrderedTask.h in Headers */, - 86C40C4E1A8D7C5C00081FAC /* ORKTappingContentView.h in Headers */, FF5051F01D66908C0065E677 /* ORKNavigablePageStep.h in Headers */, - 511B8B33293A7A0B00049947 /* ORKTouchAbilityRotationResult.h in Headers */, - 511B8AA0293A760A00049947 /* ORKTouchAbilityTrack_Internal.h in Headers */, - 86C40CA01A8D7C5C00081FAC /* ORKHealthQuantityTypeRecorder.h in Headers */, - 24850E191BCDA9C7006E91FB /* ORKLoginStepViewController.h in Headers */, BC13CE401B0666FD0044153C /* ORKResultPredicate.h in Headers */, - 242C9E0D1BBE03F90088B7F4 /* ORKVerificationStepViewController.h in Headers */, - AEFE0AC1230DB857004D0519 /* ORKReviewIncompleteCell.h in Headers */, - 86C40CFA1A8D7C5C00081FAC /* ORKCaption1Label.h in Headers */, - FF919A361E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.h in Headers */, + 51EB9A532B8408D50064A515 /* ORKInstructionStepHTMLFormatter.h in Headers */, 86C40E081A8D7C5C00081FAC /* ORKConsentReviewStep.h in Headers */, - 86C40C901A8D7C5C00081FAC /* ORKActiveStepViewController_Internal.h in Headers */, - 86C40CD81A8D7C5C00081FAC /* ORKTextFieldView.h in Headers */, - 86C40DD01A8D7C5C00081FAC /* ORKTaskViewController_Private.h in Headers */, - 10FF9ACF1B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.h in Headers */, - 224CD4FD283540FF0029B820 /* ORKAudiometryProtocol.h in Headers */, - 71769E3D20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.h in Headers */, - 86C40DAE1A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.h in Headers */, - 71BD9EAD2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.h in Headers */, - 10864CA41B27146B000F4158 /* ORKPSATKeyboardView.h in Headers */, - 86C40CFE1A8D7C5C00081FAC /* ORKChoiceViewCell.h in Headers */, + 519CE82B2C6582BE003BB584 /* ORKFamilyHistoryStep.h in Headers */, + CA6A0D83288B5B370048C1EF /* ORKHTMLPDFWriter.h in Headers */, 86C40DC61A8D7C5C00081FAC /* ORKTask.h in Headers */, - 2E8070941FA7DC5100E4FC7F /* ORKStreamingAudioRecorder.h in Headers */, - 86C40C561A8D7C5C00081FAC /* ORKTappingIntervalStepViewController.h in Headers */, - 86AD91101AB7B8A600361FEB /* ORKActiveStepView.h in Headers */, - 86C40C9C1A8D7C5C00081FAC /* ORKDeviceMotionRecorder.h in Headers */, 86C40E1E1A8D7C5C00081FAC /* ORKConsentSignature.h in Headers */, - 24898B0D1B7186C000B0E7E7 /* ORKScaleRangeImageView.h in Headers */, - CBD34A5A1BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.h in Headers */, - 71D8EF1720B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.h in Headers */, - FF36A48D1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.h in Headers */, - 86C40C5E1A8D7C5C00081FAC /* ORKWalkingTaskStepViewController.h in Headers */, - 86C40D2C1A8D7C5C00081FAC /* ORKHeadlineLabel.h in Headers */, - 5190141924759E6800E3A418 /* ORKFrontFacingCameraStepResult.h in Headers */, - 86C40D1C1A8D7C5C00081FAC /* ORKFormSectionTitleLabel.h in Headers */, - 5175145E245A4FF1009E8FFC /* ORKFrontFacingCameraStep.h in Headers */, - 86C40CBC1A8D7C5C00081FAC /* UITouch+ORKJSONDictionary.h in Headers */, - 511B8B1E293A799800049947 /* ORKTouchAbilityPinchResult.h in Headers */, - 241A2E871B94FD8800ED3B39 /* ORKPasscodeStepViewController_Internal.h in Headers */, + 5192BF522AE09673006E43FB /* ORKPredicateFormItemVisibilityRule_Private.h in Headers */, FF5051ED1D668FF80065E677 /* ORKPageStep_Private.h in Headers */, - 86C40D741A8D7C5C00081FAC /* ORKScaleRangeLabel.h in Headers */, - 86C40DDE1A8D7C5C00081FAC /* ORKVerticalContainerView.h in Headers */, - 2E8071131FB0EEF900E4FC7F /* ORKSpeechRecognitionContentView.h in Headers */, - 9550E67C1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.h in Headers */, BC94EF311E962F7400143081 /* ORKDeprecated.h in Headers */, - 511B8B19293A798D00049947 /* ORKTouchAbilityPinchTrial.h in Headers */, - 86C40CB01A8D7C5C00081FAC /* ORKRecorder_Internal.h in Headers */, - 86C40DAA1A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.h in Headers */, - 10864C9E1B27146B000F4158 /* ORKPSATStep.h in Headers */, + CA2B902128A186550025B773 /* ORKRecorder_Private.h in Headers */, + CA23A31D2899941700EC6E91 /* ORKSkin_Private.h in Headers */, 86C40D6E1A8D7C5C00081FAC /* ORKResult_Private.h in Headers */, - A659C53E262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.h in Headers */, - 781D54121DF886AB00223305 /* ORKTrailmakingStep.h in Headers */, 86C40D161A8D7C5C00081FAC /* ORKErrors.h in Headers */, 866DA5291D63D04700C9AF3F /* ORKOperation.h in Headers */, - BA3D7E732223F8B90023FE3A /* ORKChoiceViewCell_Internal.h in Headers */, - 861D11B51AA7D073003C98A7 /* ORKTextChoiceCellGroup.h in Headers */, 24BC5CEE1BC345D900846B43 /* ORKLoginStep.h in Headers */, - 147503B91AEE807C004B17F3 /* ORKToneAudiometryStep.h in Headers */, - FF919A221E81A56F005C2A1E /* ORKTappingIntervalResult.h in Headers */, - 51DB3848293E811C0089C82C /* ResearchKit_Private.h in Headers */, - 106FF2A21B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.h in Headers */, - 511B8AEF293A785A00049947 /* ORKTouchAbilitySwipeResult.h in Headers */, - 24A4DA101B8D0F21009C797A /* ORKPasscodeStepView.h in Headers */, BABBB1AE2097D97200CB29E5 /* ORKPDFViewerStep.h in Headers */, BA8C5021226FFB04001896D0 /* ORKLearnMoreItem.h in Headers */, + 519CE8242C6582BE003BB584 /* ORKHealthCondition.h in Headers */, 2489F7B11D65214D008DEF20 /* ORKVideoCaptureStep.h in Headers */, + CA2B902328A186A80025B773 /* ORKDataLogger.h in Headers */, 861D11AD1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.h in Headers */, 03BD9EA3253E62A0008ADBE1 /* ORKBundleAsset.h in Headers */, - 86C40C461A8D7C5C00081FAC /* ORKSpatialSpanMemoryStepViewController.h in Headers */, - 51198769245CA50D004FC2C7 /* ORKUSDZModelManagerScene.h in Headers */, - 511B8AB9293A76DE00049947 /* ORKTouchAbilityTapContentView.h in Headers */, - 86C40C521A8D7C5C00081FAC /* ORKTappingIntervalStep.h in Headers */, - 511B8B11293A796600049947 /* ORKTouchAbilityPinchContentView.h in Headers */, - 86C40D8A1A8D7C5C00081FAC /* ORKSkin.h in Headers */, - 8419D6721FB73EC60088D7E5 /* ORKWebViewStepViewController.h in Headers */, 86C40DFE1A8D7C5C00081FAC /* ORKConsentDocument.h in Headers */, - 511B8B26293A79C000049947 /* ORKTouchAbilityRotationStep.h in Headers */, - BA8078E3224A8D6E0013B554 /* ORKTitleLabel.h in Headers */, - D442397D1AF17F7600559D96 /* ORKImageCaptureStepViewController.h in Headers */, - 86C40C4A1A8D7C5C00081FAC /* ORKSpatialSpanTargetView.h in Headers */, - BADA2F26225DA54B005D2255 /* ORKInstructionStepContainerView.h in Headers */, 866DA5221D63D04700C9AF3F /* ORKDataCollectionManager_Internal.h in Headers */, - 86C40C1A1A8D7C5C00081FAC /* ORKAudioStep.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CA1C7A43288B0C68004DAB3A /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 519CE8412C658654003BB584 /* ORKFamilyHistoryRelatedPersonCell.h in Headers */, + CAA20E5B288B3E9900EDC764 /* UIImage+ResearchKit.h in Headers */, + 51AEAAB52B744BC000F4D107 /* ORKQuestionStepView.h in Headers */, + CAA20DB2288B3DB300EDC764 /* ORKTextFieldView.h in Headers */, + CAA20DCF288B3DB400EDC764 /* ORKImageChoiceLabel.h in Headers */, + CAA20E55288B3E9200EDC764 /* ORKTaskViewController.h in Headers */, + CAA20D6E288B3D9100EDC764 /* ORKWeightPicker.h in Headers */, + CAA20E2B288B3E8200EDC764 /* ORKInstructionStepContainerView.h in Headers */, + CA6A0D81288B54650048C1EF /* ORKConsentReviewController.h in Headers */, + CAA20F34288B3F6700EDC764 /* ORKVerificationStepViewController.h in Headers */, + CAA20E1F288B3E8200EDC764 /* ORKPasscodeStepViewController.h in Headers */, + 519CE85C2C6AD858003BB584 /* ORKFamilyHistoryStepViewController_Private.h in Headers */, + 519CE8452C658654003BB584 /* ORKFamilyHistoryTableHeaderView.h in Headers */, + CAA20E39288B3E8200EDC764 /* ORKFormStepViewController.h in Headers */, + 51FBAC5D2BC9CE4A009CA28F /* ORKBorderedButton_Internal.h in Headers */, + CAA20E37288B3E8200EDC764 /* ORKRequestPermissionsStepViewController.h in Headers */, + CAA20F37288B3F6700EDC764 /* ORKVerificationStepView.h in Headers */, + CAA20D7A288B3D9100EDC764 /* ORKTextChoiceCellGroup.h in Headers */, + CAA20F3E288B3F6D00EDC764 /* ORKAccessibilityFunctions.h in Headers */, + CAA20D80288B3D9100EDC764 /* ORKFormSectionTitleLabel.h in Headers */, + CAA20D9A288B3D9C00EDC764 /* ORKTableContainerView.h in Headers */, + 519CE8432C658654003BB584 /* ORKFamilyHistoryTableFooterView.h in Headers */, + CAA20DFF288B3E8100EDC764 /* ORKCustomSignatureFooterView.h in Headers */, + CAA20DAF288B3DB300EDC764 /* ORKDefaultFont.h in Headers */, + CAA20F2A288B3F5B00EDC764 /* ORKConsentSharingStepViewController.h in Headers */, + CAA20DE3288B3DB400EDC764 /* ORKDontKnowButton.h in Headers */, + CAA20DF6288B3E8100EDC764 /* ORKStepView.h in Headers */, + CAA20DA0288B3D9C00EDC764 /* ORKStepContainerView.h in Headers */, + CAA20D68288B3D9100EDC764 /* ORKImageSelectionView.h in Headers */, + CAA20E0B288B3E8200EDC764 /* ORKFreehandDrawingView.h in Headers */, + CAA20E4D288B3E8200EDC764 /* ORKRequestPermissionsStepContainerView.h in Headers */, + CAA20E04288B3E8200EDC764 /* ORKPasscodeViewController.h in Headers */, + CAA20DCE288B3DB400EDC764 /* ORKTintedImageView.h in Headers */, + CAA20DEC288B3DB400EDC764 /* ORKHeadlineLabel.h in Headers */, + CAA20D85288B3D9100EDC764 /* ORKAnswerTextView.h in Headers */, + CAA20D70288B3D9100EDC764 /* ORKLocationSelectionView.h in Headers */, + CAA20D62288B3D9100EDC764 /* ORKFormItemCell.h in Headers */, + CAA20E3E288B3E8200EDC764 /* ORKVideoCaptureCameraPreviewView.h in Headers */, + CAA20DF3288B3E8100EDC764 /* ORKPDFViewerStepViewController.h in Headers */, + CAA20E33288B3E8200EDC764 /* ORKVideoCaptureStepViewController.h in Headers */, + CAA20DC3288B3DB400EDC764 /* ORKSubheadlineLabel.h in Headers */, + CAA20DA7288B3D9C00EDC764 /* ORKStepHeaderView.h in Headers */, + CAA20D76288B3D9100EDC764 /* ORKSurveyAnswerCellForPicker.h in Headers */, + CAA20D92288B3D9100EDC764 /* ORKSurveyAnswerCell.h in Headers */, + CAA20E4E288B3E8200EDC764 /* ORKReviewStepViewController.h in Headers */, + CAA20DFE288B3E8100EDC764 /* ORKTableStepViewController.h in Headers */, + CAA20DA8288B3DA300EDC764 /* ORKObserver.h in Headers */, + CAA20D81288B3D9100EDC764 /* ORKSurveyAnswerCellForNumber.h in Headers */, + CAA20E26288B3E8200EDC764 /* ORKPageStepViewController.h in Headers */, + CAA20F3D288B3F6D00EDC764 /* ORKGraphChartAccessibilityElement.h in Headers */, + CAA20DE8288B3DB400EDC764 /* ORKScaleRangeDescriptionLabel.h in Headers */, + CAA20DCA288B3DB400EDC764 /* ORKSeparatorView.h in Headers */, + CAA20D5D288B3D9100EDC764 /* ORKSurveyAnswerCellForImageSelection.h in Headers */, + CAA20D99288B3D9C00EDC764 /* ORKBodyContainerView.h in Headers */, + CAA20DDF288B3DB400EDC764 /* ORKChoiceViewCell.h in Headers */, + CAA20D78288B3D9100EDC764 /* ORKSESSelectionView.h in Headers */, + CAA20DC4288B3DB400EDC764 /* ORKDirectionView.h in Headers */, + 5192BF972AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.h in Headers */, + CAA20D5B288B3D9100EDC764 /* ORKScaleSliderView.h in Headers */, + CAA20D79288B3D9100EDC764 /* ORKAnswerTextField.h in Headers */, + CAA20D97288B3D9C00EDC764 /* ORKStepContentView.h in Headers */, + CAA20DA6288B3D9C00EDC764 /* ORKLearnMoreView.h in Headers */, + CAA20DF1288B3DB400EDC764 /* ORKScaleRangeImageView.h in Headers */, + CAA20DD1288B3DB400EDC764 /* ORKUnitLabel.h in Headers */, + CAA20E42288B3E8200EDC764 /* ORKVideoCaptureView.h in Headers */, + CAA20D50288B3D6400EDC764 /* ORKCheckmarkView.h in Headers */, + CAA20D94288B3D9C00EDC764 /* ORKNavigationContainerView.h in Headers */, + 5192BF932AE1C2F8006E43FB /* ORKChoiceViewCell+ORKColorChoice.h in Headers */, + CAA20DBD288B3DB300EDC764 /* ORKTableViewCell.h in Headers */, + 51AEAAB32B744ACC00F4D107 /* ORKQuestionStepViewController_Private.h in Headers */, + CAA20E05288B3E8200EDC764 /* ORKVideoInstructionStepViewController.h in Headers */, + CAA20D58288B3D6F00EDC764 /* ORKPlaybackButton.h in Headers */, + CAA20D83288B3D9100EDC764 /* ORKHeightPicker.h in Headers */, + CAA20DD4288B3DB400EDC764 /* ORKProgressView.h in Headers */, + CAA20E1E288B3E8200EDC764 /* ORKCustomStepViewController.h in Headers */, + CAA20E38288B3E8200EDC764 /* ORKInstructionStepViewController.h in Headers */, + CAA20DBB288B3DB300EDC764 /* ORKTextButton.h in Headers */, + CAA20E1B288B3E8200EDC764 /* ORKImageCaptureView.h in Headers */, + CAA20D88288B3D9100EDC764 /* ORKPicker.h in Headers */, + CAA20DAE288B3DB300EDC764 /* ORKBorderedButton.h in Headers */, + CAA20E56288B3E9200EDC764 /* ORKTaskReviewViewController.h in Headers */, + CAA20E5A288B3E9900EDC764 /* UIResponder+ResearchKit.h in Headers */, + CAA20D59288B3D7600EDC764 /* ORKRingView.h in Headers */, + CA6A0D9E288F1CA20048C1EF /* ResearchKitUI_Private.h in Headers */, + CAA20D4E288B3D5700EDC764 /* ORKRecordButton.h in Headers */, + CAA20D7D288B3D9100EDC764 /* ORKSurveyCardHeaderView.h in Headers */, + CAA20E1D288B3E8200EDC764 /* ORKImageCaptureCameraPreviewView.h in Headers */, + CAA20D67288B3D9100EDC764 /* ORKDateTimePicker.h in Headers */, + CAA20D89288B3D9100EDC764 /* ORKValuePicker.h in Headers */, + 51AEAAB22B744AC200F4D107 /* ORKQuestionStepViewController.h in Headers */, + CAA20D71288B3D9100EDC764 /* ORKFormTextView.h in Headers */, + CAA20E0A288B3E8200EDC764 /* ORKWaitStepViewController.h in Headers */, + CAA20D96288B3D9C00EDC764 /* ORKStepContentView_Private.h in Headers */, + CAA20DFB288B3E8100EDC764 /* ORKPDFViewerStepView.h in Headers */, + CAA20DC6288B3DB400EDC764 /* ORKSelectionSubTitleLabel.h in Headers */, + CAA20DB7288B3DB300EDC764 /* ORKIconButton.h in Headers */, + CAA20DD5288B3DB400EDC764 /* ORKTitleLabel.h in Headers */, + CAA20D9D288B3D9C00EDC764 /* ORKVerticalContainerView.h in Headers */, + CAA20DD8288B3DB400EDC764 /* ORKBodyLabel.h in Headers */, + 5192BF9E2AE1DE62006E43FB /* ORKColorChoiceCellGroup.h in Headers */, + CAA20D6B288B3D9100EDC764 /* ORKSurveyAnswerCellForScale.h in Headers */, + CAA20DC1288B3DB400EDC764 /* ORKCountdownLabel.h in Headers */, + CAA20E28288B3E8200EDC764 /* ORKImageCaptureStepViewController.h in Headers */, + 5192BF992AE1D876006E43FB /* ORKChoiceViewCell+ORKTextChoice.h in Headers */, + CAA20E15288B3E8200EDC764 /* ORKCompletionCheckmarkView.h in Headers */, + CAA20D82288B3D9100EDC764 /* ORKTimeIntervalPicker.h in Headers */, + CAA20D54288B3D6B00EDC764 /* ORKReviewViewController.h in Headers */, + CAA20F39288B3F6700EDC764 /* ORKLoginStepViewController.h in Headers */, + CAA20D7C288B3D9100EDC764 /* ORKSurveyAnswerCellForSES.h in Headers */, + CAA20F3B288B3F6D00EDC764 /* UIView+ORKAccessibility.h in Headers */, + CAA20D61288B3D9100EDC764 /* ORKScaleSlider.h in Headers */, + CAA20DEF288B3DB400EDC764 /* ORKCaption1Label.h in Headers */, + CAA20F31288B3F5B00EDC764 /* ORKConsentReviewStepViewController.h in Headers */, + CAA20DC8288B3DB400EDC764 /* ORKRoundTappingButton.h in Headers */, + CAA20E27288B3E8200EDC764 /* ORKWaitStepView.h in Headers */, + CAA20D55288B3D6B00EDC764 /* ORKReviewIncompleteCell.h in Headers */, + CAA20D63288B3D9100EDC764 /* ORKMultipleValuePicker.h in Headers */, + CAA20E13288B3E8200EDC764 /* ORKWebViewStepViewController.h in Headers */, + 5192BF8F2AE1C051006E43FB /* ORKAgePicker.h in Headers */, + CAA20E24288B3E8200EDC764 /* ORKCompletionStepViewController.h in Headers */, + 51F716D1297E2CC400D8ACF7 /* ORKConsentLearnMoreViewController.h in Headers */, + CAA20E5E288B3E9900EDC764 /* UIBarButtonItem+ORKBarButtonItem.h in Headers */, + CAA20DD2288B3DB400EDC764 /* ORKContinueButton.h in Headers */, + CAA20E0E288B3E8200EDC764 /* ORKPasscodeStepView.h in Headers */, + CAA20DE1288B3DB400EDC764 /* ORKLabel.h in Headers */, + CAA20DD3288B3DB400EDC764 /* ORKSelectionTitleLabel.h in Headers */, + CA08054028AD7CC8001695EF /* ORKViewControllerProviding.h in Headers */, + CAA20D6A288B3D9100EDC764 /* ORKSurveyAnswerCellForLocation.h in Headers */, + CAA20DD9288B3DB400EDC764 /* ORKScaleValueLabel.h in Headers */, + CAA20E34288B3E8200EDC764 /* ORKSignatureView.h in Headers */, + CAA20DF9288B3E8100EDC764 /* ORKLearnMoreStepViewController.h in Headers */, + CAA20DF0288B3DB400EDC764 /* ORKFootnoteLabel.h in Headers */, + CAA20F3C288B3F6D00EDC764 /* ORKAccessibility.h in Headers */, + CAA20E30288B3E8200EDC764 /* ORKSecondaryTaskStepViewController.h in Headers */, + CAA20E22288B3E8200EDC764 /* ORKSignatureStepViewController.h in Headers */, + CAA20DE7288B3DB400EDC764 /* ORKScaleRangeLabel.h in Headers */, + CAA20DEA288B3DB400EDC764 /* ORKTagLabel.h in Headers */, + 519CE8352C658617003BB584 /* ORKFamilyHistoryStepViewController.h in Headers */, + CAA20E29288B3E8200EDC764 /* ORKCustomStepView.h in Headers */, + CAA20E31288B3E8200EDC764 /* ORKStepViewController.h in Headers */, + CAA20DB1288B3DB300EDC764 /* ORKTapCountLabel.h in Headers */, + CAA20D8E288B3D9100EDC764 /* ORKSurveyAnswerCellForText.h in Headers */, + CAA20E16288B3E8200EDC764 /* ORKStepView_Private.h in Headers */, + CAA20E59288B3E9200EDC764 /* ORKTaskViewController_Private.h in Headers */, + 51FBAC902BD07333009CA28F /* UIImageView+ResearchKit.h in Headers */, + CAA20E2C288B3E8200EDC764 /* ORKFormStepViewController_Private.h in Headers */, + CAA20D95288B3D9C00EDC764 /* ORKStepContainerView_Private.h in Headers */, + CAA20E21288B3E8200EDC764 /* ORKCustomSignatureFooterView_Private.h in Headers */, + CA1C7A44288B0C68004DAB3A /* ResearchKitUI.h in Headers */, + CAA20E08288B3E8200EDC764 /* ORKPDFViewerStepView_Internal.h in Headers */, + CAA20D93288B3D9C00EDC764 /* ORKStepHeaderView_Internal.h in Headers */, + CAA20DB3288B3DB300EDC764 /* ORKTextButton_Internal.h in Headers */, + CAA20E3F288B3E8200EDC764 /* ORKStepViewController_Internal.h in Headers */, + CAA20E19288B3E8200EDC764 /* ORKReviewStepViewController_Internal.h in Headers */, + CAA20E53288B3E9200EDC764 /* ORKTaskViewController_Internal.h in Headers */, + CAA20DA2288B3D9C00EDC764 /* ORKVerticalContainerView_Internal.h in Headers */, + CAA20DDE288B3DB400EDC764 /* ORKTintedImageView_Internal.h in Headers */, + CAA20E44288B3E8200EDC764 /* ORKTableStepViewController_Internal.h in Headers */, + CAA20E35288B3E8200EDC764 /* ORKPasscodeStepViewController_Internal.h in Headers */, + CAA20DA3288B3D9C00EDC764 /* ORKNavigationContainerView_Internal.h in Headers */, + CAA20E18288B3E8200EDC764 /* ORKFormStepViewController_Internal.h in Headers */, + CAA20E2D288B3E8200EDC764 /* ORKInstructionStepViewController_Internal.h in Headers */, + CAA20D57288B3D6F00EDC764 /* ORKPlaybackButton_Internal.h in Headers */, + CAA20DB8288B3DB300EDC764 /* ORKChoiceViewCell_Internal.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CAD08962289DD747007B2A98 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + CA2B8FC728A175EA0025B773 /* ORKHolePegTestRemoveStepViewController.h in Headers */, + CA2B8FAD28A1753C0025B773 /* ORKAudioMeteringView.h in Headers */, + CA2B8FE428A177330025B773 /* ORKStroopContentView.h in Headers */, + CA2B901728A180480025B773 /* ORKOrderedTask+ORKPredefinedActiveTask.h in Headers */, + 5156CA632B7E465500983535 /* ORKTouchAbilityRotationResult.h in Headers */, + CA2B8FC228A175C40025B773 /* ORKHolePegTestPlacePegView.h in Headers */, + CAD08A39289DE5F0007B2A98 /* CMDeviceMotion+ORKJSONDictionary.h in Headers */, + 511E8D622995C20E00A384A5 /* ORKEnvironmentSPLMeterStepViewController_Private.h in Headers */, + CAD08A8C289DE772007B2A98 /* ORKAudioGenerator.h in Headers */, + CA2B8F9128A16E3B0025B773 /* ORKEnvironmentSPLMeterContentView.h in Headers */, + CA2B8FBB28A175940025B773 /* ORKFitnessContentView.h in Headers */, + 5156CA4A2B7E45AE00983535 /* ORKTouchAbilityPinchContentView.h in Headers */, + CA2B901028A17BEE0025B773 /* ORKActiveTaskResult.h in Headers */, + 5156C9D92B7E42C200983535 /* ORKTouchAbilityTouch.h in Headers */, + CAD08A74289DE6ED007B2A98 /* ORKSpatialSpanMemoryResult.h in Headers */, + CAD08A90289DE77E007B2A98 /* ORKToneAudiometryStep.h in Headers */, + CAD08A3F289DE611007B2A98 /* ORKHealthQuantityTypeRecorder.h in Headers */, + CAD08A2D289DE5C2007B2A98 /* ORKAccelerometerRecorder.h in Headers */, + CAD08A82289DE71D007B2A98 /* ORKAccuracyStroopResult.h in Headers */, + CAD08A49289DE634007B2A98 /* CMPedometerData+ORKJSONDictionary.h in Headers */, + 5156C9E12B7E42C200983535 /* ORKTouchAbilityGestureRecoginzerEvent.h in Headers */, + CAD08A20289DE554007B2A98 /* ORKActiveStepTimer.h in Headers */, + 5156CA4C2B7E45AE00983535 /* ORKTouchAbilityPinchTrial.h in Headers */, + CA2B8FE528A177360025B773 /* ORKStroopStepViewController.h in Headers */, + 51F716C9297E288A00D8ACF7 /* ORKNormalizedReactionTimeViewController.h in Headers */, + 5156C9DA2B7E42C200983535 /* ORKTouchAbilityTrial_Internal.h in Headers */, + CA2B8F8A28A16D1F0025B773 /* ORK3DModelStepViewController.h in Headers */, + CA2B8FCF28A1761C0025B773 /* ORKPSATKeyboardView.h in Headers */, + CAD08A6C289DE6CD007B2A98 /* ORKRangeOfMotionResult.h in Headers */, + CAD08A7C289DE709007B2A98 /* ORKStroopResult.h in Headers */, + CA2B8F8628A16D070025B773 /* ORKUSDZModelManager.h in Headers */, + CAD08A12289DE4F8007B2A98 /* ORKdBHLToneAudiometryOnboardingStep.h in Headers */, + 5156C9F02B7E437A00983535 /* ORKTouchAbilityTapStep.h in Headers */, + 5156CA082B7E440A00983535 /* ORKTouchAbilityLongPressContentView.h in Headers */, + CAD08A57289DE675007B2A98 /* ORKSpeechRecognizer.h in Headers */, + CA2B8F8B28A16D290025B773 /* ORK3DModelStepContentView.h in Headers */, + CA2B902B28A18EEF0025B773 /* ORKFrontFacingCameraStepViewController.h in Headers */, + CA2B8FF128A1779D0025B773 /* ORKToneAudiometryStepViewController.h in Headers */, + CAD08A0B289DE4D6007B2A98 /* ORKAudiometryStimulus.h in Headers */, + 5156CA452B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.h in Headers */, + CA2B8FEC28A177790025B773 /* ORKTappingContentView.h in Headers */, + CAD08A2F289DE5CA007B2A98 /* CMAccelerometerData+ORKJSONDictionary.h in Headers */, + CAD08A8A289DE769007B2A98 /* ORKTappingIntervalStep.h in Headers */, + CA2B8FDE28A177110025B773 /* ORKSpatialSpanMemoryContentView.h in Headers */, + 5156C9DB2B7E42C200983535 /* ORKTouchAbilityTrack.h in Headers */, + CA2B8FE728A1773E0025B773 /* UIColor+String.h in Headers */, + CA2B8FC828A175F00025B773 /* ORKHolePegTestRemoveContentView.h in Headers */, + CAD08A9C289DE7B1007B2A98 /* ORKWalkingTaskStep.h in Headers */, + CA2B8FB028A175490025B773 /* ORKAudioStepViewController.h in Headers */, + 51F716C5297E288A00D8ACF7 /* ORKNormalizedReactionTimeResult.h in Headers */, + 5156C9EF2B7E437A00983535 /* ORKTouchAbilityTapResult.h in Headers */, + CAD08A4B289DE63B007B2A98 /* ORKTouchRecorder.h in Headers */, + CAD08A53289DE665007B2A98 /* ORKAudioLevelNavigationRule.h in Headers */, + CA2B8FF828A177C10025B773 /* ORKTrailmakingContentView.h in Headers */, + 5192BEEE2AE043D3006E43FB /* ORKTimedWalkContentView.h in Headers */, + 51A11F222BD152660060C07E /* ORKActiveStepCustomView.h in Headers */, + CAD08A17289DE512007B2A98 /* ORKAmslerGridStep.h in Headers */, + CAD08A1B289DE523007B2A98 /* ORKTouchAnywhereStep.h in Headers */, + CA2B8FF028A177990025B773 /* ORKToneAudiometryContentView.h in Headers */, + CAD08A47289DE62C007B2A98 /* ORKPedometerRecorder.h in Headers */, + CA2B8FD928A176E80025B773 /* ORKReactionTimeStimulusView.h in Headers */, + CAD08A8E289DE777007B2A98 /* ORKToneAudiometryResult.h in Headers */, + CAD08A45289DE626007B2A98 /* CLLocation+ORKJSONDictionary.h in Headers */, + 5156C9ED2B7E437A00983535 /* ORKTouchAbilityTapStepViewController.h in Headers */, + CAD08A22289DE55D007B2A98 /* ORKVoiceEngine.h in Headers */, + CA2B8FA428A16F7B0025B773 /* ORKActiveStepQuantityView.h in Headers */, + 51F716C2297E288A00D8ACF7 /* ORKNormalizedReactionTimeStimulusView.h in Headers */, + CAD08A14289DE4FF007B2A98 /* ORKdBHLToneAudiometryStep.h in Headers */, + CA2B8FD828A176E50025B773 /* ORKReactionTimeContentView.h in Headers */, + CAD08A43289DE620007B2A98 /* ORKLocationRecorder.h in Headers */, + 5156CA5E2B7E465500983535 /* ORKTouchAbilityRotationContentView.h in Headers */, + CAD08A19289DE519007B2A98 /* ORKAmslerGridResult.h in Headers */, + CA2B8FDF28A177150025B773 /* ORKSpatialSpanTargetView.h in Headers */, + CA2B8FA728A16F9A0025B773 /* ORKCountdownStepViewController.h in Headers */, + CA2B8FDD28A1770A0025B773 /* ORKSpatialSpanMemoryStepViewController.h in Headers */, + 5156C9F22B7E437A00983535 /* ORKTouchAbilityTapContentView.h in Headers */, + CA2B8F9D28A16F010025B773 /* ORKAmslerGridContentView.h in Headers */, + CA2B8FCD28A176140025B773 /* ORKPSATStepViewController.h in Headers */, + CAD08A5C289DE689007B2A98 /* ORKFitnessStep.h in Headers */, + CA2B8F8828A16D110025B773 /* ORKUSDZModelManagerResult.h in Headers */, + CA2B8F9728A16E930025B773 /* ORKdBHLToneAudiometryAudioGenerator.h in Headers */, + 5156C9C52B7E426900983535 /* ORKTouchAbilityArrowView.h in Headers */, + 5156CA2C2B7E451C00983535 /* ORKTouchAbilityScrollStep.h in Headers */, + CA2B8FFB28A177E40025B773 /* ORKWalkingTaskStepViewController.h in Headers */, + CA2B8F8F28A16E320025B773 /* ORKEnvironmentSPLMeterStepViewController.h in Headers */, + 5156C9C72B7E426900983535 /* ORKTouchAbilityContentView.h in Headers */, + CAD08A9A289DE7A7007B2A98 /* ORKTrailmakingStep.h in Headers */, + CAD08A55289DE66E007B2A98 /* ORKSpeechRecognitionStep.h in Headers */, + 5156CA5F2B7E465500983535 /* ORKTouchAbilityRotationTrial.h in Headers */, + 5156C9D62B7E42C200983535 /* ORKTouchAbilityTouchTracker.h in Headers */, + CAD08A9E289DE7B8007B2A98 /* ORKTimedWalkResult.h in Headers */, + CA2B8FC328A175C90025B773 /* ORKHolePegTestPlaceHoleView.h in Headers */, + 51F716EB2981B49000D8ACF7 /* ORKSpeechInNoiseStepViewController_Private.h in Headers */, + 5156CA492B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.h in Headers */, + 5156CA202B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.h in Headers */, + CAD08A66289DE6B0007B2A98 /* ORKPSATResult.h in Headers */, + CAD08A31289DE5D1007B2A98 /* ORKAudioRecorder.h in Headers */, + CA2B8F8428A16CFC0025B773 /* ORKUSDZModelManagerScene.h in Headers */, + CAD08A4D289DE641007B2A98 /* UITouch+ORKJSONDictionary.h in Headers */, + 5156CA0B2B7E440A00983535 /* ORKTouchAbilityLongPressResult.h in Headers */, + CAD08A70289DE6DE007B2A98 /* ORKReactionTimeResult.h in Headers */, + CA2B8FAF28A175450025B773 /* ORKAudioGraphView.h in Headers */, + CAD08A68289DE6B6007B2A98 /* ORKPSATStep.h in Headers */, + CAD08A0D289DE4DE007B2A98 /* ORKAudiometry.h in Headers */, + 5156CA092B7E440A00983535 /* ORKTouchAbilityLongPressStep.h in Headers */, + CAD089F6289DE494007B2A98 /* ORKEnvironmentSPLMeterResult.h in Headers */, + CAD08A96289DE796007B2A98 /* ORKTowerOfHanoiResult.h in Headers */, + CA2B8FBA28A175900025B773 /* ORKAudioFitnessStepViewController.h in Headers */, + CAD08A33289DE5D7007B2A98 /* ORKStreamingAudioRecorder.h in Headers */, + 5156CA192B7E448600983535 /* ORKTouchAbilitySwipeTrial.h in Headers */, + CAD089BA289DE347007B2A98 /* ORKSpeechInNoiseStep.h in Headers */, + 5192BEED2AE043D3006E43FB /* ORKTimedWalkStepViewController.h in Headers */, + 5156CA2D2B7E451C00983535 /* ORKTouchAbilityScrollContentView.h in Headers */, + CAD08A92289DE788007B2A98 /* ORKTowerOfHanoiStep.h in Headers */, + CAD08A59289DE67C007B2A98 /* ORKSpeechRecognitionError.h in Headers */, + CA2B8F9828A16E960025B773 /* ORKdBHLToneAudiometryContentView.h in Headers */, + CAD08A51289DE65E007B2A98 /* ORKAudioStep.h in Headers */, + CAD08A35289DE5DE007B2A98 /* ORKAudioStreamer.h in Headers */, + CA2B8FB928A1758B0025B773 /* ORKFitnessStepViewController.h in Headers */, + CA2B902828A18EAD0025B773 /* ORKActiveStepViewController_Internal.h in Headers */, + 5156CA5A2B7E465500983535 /* ORKTouchAbilityRotationStepViewController.h in Headers */, + CA2B8FD228A176B70025B773 /* ORKRangeOfMotionStepViewController.h in Headers */, + CA2B8FC928A175F40025B773 /* ORKHolePegTestRemovePegView.h in Headers */, + CA2B8FA328A16F730025B773 /* ORKActiveStepView.h in Headers */, + 51F716CA297E288A00D8ACF7 /* ORKNormalizedReactionTimeContentView.h in Headers */, + CA2B8FB128A1754D0025B773 /* ORKAudioContentView.h in Headers */, + CA2B8FF428A177AE0025B773 /* ORKTowerOfHanoiStepViewController.h in Headers */, + CA2B8FE628A1773A0025B773 /* ORKAccuracyStroopStepViewController.h in Headers */, + CAD08A25289DE58A007B2A98 /* ORKCountdownStep.h in Headers */, + CA2B8FC128A175BD0025B773 /* ORKHolePegTestPlaceContentView.h in Headers */, + 5156CA332B7E451C00983535 /* ORKTouchAbilityScrollTrial.h in Headers */, + 5156CA172B7E448600983535 /* ORKTouchAbilitySwipeContentView.h in Headers */, + 5156CA052B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.h in Headers */, + CAD08A60289DE69A007B2A98 /* ORKHolePegTestPlaceStep.h in Headers */, + CAD08A5E289DE690007B2A98 /* ORKAudioFitnessStep.h in Headers */, + 5156CA472B7E45AE00983535 /* ORKTouchAbilityPinchStep.h in Headers */, + CAD08A6E289DE6D4007B2A98 /* ORKRangeOfMotionStep.h in Headers */, + CA2B902C28A18EF40025B773 /* ORKFrontFacingCameraStepContentView.h in Headers */, + 5192BEE62AE043A2006E43FB /* ORKTimedWalkStep.h in Headers */, + CAD089F2289DE48A007B2A98 /* ORKEnvironmentSPLMeterStep.h in Headers */, + 5156C9F42B7E437A00983535 /* ORKTouchAbilityTapTrial.h in Headers */, + CA2B8FB528A175750025B773 /* ORKSpeechRecognitionContentView.h in Headers */, + CAD08A64289DE6A8007B2A98 /* ORKHolePegTestResult.h in Headers */, + 5156CA182B7E448600983535 /* ORKTouchAbilitySwipeStep.h in Headers */, + 5156CA2F2B7E451C00983535 /* ORKTouchAbilityScrollStepViewController.h in Headers */, + CAD08A37289DE5E7007B2A98 /* ORKDeviceMotionRecorder.h in Headers */, + CA2B8FC028A175B60025B773 /* ORKHolePegTestPlaceStepViewController.h in Headers */, + CA2B8FF528A177B10025B773 /* ORKTowerOfHanoiTowerView.h in Headers */, + CAD089BC289DE351007B2A98 /* ORKSpeechInNoiseResult.h in Headers */, + CAD089EE289DE45C007B2A98 /* ORK3DModelManager_Internal.h in Headers */, + CA2B8FB428A175700025B773 /* ORKSpeechRecognitionStepViewController.h in Headers */, + CA2B8F6D28A16BAC0025B773 /* ORKSpeechInNoiseContentView.h in Headers */, + CAD08A72289DE6E5007B2A98 /* ORKReactionTimeStep.h in Headers */, + CAD089ED289DE454007B2A98 /* ORK3DModelManager.h in Headers */, + CAD08A80289DE716007B2A98 /* ORKAccuracyStroopStep.h in Headers */, + CAD08A3D289DE609007B2A98 /* ORKHealthClinicalTypeRecorder.h in Headers */, + CAD08A76289DE6F3007B2A98 /* ORKSpatialSpanMemoryStep.h in Headers */, + CAD08A10289DE4F1007B2A98 /* ORKdBHLToneAudiometryResult.h in Headers */, + 5156CA5C2B7E465500983535 /* ORKTouchAbilityRotationStep.h in Headers */, + 511BB024298DCCC200936EC0 /* ORKSpeechRecognitionStepViewController_Private.h in Headers */, + 5156CA312B7E451C00983535 /* ORKTouchAbilityScrollResult.h in Headers */, + 5156CA1E2B7E448600983535 /* ORKTouchAbilitySwipeResult.h in Headers */, + 5156C9DF2B7E42C200983535 /* ORKTouchAbilityTrial.h in Headers */, + CA2B8FED28A1777D0025B773 /* ORKTappingIntervalStepViewController.h in Headers */, + CA2B8FCE28A176190025B773 /* ORKPSATContentView.h in Headers */, + 5156CA432B7E45AE00983535 /* ORKTouchAbilityPinchResult.h in Headers */, + CAFAA6C228A198BD0010BBDE /* ResearchKitActiveTask_Private.h in Headers */, + CAD08A88289DE762007B2A98 /* ORKTappingIntervalResult.h in Headers */, + CA2B8FA528A16F7F0025B773 /* ORKActiveStepTimerView.h in Headers */, + CA2B8FD728A176DC0025B773 /* ORKReactionTimeViewController.h in Headers */, + CAD08A98289DE79F007B2A98 /* ORKTrailmakingResult.h in Headers */, + CA2B8F9928A16E9C0025B773 /* ORKdBHLToneAudiometryStepViewController.h in Headers */, + CA2B8F9F28A16F310025B773 /* ORKTouchAnywhereStepViewController.h in Headers */, + CAD08A0A289DE4D2007B2A98 /* ORKAudiometryProtocol.h in Headers */, + 51F716C4297E288A00D8ACF7 /* ORKNormalizedReactionTimeStep.h in Headers */, + CAD08A94289DE790007B2A98 /* ORKTowerOfHanoiTower.h in Headers */, + 5156CA0A2B7E440A00983535 /* ORKTouchAbilityLongPressTrial.h in Headers */, + CA2B8FF928A177C30025B773 /* ORKTrailmakingStepViewController.h in Headers */, + CA2B8F9028A16E380025B773 /* ORKEnvironmentSPLMeterBarView.h in Headers */, + CA2B8F6E28A16BBA0025B773 /* ORKSpeechInNoiseStepViewController.h in Headers */, + CA2B8F9C28A16EFC0025B773 /* ORKAmslerGridStepViewController.h in Headers */, + CAD08A62289DE6A2007B2A98 /* ORKHolePegTestRemoveStep.h in Headers */, + CAD08A78289DE6F9007B2A98 /* ORKSpatialSpanGame.h in Headers */, + 5156C9D72B7E42C200983535 /* ORKTouchAbilityTrack_Internal.h in Headers */, + CAD08A5A289DE67F007B2A98 /* ORKSpeechRecognitionResult.h in Headers */, + CAD08A24289DE563007B2A98 /* ORKVoiceEngine_Internal.h in Headers */, + CA2B902928A18EB10025B773 /* ORKActiveStepViewController.h in Headers */, + CA2B8F9628A16E8F0025B773 /* ORKdBHLToneAudiometryOnboardingStepViewController.h in Headers */, + CA2B8FD328A176BC0025B773 /* ORKShoulderRangeOfMotionStepViewController.h in Headers */, + CAD089F0289DE466007B2A98 /* ORK3DModelStep.h in Headers */, + CAD0896A289DD747007B2A98 /* ResearchKitActiveTask.h in Headers */, + CAD08A6A289DE6BF007B2A98 /* ORKShoulderRangeOfMotionStep.h in Headers */, + CAD08A7E289DE710007B2A98 /* ORKStroopStep.h in Headers */, + CAD08A7A289DE6FE007B2A98 /* ORKSpatialSpanGameState.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4758,6 +5160,8 @@ buildRules = ( ); dependencies = ( + CA4B673528A1CD5700FAE01F /* PBXTargetDependency */, + CAF8D2BA288F2DCB001E6992 /* PBXTargetDependency */, 86CC8EA21AC09332001CCD89 /* PBXTargetDependency */, ); name = ResearchKitTests; @@ -4784,15 +5188,56 @@ productReference = B183A5951A8535D100C76870 /* ResearchKit.framework */; productType = "com.apple.product-type.framework"; }; + CA1C7A40288B0C68004DAB3A /* ResearchKitUI */ = { + isa = PBXNativeTarget; + buildConfigurationList = CA1C7A54288B0C68004DAB3A /* Build configuration list for PBXNativeTarget "ResearchKitUI" */; + buildPhases = ( + CA1C7A43288B0C68004DAB3A /* Headers */, + CA1C7A45288B0C68004DAB3A /* Sources */, + CA1C7A50288B0C68004DAB3A /* Frameworks */, + CA1C7A52288B0C68004DAB3A /* Resources */, + CA1C7A60288B0CA2004DAB3A /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + CA1C7A5F288B0CA2004DAB3A /* PBXTargetDependency */, + ); + name = ResearchKitUI; + productName = ResearchKitUI; + productReference = CA1C7A5A288B0C68004DAB3A /* ResearchKitUI.framework */; + productType = "com.apple.product-type.framework"; + }; + CAD08966289DD747007B2A98 /* ResearchKitActiveTask */ = { + isa = PBXNativeTarget; + buildConfigurationList = CAD08970289DD747007B2A98 /* Build configuration list for PBXNativeTarget "ResearchKitActiveTask" */; + buildPhases = ( + CAD08962289DD747007B2A98 /* Headers */, + CAD08963289DD747007B2A98 /* Sources */, + CAD08964289DD747007B2A98 /* Frameworks */, + CAD08965289DD747007B2A98 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + CAFAA6C928A19E330010BBDE /* PBXTargetDependency */, + CAFAA6C728A19E2F0010BBDE /* PBXTargetDependency */, + ); + name = ResearchKitActiveTask; + productName = ResearchKitActiveTask; + productReference = CAD08967289DD747007B2A98 /* ResearchKitActiveTask.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 3FFF18351829DB1D00167070 /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; CLASSPREFIX = ORK; - LastSwiftUpdateCheck = 1020; - LastUpgradeCheck = 1310; + LastSwiftUpdateCheck = 1530; + LastUpgradeCheck = 1500; ORGANIZATIONNAME = researchkit.org; TargetAttributes = { 86CC8E991AC09332001CCD89 = { @@ -4803,8 +5248,12 @@ LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; - B18FF3A41A9FE25700C0C3B0 = { - CreatedOnToolsVersion = 7.0; + CA1C7A40288B0C68004DAB3A = { + ProvisioningStyle = Manual; + }; + CAD08966289DD747007B2A98 = { + CreatedOnToolsVersion = 13.4.1; + ProvisioningStyle = Manual; }; }; }; @@ -4862,7 +5311,9 @@ targets = ( B183A4731A8535D100C76870 /* ResearchKit */, 86CC8E991AC09332001CCD89 /* ResearchKitTests */, - B18FF3A41A9FE25700C0C3B0 /* docs */, + CA1C7A40288B0C68004DAB3A /* ResearchKitUI */, + CAD08966289DD747007B2A98 /* ResearchKitActiveTask */, + 0BC672D82BD9C52D005798AC /* ResearchKitAllTargets */, ); }; /* End PBXProject section */ @@ -4873,6 +5324,7 @@ buildActionMask = 2147483647; files = ( 22ED1848285290250052406B /* ORKAudiometryTestData.plist in Resources */, + 51AF19592B583BBA00D3B399 /* samples.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4880,78 +5332,66 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 7118AC6A20BF6A3A00D7A6BB /* Sentence5.wav in Resources */, - B1A860EE1A9693C400EA57B7 /* consent_05@2x.m4v in Resources */, - 62DF9F4528CA87D300D13018 /* retspl_AIRPODSPROV2.plist in Resources */, - 86C40DFA1A8D7C5C00081FAC /* MovieTintShader.fsh in Resources */, - 62DF9F4928CA87E800D13018 /* volume_curve_AIRPODSPROV2.plist in Resources */, - E2EE530022E7735700F34987 /* VolumeCalibration.wav in Resources */, - B1A860EA1A9693C400EA57B7 /* consent_01@2x.m4v in Resources */, - E293656025757E6100092A7C /* retspl_AIRPODSMAX.plist in Resources */, - E29189BB23855BA2001AFF0F /* volume_curve_AIRPODSPRO.plist in Resources */, - 71B7B4DA20AA91D400C5768A /* retspl_AIRPODS.plist in Resources */, - E293656225757E7700092A7C /* volume_curve_AIRPODSMAX.plist in Resources */, - 71F3B28021001DED00FB1C41 /* splMeter_sensitivity_offset.plist in Resources */, - 2246E5172749350300261D5A /* volume_curve_AIRPODSV3.plist in Resources */, - E26E32D622E75FB7004F42EC /* Noise.wav in Resources */, - 713D4B1E20FE5480002BE28D /* retspl_EARPODS.plist in Resources */, - 2246E5152749350300261D5A /* frequency_dBSPL_AIRPODSV3.plist in Resources */, - B1A860F31A9693C400EA57B7 /* consent_03@3x.m4v in Resources */, - B1A860F11A9693C400EA57B7 /* consent_01@3x.m4v in Resources */, - E26E32D722E75FBF004F42EC /* Window.wav in Resources */, - 62DF9F4728CA87DE00D13018 /* frequency_dBSPL_AIRPODSPROV2.plist in Resources */, - B1A860F71A9693C400EA57B7 /* consent_07@3x.m4v in Resources */, - 713D4B1020FE4702002BE28D /* volume_curve_WIRED.plist in Resources */, - 713D4B1C20FE5464002BE28D /* frequency_dBSPL_EARPODS.plist in Resources */, - B1A860F21A9693C400EA57B7 /* consent_02@3x.m4v in Resources */, - E29189BD23855BAE001AFF0F /* retspl_AIRPODSPRO.plist in Resources */, - B1A860EB1A9693C400EA57B7 /* consent_02@2x.m4v in Resources */, - B1A860F61A9693C400EA57B7 /* consent_06@3x.m4v in Resources */, - B1A860F01A9693C400EA57B7 /* consent_07@2x.m4v in Resources */, - 7118AC6920BF6A3A00D7A6BB /* Sentence6.wav in Resources */, - B1A860EF1A9693C400EA57B7 /* consent_06@2x.m4v in Resources */, - B1A860EC1A9693C400EA57B7 /* consent_03@2x.m4v in Resources */, - E29189B923855B97001AFF0F /* frequency_dBSPL_AIRPODSPRO.plist in Resources */, - B1A860F41A9693C400EA57B7 /* consent_04@3x.m4v in Resources */, - 71B7B4DF20AA91D400C5768A /* volume_curve_AIRPODS.plist in Resources */, - B1A860ED1A9693C400EA57B7 /* consent_04@2x.m4v in Resources */, - 7118AC6820BF6A3A00D7A6BB /* Sentence4.wav in Resources */, - E293655E25757CC700092A7C /* frequency_dBSPL_AIRPODSMAX.plist in Resources */, - BA22F76D20C4F884006E6E11 /* SentencesList.txt in Resources */, - B17FE7FD1A8DBE7C00BF9C28 /* Artwork.xcassets in Resources */, - 2246E5162749350300261D5A /* retspl_AIRPODSV3.plist in Resources */, - 7118AC6C20BF6A3A00D7A6BB /* Sentence2.wav in Resources */, + 0B0852742BD872C400149963 /* PrivacyInfo.xcprivacy in Resources */, B1C0F4E41A9BA65F0022C153 /* ResearchKit.strings in Resources */, - 86C40DFC1A8D7C5C00081FAC /* MovieTintShader.vsh in Resources */, + 5192BFA12AEAD7B5006E43FB /* Artwork.xcassets in Resources */, 714080DB235FD14700281E04 /* ResearchKit.stringsdict in Resources */, - 7118AC6B20BF6A3A00D7A6BB /* Sentence3.wav in Resources */, - 71B7B4DE20AA91D400C5768A /* frequency_dBSPL_AIRPODS.plist in Resources */, - B1A860F51A9693C400EA57B7 /* consent_05@3x.m4v in Resources */, - 7118AC6720BF6A3A00D7A6BB /* Sentence7.wav in Resources */, - 7118AC6D20BF6A3A00D7A6BB /* Sentence1.wav in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - B1429E9C1AAA651C003DE546 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; + CA1C7A52288B0C68004DAB3A /* Resources */ = { + isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 0B0852762BD872D800149963 /* PrivacyInfo.xcprivacy in Resources */, + 0B53DA642BD0595100227126 /* ResearchKitUI.strings in Resources */, ); - inputPaths = ( - ); - outputPaths = ( + runOnlyForDeploymentPostprocessing = 0; + }; + CAD08965289DD747007B2A98 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5EB91CC92BCE2F1D00BBF23E /* SentencesList.txt in Resources */, + 5EB91CC82BCE2EFD00BBF23E /* splMeter_sensitivity_offset.plist in Resources */, + 0BD9B6112B75992800A64EF9 /* Sentence5.wav in Resources */, + 51BD8FD329D60FB60001D54E /* volume_curve_AIRPODSMAX.plist in Resources */, + 5192BF7F2AE1A9BA006E43FB /* volume_curve_AIRPODSPROV2.plist in Resources */, + 0BD9B60F2B75992200A64EF9 /* Sentence3.wav in Resources */, + 51BD8FCF29D60FB60001D54E /* retspl_AIRPODSV3.plist in Resources */, + 51BD8FD129D60FB60001D54E /* retspl_AIRPODS.plist in Resources */, + 5192BF7D2AE1A87D006E43FB /* retspl_AIRPODSPROV2.plist in Resources */, + 51BD8FCA29D60FB60001D54E /* frequency_dBSPL_EARPODS.plist in Resources */, + 0BD9B60D2B75991B00A64EF9 /* Sentence1.wav in Resources */, + 51BD8FD529D60FB60001D54E /* volume_curve_AIRPODSPRO.plist in Resources */, + 51BD8FCD29D60FB60001D54E /* retspl_AIRPODSMAX.plist in Resources */, + 51BD8FD629D60FB60001D54E /* retspl_AIRPODSPRO.plist in Resources */, + 51AF1B232B69803A00D3B399 /* Window.wav in Resources */, + 51BD8FD729D60FB60001D54E /* frequency_dBSPL_AIRPODSPRO.plist in Resources */, + 51AF1B242B69803A00D3B399 /* Noise.wav in Resources */, + 5192BF5D2AE19036006E43FB /* frequency_dBSPL_AIRPODSPROV2.plist in Resources */, + 0B0852782BD872EA00149963 /* PrivacyInfo.xcprivacy in Resources */, + 51BD8FD029D60FB60001D54E /* volume_curve_AIRPODS.plist in Resources */, + 51BD8FD429D60FB60001D54E /* volume_curve_WIRED.plist in Resources */, + 0BD9B6132B75992F00A64EF9 /* Sentence7.wav in Resources */, + 51BD8FD229D60FB60001D54E /* frequency_dBSPL_AIRPODSV3.plist in Resources */, + 622774402C5CF7DC00F2E741 /* retspl_dBFS_AIRPODSPROV2.plist in Resources */, + 0BD9B6102B75992500A64EF9 /* Sentence4.wav in Resources */, + 51BD8FC929D60FB60001D54E /* frequency_dBSPL_AIRPODSMAX.plist in Resources */, + 0BD9B60E2B75991F00A64EF9 /* Sentence2.wav in Resources */, + 51BD8FCE29D60FB60001D54E /* retspl_EARPODS.plist in Resources */, + 51BD8FCC29D60FB60001D54E /* volume_curve_AIRPODSV3.plist in Resources */, + 0BD9B6122B75992C00A64EF9 /* Sentence6.wav in Resources */, + 51BD8FCB29D60FB60001D54E /* frequency_dBSPL_AIRPODS.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# License check: all\n\necho \"Checking for BSD license text (files missing licenses listed below):\"\n\nLICENSE_MISSING=`find . -name '*.[hm]' -o -name '*.vsh' -o -name '*.fsh' -exec grep -iL \"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\" {} \\;`\necho \"$LICENSE_MISSING\"\n\ntest \"$LICENSE_MISSING\" == \"\"\n\n"; - showEnvVarsInLog = 0; }; - B18FF3A81A9FE26300C0C3B0 /* ShellScript */ = { +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + B1429E9C1AAA651C003DE546 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -4961,7 +5401,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [ ! -x /usr/local/bin/appledoc ]; then\n echo \"error: appledoc is required for building ResearchKit's documentation. See http://appledoc.gentlebytes.com\" 1>&2\n exit 1\nfi\n\n/usr/local/bin/appledoc --print-settings --publish-docset --install-docset --output \"${BUILT_PRODUCTS_DIR}/docs/\" --include \"docs/ActiveTasks\" --include \"docs/InformedConsent\" --include \"docs/Overview\" --include \"docs/Survey\" --include \"docs/ChartsAndGraphs\" --include \"docs/Passcode\" --include \"docs/Account\" --ignore \"docs/templates\" --templates \"docs/templates\" \"${BUILT_PRODUCTS_DIR}/ResearchKit.framework\" \"docs\"\n\necho \"note: Opening documentation in browser...\"\nopen \"$HOME/Library/Developer/Shared/Documentation/DocSets/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/index.html\""; + shellScript = "# License check: all\n\necho \"Checking for BSD license text (files missing licenses listed below):\"\n\nLICENSE_MISSING=`find . -name '*.[hm]' -o -name '*.vsh' -o -name '*.fsh' -exec grep -iL \"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\" {} \\;`\necho \"$LICENSE_MISSING\"\n\ntest \"$LICENSE_MISSING\" == \"\"\n\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -4972,8 +5412,10 @@ buildActionMask = 2147483647; files = ( 248604061B4C98760010C8A0 /* ORKAnswerFormatTests.m in Sources */, + 5E6AB7DF2BC86900009ED0D5 /* ORKTaskViewControllerTests.swift in Sources */, 86CC8EBA1AC09383001CCD89 /* ORKResultTests.m in Sources */, 03057F492518ECDC00C4EC5B /* ORKAudioStepViewControllerTests.m in Sources */, + 0BFD27562B8D1D3B00B540E8 /* ORKJSONSerializationTests.m in Sources */, FA7A9D391B0969A7005A2BEA /* ORKConsentSignatureFormatterTests.m in Sources */, 86CC8EB81AC09383001CCD89 /* ORKHKSampleTests.m in Sources */, BCB96C131B19C0EC002A0B96 /* ORKStepTests.m in Sources */, @@ -4985,6 +5427,7 @@ 14BE7092220A206B005DEF07 /* ORKDataLoggerManagerTests.m in Sources */, 14D3F09C225BCA8100A3962D /* ORKBorderedButtonTests.swift in Sources */, 1483DBB5220125BE004C26B6 /* ORKActiveStepTests.swift in Sources */, + 51CB80D82AFEBEC600A1F410 /* ORKPredicateFormItemVisibilityRuleTests.swift in Sources */, 1490DCF6224D426B003FEEDA /* ORKSignatureResultTests.swift in Sources */, 148E58C2227B753F00EEF915 /* ORKContinueButtonTests.swift in Sources */, 2EBFE11D1AE1B32D00CB8254 /* ORKUIViewAccessibilityTests.m in Sources */, @@ -4992,22 +5435,29 @@ 1490DCF8224D4550003FEEDA /* ORKVideoInstructionStepResultTests.swift in Sources */, 86CC8EB41AC09383001CCD89 /* ORKChoiceAnswerFormatHelperTests.m in Sources */, 2EBFE1201AE1B74100CB8254 /* ORKVoiceEngineTests.m in Sources */, + 51AF19662B583D0F00D3B399 /* ORKESerialization.m in Sources */, BCAD50E81B0201EE0034806A /* ORKTaskTests.m in Sources */, + CA0AC56928BD4FAC00E80040 /* ORKStepViewControllerHelpers.swift in Sources */, 86CC8EBB1AC09383001CCD89 /* ORKTextChoiceCellGroupTests.m in Sources */, FA7A9D2B1B082688005A2BEA /* ORKConsentDocumentTests.m in Sources */, 22ED1847285290250052406B /* ORKAudiometryTests.m in Sources */, FA7A9D371B09365F005A2BEA /* ORKConsentSectionFormatterTests.m in Sources */, 0B59A6BF28C1738D005035B4 /* ORKPickerTestDelegate.m in Sources */, - 511A7891294D67F80011D85D /* ORKTextButtonTests.swift in Sources */, 714151D0225C4A23002CA33B /* ORKPasscodeViewControllerTests.swift in Sources */, 0324C1D825439E1800BBE77B /* ORKVideoInstructionStepViewControllerTests.swift in Sources */, - 14E79040226A5F72009D8083 /* ORKStepViewControllerHelpers.swift in Sources */, + 0B9A990F2A8AC47500D64C40 /* NSObject+TestingSupport.m in Sources */, + BC4D521F27B326EA0099DC18 /* ORKSecureCodingTests.swift in Sources */, 86D348021AC161B0006DB02B /* ORKRecorderTests.m in Sources */, + 519CE85F2C6BC1DB003BB584 /* ORKFamilyHistoryResultTests.swift in Sources */, 1490DCFC224D4867003FEEDA /* ORKEnvironmentSPLMeterResultTests.swift in Sources */, + 51CB80D62AFEBE7E00A1F410 /* ORKFormStepViewControllerConditionalFormItemsTests.swift in Sources */, + 51AF19582B583BBA00D3B399 /* ORKDataCollectionTests.m in Sources */, 7141EA2222EFBC0C00650145 /* ORKLoggingTests.m in Sources */, + 51EB9A5E2B8D3BA70064A515 /* ORKInstructionStepHTMLFormatterTests.m in Sources */, 1490DCF4224D3C20003FEEDA /* ORKPasscodeResultTests.swift in Sources */, 14BE7091220A201E005DEF07 /* ORKDataLoggerTests.m in Sources */, 148E58BD227B36DB00EEF915 /* ORKCompletionStepViewControllerTests.swift in Sources */, + 51CB80DA2AFEBF3800A1F410 /* ORKFormItemVisibilityRuleTests.swift in Sources */, 86CC8EB31AC09383001CCD89 /* ORKAccessibilityTests.m in Sources */, 1490DD02224D6A21003FEEDA /* ORKResultPredicateTests.swift in Sources */, ); @@ -5017,441 +5467,499 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 861D2AED1B8409B2008C4CD0 /* ORKTimedWalkStepViewController.m in Sources */, - 86C40C341A8D7C5C00081FAC /* ORKFitnessStepViewController.m in Sources */, - 71769E2E208824D100A19914 /* ORKdBHLToneAudiometryOnboardingStep.m in Sources */, - 71769E3A20882CED00A19914 /* ORKdBHLToneAudiometryStep.m in Sources */, - 511B8AC2293A772400049947 /* ORKTouchAbilityTapResult.m in Sources */, - BA43CCA52271741C00F2A2D2 /* ORKStepContentView.m in Sources */, + CA2BBB2128AB06D300DD6C64 /* ORKLearnMoreItem.m in Sources */, 2433C9E41B9A506F0052D375 /* ORKKeychainWrapper.m in Sources */, - FF919A2B1E81A94B005C2A1E /* ORKRangeOfMotionResult.m in Sources */, - 86C40CA61A8D7C5C00081FAC /* ORKLocationRecorder.m in Sources */, - 86C40CB61A8D7C5C00081FAC /* ORKTouchRecorder.m in Sources */, BC2908BC1FBD628F0030AB89 /* ORKTypes.m in Sources */, - 71D8EF1820B9EE1900EBCDC6 /* ORKHealthClinicalTypeRecorder.m in Sources */, - CBD34A5B1BB207FC00F204EA /* ORKSurveyAnswerCellForLocation.m in Sources */, - 959A2C011D68B9DA00841B04 /* ORKRangeOfMotionStepViewController.m in Sources */, - 861D2AF11B8409D9008C4CD0 /* ORKTimedWalkContentView.m in Sources */, - BAD9E9172255E9CE0014FA29 /* ORKLearnMoreStepViewController.m in Sources */, - 86C40DC41A8D7C5C00081FAC /* ORKTapCountLabel.m in Sources */, - 25ECC0A01AFBD92D00F3D63B /* ORKReactionTimeContentView.m in Sources */, - 511B8B24293A79C000049947 /* ORKTouchAbilityRotationStepViewController.m in Sources */, - 2295B222282AF92700A5D9E0 /* ORKAudiometry.m in Sources */, - 86C40D4C1A8D7C5C00081FAC /* ORKLabel.m in Sources */, - 511B8AD3293A77AA00049947 /* ORKTouchAbilityLongPressTrial.m in Sources */, - 511B8ACA293A777400049947 /* ORKTouchAbilityLongPressStepViewController.m in Sources */, - 86C40C9E1A8D7C5C00081FAC /* ORKDeviceMotionRecorder.m in Sources */, - FFF65AB91E318F2D0043FB40 /* ORKMultipleValuePicker.m in Sources */, - 86C40D961A8D7C5C00081FAC /* ORKStepViewController.m in Sources */, 2489F7B21D65214D008DEF20 /* ORKVideoCaptureStep.m in Sources */, - 51D823062472FB9B00BF4F72 /* ORKRequestPermissionsStepContainerView.m in Sources */, - 0BAF97A8291088F200EF138A /* ORKNormalizedReactionTimeResult.m in Sources */, - 86C40DF81A8D7C5C00081FAC /* ORKSignatureStepViewController.m in Sources */, FF919A601E81CF07005C2A1E /* ORKVideoInstructionStepResult.m in Sources */, - 959A2BFD1D68B98700841B04 /* ORKRangeOfMotionStep.m in Sources */, - 51906C5F291D796600FF4185 /* EyeActivitySlider.swift in Sources */, - FF919A2F1E81AAD0005C2A1E /* ORKTowerOfHanoiResult.m in Sources */, - BCB6E6531B7D533B000D5B34 /* ORKPieChartLegendCell.m in Sources */, 866DA52A1D63D04700C9AF3F /* ORKOperation.m in Sources */, - 86C40D8C1A8D7C5C00081FAC /* ORKSkin.m in Sources */, 86C40D221A8D7C5C00081FAC /* ORKFormStep.m in Sources */, - 511B8B32293A7A0B00049947 /* ORKTouchAbilityRotationResult.m in Sources */, - 7118AC7820BF6A7800D7A6BB /* ORKSpeechInNoiseStep.m in Sources */, - BA2FE3EF20B109C600AAC231 /* ORKAmslerGridResult.m in Sources */, - 10FF9ACC1B79F22900ECB5B4 /* ORKHolePegTestRemoveStepViewController.m in Sources */, - 517514532459EF5D009E8FFC /* ORK3DModelStepViewController.m in Sources */, - 86C40CD61A8D7C5C00081FAC /* ORKTableContainerView.m in Sources */, 2429D5731BBB5397003A512F /* ORKRegistrationStep.m in Sources */, - 511B8AF0293A785A00049947 /* ORKTouchAbilitySwipeResult.m in Sources */, - BAC2B65822F252F70079304E /* ORKSurveyAnswerCellForSES.m in Sources */, - 257FCE201B4D14E50001EF06 /* ORKTowerOfHanoiTowerView.m in Sources */, - 2489F7B61D65214D008DEF20 /* ORKVideoCaptureView.m in Sources */, 861D11AE1AA7951F003C98A7 /* ORKChoiceAnswerFormatHelper.m in Sources */, - 106FF2AB1B690FD7004EACF2 /* ORKHolePegTestPlacePegView.m in Sources */, BF91559D1BDE8D7D007FA459 /* ORKReviewStep.m in Sources */, - 86C40C381A8D7C5C00081FAC /* ORKSpatialSpanGame.m in Sources */, - 86C40C481A8D7C5C00081FAC /* ORKSpatialSpanMemoryStepViewController.m in Sources */, - 86C40CDA1A8D7C5C00081FAC /* ORKTextFieldView.m in Sources */, - 8419D6731FB73EC60088D7E5 /* ORKWebViewStepViewController.m in Sources */, - 517514572459F0BE009E8FFC /* ORK3DModelStepContentView.m in Sources */, - B8760F2C1AFBEFB0007FA16F /* ORKScaleRangeDescriptionLabel.m in Sources */, - 86C40D821A8D7C5C00081FAC /* ORKSelectionSubTitleLabel.m in Sources */, - FF919A441E81B904005C2A1E /* ORKPSATResult.m in Sources */, - 226565542847FD1D00E916FF /* ORKAudiometryStimulus.m in Sources */, - 86C40DCC1A8D7C5C00081FAC /* ORKTaskViewController.m in Sources */, - 0BAF97A6291088F200EF138A /* ORKNormalizedReactionTimeContentView.m in Sources */, - 511987A0245FE68D004FC2C7 /* ORKUSDZModelManager.m in Sources */, - 86C40E061A8D7C5C00081FAC /* ORKConsentLearnMoreViewController.m in Sources */, - BABBB19E2093299A00CB29E5 /* ORKSurveyCardHeaderView.m in Sources */, - 86C40D7A1A8D7C5C00081FAC /* ORKScaleSlider.m in Sources */, - A659C547262E0F5600E920DA /* UIColor+String.m in Sources */, - 244103501B966D4C00EEAB0C /* ORKPasscodeViewController.m in Sources */, - 71BD9EAE2096A26C007B436E /* ORKEnvironmentSPLMeterContentView.m in Sources */, - 86C40C801A8D7C5C00081FAC /* ORKActiveStep.m in Sources */, + CA994D5628AB08410019DEA4 /* ORKDeprecated.m in Sources */, 00C2668F23022CD400337E0B /* ORKCustomStep.m in Sources */, - 86C40D721A8D7C5C00081FAC /* ORKRoundTappingButton.m in Sources */, - 86C40E2A1A8D7C5C00081FAC /* ORKSignatureView.m in Sources */, 866DA5281D63D04700C9AF3F /* ORKMotionActivityQueryOperation.m in Sources */, - 0BAF97A5291088F200EF138A /* ORKNormalizedReactionTimeStimulusView.m in Sources */, BCFF24BD1B0798D10044EC35 /* ORKResultPredicate.m in Sources */, - 106FF2B51B71F18E004EACF2 /* ORKHolePegTestPlaceHoleView.m in Sources */, - 106FF2A31B665B86004EACF2 /* ORKHolePegTestPlaceStepViewController.m in Sources */, - 25ECC0A41AFBDD2700F3D63B /* ORKReactionTimeStimulusView.m in Sources */, - 86C40CBA1A8D7C5C00081FAC /* ORKVoiceEngine.m in Sources */, - 861D11B61AA7D073003C98A7 /* ORKTextChoiceCellGroup.m in Sources */, - 86C40CCA1A8D7C5C00081FAC /* ORKFormItemCell.m in Sources */, - 147503B81AEE807C004B17F3 /* ORKToneAudiometryContentView.m in Sources */, - 86C40CBE1A8D7C5C00081FAC /* UITouch+ORKJSONDictionary.m in Sources */, - 618DA0521A93D0D600E63AA8 /* ORKAccessibilityFunctions.m in Sources */, - 511B8ACE293A779200049947 /* ORKTouchAbilityLongPressContentView.m in Sources */, - BF9155AC1BDE8DA9007FA459 /* ORKWaitStepViewController.m in Sources */, - 86C40DB81A8D7C5C00081FAC /* ORKSurveyAnswerCellForText.m in Sources */, 511987C4246330CA004FC2C7 /* ORKRequestPermissionsStep.m in Sources */, - BA8C067022ECF87900ACDE6B /* ORKSecondaryTaskStepViewController.m in Sources */, - 86C40CF01A8D7C5C00081FAC /* ORKAnswerTextView.m in Sources */, - 86C40D3E1A8D7C5C00081FAC /* ORKImageChoiceLabel.m in Sources */, - 1B4B95B81F5F012E006B629F /* ORKWeightPicker.m in Sources */, - 250F94051B4C5A6600FA23EB /* ORKTowerOfHanoiStep.m in Sources */, 86C40E0A1A8D7C5C00081FAC /* ORKConsentReviewStep.m in Sources */, - 511B8AE0293A782800049947 /* ORKTouchAbilitySwipeStepViewController.m in Sources */, 03BD9EA4253E62A0008ADBE1 /* ORKBundleAsset.m in Sources */, + 5192BF8A2AE1BBB0006E43FB /* ORKSecondaryTaskStep.m in Sources */, + CA2B900A28A17ADE0025B773 /* ORKActiveStep.m in Sources */, 12F339BF26A1F09A000665E4 /* ORKLocationPermissionType.m in Sources */, - BCD192E81B81243900FCC08A /* ORKPieChartLegendView.m in Sources */, - FF919A481E81BA3D005C2A1E /* ORKHolePegTestResult.m in Sources */, - 511B8A9E293A75F300049947 /* ORKTouchAbilityTrack.m in Sources */, - 86C40D1E1A8D7C5C00081FAC /* ORKFormSectionTitleLabel.m in Sources */, - 71BD9EA620969BE1007B436E /* ORKEnvironmentSPLMeterStep.m in Sources */, - 250F94091B4C5AA400FA23EB /* ORKTowerOfHanoiStepViewController.m in Sources */, - FF72B1F01F5F10CD004C6F15 /* ORKStroopResult.m in Sources */, - BADA2F27225DA54B005D2255 /* ORKInstructionStepContainerView.m in Sources */, - BC1C032D1CA301E300869355 /* ORKHeightPicker.m in Sources */, - BAD65E4C2284EFF9008A5DCE /* ORKStepView.m in Sources */, - 86C40CF81A8D7C5C00081FAC /* ORKBorderedButton.m in Sources */, 86C40E201A8D7C5C00081FAC /* ORKConsentSignature.m in Sources */, BF1D43861D4904C6007EE90B /* ORKVideoInstructionStep.m in Sources */, - 511B8AAD293A767C00049947 /* ORKTouchAbilityTouchTracker.m in Sources */, - 9550E67D1D58DD2000C691B8 /* ORKTouchAnywhereStepViewController.m in Sources */, - 86C40C601A8D7C5C00081FAC /* ORKWalkingTaskStepViewController.m in Sources */, - 511B8AA8293A764900049947 /* ORKTouchAbilityTrial.m in Sources */, - BCD192E01B81240400FCC08A /* ORKPieChartPieView.m in Sources */, - 515310D0233570CF007BCA58 /* ORKDontKnowButton.m in Sources */, FF919A6E1E81D3B0005C2A1E /* ORKPasscodeResult.m in Sources */, - 959A2C0E1D68C91400841B04 /* ORKShoulderRangeOfMotionStep.m in Sources */, - 866F86011A96CBF3007B282C /* ORKSurveyAnswerCell.m in Sources */, BABBB1AF2097D97200CB29E5 /* ORKPDFViewerStep.m in Sources */, + 519CE82D2C6582BE003BB584 /* ORKFamilyHistoryResult.m in Sources */, + 51AF1B162B67F30500D3B399 /* ORKSignatureFormatter.m in Sources */, FF919A641E81D04D005C2A1E /* ORKSignatureResult.m in Sources */, - 7118AC7420BF6A7800D7A6BB /* ORKSpeechInNoiseStepViewController.m in Sources */, - 10FF9AD01B79F5CE00ECB5B4 /* ORKHolePegTestRemoveContentView.m in Sources */, - 10FF9AD41B79F5EA00ECB5B4 /* ORKHolePegTestRemovePegView.m in Sources */, - 519C298126D027AB00FD5F44 /* SwiftUIViewFactory.swift in Sources */, - 618DA0561A93D0D600E63AA8 /* UIView+ORKAccessibility.m in Sources */, 8419D66F1FB73CC80088D7E5 /* ORKWebViewStep.m in Sources */, 866DA5211D63D04700C9AF3F /* ORKCollector.m in Sources */, - BC4A21401C85FC0000BFC271 /* ORKBarGraphChartView.m in Sources */, - 86C40D3A1A8D7C5C00081FAC /* ORKHTMLPDFWriter.m in Sources */, - AEFE0AC2230DB857004D0519 /* ORKReviewIncompleteCell.m in Sources */, - 865EA1691ABA1AA10037C68E /* ORKPicker.m in Sources */, - BCB6E6511B7D533B000D5B34 /* ORKPieChartLegendCollectionViewLayout.m in Sources */, + 0BE9D5272947EA4900DA0625 /* ORKConsentDocument+ORKInstructionStep.m in Sources */, 51E03D692491A601008F8406 /* ORKHealthKitPermissionType.m in Sources */, - 511B8A9A293A75B900049947 /* ORKTouchAbilityTouch.m in Sources */, - 511B8B05293A791B00049947 /* ORKTouchAbilityScrollResult.m in Sources */, - A659C53B262E0A3200E920DA /* ORKAccuracyStroopStep.m in Sources */, - 511B8B1A293A798D00049947 /* ORKTouchAbilityPinchTrial.m in Sources */, - 511B8AED293A785A00049947 /* ORKTouchAbilitySwipeTrial.m in Sources */, + 5192BF862AE1BA47006E43FB /* ORKFrontFacingCameraStep.m in Sources */, 86C40D321A8D7C5C00081FAC /* ORKHealthAnswerFormat.m in Sources */, - 10FF9AC41B79EF2800ECB5B4 /* ORKHolePegTestRemoveStep.m in Sources */, - 5175144F2459EBF0009E8FFC /* ORK3DModelStep.m in Sources */, 03EDD58124CA6B1D006245E9 /* ORKNotificationPermissionType.m in Sources */, - 10BAA2CB1B5FCB4F004FE478 /* ORKProgressView.m in Sources */, - 86C40D861A8D7C5C00081FAC /* ORKSelectionTitleLabel.m in Sources */, - 51906C51291D790800FF4185 /* ORKLandoltCStepContentView.swift in Sources */, - FF36A49E1D1A15FC00DE8470 /* ORKTableStepViewController.m in Sources */, - 86C40D001A8D7C5C00081FAC /* ORKChoiceViewCell.m in Sources */, + 519CE8262C6582BE003BB584 /* ORKRelatedPerson.m in Sources */, 51E03D6424919711008F8406 /* ORKPermissionType.m in Sources */, - 86C40C4C1A8D7C5C00081FAC /* ORKSpatialSpanTargetView.m in Sources */, - 86C40D9E1A8D7C5C00081FAC /* ORKSubheadlineLabel.m in Sources */, - 10864CA31B27146B000F4158 /* ORKPSATContentView.m in Sources */, - 6146D0A41B84A91E0068491D /* ORKGraphChartAccessibilityElement.m in Sources */, - D42FEFB91AF7557000A124F8 /* ORKImageCaptureView.m in Sources */, - BA8C067922EEB84B00ACDE6B /* ORKPlaybackButton.m in Sources */, - 86C40C401A8D7C5C00081FAC /* ORKSpatialSpanMemoryContentView.m in Sources */, - 511B8B12293A796600049947 /* ORKTouchAbilityPinchContentView.m in Sources */, - BAC6F1AA22AF535100E31C22 /* ORKTaskReviewViewController.m in Sources */, - BCB6E6671B7D535F000D5B34 /* ORKXAxisView.m in Sources */, - 00C2668B2302244300337E0B /* ORKCustomStepViewController.m in Sources */, - BA8078F4224AC8AA0013B554 /* ORKStepContainerView.m in Sources */, - 5166E4A0247355D500151C57 /* ORKUSDZModelManagerResult.m in Sources */, - 51906C52291D790800FF4185 /* ORKLandoltCStepViewController.swift in Sources */, - 71769E322088260B00A19914 /* ORKdBHLToneAudiometryOnboardingStepViewController.m in Sources */, - FF919A3C1E81AF1D005C2A1E /* ORKFileResult.m in Sources */, - 147503BC1AEE807C004B17F3 /* ORKToneAudiometryStepViewController.m in Sources */, - 03057F3A2515771800C4EC5B /* ORKAudioFitnessStepViewController.m in Sources */, - 51906C59291D794400FF4185 /* TrackLayer.swift in Sources */, - 86AD910B1AB7AD1E00361FEB /* ORKNavigationContainerView.m in Sources */, - 5119876A245CA50D004FC2C7 /* ORKUSDZModelManagerScene.m in Sources */, - 51906C53291D790800FF4185 /* ORKLandoltCStep.swift in Sources */, - 511B8AD7293A77BE00049947 /* ORKTouchAbilityLongPressResult.m in Sources */, - 51906C67291D7A5A00FF4185 /* ORKSwiftStroopContentView.swift in Sources */, - 511B8B0E293A795900049947 /* ORKTouchAbilityPinchStepViewController.m in Sources */, FFDDD84A1D3555EA00446806 /* ORKPageStep.m in Sources */, - 2E8071021FB0E6BE00E4FC7F /* ORKAudioGraphView.m in Sources */, - 511987C82463316E004FC2C7 /* ORKRequestPermissionsStepViewController.m in Sources */, - 865EA1631AB8DF750037C68E /* ORKDateTimePicker.m in Sources */, - FF154FB51E82EF5E004ED908 /* ORKOrderedTask+ORKPredefinedActiveTask.m in Sources */, + 51EB9A542B8408D50064A515 /* ORKInstructionStepHTMLFormatter.m in Sources */, + CA2B901228A17D170025B773 /* ORKFileResult.m in Sources */, 866DA5241D63D04700C9AF3F /* ORKDataCollectionManager.m in Sources */, - 5119879C245FC33C004FC2C7 /* ORK3DModelManager.m in Sources */, - 9550E6741D58DBCF00C691B8 /* ORKTouchAnywhereStep.m in Sources */, - 51906C66291D7A5A00FF4185 /* ORKSwiftStroopResult.swift in Sources */, - 86C40C781A8D7C5C00081FAC /* HKSample+ORKJSONDictionary.m in Sources */, 86C40D421A8D7C5C00081FAC /* ORKInstructionStep.m in Sources */, - 86C40C2C1A8D7C5C00081FAC /* ORKFitnessContentView.m in Sources */, - BA95AA9F20ACD0E700E7FF8E /* ORKAmslerGridContentView.m in Sources */, - CBD34A571BB1FB9000F204EA /* ORKLocationSelectionView.m in Sources */, - BA8C066C22ECF7C200ACDE6B /* ORKSecondaryTaskStep.m in Sources */, FF919A5A1E81C628005C2A1E /* ORKQuestionResult.m in Sources */, - D458520B1AF6CCFA00A2DE13 /* ORKImageCaptureCameraPreviewView.m in Sources */, BA473FE9224DB38900A362E3 /* ORKBodyItem.m in Sources */, 86C40E1A1A8D7C5C00081FAC /* ORKConsentSection.m in Sources */, - 86C40C241A8D7C5C00081FAC /* ORKCountdownStep.m in Sources */, - BCB6E65C1B7D534C000D5B34 /* ORKDiscreteGraphChartView.m in Sources */, - 71BD9EAA20969EED007B436E /* ORKEnvironmentSPLMeterStepViewController.m in Sources */, - 511B8AFD293A78CF00049947 /* ORKTouchAbilityScrollContentView.m in Sources */, - BA2645E72301571800D00B73 /* ORKReviewViewController.m in Sources */, - 716B126920A7A40400590264 /* ORKdBHLToneAudiometryAudioGenerator.m in Sources */, - 86C40CA21A8D7C5C00081FAC /* ORKHealthQuantityTypeRecorder.m in Sources */, - 511B8AE4293A783B00049947 /* ORKTouchAbilitySwipeContentView.m in Sources */, - 95E11E561D73396300BF865B /* ORKShoulderRangeOfMotionStepViewController.m in Sources */, - BA2CFBB12342935800B71919 /* ORKCompletionCheckmarkView.m in Sources */, - 86C40DC01A8D7C5C00081FAC /* ORKTableViewCell.m in Sources */, - 51906C65291D7A5A00FF4185 /* ORKSwiftStroopStep.swift in Sources */, - 24A4DA111B8D0F21009C797A /* ORKPasscodeStepView.m in Sources */, - BC41942A1AE8453A00073D6B /* ORKObserver.m in Sources */, - 5D1CE45B23FC85F4004CB416 /* ORKAudioMeteringView.m in Sources */, - 86C40C681A8D7C5C00081FAC /* CMAccelerometerData+ORKJSONDictionary.m in Sources */, - 511B8B1D293A799800049947 /* ORKTouchAbilityPinchResult.m in Sources */, - 71769E362088291B00A19914 /* ORKdBHLToneAudiometryContentView.m in Sources */, - 86C40C701A8D7C5C00081FAC /* CMMotionActivity+ORKJSONDictionary.m in Sources */, - 147503B01AEE8071004B17F3 /* ORKAudioGenerator.m in Sources */, - 86C40D7E1A8D7C5C00081FAC /* ORKScaleValueLabel.m in Sources */, - 511B8B15293A797C00049947 /* ORKTouchAbilityPinchGuideView.m in Sources */, - 511B8AB1293A76A100049947 /* ORKTouchAbilityTapStep.m in Sources */, - 8056857A1C90C19500BF437A /* UIImage+ResearchKit.m in Sources */, - BA8C5022226FFB04001896D0 /* ORKLearnMoreItem.m in Sources */, - BC94EF321E962F7400143081 /* ORKDeprecated.m in Sources */, + CA2B902628A187390025B773 /* ORKTask_Util.m in Sources */, + 5192BF512AE09673006E43FB /* ORKPredicateFormItemVisibilityRule.m in Sources */, BAD9E9132255E9750014FA29 /* ORKLearnMoreInstructionStep.m in Sources */, 86C40D901A8D7C5C00081FAC /* ORKStep.m in Sources */, - 86C40D2E1A8D7C5C00081FAC /* ORKHeadlineLabel.m in Sources */, FA7A9D341B0843A9005A2BEA /* ORKConsentSignatureFormatter.m in Sources */, - 86C40CFC1A8D7C5C00081FAC /* ORKCaption1Label.m in Sources */, 86C40E001A8D7C5C00081FAC /* ORKConsentDocument.m in Sources */, - 511B8AF7293A78BB00049947 /* ORKTouchAbilityScrollStep.m in Sources */, D442397A1AF17F5100559D96 /* ORKImageCaptureStep.m in Sources */, - FF36A48E1D1A0ACA00DE8470 /* ORKAudioLevelNavigationRule.m in Sources */, - 511B8ABD293A770D00049947 /* ORKTouchAbilityTapTrial.m in Sources */, - 86C40CDE1A8D7C5C00081FAC /* ORKTintedImageView.m in Sources */, - 86B781BC1AA668ED00688151 /* ORKTimeIntervalPicker.m in Sources */, - 86B781BE1AA668ED00688151 /* ORKValuePicker.m in Sources */, - 86B89ABC1AB3BECC001626A4 /* ORKStepHeaderView.m in Sources */, - 861D11AA1AA691BB003C98A7 /* ORKScaleSliderView.m in Sources */, - 86C40C141A8D7C5C00081FAC /* ORKActiveStepQuantityView.m in Sources */, - 86C40C6C1A8D7C5C00081FAC /* CMDeviceMotion+ORKJSONDictionary.m in Sources */, - 86C40DF01A8D7C5C00081FAC /* UIResponder+ResearchKit.m in Sources */, - 865EA16D1ABA1BE20037C68E /* ORKSurveyAnswerCellForPicker.m in Sources */, - BF9155AA1BDE8DA9007FA459 /* ORKWaitStepView.m in Sources */, - 86C40D261A8D7C5C00081FAC /* ORKFormStepViewController.m in Sources */, - BC5FAF851C6901A200057CF1 /* ORKChartTypes.m in Sources */, 866DA5261D63D04700C9AF3F /* ORKHealthSampleQueryOperation.m in Sources */, + 519CE8222C6582BE003BB584 /* ORKHealthCondition.m in Sources */, + CA6A0D86288B5B370048C1EF /* ORKHTMLPDFWriter.m in Sources */, FF5CA6131D2C2670001660A3 /* ORKTableStep.m in Sources */, - 86C40C8A1A8D7C5C00081FAC /* ORKActiveStepTimerView.m in Sources */, - 86AD91111AB7B8A600361FEB /* ORKActiveStepView.m in Sources */, - 86C40C201A8D7C5C00081FAC /* ORKAudioStepViewController.m in Sources */, - 5170009D254A197300CACE12 /* ORKRequestPermissionButton.m in Sources */, - E293668625EE67C200EB7F24 /* ORKEnvironmentSPLMeterBarView.m in Sources */, - 51BF30BF247B330A00E2E669 /* ORKIconButton.m in Sources */, - 03057F3E2515772E00C4EC5B /* ORKAudioFitnessStep.m in Sources */, - 86C40D081A8D7C5C00081FAC /* ORKCountdownLabel.m in Sources */, 036B1E8E25351BAD008483DF /* ORKMotionActivityPermissionType.m in Sources */, - D442397E1AF17F7600559D96 /* ORKImageCaptureStepViewController.m in Sources */, - 511B8B01293A78EF00049947 /* ORKTouchAbilityScrollTrial.m in Sources */, - 86C40CAE1A8D7C5C00081FAC /* ORKRecorder.m in Sources */, - FF919A401E81AFEF005C2A1E /* ORKReactionTimeResult.m in Sources */, - 0BAF97A4291088F200EF138A /* ORKNormalizedReactionTimeViewController.m in Sources */, - 86C40DAC1A8D7C5C00081FAC /* ORKSurveyAnswerCellForNumber.m in Sources */, - 51751468245A53D7009E8FFC /* ORKFrontFacingCameraStepContentView.m in Sources */, + CA2B902228A1867E0025B773 /* ORKRecorder.m in Sources */, 5D04885825F19A7A0006C68B /* ORKDevice.m in Sources */, - 86C40C541A8D7C5C00081FAC /* ORKTappingIntervalStep.m in Sources */, + CA2B902428A186AF0025B773 /* ORKDataLogger.m in Sources */, + 519CE8292C6582BE003BB584 /* ORKConditionStepConfiguration.m in Sources */, 86C40D6C1A8D7C5C00081FAC /* ORKResult.m in Sources */, - 781D54151DF886AB00223305 /* ORKTrailmakingStepViewController.m in Sources */, - BA87E26E20A79FA100B375A9 /* ORKRingView.m in Sources */, - 86C40CD21A8D7C5C00081FAC /* ORKInstructionStepView.m in Sources */, - 10FF9AD81B7A045E00ECB5B4 /* ORKSeparatorView.m in Sources */, 86C40D181A8D7C5C00081FAC /* ORKErrors.m in Sources */, - 51906C54291D790800FF4185 /* ORKLandoltCResult.swift in Sources */, - BAC2B65C22F25A2F0079304E /* ORKSESSelectionView.m in Sources */, - 24850E1A1BCDA9C7006E91FB /* ORKLoginStepViewController.m in Sources */, - 25ECC09C1AFBD8B300F3D63B /* ORKReactionTimeViewController.m in Sources */, - 5D43C5D224217393006F4084 /* ORKRecordButton.m in Sources */, - 86C40DB01A8D7C5C00081FAC /* ORKSurveyAnswerCellForScale.m in Sources */, - 511B8ABA293A76DE00049947 /* ORKTouchAbilityTapContentView.m in Sources */, - BABBB1B72097E58300CB29E5 /* ORKPDFViewerStepView.m in Sources */, - 86C40C281A8D7C5C00081FAC /* ORKCountdownStepViewController.m in Sources */, - 86C40C641A8D7C5C00081FAC /* CLLocation+ORKJSONDictionary.m in Sources */, + 5192BF852AE1BA47006E43FB /* ORKFrontFacingCameraStepResult.m in Sources */, 031A0FC224CF4ECD000E4455 /* ORKSensorPermissionType.m in Sources */, - 51751464245A5172009E8FFC /* ORKFrontFacingCameraStepViewController.m in Sources */, - 86C40D041A8D7C5C00081FAC /* ORKContinueButton.m in Sources */, + CA6A0D85288B5B370048C1EF /* ORKHTMLPDFPageRenderer.m in Sources */, + 519CE8232C6582BE003BB584 /* ORKFamilyHistoryStep.m in Sources */, + 51A11F182BD08D5E0060C07E /* CMMotionActivity+ORKJSONDictionary.m in Sources */, 24A4DA151B8D1115009C797A /* ORKPasscodeStep.m in Sources */, - 86C40DEC1A8D7C5C00081FAC /* UIBarButtonItem+ORKBarButtonItem.m in Sources */, - 51E03D6E2491B6DB008F8406 /* ORKRequestPermissionView.m in Sources */, - 106FF2AF1B6FACA8004EACF2 /* ORKDirectionView.m in Sources */, - BF1D438A1D4905FC007EE90B /* ORKVideoInstructionStepViewController.m in Sources */, - 5190141A24759E6800E3A418 /* ORKFrontFacingCameraStepResult.m in Sources */, - BA473FEE224DBA3700A362E3 /* ORKLearnMoreView.m in Sources */, - 86C40CAA1A8D7C5C00081FAC /* ORKPedometerRecorder.m in Sources */, BCA5C0361AEC05F20092AC8D /* ORKStepNavigationRule.m in Sources */, - 8DE27B401D5BC0B9009A26E3 /* ORKHTMLPDFPageRenderer.m in Sources */, - 106FF2A71B665CF5004EACF2 /* ORKHolePegTestPlaceContentView.m in Sources */, - 511B8ADC293A781000049947 /* ORKTouchAbilitySwipeStep.m in Sources */, - 86C40D761A8D7C5C00081FAC /* ORKScaleRangeLabel.m in Sources */, - 511B8B09293A794D00049947 /* ORKTouchAbilityPinchStep.m in Sources */, - BABBB1BB2097EF3800CB29E5 /* ORKFreehandDrawingView.m in Sources */, - 86C40C741A8D7C5C00081FAC /* CMPedometerData+ORKJSONDictionary.m in Sources */, - 86AD91151AB7B97E00361FEB /* ORKQuestionStepView.m in Sources */, - 71769E2A20880C4500A19914 /* ORKdBHLToneAudiometryResult.m in Sources */, - 10864CA11B27146B000F4158 /* ORKPSATStepViewController.m in Sources */, - AE2CF2C223231C5A00FDD733 /* ORKTagLabel.m in Sources */, FF919A6A1E81D255005C2A1E /* ORKConsentSignatureResult.m in Sources */, - 86C40C5C1A8D7C5C00081FAC /* ORKWalkingTaskStep.m in Sources */, - 5175145F245A4FF1009E8FFC /* ORKFrontFacingCameraStep.m in Sources */, - 7118AC7620BF6A7800D7A6BB /* ORKSpeechInNoiseContentView.m in Sources */, - 257FCE241B4D37A80001EF06 /* ORKTowerOfHanoiTower.m in Sources */, - 86C40C3C1A8D7C5C00081FAC /* ORKSpatialSpanGameState.m in Sources */, - FF919A371E81AD9C005C2A1E /* ORKSpatialSpanMemoryResult.m in Sources */, - 86C40CF41A8D7C5C00081FAC /* ORKBodyLabel.m in Sources */, - FF919A4C1E81BB7E005C2A1E /* ORKTimedWalkResult.m in Sources */, - 106FF29F1B663FCE004EACF2 /* ORKHolePegTestPlaceStep.m in Sources */, - A659C53F262E0ABE00E920DA /* ORKAccuracyStroopStepViewController.m in Sources */, - FFAE71411DAEC66200AE82B4 /* ORKFootnoteLabel.m in Sources */, - 86C40C941A8D7C5C00081FAC /* ORKAudioRecorder.m in Sources */, - FF5E3CCC1D23444400ECE4B7 /* ORKPageStepViewController.m in Sources */, - 86C40C581A8D7C5C00081FAC /* ORKTappingIntervalStepViewController.m in Sources */, - BA473FE4224DAFEF00A362E3 /* ORKBodyContainerView.m in Sources */, - BA0AA6971EAEC0B600671ACE /* ORKStroopStep.m in Sources */, - BAD6FAB22332A2FD006647E7 /* ORKCheckmarkView.m in Sources */, - 86C40E0E1A8D7C5C00081FAC /* ORKConsentReviewStepViewController.m in Sources */, - 511B8A96293A759300049947 /* ORKTouchAbilityArrowView.m in Sources */, - BF9155A01BDE8D7E007FA459 /* ORKReviewStepViewController.m in Sources */, - 2E80C1AA1FA2AA8D00399A0C /* ORKStreamingAudioRecorder.m in Sources */, - 86C40E261A8D7C5C00081FAC /* ORKEAGLMoviePlayerView.m in Sources */, + 5192BF5A2AE09794006E43FB /* ORKFormItemVisibilityRule.m in Sources */, 86C40CC21A8D7C5C00081FAC /* ORKCompletionStep.m in Sources */, - 86C40C301A8D7C5C00081FAC /* ORKFitnessStep.m in Sources */, - 86C40C501A8D7C5C00081FAC /* ORKTappingContentView.m in Sources */, - 0BAF97A9291088F200EF138A /* ORKNormalizedReactionTimeStep.m in Sources */, - BABBB1B32097E16700CB29E5 /* ORKPDFViewerStepViewController.m in Sources */, - 24A4DA191B8D13FE009C797A /* ORKPasscodeStepViewController.m in Sources */, BF9155A81BDE8DA9007FA459 /* ORKWaitStep.m in Sources */, - 86C40CEC1A8D7C5C00081FAC /* ORKAnswerTextField.m in Sources */, - 716B126520A78C6B00590264 /* ORKEnvironmentSPLMeterResult.m in Sources */, - 86C40C441A8D7C5C00081FAC /* ORKSpatialSpanMemoryStep.m in Sources */, BCB080A11B83EFB900A3F400 /* ORKStepNavigationRule.swift in Sources */, - 24898B0E1B7186C000B0E7E7 /* ORKScaleRangeImageView.m in Sources */, - 511B8AA3293A762400049947 /* ORKTouchAbilityGestureRecoginzerEvent.m in Sources */, - 86C40DD81A8D7C5C00081FAC /* ORKUnitLabel.m in Sources */, AE75433B24E32CCC00E4C7CF /* ORKEarlyTerminationConfiguration.m in Sources */, + 519CE8282C6582BE003BB584 /* ORKRelativeGroup.m in Sources */, 86C40D361A8D7C5C00081FAC /* ORKHelpers.m in Sources */, - 519C298E26D027E500FD5F44 /* TextChoiceView.swift in Sources */, - 86C40C181A8D7C5C00081FAC /* ORKAudioContentView.m in Sources */, - 511B8B27293A79C000049947 /* ORKTouchAbilityRotationStep.m in Sources */, - 86C40C8E1A8D7C5C00081FAC /* ORKActiveStepViewController.m in Sources */, - 10864CA51B27146B000F4158 /* ORKPSATKeyboardView.m in Sources */, - 511B8AB5293A76B200049947 /* ORKTouchAbilityTapStepViewController.m in Sources */, 86C40CE61A8D7C5C00081FAC /* ORKAnswerFormat.m in Sources */, - 51906C5D291D796600FF4185 /* Math.swift in Sources */, - 25ECC0961AFBD68300F3D63B /* ORKReactionTimeStep.m in Sources */, + CA6A0D7F288B51D30048C1EF /* ORKSkin.m in Sources */, BC13CE3A1B0660220044153C /* ORKNavigableOrderedTask.m in Sources */, - 5D58803A2410394F005B3D91 /* ORKSpeechInNoiseResult.m in Sources */, - 2E8070FC1FAD217500E4FC7F /* ORKSpeechRecognitionStep.m in Sources */, - BA0AA6991EAEC0B600671ACE /* ORKStroopStepViewController.m in Sources */, - B11C54A11A9EF4A700265E61 /* ORKConsentSharingStepViewController.m in Sources */, - 86C40DA81A8D7C5C00081FAC /* ORKSurveyAnswerCellForImageSelection.m in Sources */, - 86C40CCE1A8D7C5C00081FAC /* ORKImageSelectionView.m in Sources */, - 86C40D461A8D7C5C00081FAC /* ORKInstructionStepViewController.m in Sources */, - BA95AA9720ACD07A00E7FF8E /* ORKAmslerGridStep.m in Sources */, - FF919A331E81AC26005C2A1E /* ORKToneAudiometryResult.m in Sources */, - BCB6E6611B7D534C000D5B34 /* ORKLineGraphChartView.m in Sources */, - 511B8B2B293A79E500049947 /* ORKTouchAbilityRotationContentView.m in Sources */, - BA95AA9B20ACD0BD00E7FF8E /* ORKAmslerGridStepViewController.m in Sources */, - 86C40C7C1A8D7C5C00081FAC /* ORKAccelerometerRecorder.m in Sources */, - 781D54111DF886AB00223305 /* ORKTrailmakingContentView.m in Sources */, - FF919A501E81BD05005C2A1E /* ORKTrailmakingResult.m in Sources */, FF5051F11D66908C0065E677 /* ORKNavigablePageStep.m in Sources */, - 86C40C861A8D7C5C00081FAC /* ORKActiveStepTimer.m in Sources */, 242C9E061BBDFDAC0088B7F4 /* ORKVerificationStep.m in Sources */, - 511B8AC9293A777400049947 /* ORKTouchAbilityLongPressStep.m in Sources */, - BA8078E4224A8D6E0013B554 /* ORKTitleLabel.m in Sources */, - 2E8070F81FAD217500E4FC7F /* ORKSpeechRecognizer.m in Sources */, B11C549B1A9EEF8800265E61 /* ORKConsentSharingStep.m in Sources */, FF0CB38B1FD5C4C3002D838C /* ORKWebViewStepResult.m in Sources */, - 86C40DE01A8D7C5C00081FAC /* ORKVerticalContainerView.m in Sources */, - 71769E3E20884DB800A19914 /* ORKdBHLToneAudiometryStepViewController.m in Sources */, - BA5B9208204F5D9A007C2F9D /* ORKSpeechRecognitionResult.m in Sources */, - 511B8B2E293A79FF00049947 /* ORKTouchAbilityRotationTrial.m in Sources */, - BCD192EC1B81245500FCC08A /* ORKPieChartTitleTextView.m in Sources */, - 2489F7B41D65214D008DEF20 /* ORKVideoCaptureStepViewController.m in Sources */, - 861D2AF71B843968008C4CD0 /* ORKCompletionStepViewController.m in Sources */, - BCB6E65F1B7D534C000D5B34 /* ORKGraphChartView.m in Sources */, + 512741272B1557220045A449 /* ResearchKit.docc in Sources */, 24BC5CEF1BC345D900846B43 /* ORKLoginStep.m in Sources */, - 511B8A92293A757E00049947 /* ORKTouchAbilityContentView.m in Sources */, - 861D2AE91B840991008C4CD0 /* ORKTimedWalkStep.m in Sources */, - 86C40D661A8D7C5C00081FAC /* ORKQuestionStepViewController.m in Sources */, - 86C40DF41A8D7C5C00081FAC /* ORKConsentReviewController.m in Sources */, - 242C9E121BBE06DE0088B7F4 /* ORKVerificationStepView.m in Sources */, - 2489F7B01D65214D008DEF20 /* ORKVideoCaptureCameraPreviewView.m in Sources */, - 2E8070FF1FAD256A00E4FC7F /* ORKSpeechRecognitionContentView.m in Sources */, - 511B8AF6293A78BB00049947 /* ORKTouchAbilityScrollStepViewController.m in Sources */, - F7EC216724787338000C1F46 /* ORKCustomSignatureFooterView.m in Sources */, - BA0AA6951EAEC0B600671ACE /* ORKStroopContentView.m in Sources */, - 147503BA1AEE807C004B17F3 /* ORKToneAudiometryStep.m in Sources */, - 781D54131DF886AB00223305 /* ORKTrailmakingStep.m in Sources */, FA7A9D301B083DD3005A2BEA /* ORKConsentSectionFormatter.m in Sources */, - 86C40D2A1A8D7C5C00081FAC /* ORKFormTextView.m in Sources */, - 242C9E0E1BBE03F90088B7F4 /* ORKVerificationStepViewController.m in Sources */, - 51906C68291D7A5A00FF4185 /* ORKSwiftStroopStepViewController.swift in Sources */, - 86C40DD41A8D7C5C00081FAC /* ORKTextButton.m in Sources */, - 86C40C981A8D7C5C00081FAC /* ORKDataLogger.m in Sources */, - 86C40D0C1A8D7C5C00081FAC /* ORKCustomStepView.m in Sources */, - FF919A231E81A56F005C2A1E /* ORKTappingIntervalResult.m in Sources */, FF5CA61C1D2C6453001660A3 /* ORKSignatureStep.m in Sources */, - 86C40C1C1A8D7C5C00081FAC /* ORKAudioStep.m in Sources */, - 5D003DA226377E7400A6439B /* ORKAccuracyStroopResult.m in Sources */, - BCC1CD9B1B7ED64F00D86886 /* ORKYAxisView.m in Sources */, - 51906C5E291D796600FF4185 /* CircleSlider.swift in Sources */, FF919A541E81BEB5005C2A1E /* ORKCollectionResult.m in Sources */, + 51B94DC72B3254FE0039B0E7 /* CLLocationManager+ResearchKit.m in Sources */, + 51A11F192BD08D5E0060C07E /* HKSample+ORKJSONDictionary.m in Sources */, 86C40D581A8D7C5C00081FAC /* ORKOrderedTask.m in Sources */, - 5D38006C2437E53500E7D2BD /* ORKAudioStreamer.m in Sources */, - 51906C56291D791900FF4185 /* ExtensionModel.swift in Sources */, - 2E8070F91FAD217500E4FC7F /* ORKSpeechRecognitionStepViewController.m in Sources */, 86C40D601A8D7C5C00081FAC /* ORKQuestionStep.m in Sources */, - BCB6E64B1B7D531C000D5B34 /* ORKPieChartView.m in Sources */, - 10864C9F1B27146B000F4158 /* ORKPSATStep.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CA1C7A45288B0C68004DAB3A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5192BF902AE1C051006E43FB /* ORKAgePicker.m in Sources */, + CAA20D9E288B3D9C00EDC764 /* ORKVerticalContainerView.m in Sources */, + CAA20E43288B3E8200EDC764 /* ORKVideoCaptureView.m in Sources */, + CAA20D7E288B3D9100EDC764 /* ORKPicker.m in Sources */, + CAA20DDD288B3DB400EDC764 /* ORKTextButton.m in Sources */, + CAA20E47288B3E8200EDC764 /* ORKCustomStepViewController.m in Sources */, + CAA20F35288B3F6700EDC764 /* ORKVerificationStepViewController.m in Sources */, + CAA20D5F288B3D9100EDC764 /* ORKSurveyAnswerCellForPicker.m in Sources */, + CA954B6F28AD8DA50020A35C /* ORKStep+ResearchKitUI.m in Sources */, + CAA20D66288B3D9100EDC764 /* ORKScaleSlider.m in Sources */, + CAA20D52288B3D6B00EDC764 /* ORKReviewViewController.m in Sources */, + CAA20DCD288B3DB400EDC764 /* ORKScaleValueLabel.m in Sources */, + CAA20D60288B3D9100EDC764 /* ORKFormTextView.m in Sources */, + CAA20E5C288B3E9900EDC764 /* UIImage+ResearchKit.m in Sources */, + CAA20DB0288B3DB300EDC764 /* ORKSelectionSubTitleLabel.m in Sources */, + CAA20E49288B3E8200EDC764 /* ORKLearnMoreStepViewController.m in Sources */, + 51B76DFD2CB5C73C0061698A /* ResearchKitUI.docc in Sources */, + CAA20E2F288B3E8200EDC764 /* ORKWaitStepViewController.m in Sources */, + CAA20DFC288B3E8100EDC764 /* ORKFreehandDrawingView.m in Sources */, + CAA20D69288B3D9100EDC764 /* ORKMultipleValuePicker.m in Sources */, + 51AEAAB62B744BC800F4D107 /* ORKQuestionStepView.m in Sources */, + CAA20DA4288B3D9C00EDC764 /* ORKStepContentView.m in Sources */, + CAA20E40288B3E8200EDC764 /* ORKVideoInstructionStepViewController.m in Sources */, + CAA20DBF288B3DB300EDC764 /* ORKTintedImageView.m in Sources */, + CAA20E4A288B3E8200EDC764 /* ORKTableStepViewController.m in Sources */, + CAA20DA1288B3D9C00EDC764 /* ORKNavigationContainerView.m in Sources */, + CAA20D65288B3D9100EDC764 /* ORKSurveyAnswerCellForNumber.m in Sources */, + CAA20DB6288B3DB300EDC764 /* ORKTagLabel.m in Sources */, + CAA20D98288B3D9C00EDC764 /* ORKStepContainerView.m in Sources */, + CAA20E50288B3E8200EDC764 /* ORKPasscodeViewController.m in Sources */, + CAA20D87288B3D9100EDC764 /* ORKLocationSelectionView.m in Sources */, + CAA20E02288B3E8100EDC764 /* ORKPasscodeStepViewController.m in Sources */, + CAA20E0F288B3E8200EDC764 /* ORKReviewStepViewController.m in Sources */, + CAA20DA9288B3DA300EDC764 /* ORKObserver.m in Sources */, + CA6A0D82288B54650048C1EF /* ORKConsentReviewController.m in Sources */, + CAA20D8A288B3D9100EDC764 /* ORKScaleSliderView.m in Sources */, + 519CE8462C658654003BB584 /* ORKFamilyHistoryTableHeaderView.m in Sources */, + CAA20F36288B3F6700EDC764 /* ORKLoginStepViewController.m in Sources */, + 519CE8422C658654003BB584 /* ORKFamilyHistoryRelatedPersonCell.m in Sources */, + CAA20D4F288B3D5700EDC764 /* ORKRecordButton.m in Sources */, + CAA20DE0288B3DB400EDC764 /* ORKCountdownLabel.m in Sources */, + CAA20D7F288B3D9100EDC764 /* SwiftUIViewFactory.swift in Sources */, + CAA20E0D288B3E8200EDC764 /* ORKRequestPermissionsStepViewController.m in Sources */, + CAA20E4F288B3E8200EDC764 /* ORKImageCaptureCameraPreviewView.m in Sources */, + CAA20F3F288B3F6D00EDC764 /* ORKGraphChartAccessibilityElement.m in Sources */, + CAA20D56288B3D6F00EDC764 /* ORKPlaybackButton.m in Sources */, + CAA20DCC288B3DB400EDC764 /* ORKTextFieldView.m in Sources */, + CAA20DC5288B3DB400EDC764 /* ORKUnitLabel.m in Sources */, + CAA20E46288B3E8200EDC764 /* ORKWaitStepView.m in Sources */, + 5192BF9A2AE1D8A4006E43FB /* ORKChoiceViewCell+ORKTextChoice.m in Sources */, + CAA20D86288B3D9100EDC764 /* TextChoiceView.swift in Sources */, + CAA20DE9288B3DB400EDC764 /* ORKTapCountLabel.m in Sources */, + CAA20D84288B3D9100EDC764 /* ORKAnswerTextView.m in Sources */, + CAA20DE5288B3DB400EDC764 /* ORKContinueButton.m in Sources */, + CAA20D9B288B3D9C00EDC764 /* ORKLearnMoreView.m in Sources */, + CAA20DEB288B3DB400EDC764 /* ORKSubheadlineLabel.m in Sources */, + CAA20E5D288B3E9900EDC764 /* UIResponder+ResearchKit.m in Sources */, + CAA20D9F288B3D9C00EDC764 /* ORKBodyContainerView.m in Sources */, + CAA20DF8288B3E8100EDC764 /* ORKFormStepViewController.m in Sources */, + CAA20D5C288B3D9100EDC764 /* ORKWeightPicker.m in Sources */, + CAA20D73288B3D9100EDC764 /* ORKValuePicker.m in Sources */, + CAA20D5A288B3D7600EDC764 /* ORKRingView.m in Sources */, + CAA20D8C288B3D9100EDC764 /* ORKSurveyAnswerCell.m in Sources */, + CAA20D7B288B3D9100EDC764 /* ORKSurveyAnswerCellForImageSelection.m in Sources */, + CAA20DE6288B3DB400EDC764 /* ORKBorderedButton.m in Sources */, + CAA20D6F288B3D9100EDC764 /* ORKFormSectionTitleLabel.m in Sources */, + CAA20E58288B3E9200EDC764 /* ORKTaskReviewViewController.m in Sources */, + CAA20E52288B3E9200EDC764 /* ORKTaskViewController.m in Sources */, + CAA20D8D288B3D9100EDC764 /* ORKAnswerTextField.m in Sources */, + CAA20E1C288B3E8200EDC764 /* ORKInstructionStepViewController.m in Sources */, + CAA20DBC288B3DB300EDC764 /* ORKHeadlineLabel.m in Sources */, + CAA20E23288B3E8200EDC764 /* ORKPDFViewerStepView.m in Sources */, + CAA20E25288B3E8200EDC764 /* ORKSignatureView.m in Sources */, + CAA20E3A288B3E8200EDC764 /* ORKImageCaptureView.m in Sources */, + CAA20E41288B3E8200EDC764 /* ORKVideoCaptureCameraPreviewView.m in Sources */, + CAA20E00288B3E8100EDC764 /* ORKCustomStepView.m in Sources */, + CA2616D42894649A008B1425 /* ORKRequestPermissionButton.m in Sources */, + CAA20DED288B3DB400EDC764 /* ORKScaleRangeDescriptionLabel.m in Sources */, + CAA20E10288B3E8200EDC764 /* ORKCustomSignatureFooterView.m in Sources */, + CAA20D53288B3D6B00EDC764 /* ORKReviewIncompleteCell.m in Sources */, + CAA20E06288B3E8200EDC764 /* ORKPageStepViewController.m in Sources */, + CAA20DB9288B3DB300EDC764 /* ORKLabel.m in Sources */, + CAA20DD0288B3DB400EDC764 /* ORKSelectionTitleLabel.m in Sources */, + CAA20DDA288B3DB400EDC764 /* ORKTableViewCell.m in Sources */, + 519CE8442C658654003BB584 /* ORKFamilyHistoryTableFooterView.m in Sources */, + CAA20DBE288B3DB300EDC764 /* ORKFootnoteLabel.m in Sources */, + CAA20F2E288B3F5B00EDC764 /* ORKConsentReviewStepViewController.m in Sources */, + 51F716D3297E2FB600D8ACF7 /* ORKConsentLearnMoreViewController.m in Sources */, + CAA20D90288B3D9100EDC764 /* ORKTextChoiceCellGroup.m in Sources */, + 5192BF9D2AE1DE62006E43FB /* ORKColorChoiceCellGroup.m in Sources */, + CAA20D51288B3D6400EDC764 /* ORKCheckmarkView.m in Sources */, + CAA20E20288B3E8200EDC764 /* ORKSignatureStepViewController.m in Sources */, + CAA20DE2288B3DB400EDC764 /* ORKRoundTappingButton.m in Sources */, + CAA20DC9288B3DB400EDC764 /* ORKScaleRangeLabel.m in Sources */, + CAA20E5F288B3E9900EDC764 /* UIBarButtonItem+ORKBarButtonItem.m in Sources */, + CAA20D91288B3D9100EDC764 /* ORKSurveyAnswerCellForSES.m in Sources */, + CAA20F40288B3F6D00EDC764 /* UIView+ORKAccessibility.m in Sources */, + CAA20DBA288B3DB300EDC764 /* ORKSeparatorView.m in Sources */, + CAA20DF4288B3E8100EDC764 /* ORKWebViewStepViewController.m in Sources */, + CAA20E0C288B3E8200EDC764 /* ORKVideoCaptureStepViewController.m in Sources */, + CAA20DDC288B3DB400EDC764 /* ORKCaption1Label.m in Sources */, + CAA20E12288B3E8200EDC764 /* ORKPasscodeStepView.m in Sources */, + CAA20DC2288B3DB400EDC764 /* ORKIconButton.m in Sources */, + CAA20D6D288B3D9100EDC764 /* ORKSurveyCardHeaderView.m in Sources */, + 5192BF942AE1C2F8006E43FB /* ORKChoiceViewCell+ORKColorChoice.m in Sources */, + CAA20F30288B3F5B00EDC764 /* ORKConsentSharingStepViewController.m in Sources */, + CAA20DC0288B3DB300EDC764 /* ORKImageChoiceLabel.m in Sources */, + CAA20DD7288B3DB400EDC764 /* ORKChoiceViewCell.m in Sources */, + 51AEAAB42B744B5700F4D107 /* ORKQuestionStepViewController.m in Sources */, + CAA20DE4288B3DB400EDC764 /* ORKProgressView.m in Sources */, + CA2616D32894649A008B1425 /* ORKRequestPermissionView.m in Sources */, + CAA20D8F288B3D9100EDC764 /* ORKSurveyAnswerCellForLocation.m in Sources */, + CAA20E3B288B3E8200EDC764 /* ORKCompletionCheckmarkView.m in Sources */, + CAA20DB5288B3DB300EDC764 /* ORKBodyLabel.m in Sources */, + CAA20D5E288B3D9100EDC764 /* ORKHeightPicker.m in Sources */, + CAA20D9C288B3D9C00EDC764 /* ORKTableContainerView.m in Sources */, + CAA20E45288B3E8200EDC764 /* ORKPDFViewerStepViewController.m in Sources */, + CAA20DC7288B3DB400EDC764 /* ORKScaleRangeImageView.m in Sources */, + CAA20D72288B3D9100EDC764 /* ORKSurveyAnswerCellForText.m in Sources */, + CAA20DB4288B3DB300EDC764 /* ORKTitleLabel.m in Sources */, + CAA20DEE288B3DB400EDC764 /* ORKDirectionView.m in Sources */, + CAA20F3A288B3F6D00EDC764 /* ORKAccessibilityFunctions.m in Sources */, + 5192BF982AE1C5A1006E43FB /* ORKAnswerFormat+FormStepViewControllerAdditions.m in Sources */, + CAA20E01288B3E8100EDC764 /* ORKRequestPermissionsStepContainerView.m in Sources */, + 51A11F242BD1548C0060C07E /* UIImageView+ResearchKit.m in Sources */, + CAA20F38288B3F6700EDC764 /* ORKVerificationStepView.m in Sources */, + CAA20D6C288B3D9100EDC764 /* ORKSurveyAnswerCellForScale.m in Sources */, + CAA20E2A288B3E8200EDC764 /* ORKStepView.m in Sources */, + CAA20D8B288B3D9100EDC764 /* ORKFormItemCell.m in Sources */, + CAA20DCB288B3DB400EDC764 /* ORKDontKnowButton.m in Sources */, + CAA20E09288B3E8200EDC764 /* ORKStepViewController.m in Sources */, + CAA20DF5288B3E8100EDC764 /* ORKCompletionStepViewController.m in Sources */, + CAA20DA5288B3D9C00EDC764 /* ORKStepHeaderView.m in Sources */, + CAA20D75288B3D9100EDC764 /* ORKSESSelectionView.m in Sources */, + CAA20E03288B3E8100EDC764 /* ORKImageCaptureStepViewController.m in Sources */, + CAA20D77288B3D9100EDC764 /* ORKDateTimePicker.m in Sources */, + CAA20D74288B3D9100EDC764 /* ORKImageSelectionView.m in Sources */, + 519CE8382C658617003BB584 /* ORKFamilyHistoryStepViewController.m in Sources */, + CAA20E4B288B3E8200EDC764 /* ORKSecondaryTaskStepViewController.m in Sources */, + CAA20D64288B3D9100EDC764 /* ORKTimeIntervalPicker.m in Sources */, + CAA20E14288B3E8200EDC764 /* ORKInstructionStepContainerView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CAD08963289DD747007B2A98 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5EB91CC72BCE2EE600BBF23E /* ORKActiveStepView.m in Sources */, + 5EB91CC62BCE2ED500BBF23E /* ORKActiveStepQuantityView.m in Sources */, + CAD08A7F289DE714007B2A98 /* ORKStroopStep.m in Sources */, + CAD08A34289DE5DB007B2A98 /* ORKStreamingAudioRecorder.m in Sources */, + 5156C9C82B7E426900983535 /* ORKTouchAbilityArrowView.m in Sources */, + 5156CA482B7E45AE00983535 /* ORKTouchAbilityPinchGuideView.m in Sources */, + 5156CA322B7E451C00983535 /* ORKTouchAbilityScrollResult.m in Sources */, + CAD08A1A289DE51D007B2A98 /* ORKAmslerGridResult.m in Sources */, + CA2B8FAA28A175360025B773 /* ORKAudioStepViewController.m in Sources */, + CA2B8FF628A177BF0025B773 /* ORKTrailmakingStepViewController.m in Sources */, + CA2B8FF728A177BF0025B773 /* ORKTrailmakingContentView.m in Sources */, + CAD08A75289DE6F1007B2A98 /* ORKSpatialSpanMemoryResult.m in Sources */, + CA2B8FB628A175870025B773 /* ORKAudioFitnessStepViewController.m in Sources */, + CA2B8FEE28A177950025B773 /* ORKToneAudiometryContentView.m in Sources */, + CAD08A73289DE6E9007B2A98 /* ORKReactionTimeStep.m in Sources */, + CA2B8FAC28A175360025B773 /* ORKAudioContentView.m in Sources */, + CA2B8F9428A16E860025B773 /* ORKdBHLToneAudiometryStepViewController.m in Sources */, + CA2B8FAB28A175360025B773 /* ORKAudioMeteringView.m in Sources */, + 5156CA032B7E440A00983535 /* ORKTouchAbilityLongPressContentView.m in Sources */, + CAD08A15289DE503007B2A98 /* ORKdBHLToneAudiometryStep.m in Sources */, + CA2B8F8928A16D170025B773 /* ORKUSDZModelManagerResult.m in Sources */, + CAD08A91289DE784007B2A98 /* ORKToneAudiometryStep.m in Sources */, + CA2B8F8C28A16E2E0025B773 /* ORKEnvironmentSPLMeterBarView.m in Sources */, + CAD08A9D289DE7B5007B2A98 /* ORKWalkingTaskStep.m in Sources */, + CAD08A0E289DE4E2007B2A98 /* ORKAudiometry.m in Sources */, + 51A11F232BD152660060C07E /* ORKActiveStepCustomView.m in Sources */, + CA2B8FD128A176B40025B773 /* ORKRangeOfMotionStepViewController.m in Sources */, + CA2B8F8228A16CF40025B773 /* ORK3DModelStepViewController.m in Sources */, + 5156CA612B7E465500983535 /* ORKTouchAbilityRotationTrial.m in Sources */, + CA2B8FCC28A176120025B773 /* ORKPSATKeyboardView.m in Sources */, + 5192BEE72AE043A2006E43FB /* ORKTimedWalkStep.m in Sources */, + 5192BEEC2AE043D3006E43FB /* ORKTimedWalkContentView.m in Sources */, + CAD08A30289DE5CD007B2A98 /* CMAccelerometerData+ORKJSONDictionary.m in Sources */, + CAD08A32289DE5D5007B2A98 /* ORKAudioRecorder.m in Sources */, + CAD08A5F289DE693007B2A98 /* ORKAudioFitnessStep.m in Sources */, + CA2B8FFA28A177DE0025B773 /* ORKWalkingTaskStepViewController.m in Sources */, + 5156CA062B7E440A00983535 /* ORKTouchAbilityLongPressResult.m in Sources */, + CAD08A5D289DE68D007B2A98 /* ORKFitnessStep.m in Sources */, + CAD08A1C289DE527007B2A98 /* ORKTouchAnywhereStep.m in Sources */, + CAD08A11289DE4F5007B2A98 /* ORKdBHLToneAudiometryResult.m in Sources */, + CAD08A3E289DE60E007B2A98 /* ORKHealthClinicalTypeRecorder.m in Sources */, + CA2B8F8728A16D0E0025B773 /* ORKUSDZModelManager.m in Sources */, + CA2B8FBF28A175B40025B773 /* ORKHolePegTestPlaceHoleView.m in Sources */, + CAD08A6B289DE6C3007B2A98 /* ORKShoulderRangeOfMotionStep.m in Sources */, + CA2B8FF328A177AC0025B773 /* ORKTowerOfHanoiStepViewController.m in Sources */, + 5156C9F52B7E437A00983535 /* ORKTouchAbilityTapResult.m in Sources */, + CA2B902D28A18EFE0025B773 /* ORKFrontFacingCameraStepViewController.m in Sources */, + CAD08A79289DE6FC007B2A98 /* ORKSpatialSpanGame.m in Sources */, + CA2B8FF228A177AC0025B773 /* ORKTowerOfHanoiTowerView.m in Sources */, + CA2B8FD028A176AA0025B773 /* ORKShoulderRangeOfMotionStepViewController.m in Sources */, + CAD08A67289DE6B4007B2A98 /* ORKPSATResult.m in Sources */, + CA2B8F9328A16E860025B773 /* ORKdBHLToneAudiometryContentView.m in Sources */, + CAD089F7289DE499007B2A98 /* ORKEnvironmentSPLMeterResult.m in Sources */, + 5156CA342B7E451C00983535 /* ORKTouchAbilityScrollContentView.m in Sources */, + 5156CA622B7E465500983535 /* ORKTouchAbilityRotationStep.m in Sources */, + 51F716C3297E288A00D8ACF7 /* ORKNormalizedReactionTimeContentView.m in Sources */, + CAD08A46289DE628007B2A98 /* CLLocation+ORKJSONDictionary.m in Sources */, + CA2B8FEF28A177950025B773 /* ORKToneAudiometryStepViewController.m in Sources */, + 5156CA5B2B7E465500983535 /* ORKTouchAbilityRotationContentView.m in Sources */, + CA2B8F9A28A16EF90025B773 /* ORKAmslerGridContentView.m in Sources */, + CAD08A61289DE69E007B2A98 /* ORKHolePegTestPlaceStep.m in Sources */, + CA2B8FD428A176D70025B773 /* ORKReactionTimeViewController.m in Sources */, + 5156CA302B7E451C00983535 /* ORKTouchAbilityScrollStepViewController.m in Sources */, + CAD08A95289DE793007B2A98 /* ORKTowerOfHanoiTower.m in Sources */, + CA2B8F8E28A16E2E0025B773 /* ORKEnvironmentSPLMeterStepViewController.m in Sources */, + CAD089BB289DE34C007B2A98 /* ORKSpeechInNoiseStep.m in Sources */, + 5156CA4E2B7E45AE00983535 /* ORKTouchAbilityPinchStepViewController.m in Sources */, + CA2B8FD528A176D70025B773 /* ORKReactionTimeContentView.m in Sources */, + 5156CA5D2B7E465500983535 /* ORKTouchAbilityRotationResult.m in Sources */, + CAD089F3289DE48F007B2A98 /* ORKEnvironmentSPLMeterStep.m in Sources */, + CAD08A26289DE58E007B2A98 /* ORKCountdownStep.m in Sources */, + 5156CA072B7E440A00983535 /* ORKTouchAbilityLongPressStepViewController.m in Sources */, + CA2B8F8528A16D030025B773 /* ORKUSDZModelManagerScene.m in Sources */, + CA2B8FBC28A175B40025B773 /* ORKHolePegTestPlacePegView.m in Sources */, + CAD08A36289DE5E1007B2A98 /* ORKAudioStreamer.m in Sources */, + CAD08A48289DE630007B2A98 /* ORKPedometerRecorder.m in Sources */, + CA2B8FE028A1772D0025B773 /* ORKStroopContentView.m in Sources */, + CAD08A40289DE615007B2A98 /* ORKHealthQuantityTypeRecorder.m in Sources */, + 5156CA4B2B7E45AE00983535 /* ORKTouchAbilityPinchResult.m in Sources */, + CAD08A8F289DE77B007B2A98 /* ORKToneAudiometryResult.m in Sources */, + CA2B8FDA28A177070025B773 /* ORKSpatialSpanTargetView.m in Sources */, + CA2B8FB228A175660025B773 /* ORKSpeechRecognitionStepViewController.m in Sources */, + CAD08A9F289DE7BD007B2A98 /* ORKTimedWalkResult.m in Sources */, + CA2B8FA928A175360025B773 /* ORKAudioGraphView.m in Sources */, + CAD08A63289DE6A6007B2A98 /* ORKHolePegTestRemoveStep.m in Sources */, + 5156CA4D2B7E45AE00983535 /* ORKTouchAbilityPinchStep.m in Sources */, + 51F716C6297E288A00D8ACF7 /* ORKNormalizedReactionTimeResult.m in Sources */, + CAD08A4C289DE63F007B2A98 /* ORKTouchRecorder.m in Sources */, + CAD08A18289DE516007B2A98 /* ORKAmslerGridStep.m in Sources */, + 5156CA2E2B7E451C00983535 /* ORKTouchAbilityScrollStep.m in Sources */, + CAD08A4E289DE644007B2A98 /* UITouch+ORKJSONDictionary.m in Sources */, + 5156C9D82B7E42C200983535 /* ORKTouchAbilityGestureRecoginzerEvent.m in Sources */, + CAD08A71289DE6E2007B2A98 /* ORKReactionTimeResult.m in Sources */, + 5156C9E02B7E42C200983535 /* ORKTouchAbilityTrial.m in Sources */, + CA954B6E28AD8A8C0020A35C /* ORKStep+ResearchKitActiveTask.m in Sources */, + CA2B8FC628A175E80025B773 /* ORKHolePegTestRemovePegView.m in Sources */, + CA2B8F9228A16E860025B773 /* ORKdBHLToneAudiometryAudioGenerator.m in Sources */, + CA2B8F8328A16CF40025B773 /* ORK3DModelStepContentView.m in Sources */, + CA2B8FE328A1772D0025B773 /* ORKAccuracyStroopStepViewController.m in Sources */, + 5156C9F12B7E437A00983535 /* ORKTouchAbilityTapContentView.m in Sources */, + CA2B902F28A18F860025B773 /* ORKActiveStepTimerView.m in Sources */, + CA2B8FA628A16F930025B773 /* ORKCountdownStepViewController.m in Sources */, + CAD08A6D289DE6D2007B2A98 /* ORKRangeOfMotionResult.m in Sources */, + CA2B8FEA28A1776B0025B773 /* ORKTappingIntervalStepViewController.m in Sources */, + CA2B8F6228A16B050025B773 /* ORKSpeechInNoiseContentView.m in Sources */, + CA2B902E28A18F000025B773 /* ORKFrontFacingCameraStepContentView.m in Sources */, + 5156CA042B7E440A00983535 /* ORKTouchAbilityLongPressStep.m in Sources */, + CA2B8FCA28A176120025B773 /* ORKPSATStepViewController.m in Sources */, + CAD08A3A289DE5F3007B2A98 /* CMDeviceMotion+ORKJSONDictionary.m in Sources */, + CA2B8F9E28A16F270025B773 /* ORKTouchAnywhereStepViewController.m in Sources */, + 5156C9DE2B7E42C200983535 /* ORKTouchAbilityTrack.m in Sources */, + CA2B8FDB28A177070025B773 /* ORKSpatialSpanMemoryStepViewController.m in Sources */, + CAD08A5B289DE683007B2A98 /* ORKSpeechRecognitionResult.m in Sources */, + 5156CA1F2B7E448600983535 /* ORKTouchAbilitySwipeTrial.m in Sources */, + 5156C9C62B7E426900983535 /* ORKTouchAbilityContentView.m in Sources */, + CAD08A89289DE766007B2A98 /* ORKTappingIntervalResult.m in Sources */, + CAD08A77289DE6F7007B2A98 /* ORKSpatialSpanMemoryStep.m in Sources */, + 5156CA1D2B7E448600983535 /* ORKTouchAbilitySwipeStepViewController.m in Sources */, + CAD08A8D289DE775007B2A98 /* ORKAudioGenerator.m in Sources */, + CA2B902728A18EA60025B773 /* ORKActiveStepViewController.m in Sources */, + CA2B8FC428A175E80025B773 /* ORKHolePegTestRemoveContentView.m in Sources */, + CAD08A58289DE678007B2A98 /* ORKSpeechRecognizer.m in Sources */, + CAD08A13289DE4FC007B2A98 /* ORKdBHLToneAudiometryOnboardingStep.m in Sources */, + 5156C9DD2B7E42C200983535 /* ORKTouchAbilityTouchTracker.m in Sources */, + CAD08A2E289DE5C7007B2A98 /* ORKAccelerometerRecorder.m in Sources */, + 51F716C7297E288A00D8ACF7 /* ORKNormalizedReactionTimeViewController.m in Sources */, + CA2B8F9B28A16EF90025B773 /* ORKAmslerGridStepViewController.m in Sources */, + 5156C9F32B7E437A00983535 /* ORKTouchAbilityTapTrial.m in Sources */, + CAD08A99289DE7A4007B2A98 /* ORKTrailmakingResult.m in Sources */, + 51B76DFB2CB5B5A30061698A /* ResearchKitActiveTask.docc in Sources */, + CA2B8F8D28A16E2E0025B773 /* ORKEnvironmentSPLMeterContentView.m in Sources */, + 5156C9F62B7E437A00983535 /* ORKTouchAbilityTapStep.m in Sources */, + CA2B8FD628A176D70025B773 /* ORKReactionTimeStimulusView.m in Sources */, + CA2B8F9528A16E860025B773 /* ORKdBHLToneAudiometryOnboardingStepViewController.m in Sources */, + CAD08A23289DE561007B2A98 /* ORKVoiceEngine.m in Sources */, + CA2B8FB828A175870025B773 /* ORKFitnessContentView.m in Sources */, + 51F716C1297E288A00D8ACF7 /* ORKNormalizedReactionTimeStimulusView.m in Sources */, + 5156C9EE2B7E437A00983535 /* ORKTouchAbilityTapStepViewController.m in Sources */, + CAD089BD289DE356007B2A98 /* ORKSpeechInNoiseResult.m in Sources */, + CA2B8FE128A1772D0025B773 /* ORKStroopStepViewController.m in Sources */, + CAD08A7D289DE70D007B2A98 /* ORKStroopResult.m in Sources */, + CAD08A83289DE721007B2A98 /* ORKAccuracyStroopResult.m in Sources */, + CA2B8FEB28A1776B0025B773 /* ORKTappingContentView.m in Sources */, + 5156CA1B2B7E448600983535 /* ORKTouchAbilitySwipeContentView.m in Sources */, + 5156CA1C2B7E448600983535 /* ORKTouchAbilitySwipeResult.m in Sources */, + CAD08A38289DE5EC007B2A98 /* ORKDeviceMotionRecorder.m in Sources */, + 5156CA442B7E45AE00983535 /* ORKTouchAbilityPinchTrial.m in Sources */, + 5156C9DC2B7E42C200983535 /* ORKTouchAbilityTouch.m in Sources */, + CA2B8FE228A1772D0025B773 /* UIColor+String.m in Sources */, + CAD08A65289DE6AC007B2A98 /* ORKHolePegTestResult.m in Sources */, + CA2B8FCB28A176120025B773 /* ORKPSATContentView.m in Sources */, + CAD08A0C289DE4DB007B2A98 /* ORKAudiometryStimulus.m in Sources */, + CA2B8FB328A175660025B773 /* ORKSpeechRecognitionContentView.m in Sources */, + CAD08A8B289DE76D007B2A98 /* ORKTappingIntervalStep.m in Sources */, + CAD08A9B289DE7AB007B2A98 /* ORKTrailmakingStep.m in Sources */, + 5156CA602B7E465500983535 /* ORKTouchAbilityRotationStepViewController.m in Sources */, + CAD08A54289DE669007B2A98 /* ORKAudioLevelNavigationRule.m in Sources */, + 5156CA352B7E451C00983535 /* ORKTouchAbilityScrollTrial.m in Sources */, + 51F716C8297E288A00D8ACF7 /* ORKNormalizedReactionTimeStep.m in Sources */, + CAD089F1289DE486007B2A98 /* ORK3DModelStep.m in Sources */, + CA2B901628A1802C0025B773 /* ORKOrderedTask+ORKPredefinedActiveTask.m in Sources */, + CA2B8FBE28A175B40025B773 /* ORKHolePegTestPlaceContentView.m in Sources */, + CA2B8FBD28A175B40025B773 /* ORKHolePegTestPlaceStepViewController.m in Sources */, + CAD08A21289DE559007B2A98 /* ORKActiveStepTimer.m in Sources */, + CA2B8F6128A16B050025B773 /* ORKSpeechInNoiseStepViewController.m in Sources */, + 5192BEEF2AE043D3006E43FB /* ORKTimedWalkStepViewController.m in Sources */, + 5156CA462B7E45AE00983535 /* ORKTouchAbilityPinchContentView.m in Sources */, + CAD08A93289DE78D007B2A98 /* ORKTowerOfHanoiStep.m in Sources */, + CA2B8FDC28A177070025B773 /* ORKSpatialSpanMemoryContentView.m in Sources */, + CAD08A44289DE623007B2A98 /* ORKLocationRecorder.m in Sources */, + CAD08A6F289DE6D9007B2A98 /* ORKRangeOfMotionStep.m in Sources */, + CAD08A52289DE662007B2A98 /* ORKAudioStep.m in Sources */, + 5156CA1A2B7E448600983535 /* ORKTouchAbilitySwipeStep.m in Sources */, + CA2B8FC528A175E80025B773 /* ORKHolePegTestRemoveStepViewController.m in Sources */, + CAD08A4A289DE637007B2A98 /* CMPedometerData+ORKJSONDictionary.m in Sources */, + 5156CA022B7E440A00983535 /* ORKTouchAbilityLongPressTrial.m in Sources */, + CAD08A56289DE672007B2A98 /* ORKSpeechRecognitionStep.m in Sources */, + CAD08A7B289DE703007B2A98 /* ORKSpatialSpanGameState.m in Sources */, + CAD08A69289DE6BA007B2A98 /* ORKPSATStep.m in Sources */, + CAD08A81289DE71A007B2A98 /* ORKAccuracyStroopStep.m in Sources */, + CA2B8FB728A175870025B773 /* ORKFitnessStepViewController.m in Sources */, + CAD08A97289DE79A007B2A98 /* ORKTowerOfHanoiResult.m in Sources */, + CAD089EF289DE462007B2A98 /* ORK3DModelManager.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + 0BC672E02BD9C541005798AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B183A4731A8535D100C76870 /* ResearchKit */; + targetProxy = 0BC672DF2BD9C541005798AC /* PBXContainerItemProxy */; + }; + 0BC672E22BD9C541005798AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CAD08966289DD747007B2A98 /* ResearchKitActiveTask */; + targetProxy = 0BC672E12BD9C541005798AC /* PBXContainerItemProxy */; + }; + 0BC672E62BD9C541005798AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CA1C7A40288B0C68004DAB3A /* ResearchKitUI */; + targetProxy = 0BC672E52BD9C541005798AC /* PBXContainerItemProxy */; + }; 86CC8EA21AC09332001CCD89 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B183A4731A8535D100C76870 /* ResearchKit */; targetProxy = 86CC8EA11AC09332001CCD89 /* PBXContainerItemProxy */; }; - B11DF3B11AA10795009E76D2 /* PBXTargetDependency */ = { + CA1C7A5F288B0CA2004DAB3A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B183A4731A8535D100C76870 /* ResearchKit */; + targetProxy = CA1C7A5E288B0CA2004DAB3A /* PBXContainerItemProxy */; + }; + CA4B673528A1CD5700FAE01F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CAD08966289DD747007B2A98 /* ResearchKitActiveTask */; + targetProxy = CA4B673428A1CD5700FAE01F /* PBXContainerItemProxy */; + }; + CAF8D2BA288F2DCB001E6992 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CA1C7A40288B0C68004DAB3A /* ResearchKitUI */; + targetProxy = CAF8D2B9288F2DCB001E6992 /* PBXContainerItemProxy */; + }; + CAFAA6C728A19E2F0010BBDE /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B183A4731A8535D100C76870 /* ResearchKit */; - targetProxy = B11DF3B01AA10795009E76D2 /* PBXContainerItemProxy */; + targetProxy = CAFAA6C628A19E2F0010BBDE /* PBXContainerItemProxy */; + }; + CAFAA6C928A19E330010BBDE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = CA1C7A40288B0C68004DAB3A /* ResearchKitUI */; + targetProxy = CAFAA6C828A19E330010BBDE /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 0B53DA622BD0595100227126 /* ResearchKitUI.strings */ = { + isa = PBXVariantGroup; + children = ( + 0B53DA632BD0595100227126 /* en */, + ); + name = ResearchKitUI.strings; + sourceTree = ""; + }; 714080D9235FD14700281E04 /* ResearchKit.stringsdict */ = { isa = PBXVariantGroup; children = ( @@ -5509,245 +6017,295 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 050968E6236B71FF006F734C /* Debug */ = { + 0BC672DA2BD9C52D005798AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 0BC672DC2BD9C52D005798AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 3FFF18691829DB1E00167070 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5D000ED12620F27100E5442A /* Project-Debug.xcconfig */; buildSettings = { + ENABLE_MODULE_VERIFIER = YES; + ENABLE_TESTING_SEARCH_PATHS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - PRODUCT_NAME = ""; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; }; name = Debug; }; 3FFF186A1829DB1E00167070 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5D000ECC2620F27100E5442A /* Project-Release.xcconfig */; buildSettings = { + ENABLE_MODULE_VERIFIER = YES; + ENABLE_TESTING_SEARCH_PATHS = YES; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - PRODUCT_NAME = ""; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_VERSION = 5.0; }; name = Release; }; 86CC8EA41AC09332001CCD89 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5D000ED72620F27100E5442A /* ResearchKitTests-Debug.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = ResearchKitTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; - LD_RUNPATH_SEARCH_PATHS = ( + "FRAMEWORK_SEARCH_PATHS[arch=*]" = "$(PLATFORM_DIR)/Developer/Library/Frameworks"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", ); - ONLY_ACTIVE_ARCH = YES; - PRODUCT_BUNDLE_IDENTIFIER = "org.researchkit.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "ResearchKitTests/ResearchKitTests-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = 1; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 86CC8EA51AC09332001CCD89 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 5D000ED52620F27100E5442A /* ResearchKitTests-Release.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = ResearchKitTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - ONLY_ACTIVE_ARCH = NO; - PRODUCT_BUNDLE_IDENTIFIER = "org.researchkit.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SDKROOT = iphoneos; - SWIFT_OBJC_BRIDGING_HEADER = "ResearchKitTests/ResearchKitTests-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = 1; - VALIDATE_PRODUCT = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = YES; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; B183A5931A8535D100C76870 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5D000EC22620F27100E5442A /* ResearchKit-Debug.xcconfig */; + buildSettings = { + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "$(ORK_GCC_PREPROCESSOR_DEFINITIONS)", + ); + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MODULEMAP_PRIVATE_FILE = ResearchKit/ResearchKit_Private.modulemap; + "OTHER_SWIFT_FLAGS[arch=*]" = "$(inherited) -runtime-compatibility-version none"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B183A5941A8535D100C76870 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5D000EC62620F27100E5442A /* ResearchKit-Release.xcconfig */; + buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MODULEMAP_PRIVATE_FILE = ResearchKit/ResearchKit_Private.modulemap; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + CA1C7A55288B0C68004DAB3A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CA481E8228CBD79B001C4D49 /* ResearchKitUI-iOS-Debug.xcconfig */; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + CURRENT_PROJECT_VERSION = ""; + ENABLE_MODULE_VERIFIER = YES; + ENABLE_TESTING_SEARCH_PATHS = YES; + MODULEMAP_PRIVATE_FILE = ResearchKitUI/ResearchKitUI_Private.modulemap; + PRODUCT_NAME = ResearchKitUI; + SUPPORTS_MACCATALYST = NO; + SWIFT_OBJC_BRIDGING_HEADER = ""; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + CA1C7A57288B0C68004DAB3A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CA481E8428CBD835001C4D49 /* ResearchKitUI-iOS-Release.xcconfig */; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; + CURRENT_PROJECT_VERSION = ""; + ENABLE_MODULE_VERIFIER = YES; + ENABLE_TESTING_SEARCH_PATHS = YES; + MODULEMAP_PRIVATE_FILE = ResearchKitUI/ResearchKitUI_Private.modulemap; + PRODUCT_NAME = ResearchKitUI; + SUPPORTS_MACCATALYST = NO; + SWIFT_OBJC_BRIDGING_HEADER = ""; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + CAD0896B289DD747007B2A98 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CA481E8D28CBD9F1001C4D49 /* ResearchKitActiveTask-Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = NO; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = NO; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_ENABLE_OBJC_WEAK = NO; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = NO; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = NO; + CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "$(inherited)", - "$(ORK_GCC_PREPROCESSOR_DEFINITIONS)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_SHADOW = YES; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_LABEL = YES; - INFOPLIST_FILE = ResearchKit/Info.plist; - INFOPLIST_OUTPUT_FORMAT = binary; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = NO; + INFOPLIST_FILE = ResearchKitActiveTask/Info.plist; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 researchkit.org. All rights reserved."; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.1; - MODULEMAP_FILE = ResearchKit/ResearchKit.modulemap; - MODULEMAP_PRIVATE_FILE = ""; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - PLIST_FILE_OUTPUT_FORMAT = binary; - PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; - PRODUCT_BUNDLE_IDENTIFIER = "org.researchkit.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = ResearchKit; - RUN_CLANG_STATIC_ANALYZER = YES; + MARKETING_VERSION = 1.0; + MODULEMAP_PRIVATE_FILE = ResearchKitActiveTask/ResearchKitActiveTask_Private.modulemap; + "OTHER_SWIFT_FLAGS[arch=*]" = ""; + PRODUCT_BUNDLE_IDENTIFIER = org.researchkit.ResearchKitActiveTask; SKIP_INSTALL = YES; - STRINGS_FILE_OUTPUT_ENCODING = binary; SUPPORTS_MACCATALYST = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; - SWIFT_VERSION = 5.0; - SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/ResearchKit/PrivateHeaders"; - SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/ResearchKit/PrivateHeaders"; - TARGETED_DEVICE_FAMILY = 1; - WARNING_CFLAGS = ( - "-Wunreachable-code", - "-Wextra", - "-Wno-unused-parameter", - "-Wno-sign-compare", - ); + SWIFT_EMIT_LOC_STRINGS = NO; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = ""; + VERSION_INFO_PREFIX = ""; }; name = Debug; }; - B183A5941A8535D100C76870 /* Release */ = { + CAD0896D289DD747007B2A98 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 511A78992950D7030011D85D /* ResearchKit-Release.xcconfig */; + baseConfigurationReference = CA481E8C28CBD9F1001C4D49 /* ResearchKitActiveTask-Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - BUILD_LIBRARY_FOR_DISTRIBUTION = YES; - CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; - CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; - CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; + CLANG_ANALYZER_NONNULL = NO; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = NO; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_STATIC_ANALYZER_MODE = deep; - CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES; - CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; - CLANG_WARN_ASSIGN_ENUM = YES; + CLANG_ENABLE_OBJC_WEAK = NO; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = NO; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = NO; + CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - DEAD_CODE_STRIPPING = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = NO; + COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREPROCESSOR_DEFINITIONS = GLES_SILENCE_DEPRECATION; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; + GCC_NO_COMMON_BLOCKS = YES; GCC_SYMBOLS_PRIVATE_EXTERN = YES; - GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_SHADOW = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_LABEL = YES; - INFOPLIST_FILE = ResearchKit/Info.plist; - INFOPLIST_OUTPUT_FORMAT = binary; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = NO; + INFOPLIST_FILE = ResearchKitActiveTask/Info.plist; + INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2022 researchkit.org. All rights reserved."; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 2.1.1; - MODULEMAP_FILE = ResearchKit/ResearchKit.modulemap; - MODULEMAP_PRIVATE_FILE = ""; - MTL_ENABLE_DEBUG_INFO = NO; - PLIST_FILE_OUTPUT_FORMAT = binary; - PRIVATE_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/PrivateHeaders"; - PRODUCT_BUNDLE_IDENTIFIER = "org.researchkit.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = ResearchKit; - PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; + MARKETING_VERSION = 1.0; + MODULEMAP_PRIVATE_FILE = ResearchKitActiveTask/ResearchKitActiveTask_Private.modulemap; + PRODUCT_BUNDLE_IDENTIFIER = org.researchkit.ResearchKitActiveTask; SKIP_INSTALL = YES; - STRINGS_FILE_OUTPUT_ENCODING = binary; SUPPORTS_MACCATALYST = NO; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; - SWIFT_VERSION = 5.0; - SYSTEM_FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/ResearchKit/PrivateHeaders"; - SYSTEM_HEADER_SEARCH_PATHS = "$(SRCROOT)/ResearchKit/PrivateHeaders"; - TARGETED_DEVICE_FAMILY = 1; - WARNING_CFLAGS = ( - "-Wunreachable-code", - "-Wextra", - "-Wno-unused-parameter", - "-Wno-sign-compare", - ); - }; - name = Release; - }; - B18FF3A51A9FE25700C0C3B0 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - }; - name = Debug; - }; - B18FF3A61A9FE25700C0C3B0 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { + SWIFT_EMIT_LOC_STRINGS = NO; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = NO; + VERSIONING_SYSTEM = ""; + VERSION_INFO_PREFIX = ""; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 0BC672D92BD9C52D005798AC /* Build configuration list for PBXAggregateTarget "ResearchKitAllTargets" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0BC672DA2BD9C52D005798AC /* Debug */, + 0BC672DC2BD9C52D005798AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; 3FFF18381829DB1D00167070 /* Build configuration list for PBXProject "ResearchKit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 050968E6236B71FF006F734C /* Debug */, + 3FFF18691829DB1E00167070 /* Debug */, 3FFF186A1829DB1E00167070 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; 86CC8EA31AC09332001CCD89 /* Build configuration list for PBXNativeTarget "ResearchKitTests" */ = { isa = XCConfigurationList; @@ -5756,7 +6314,7 @@ 86CC8EA51AC09332001CCD89 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; B183A5921A8535D100C76870 /* Build configuration list for PBXNativeTarget "ResearchKit" */ = { isa = XCConfigurationList; @@ -5765,16 +6323,25 @@ B183A5941A8535D100C76870 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; }; - B18FF3A71A9FE25700C0C3B0 /* Build configuration list for PBXAggregateTarget "docs" */ = { + CA1C7A54288B0C68004DAB3A /* Build configuration list for PBXNativeTarget "ResearchKitUI" */ = { isa = XCConfigurationList; buildConfigurations = ( - B18FF3A51A9FE25700C0C3B0 /* Debug */, - B18FF3A61A9FE25700C0C3B0 /* Release */, + CA1C7A55288B0C68004DAB3A /* Debug */, + CA1C7A57288B0C68004DAB3A /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = Release; + }; + CAD08970289DD747007B2A98 /* Build configuration list for PBXNativeTarget "ResearchKitActiveTask" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + CAD0896B289DD747007B2A98 /* Debug */, + CAD0896D289DD747007B2A98 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKit.xcscheme b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKit.xcscheme index 973fb30189..ee16d449ab 100644 --- a/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKit.xcscheme +++ b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKit.xcscheme @@ -1,10 +1,10 @@ + buildImplicitDependencies = "YES"> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitAllTargets.xcscheme b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitAllTargets.xcscheme new file mode 100644 index 0000000000..bfad3c4fd5 --- /dev/null +++ b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitAllTargets.xcscheme @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitTests.xcscheme b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitTests.xcscheme index 0efec38ff0..f267b0c018 100644 --- a/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitTests.xcscheme +++ b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitTests.xcscheme @@ -1,6 +1,6 @@ + + + + diff --git a/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitUI.xcscheme b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitUI.xcscheme new file mode 100644 index 0000000000..2576e63404 --- /dev/null +++ b/ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKitUI.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ResearchKit.xcodeproj/xcshareddata/xcschemes/docs.xcscheme b/ResearchKit.xcodeproj/xcshareddata/xcschemes/docs.xcscheme deleted file mode 100644 index d4b6af9b40..0000000000 --- a/ResearchKit.xcodeproj/xcshareddata/xcschemes/docs.xcscheme +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ResearchKit.xctestplan b/ResearchKit.xctestplan index fc1964fbe6..10504d9f1c 100644 --- a/ResearchKit.xctestplan +++ b/ResearchKit.xctestplan @@ -13,6 +13,9 @@ }, "testTargets" : [ { + "skippedTests" : [ + "ORKDataCollectionTests" + ], "target" : { "containerPath" : "container:ResearchKit.xcodeproj", "identifier" : "86CC8E991AC09332001CCD89", diff --git a/ResearchKit/ActiveTasks/CircleSlider.swift b/ResearchKit/ActiveTasks/CircleSlider.swift deleted file mode 100644 index 0f75ee604d..0000000000 --- a/ResearchKit/ActiveTasks/CircleSlider.swift +++ /dev/null @@ -1,283 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -public enum CircleSliderOption { - case startAngle(Double) - case barColor(UIColor) - case trackingColor(UIColor) - case thumbColor(UIColor) - case thumbImage(UIImage) - case barWidth(CGFloat) - case thumbWidth(CGFloat) - case maxValue(Float) - case minValue(Float) - case sliderEnabled(Bool) - case viewInset(CGFloat) - case minMaxSwitchTreshold(Float) -} - -open class CircleSlider: UISlider { - - private let minThumbTouchAreaWidth: CGFloat = 44 - private var latestDegree: Double = 0 - private var startValue: Float = 0 - open var sliderValue: Float { - get { - return startValue - } - set { - var value = newValue - let significantChange = (maxValue - minValue) * (1.0 - minMaxSwitchTreshold) - let isSignificantChangeOccured = abs(newValue - startValue) > significantChange - - if isSignificantChangeOccured { - if startValue < newValue { - value = minValue - } else { - value = maxValue - } - } else { - value = newValue - } - - startValue = value - sendActions(for: .valueChanged) - var degree = Math.degreeFromValue(startAngle, value: sliderValue, maxValue: maxValue, minValue: minValue) - - if startValue == maxValue { - degree -= degree / (360 * 100) - } - - layout(degree) - } - } - private var trackLayer: TrackLayer! { - didSet { - layer.addSublayer(trackLayer) - } - } - private var thumbView: UIView! { - didSet { - if sliderEnabled { - thumbView.backgroundColor = thumbColor - thumbView.center = thumbCenter(startAngle) - thumbView.layer.cornerRadius = thumbView!.bounds.size.width * 0.5 - addSubview(thumbView) - if let thumbImage = thumbImage { - let thumbImageView = UIImageView(frame: thumbView.bounds) - thumbImageView.image = thumbImage - thumbView.addSubview(thumbImageView) - thumbView.backgroundColor = UIColor.clear - } - } else { - thumbView.isHidden = true - } - } - } - - private var startAngle: Double = -90 - private var barColor = UIColor.lightGray - private var trackingColor = UIColor.blue - private var thumbColor = UIColor.black - private var barWidth: CGFloat = 20 - private var maxValue: Float = 101 - private var minValue: Float = 0 - private var sliderEnabled = true - private var viewInset: CGFloat = 20 - private var minMaxSwitchTreshold: Float = 0.0 - private var thumbImage: UIImage? - private var _thumbWidth: CGFloat? - private var thumbWidth: CGFloat { - get { - if let retValue = _thumbWidth { - return retValue - } - - return (thumbImage?.size.height)! - } - set { - _thumbWidth = newValue - } - } - - override open func awakeFromNib() { - super.awakeFromNib() - backgroundColor = UIColor.clear - } - - public init(frame: CGRect, options: [CircleSliderOption]?) { - super.init(frame: frame) - if let options = options { - build(options) - - let tapGesture = UITapGestureRecognizer(target: self, action: #selector(tapHandle(sender:))) - tapGesture.numberOfTouchesRequired = 1 - let panGesture = UIPanGestureRecognizer(target: self, action: #selector(tapHandle(sender:))) - addGestureRecognizer(tapGesture) - addGestureRecognizer(panGesture) - } - } - - required public init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override open func layoutSublayers(of layer: CALayer) { - if trackLayer == nil { - trackLayer = TrackLayer(bounds: bounds.insetBy(dx: viewInset, dy: viewInset), setting: createLayerSetting()) - } - if thumbView == nil { - if let image = thumbImage { - thumbView = UIView(frame: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) - } else { - thumbView = UIView(frame: CGRect(x: 0, y: 0, width: thumbWidth, height: thumbWidth)) - } - } - } - - override open func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { - if !sliderEnabled { - return nil - } - - return self - } - - open override func point(inside point: CGPoint, with event: UIEvent?) -> Bool { - var bounds = self.bounds - bounds = bounds.insetBy(dx: 100.0, dy: 100.0) - return bounds.contains(point) - } - - override open func continueTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { - let degree = Math.pointPairToBearingDegrees(center, endPoint: touch.location(in: self)) - latestDegree = degree - layout(degree) - let value = Float(Math.adjustValue(startAngle, degree: degree, maxValue: maxValue, minValue: minValue)) - thumbView.transform = CGAffineTransform(rotationAngle: CGFloat(Math.degreesToRadians(degree))) - sliderValue = value - return true - } - - @objc - func tapHandle(sender: UIGestureRecognizer) { - if isUserInteractionEnabled { - let degree = Math.pointPairToBearingDegrees(center, endPoint: sender.location(in: self)) - latestDegree = degree - layout(degree) - let value = Float(Math.adjustValue(startAngle, degree: degree, maxValue: maxValue, minValue: minValue)) - thumbView.transform = CGAffineTransform(rotationAngle: CGFloat(Math.degreesToRadians(degree))) - sliderValue = value - } - } - - open func changeOptions(_ options: [CircleSliderOption]) { - build(options) - redraw() - } - - private func redraw() { - - if trackLayer != nil { - trackLayer.removeFromSuperlayer() - } - trackLayer = TrackLayer(bounds: bounds.insetBy(dx: viewInset, dy: viewInset), setting: createLayerSetting()) - if thumbView != nil { - thumbView.removeFromSuperview() - } - - if let image = thumbImage { - thumbView = UIView(frame: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) - } else { - thumbView = UIView(frame: CGRect(x: 0, y: 0, width: thumbWidth, height: thumbWidth)) - } - - self.layout(self.latestDegree) - } - - func build(_ options: [CircleSliderOption]) { - for option in options { - switch option { - case let .startAngle(value): - startAngle = value - latestDegree = startAngle - case let .barColor(value): - barColor = value - case let .trackingColor(value): - trackingColor = value - case let .thumbColor(value): - thumbColor = value - case let .barWidth(value): - barWidth = value - case let .thumbWidth(value): - thumbWidth = value - case let .maxValue(value): - maxValue = value - maxValue += 1 - case let .minValue(value): - minValue = value - startValue = minValue - case let .sliderEnabled(value): - sliderEnabled = value - case let .viewInset(value): - viewInset = value - case let .minMaxSwitchTreshold(value): - minMaxSwitchTreshold = value - case let .thumbImage(value): - thumbImage = value - } - } - } - - private func layout(_ degree: Double) { - if let trackLayer = trackLayer, let thumbView = self.thumbView { - trackLayer.degree = degree - thumbView.center = thumbCenter(degree) - thumbView.transform = CGAffineTransform(rotationAngle: CGFloat(Math.degreesToRadians(degree))) - trackLayer.setNeedsDisplay() - } - } - - private func createLayerSetting() -> TrackLayer.Setting { - var setting = TrackLayer.Setting() - setting.startAngle = startAngle - setting.barColor = barColor - setting.trackingColor = trackingColor - setting.barWidth = barWidth - return setting - } - - private func thumbCenter(_ degree: Double) -> CGPoint { - let radius = (bounds.insetBy(dx: viewInset, dy: viewInset).width * 0.5) - (barWidth * 0.5) + 5 - return Math.pointFromAngle(frame, angle: degree, radius: Double(radius)) - } -} - diff --git a/ResearchKit/ActiveTasks/ExtensionModel.swift b/ResearchKit/ActiveTasks/ExtensionModel.swift deleted file mode 100644 index bd2655a303..0000000000 --- a/ResearchKit/ActiveTasks/ExtensionModel.swift +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -public enum DeviceType: String { - - case iPhone5 = "iPhone5" - case iPhone5C = "iPhone5C" - case iPhone5S = "iPhone5S" - case iPhone6Plus = "iPhone6Plus" - case iPhone6 = "iPhone6" - case iPhone6S = "iPhone6S" - case iPhone6SPlus = "iPhone6SPlus" - case iPhone7 = "iPhone7" - case iPhone7Plus = "iPhone7Plus" - case iPhoneSE = "iPhoneSE" - - case IPodTouch5 = "iPod5,1" - case IPodTouch6 = "iPod7,1" -} - -func parseDeviceType(_ identifier: String) -> DeviceType { - - switch identifier { - case "iPhone5,1", "iPhone5,2": return .iPhone5 - case "iPhone5,3", "iPhone5,4": return .iPhone5C - case "iPhone6,1", "iPhone6,2": return .iPhone5S - case "iPhone7,1": return .iPhone6Plus - case "iPhone7,2": return .iPhone6 - case "iPhone8,2": return .iPhone6SPlus - case "iPhone8,1": return .iPhone6S - case "iPhone9,1", "iPhone9,3": return .iPhone7 - case "iPhone9,2", "iPhone9,4": return .iPhone7Plus - case "iPhone8,4": return .iPhoneSE - - case "iPod5,1": return .IPodTouch5 - case "iPod7,1": return .IPodTouch6 - - default: - if UIDevice.iPhonePlus { - return .iPhone7Plus - } else { - return .iPhone7 - } - } -} - -var pixelPerInchIphonePlus: CGFloat = 401 - -var pixelPerInchIphone: CGFloat = 326 - -var inchPerMm: CGFloat = 25.4 - -var renderedPixels: CGFloat = 1.15 - -func parsePixelPerInch(deviceType: DeviceType) -> CGFloat { - - switch deviceType { - case .iPhone5, .iPhone5C, .iPhone5S, .iPhoneSE, .iPhone6, .iPhone6S, .iPhone7, .IPodTouch5, .IPodTouch6: return pixelPerInchIphone - case .iPhone6Plus, .iPhone6SPlus, .iPhone7Plus: return pixelPerInchIphonePlus - } -} - -public extension UIDevice { - - class var deviceType: DeviceType { - var systemInfo = utsname() - uname(&systemInfo) - - let machine = systemInfo.machine - let mirror = Mirror(reflecting: machine) - var identifier = "" - - for child in mirror.children { - if let value = child.value as? Int8, value != 0 { - identifier.append(String(UnicodeScalar(UInt8(value)))) - } - } - - return parseDeviceType(identifier) - } - - class var pixelsPerMm: CGFloat { - return parsePixelPerInch(deviceType: UIDevice.deviceType) / inchPerMm - } - - class var iPhonePlus: Bool { - if UIDevice.current.userInterfaceIdiom != .phone { - return false - } - - if UIScreen.main.scale > 2.9 { - return true - } - - return false - } -} - diff --git a/ResearchKit/ActiveTasks/EyeActivitySlider.swift b/ResearchKit/ActiveTasks/EyeActivitySlider.swift deleted file mode 100644 index 37877e7223..0000000000 --- a/ResearchKit/ActiveTasks/EyeActivitySlider.swift +++ /dev/null @@ -1,181 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -internal class EyeActivitySlider: UIView { - - private var testType: VisionStepType? - - private var incorrectAnswers = 0 - private let contentGap: CGFloat = 20.0 - private let toleranceAngle = 22.5 - private let letterAngles = [0, 45, 90, 135, 180, 225, 270, 315] - private var letterSize: CGFloat { - var letterSize: CGFloat! - - if self.testType == .visualAcuity { - letterSize = letterMmSizes[currentStep] * UIDevice.pixelsPerMm / UIScreen.main.nativeScale - } else { - letterSize = 20 * UIDevice.pixelsPerMm / UIScreen.main.nativeScale - } - - return letterSize - } - - private var currentStep = 0 - private var letterMmSizes: [CGFloat] = [5.82, 4.65, 3.72, 2.91, 2.33, 1.86, 1.45, 1.16, 0.93, 0.73, 0.58, 0.47, 0.37] - private var contrastLevels: [CGFloat] = [0.9, 0.92, 0.937, 0.95, 0.96, 0.968, 0.975, 0.98, 0.984, 0.9875, 0.99] - private var stepScores: [Int] = [50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110] - private var letterAngle = 0.0 - - private lazy var letterImageView: UIImageView = { - let letterImage = UIImage(named: "iCNLandoltC", - in: Bundle(for: type(of: self)), - compatibleWith: nil) - let imageView = UIImageView(image: letterImage!) - return imageView - }() - - private lazy var circleImageView: UIImageView = { - let circleImage = UIImage(named: "orangeGrayCircle", - in: Bundle(for: type(of: self)), - compatibleWith: nil) - return UIImageView(image: circleImage!) - }() - - private var slider: CircleSlider? - - internal init(testType: VisionStepType) { - super.init(frame: CGRect()) - - self.testType = testType - commonInit() - } - - required internal init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - commonInit() - } - - private func commonInit() { - addSubview(letterImageView) - - circleImageView.contentMode = .scaleAspectFit - addSubview(circleImageView) - - let thumbImage = UIImage(named: "iCNDialPointerWithShadow", - in: Bundle(for: type(of: self)), - compatibleWith: nil) - - slider = CircleSlider(frame: bounds, options: [ - CircleSliderOption.barColor(UIColor.clear), - CircleSliderOption.trackingColor(UIColor.clear), - CircleSliderOption.startAngle(0), - CircleSliderOption.maxValue(360), - CircleSliderOption.minValue(0), - CircleSliderOption.thumbImage(thumbImage!) - ]) - - addSubview(slider!) - updateSliderAndLetter() - } - - override public func layoutSubviews() { - super.layoutSubviews() - - letterAngle = Double(letterAngles[Int(arc4random_uniform(7))]) - letterImageView.transform = CGAffineTransform.identity - letterImageView.frame = CGRect(origin: CGPoint(), size: CGSize(width: letterSize, height: letterSize)) - letterImageView.center = CGPoint(x: bounds.size.width / 2, y: bounds.size.height / 2) - letterImageView.transform = CGAffineTransform(rotationAngle: CGFloat(Math.degreesToRadians(letterAngle))) - letterImageView.alpha = getAlpha() - slider?.frame = bounds - - var frame = contentFrame() - circleImageView.frame = frame - - let labelMargin: CGFloat = 30.0 - frame.origin.x += labelMargin - frame.origin.y += labelMargin - frame.size.width -= labelMargin * 2 - frame.size.height -= labelMargin * 2 - } - - private func updateSliderAndLetter() { - guard incorrectAnswers < 2 else { return } - - letterImageView.isHidden = false - slider?.sliderValue = 0 - slider?.isUserInteractionEnabled = true - slider?.isHidden = false - setNeedsLayout() - } - - private func contentFrame() -> CGRect { - let sideLength = min(bounds.size.width, bounds.size.height) - contentGap - let contentFrame = CGRect(x: (bounds.size.width - sideLength) / 2, y: (bounds.size.height - sideLength) / 2, width: sideLength, height: sideLength) - return contentFrame - } - - private func getAlpha() -> CGFloat { - return testType == .visualAcuity ? 1.0 : (1 - contrastLevels[currentStep]) - } - - private func getResult() -> Bool { - let sliderValue = Double((slider?.sliderValue)!) - let leftMargin = letterAngle - toleranceAngle - let rightMargin = letterAngle + toleranceAngle - let result = sliderValue > leftMargin && sliderValue < rightMargin - - if result == false { - incorrectAnswers += 1 - } else { - currentStep += 1 - } - - return result - } - - internal func hideLetter() { - letterImageView.isHidden = true - } - - internal func fetchResultDataAndUpdateSlider() -> (outcome: Bool, letterAngle: Double, sliderAngle: Double, score: Int, incorrectAnswers: Int, maxScore: Int) { - let outcome = getResult() - let score = stepScores[currentStep] - let currentSliderValue = Double((slider?.sliderValue)!) - let currentLetterAngle = letterAngle - let maxScore = testType == .visualAcuity ? stepScores.last! : stepScores[contrastLevels.count - 1] - updateSliderAndLetter() - - return (outcome, currentLetterAngle, currentSliderValue, score, incorrectAnswers, maxScore) - } -} - diff --git a/ResearchKit/ActiveTasks/Math.swift b/ResearchKit/ActiveTasks/Math.swift deleted file mode 100644 index 68b6df8cd2..0000000000 --- a/ResearchKit/ActiveTasks/Math.swift +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -internal class Math { - - internal class func degreesToRadians(_ angle: Double) -> Double { - return angle / 180 * .pi - } - - internal class func pointFromAngle(_ frame: CGRect, angle: Double, radius: Double) -> CGPoint { - let radian = degreesToRadians(angle) - let xPoint = Double(frame.midX) + cos(radian) * radius - let yPoint = Double(frame.midY) + sin(radian) * radius - return CGPoint(x: xPoint, y: yPoint) - } - - internal class func pointPairToBearingDegrees(_ startPoint: CGPoint, endPoint: CGPoint) -> Double { - let originPoint = CGPoint(x: endPoint.x - startPoint.x, y: endPoint.y - startPoint.y) - let bearingRadians = atan2(Double(originPoint.y), Double(originPoint.x)) - var bearingDegrees = bearingRadians * (180.0 / .pi) - bearingDegrees = (bearingDegrees > 0.0 ? bearingDegrees : (360.0 + bearingDegrees)) - return bearingDegrees - } - - internal class func adjustValue(_ startAngle: Double, degree: Double, maxValue: Float, minValue: Float) -> Double { - let ratio = Double((maxValue - minValue) / 360) - let ratioStart = ratio * startAngle - let ratioDegree = ratio * degree - let adjustValue: Double - if startAngle < 0 { - adjustValue = (360 + startAngle) > degree ? (ratioDegree - ratioStart) : (ratioDegree - ratioStart) - (360 * ratio) - } else { - adjustValue = (360 - (360 - startAngle)) < degree ? (ratioDegree - ratioStart) : (ratioDegree - ratioStart) + (360 * ratio) - } - return adjustValue + (Double(minValue)) - } - - internal class func adjustDegree(_ startAngle: Double, degree: Double) -> Double { - return (360 + startAngle) > degree ? degree : -(360 - degree) - } - - internal class func degreeFromValue(_ startAngle: Double, value: Float, maxValue: Float, minValue: Float) -> Double { - let ratio = Double((maxValue - minValue) / 360) - let angle = Double(value) / ratio - return angle + startAngle - (Double(minValue) / ratio) - } -} - diff --git a/ResearchKit/ActiveTasks/ORKHealthClinicalTypeRecorder.h b/ResearchKit/ActiveTasks/ORKHealthClinicalTypeRecorder.h deleted file mode 100644 index d75b8c72bb..0000000000 --- a/ResearchKit/ActiveTasks/ORKHealthClinicalTypeRecorder.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (c) 2018, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import -#import - - -NS_ASSUME_NONNULL_BEGIN - -/** - The `ORKHealthClinicalTypeRecorder` class represents a recorder for collecting health records data from HealthKit during - an active task. - */ -#if defined(__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0 -ORK_CLASS_AVAILABLE -API_AVAILABLE(ios(12.0)) -@interface ORKHealthClinicalTypeRecorder : ORKRecorder - -@property (nonatomic, copy, readonly) HKClinicalType *healthClinicalType; - -@property (nonatomic, copy, readonly) HKFHIRResourceType healthFHIRResourceType; - -/** - Returns an initialized health clinical type recorder using the specified HKClinicalType and HKFHIRResourceType. - - @param identifier The unique identifier of the recorder (assigned by the recorder configuration). - @param healthClinicalType The HKClinicalType data that should be collected during the active task. - @param healthFHIRResourceType The HKFHIRResourceType for the predicate used to query the HKClinicalType. - @param step The step that requested this recorder. - @param outputDirectory The directory in which the health records data queried from HealthKit should be stored. - - @return An initialized health quantity type recorder. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier - healthClinicalType:(HKClinicalType *)healthClinicalType - healthFHIRResourceType:(nullable HKFHIRResourceType)healthFHIRResourceType - step:(nullable ORKStep *)step - outputDirectory:(nullable NSURL *)outputDirectory NS_DESIGNATED_INITIALIZER API_AVAILABLE(ios(12.0)); - -@end -#endif - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKHealthQuantityTypeRecorder.h b/ResearchKit/ActiveTasks/ORKHealthQuantityTypeRecorder.h deleted file mode 100644 index 8f4b76f22b..0000000000 --- a/ResearchKit/ActiveTasks/ORKHealthQuantityTypeRecorder.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKHealthQuantityTypeRecorder; - -@protocol ORKHealthQuantityTypeRecorderDelegate - -@optional -- (void)healthQuantityTypeRecorderDidUpdate:(ORKHealthQuantityTypeRecorder *)healthQuantityTypeRecorder; - -@end - - -/** - The `ORKHealthQuantityTypeRecorder` class represents a recorder for collecting real time sample data from HealthKit, such as heart rate, during - an active task. - */ -ORK_CLASS_AVAILABLE -@interface ORKHealthQuantityTypeRecorder : ORKRecorder - -@property (nonatomic, copy, readonly) HKQuantityType *quantityType; - -@property (nonatomic, copy, readonly) HKUnit *unit; - -@property (nonatomic, copy, readonly, nullable) HKQuantitySample *lastSample; - -/** - Returns an initialized health quantity type recorder using the specified quantity type and unit. - - @param identifier The unique identifier of the recorder (assigned by the recorder configuration). - @param quantityType The quantity type that should be collected during the active task. - @param unit The unit for the data that should be collected and serialized. - @param step The step that requested this recorder. - @param outputDirectory The directory in which the HealthKit data should be stored. - - @return An initialized health quantity type recorder. -*/ -- (instancetype)initWithIdentifier:(NSString *)identifier - healthQuantityType:(HKQuantityType *)quantityType - unit:(HKUnit *)unit - step:(nullable ORKStep *)step - outputDirectory:(nullable NSURL *)outputDirectory NS_DESIGNATED_INITIALIZER; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKLandoltCResult.swift b/ResearchKit/ActiveTasks/ORKLandoltCResult.swift deleted file mode 100644 index 67a6836d4c..0000000000 --- a/ResearchKit/ActiveTasks/ORKLandoltCResult.swift +++ /dev/null @@ -1,110 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import ResearchKit.Private - -public class ORKLandoltCResult: ORKResult { - - public var outcome: Bool? - public var letterAngle: Double? - public var sliderAngle: Double? - public var score: Int? - - enum Keys: String { - case outcome - case letterAngle - case sliderAngle - case score - } - - public init(identifier: String, outcome: Bool, letterAngle: Double, sliderAngle: Double, score: Int) { - super.init(identifier: identifier) - - self.outcome = outcome - self.letterAngle = letterAngle - self.sliderAngle = sliderAngle - self.score = score - } - - override public func encode(with aCoder: NSCoder) { - super.encode(with: aCoder) - - aCoder.encode(outcome, forKey: Keys.outcome.rawValue) - aCoder.encode(letterAngle, forKey: Keys.letterAngle.rawValue) - aCoder.encode(sliderAngle, forKey: Keys.sliderAngle.rawValue) - aCoder.encode(score, forKey: Keys.score.rawValue) - } - - required init(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - - outcome = aDecoder.decodeObject(forKey: Keys.outcome.rawValue) as? Bool ?? false - letterAngle = aDecoder.decodeObject(forKey: Keys.letterAngle.rawValue) as? Double ?? 0.0 - sliderAngle = aDecoder.decodeObject(forKey: Keys.sliderAngle.rawValue) as? Double ?? 0.0 - score = aDecoder.decodeObject(forKey: Keys.score.rawValue) as? Int ?? 0 - } - - override public func copy(with zone: NSZone? = nil) -> Any { - let result = super.copy(with: zone) as! ORKLandoltCResult - - result.outcome = outcome - result.letterAngle = letterAngle - result.sliderAngle = sliderAngle - result.score = score - - return result - } - - override public func isEqual(_ object: Any?) -> Bool { - let isParentSame = super.isEqual(object) - - if let castObject = object as? ORKLandoltCResult { - - return (isParentSame && - ORKEqualObjects(outcome as Any, castObject.outcome as Any) && - ORKEqualObjects(letterAngle as Any, castObject.letterAngle as Any) && - ORKEqualObjects(sliderAngle as Any, castObject.sliderAngle as Any) && - ORKEqualObjects(score as Any, castObject.score as Any)) - } - - return true - } - - override public func description(withNumberOfPaddingSpaces numberOfPaddingSpaces: UInt) -> String { - let descriptionString = """ - \(descriptionPrefix(withNumberOfPaddingSpaces: numberOfPaddingSpaces)); - Outcome: \(String(describing: outcome)); LetterAngle: \(String(describing: letterAngle)); - SliderAngle: \(String(describing: sliderAngle)); Score: \(String(describing: score)) - """ - return descriptionString - } -} - diff --git a/ResearchKit/ActiveTasks/ORKLandoltCStep.swift b/ResearchKit/ActiveTasks/ORKLandoltCStep.swift deleted file mode 100644 index 503b1ccb96..0000000000 --- a/ResearchKit/ActiveTasks/ORKLandoltCStep.swift +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -@objc -public enum VisionStepLeftOrRightEye: Int { - case left - case right -} - -@objc -public enum VisionStepType: Int { - case visualAcuity - case contrastSensitivity -} - -@objc -public class ORKLandoltCStep: ORKActiveStep { - - public var testType: VisionStepType? - public var eyeToTest: VisionStepLeftOrRightEye? - - enum Key: String { - case testType - case eyeToTest - } - - public override class func stepViewControllerClass() -> AnyClass { - return ORKLandoltCStepViewController.self - } - - public class func supportsSecureCoding() -> Bool { - return true - } - - @objc - public init(identifier: String, testType: VisionStepType, eyeToTest: VisionStepLeftOrRightEye) { - super.init(identifier: identifier) - self.testType = testType - self.eyeToTest = eyeToTest - } - - public override var allowsBackNavigation: Bool { - return false - } - - public override func copy(with zone: NSZone? = nil) -> Any { - let visionStep: ORKLandoltCStep = super.copy(with: zone) as! ORKLandoltCStep - return visionStep - } - - public required init(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - - if let typeValue = aDecoder.decodeObject(forKey: "stepType") as? Int { - testType = VisionStepType(rawValue: typeValue) - } - - if let eyeValue = aDecoder.decodeObject(forKey: "eyeToTest") as? Int { - eyeToTest = VisionStepLeftOrRightEye(rawValue: eyeValue) - } - } - - public override func encode(with aCoder: NSCoder) { - super.encode(with: aCoder) - aCoder.encode(testType, forKey: Key.testType.rawValue) - aCoder.encode(eyeToTest, forKey: Key.eyeToTest.rawValue) - } - - public override func isEqual(_ object: Any?) -> Bool { - if let object = object as? ORKLandoltCStep { - return testType == object.testType && eyeToTest == object.eyeToTest - } - return false - } - -} - diff --git a/ResearchKit/ActiveTasks/ORKLandoltCStepContentView.swift b/ResearchKit/ActiveTasks/ORKLandoltCStepContentView.swift deleted file mode 100644 index aaeba30c7d..0000000000 --- a/ResearchKit/ActiveTasks/ORKLandoltCStepContentView.swift +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import ResearchKit.Private - -internal class ORKLandoltCStepContentView: UIView { - - var eyeActivitySlider: EyeActivitySlider? - private var testType: VisionStepType? - - internal init(testType: VisionStepType) { - super.init(frame: CGRect()) - translatesAutoresizingMaskIntoConstraints = false - - self.testType = testType - setupSubviews() - setupConstraints() - } - - internal required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - } - - internal func setupSubviews() { - guard let typeValue = testType else { - return - } - - eyeActivitySlider = EyeActivitySlider(testType: typeValue) - addSubview(eyeActivitySlider!) - } - - internal func setupConstraints() { - eyeActivitySlider?.translatesAutoresizingMaskIntoConstraints = false - - NSLayoutConstraint.activate([ - NSLayoutConstraint(item: eyeActivitySlider!, - attribute: .width, - relatedBy: .equal, - toItem: self, - attribute: .width, - multiplier: 1.0, - constant: 0.0), - NSLayoutConstraint(item: eyeActivitySlider!, - attribute: .height, - relatedBy: .equal, - toItem: self, - attribute: .width, - multiplier: 1.0, - constant: 0.0) - ]) - } -} diff --git a/ResearchKit/ActiveTasks/ORKLandoltCStepViewController.swift b/ResearchKit/ActiveTasks/ORKLandoltCStepViewController.swift deleted file mode 100644 index 129517be9b..0000000000 --- a/ResearchKit/ActiveTasks/ORKLandoltCStepViewController.swift +++ /dev/null @@ -1,268 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import ResearchKit.Private - -public class ORKLandoltCStepViewController: ORKActiveStepViewController { - - private var activityTimer = Timer() - private var results = NSMutableArray() - private var visionStepView: ORKLandoltCStepView - private var eyeToTest: VisionStepLeftOrRightEye? - private var testType: VisionStepType? - - public override init(step: ORKStep?) { - if let visionStep = step as? ORKLandoltCStep { - eyeToTest = visionStep.eyeToTest - testType = visionStep.testType - } - visionStepView = ORKLandoltCStepView(testType: testType) - super.init(step: step) - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - public override var result: ORKStepResult? { - let stepResult = super.result - stepResult?.results = results.copy() as? [ORKResult] - - return stepResult! - } - - - public override func viewDidLoad() { - super.viewDidLoad() - view.backgroundColor = UIColor.white - activeStepView?.customContentView = visionStepView - activeStepView?.removeCustomContentPadding() - activeStepView?.customContentFillsAvailableSpace = true - - // TODO: Localize - visionStepView.currentEyeLabel.text = eyeToTest == .left ? "Left Eye" : "Right Eye" - visionStepView.continueButton.addTarget(self, action: #selector(continueButtonWasPressed), for: .touchUpInside) - startTimer() - } - - override public func stepDidFinish() { - super.stepDidFinish() - goForward() - } - - private func startTimer() { - activityTimer = Timer.scheduledTimer(timeInterval: 5.0, target: self, selector: #selector(hideCircle), userInfo: nil, repeats: false) - } - - @objc - private func hideCircle() { - activityTimer.invalidate() - visionStepView.visionContentView?.eyeActivitySlider?.hideLetter() - visionStepView.topInstructionLabel.isHidden = false - } - - @objc - private func continueButtonWasPressed() { - activityTimer.invalidate() - visionStepView.topInstructionLabel.isHidden = true - visionStepView.continueButton.isEnabled = false - - if let resultData = visionStepView.visionContentView?.eyeActivitySlider?.fetchResultDataAndUpdateSlider() { - let stepResult: ORKLandoltCResult = ORKLandoltCResult(identifier: step!.identifier, - outcome: resultData.outcome, - letterAngle: resultData.letterAngle, - sliderAngle: resultData.sliderAngle, - score: resultData.score) - results.add(stepResult) - - if resultData.incorrectAnswers == 2 || resultData.score == resultData.maxScore { - stepDidFinish() - } else { - visionStepView.continueButton.isEnabled = true - startTimer() - } - } - } -} - -public class ORKLandoltCStepView: UIView { - - var visionContentView: ORKLandoltCStepContentView? - - let continueButtonCornerRadius: CGFloat = 12.0 - let eyeLabelTopPadding: CGFloat = 20.0 - let instructionLabelTopPadding: CGFloat = 15.0 - let visionContentTopPadding: CGFloat = 10.0 - - let continueButton = ORKRoundTappingButton() - let currentEyeLabel = UILabel() - let topInstructionLabel = UILabel() - - init(testType: VisionStepType!) { - super.init(frame: .zero) - setupCurrentEyeLabel() - setupTopInstructionLabel() - setupVisionContentView(testType: testType) - setupContinueButton() - setupConstraints() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - func setupVisionContentView(testType: VisionStepType!) { - if visionContentView == nil { - visionContentView = ORKLandoltCStepContentView(testType: testType) - } - addSubview(visionContentView!) - } - - func setupCurrentEyeLabel() { - currentEyeLabel.isHidden = true - currentEyeLabel.textAlignment = .center - currentEyeLabel.textColor = UIColor.black - currentEyeLabel.numberOfLines = 0 - // TODO: set FontDescriptor - currentEyeLabel.font = UIFont(name: "", size: 20.0) - addSubview(currentEyeLabel) - } - - func setupTopInstructionLabel() { - topInstructionLabel.textAlignment = .center - topInstructionLabel.numberOfLines = 0 - topInstructionLabel.textColor = UIColor.black - // TODO: Localize - topInstructionLabel.text = "Move the dial to where you think the opening in the letter was." - // TODO: set FontDescriptor - topInstructionLabel.font = UIFont(name: "", size: 20.0) - topInstructionLabel.isHidden = true - addSubview(topInstructionLabel) - } - - func setupContinueButton() { - // TODO: Localize - continueButton.diameter = 60.0 - continueButton.setTitle("Next", for: UIControl.State.normal) - continueButton.backgroundColor = tintColor - continueButton.layer.cornerRadius = continueButtonCornerRadius - addSubview(continueButton) - } - - private func setupConstraints() { - currentEyeLabel.translatesAutoresizingMaskIntoConstraints = false - topInstructionLabel.translatesAutoresizingMaskIntoConstraints = false - visionContentView?.translatesAutoresizingMaskIntoConstraints = false - continueButton.translatesAutoresizingMaskIntoConstraints = false - - let constraints = [ - NSLayoutConstraint(item: currentEyeLabel, - attribute: .top, - relatedBy: .equal, - toItem: self, - attribute: .top, - multiplier: 1.0, - constant: eyeLabelTopPadding), - NSLayoutConstraint(item: currentEyeLabel, - attribute: .centerX, - relatedBy: .equal, - toItem: self, - attribute: .centerX, - multiplier: 1.0, - constant: 0.0), - NSLayoutConstraint(item: topInstructionLabel, - attribute: .top, - relatedBy: .equal, - toItem: currentEyeLabel, - attribute: .bottom, - multiplier: 1.0, - constant: instructionLabelTopPadding), - NSLayoutConstraint(item: topInstructionLabel, - attribute: .centerX, - relatedBy: .equal, - toItem: self, - attribute: .centerX, - multiplier: 1.0, - constant: 0.0), - NSLayoutConstraint(item: topInstructionLabel, - attribute: .width, - relatedBy: .equal, - toItem: self, - attribute: .width, - multiplier: 0.8, - constant: 0.0), - NSLayoutConstraint(item: visionContentView!, - attribute: .top, - relatedBy: .equal, - toItem: topInstructionLabel, - attribute: .bottom, - multiplier: 1.0, - constant: visionContentTopPadding), - NSLayoutConstraint(item: visionContentView!, - attribute: .centerX, - relatedBy: .equal, - toItem: self, - attribute: .centerX, - multiplier: 1.0, - constant: 0.0), - NSLayoutConstraint(item: visionContentView!, - attribute: .width, - relatedBy: .equal, - toItem: self, - attribute: .width, - multiplier: 0.8, - constant: 0.0), - NSLayoutConstraint(item: visionContentView!, - attribute: .height, - relatedBy: .equal, - toItem: self, - attribute: .height, - multiplier: 0.8, - constant: 0.0), - NSLayoutConstraint(item: continueButton, - attribute: .centerX, - relatedBy: .equal, - toItem: self, - attribute: .centerX, - multiplier: 1.0, - constant: 0.0), - NSLayoutConstraint(item: continueButton, - attribute: .bottom, - relatedBy: .equal, - toItem: self, - attribute: .bottom, - multiplier: 1.0, - constant: -20.0) - ] - - NSLayoutConstraint.activate(constraints) - } -} diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/VolumeCalibration.wav b/ResearchKit/ActiveTasks/ORKSpeechInNoise/VolumeCalibration.wav deleted file mode 100644 index 066dd4fc08..0000000000 Binary files a/ResearchKit/ActiveTasks/ORKSpeechInNoise/VolumeCalibration.wav and /dev/null differ diff --git a/ResearchKit/ActiveTasks/ORKStroopContentView.m b/ResearchKit/ActiveTasks/ORKStroopContentView.m deleted file mode 100644 index 703d9ce3c6..0000000000 --- a/ResearchKit/ActiveTasks/ORKStroopContentView.m +++ /dev/null @@ -1,270 +0,0 @@ -/* - Copyright (c) 2017, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKStroopContentView.h" -#import "ORKUnitLabel.h" -#import "ORKHelpers_Internal.h" -#import "ORKSkin.h" -#import "ORKBorderedButton.h" - - -CGFloat minimumButtonHeight = 60; -UILayoutConstraintAxis alignment = UILayoutConstraintAxisHorizontal; -CGFloat labelHeight = 250.0; -CGFloat labelWidth = 250.0; -static const CGFloat buttonStackViewSpacing = 20.0; - - -@implementation ORKStroopContentView { - UILabel *_colorLabel; - UIStackView *_buttonStackView; -} - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - self.translatesAutoresizingMaskIntoConstraints = NO; - _colorLabel = [UILabel new]; - _colorLabel.numberOfLines = 1; - _colorLabel.textAlignment = NSTextAlignmentCenter; - _colorLabel.translatesAutoresizingMaskIntoConstraints = NO; - - [_colorLabel setFont:[UIFont systemFontOfSize:60]]; - [_colorLabel setAdjustsFontSizeToFitWidth:YES]; - - ORKScreenType screenType = ORKGetVerticalScreenTypeForWindow([[[UIApplication sharedApplication] delegate] window]); - - if (screenType == ORKScreenTypeiPhone5 ) { - labelWidth = 200.0; - labelHeight = 200.0; - } else { - labelWidth = 250.0; - labelHeight = 250.0; - } - - [self setupDefaultButtons]; - - [self addSubview:_colorLabel]; - - [self setUpConstraints]; - } - return self; -} - - --(void)setupButtons { - _RButton = [[ORKBorderedButton alloc] init]; - [_RButton setNormalTintColor:[UIColor blackColor]]; - - _RButton.translatesAutoresizingMaskIntoConstraints = NO; - [_RButton setTitle:ORKLocalizedString(@"STROOP_COLOR_RED_INITIAL", nil) forState:UIControlStateNormal]; - - _GButton = [[ORKBorderedButton alloc] init]; - [_GButton setNormalTintColor:[UIColor blackColor]]; - - _GButton.translatesAutoresizingMaskIntoConstraints = NO; - [_GButton setTitle:ORKLocalizedString(@"STROOP_COLOR_GREEN_INITIAL", nil) forState:UIControlStateNormal]; - - _BButton = [[ORKBorderedButton alloc] init]; - [_BButton setNormalTintColor:[UIColor blackColor]]; - - _BButton.translatesAutoresizingMaskIntoConstraints = NO; - [_BButton setTitle:ORKLocalizedString(@"STROOP_COLOR_BLUE_INITIAL", nil) forState:UIControlStateNormal]; - - _YButton = [[ORKBorderedButton alloc] init]; - [_YButton setNormalTintColor:[UIColor blackColor]]; - - _YButton.translatesAutoresizingMaskIntoConstraints = NO; - [_YButton setTitle:ORKLocalizedString(@"STROOP_COLOR_YELLOW_INITIAL", nil) forState:UIControlStateNormal]; - -} - --(void)setupDefaultButtons { - [self setupButtons]; - if (!_buttonStackView) { - _buttonStackView = [[UIStackView alloc] initWithArrangedSubviews:@[_RButton, _GButton, _BButton, _YButton]]; - alignment = UILayoutConstraintAxisHorizontal; - } - - minimumButtonHeight = 60; - - _buttonStackView.translatesAutoresizingMaskIntoConstraints = NO; - _buttonStackView.spacing = buttonStackViewSpacing; - _buttonStackView.axis = alignment; - [self addSubview:_buttonStackView]; - -} - --(void)setupGridButtons { - if (_useGridLayoutForButtons) { - [self setupButtons]; - - [_buttonStackView removeFromSuperview]; - UIStackView* stack1 = [[UIStackView alloc] initWithArrangedSubviews:@[_RButton, _GButton]]; - UIStackView* stack2 = [[UIStackView alloc] initWithArrangedSubviews:@[_BButton, _YButton]]; - - stack1.translatesAutoresizingMaskIntoConstraints = NO; - stack1.spacing = buttonStackViewSpacing; - stack1.axis = UILayoutConstraintAxisHorizontal; - - stack2.translatesAutoresizingMaskIntoConstraints = NO; - stack2.spacing = buttonStackViewSpacing; - stack2.axis = UILayoutConstraintAxisHorizontal; - - _buttonStackView = [[UIStackView alloc] initWithArrangedSubviews:@[stack1,stack2]]; - - _buttonStackView.axis = UILayoutConstraintAxisVertical; - - ORKScreenType screenType = ORKGetVerticalScreenTypeForWindow([[[UIApplication sharedApplication] delegate] window]); - - if (screenType == ORKScreenTypeiPhone6) { - minimumButtonHeight = 150.0; - } else if (screenType == ORKScreenTypeiPhone5 ) { - minimumButtonHeight = 100.0; - } else { - minimumButtonHeight = 200; - } - - alignment = UILayoutConstraintAxisVertical; - _buttonStackView.translatesAutoresizingMaskIntoConstraints = NO; - _buttonStackView.spacing = buttonStackViewSpacing; - _buttonStackView.axis = alignment; - - [self addSubview:_buttonStackView]; - [self setUpConstraints]; - } -} - -- (void)setUseGridLayoutForButtons:(bool)useGridLayoutForButtons{ - _useGridLayoutForButtons = useGridLayoutForButtons; - [self setupGridButtons]; - -} - --(void)setUseTextForStimuli:(bool)useTextForStimuli{ - _useTextForStimuli = useTextForStimuli; - if (!_useTextForStimuli) { - [_colorLabel setFont:[UIFont boldSystemFontOfSize:60]]; - } -} - -- (void)setColorLabelText:(NSString *)colorLabelText { - [_colorLabel setText:colorLabelText]; - [self setNeedsDisplay]; -} - -- (void)setColorLabelColor:(UIColor *)colorLabelColor { - [_colorLabel setTextColor:colorLabelColor]; - if (!_useTextForStimuli) { - [_colorLabel setBackgroundColor:colorLabelColor]; - } - [self setNeedsDisplay]; -} - -- (NSString *)colorLabelText { - return _colorLabel.text; -} - -- (UIColor *)colorLabelColor { - return _colorLabel.textColor; -} - -- (void)setUpConstraints { - - NSMutableArray *constraints = [[NSMutableArray alloc] init]; - NSDictionary *views = NSDictionaryOfVariableBindings(_colorLabel, _buttonStackView); - - int bottomStackViewSpace = _useGridLayoutForButtons ? 90 : 30; - - NSString * constraintString = [NSString stringWithFormat: @"V:|-(==30)-[_colorLabel]-(>=10)-[_buttonStackView]-(==%d)-|", bottomStackViewSpace]; - - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:constraintString - options:NSLayoutFormatAlignAllCenterX - metrics:nil - views:views]]; - NSArray *baseLayouts = @[[NSLayoutConstraint constraintWithItem:_buttonStackView - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:minimumButtonHeight], - [NSLayoutConstraint constraintWithItem:_buttonStackView - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeCenterX - multiplier:1.0 - constant:0.0]]; - - [constraints addObjectsFromArray:baseLayouts]; - - if (!_useTextForStimuli) { - - [constraints addObjectsFromArray: @[[NSLayoutConstraint constraintWithItem:_colorLabel - attribute:NSLayoutAttributeWidth - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:labelWidth], - [NSLayoutConstraint constraintWithItem:_colorLabel - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant: labelHeight], - [NSLayoutConstraint constraintWithItem:_buttonStackView - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:minimumButtonHeight]]]; - } - - for (ORKBorderedButton *button in @[_RButton, _GButton, _BButton, _YButton]) { - [constraints addObject:[NSLayoutConstraint constraintWithItem:button - attribute:NSLayoutAttributeWidth - relatedBy:NSLayoutRelationEqual - toItem:button - attribute:NSLayoutAttributeHeight - multiplier:1.0 - constant:0.0]]; - } - - [self addConstraints:constraints]; - [NSLayoutConstraint activateConstraints:constraints]; -} - -@end - diff --git a/ResearchKit/ActiveTasks/ORKStroopStep.h b/ResearchKit/ActiveTasks/ORKStroopStep.h deleted file mode 100644 index 7e0d3ee039..0000000000 --- a/ResearchKit/ActiveTasks/ORKStroopStep.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (c) 2017, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -ORK_CLASS_AVAILABLE -@interface ORKStroopStep : ORKActiveStep - -@property (nonatomic, assign) NSInteger numberOfAttempts; - -/** -A Boolean value indicating whether this task randomizes the visual and color of each stroop question. -This means that the color of the text displayed and the text may not match, which makes for a harder stroop test. - -By default, this property is set to `YES` -*/ -@property (nonatomic, assign) BOOL randomizeVisualAndColorAlignment; - -/** -A Boolean value indicating whether this task should use text or boxes. -If set to `YES` then color words will be displayed for the user to guess. -If set to `NO` we will display a square box with the current color for the user to guess - -By default, this property is set to `YES` -*/ -@property (nonatomic, assign) BOOL useTextForStimuli; - -/** -A Boolean value indicating whether this task will use a 2x2 grid of buttons - -By default, this property is set to `NO` -*/ -@property (nonatomic, assign) BOOL useGridLayoutForButtons; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKStroopStep.m b/ResearchKit/ActiveTasks/ORKStroopStep.m deleted file mode 100644 index 3a26237cf6..0000000000 --- a/ResearchKit/ActiveTasks/ORKStroopStep.m +++ /dev/null @@ -1,112 +0,0 @@ -/* - Copyright (c) 2017, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKStroopStep.h" -#import "ORKStroopStepViewController.h" -#import "ORKHelpers_Internal.h" - - -@implementation ORKStroopStep - -+ (Class)stepViewControllerClass { - return [ORKStroopStepViewController class]; -} - -+ (BOOL)supportsSecureCoding { - return YES; -} - -- (instancetype)initWithIdentifier:(NSString *)identifier { - self = [super initWithIdentifier:identifier]; - if (self) { - self.shouldVibrateOnStart = YES; - self.shouldShowDefaultTimer = NO; - self.shouldContinueOnFinish = YES; - self.stepDuration = NSIntegerMax; - self.randomizeVisualAndColorAlignment = YES; - self.useTextForStimuli = YES; - self.useGridLayoutForButtons = NO; - } - return self; -} - -- (void)validateParameters { - [super validateParameters]; - NSInteger minimumAttempts = 3; - if (self.numberOfAttempts < minimumAttempts) { - @throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"number of attempts should be greater or equal to %ld.", (long)minimumAttempts] userInfo:nil]; - } -} - -- (BOOL)startsFinished { - return NO; -} - -- (instancetype)copyWithZone:(NSZone *)zone { - ORKStroopStep *step = [super copyWithZone:zone]; - step.numberOfAttempts = self.numberOfAttempts; - step.useTextForStimuli = self.useTextForStimuli; - step.useGridLayoutForButtons = self.useGridLayoutForButtons; - step.randomizeVisualAndColorAlignment = self.randomizeVisualAndColorAlignment; - return step; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self ) { - ORK_DECODE_INTEGER(aDecoder, numberOfAttempts); - ORK_DECODE_BOOL(aDecoder, useTextForStimuli); - ORK_DECODE_BOOL(aDecoder, useGridLayoutForButtons); - ORK_DECODE_BOOL(aDecoder, randomizeVisualAndColorAlignment); - } - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - ORK_ENCODE_INTEGER(aCoder, numberOfAttempts); - ORK_ENCODE_BOOL(aCoder, useTextForStimuli); - ORK_ENCODE_BOOL(aCoder, useGridLayoutForButtons); - ORK_ENCODE_BOOL(aCoder, randomizeVisualAndColorAlignment); -} - -- (BOOL)isEqual:(id)object { - BOOL isParentSame = [super isEqual:object]; - - __typeof(self) castObject = object; - return (isParentSame - && (self.numberOfAttempts == castObject.numberOfAttempts) - && (self.useTextForStimuli == castObject.useTextForStimuli) - && (self.useGridLayoutForButtons == castObject.useGridLayoutForButtons) - && (self.randomizeVisualAndColorAlignment == castObject.randomizeVisualAndColorAlignment)); -} - -@end diff --git a/ResearchKit/ActiveTasks/ORKSwiftStroopContentView.swift b/ResearchKit/ActiveTasks/ORKSwiftStroopContentView.swift deleted file mode 100644 index 0428934bf8..0000000000 --- a/ResearchKit/ActiveTasks/ORKSwiftStroopContentView.swift +++ /dev/null @@ -1,168 +0,0 @@ -/* - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -internal class ORKSwiftStroopContentView: ORKActiveStepCustomView { - - public var colorLabelText: String? - public var colorLabelColor: UIColor? - - public let redButton: ORKBorderedButton = { - let button = ORKBorderedButton() - button.translatesAutoresizingMaskIntoConstraints = false - button.setTitle(ORKSwiftLocalizedString("STROOP_COLOR_RED_INITIAL", ""), for: .normal) - return button - }() - - public let greenButton: ORKBorderedButton = { - let button = ORKBorderedButton() - button.translatesAutoresizingMaskIntoConstraints = false - button.setTitle(ORKSwiftLocalizedString("STROOP_COLOR_GREEN_INITIAL", ""), for: .normal) - return button - }() - - public let blueButton: ORKBorderedButton = { - let button = ORKBorderedButton() - button.translatesAutoresizingMaskIntoConstraints = false - button.setTitle(ORKSwiftLocalizedString("STROOP_COLOR_BLUE_INITIAL", ""), for: .normal) - return button - }() - - public let yellowButton: ORKBorderedButton = { - let button = ORKBorderedButton() - button.translatesAutoresizingMaskIntoConstraints = false - button.setTitle(ORKSwiftLocalizedString("STROOP_COLOR_YELLOW_INITIAL", ""), for: .normal) - return button - }() - - private let colorLabel: UILabel = { - let label = UILabel() - let colorLabelFontSize: CGFloat = 60.0 - label.numberOfLines = 1 - label.text = " " - label.textAlignment = .center - label.translatesAutoresizingMaskIntoConstraints = false - label.font = UIFont.systemFont(ofSize: colorLabelFontSize) - label.adjustsFontSizeToFitWidth = true - return label - }() - - private let buttonStackView: UIStackView - - private let minimumButtonHeight: CGFloat = 60.0 - private let buttonStackViewSpacing: CGFloat = 20.0 - - private override init(frame: CGRect) { - buttonStackView = UIStackView(arrangedSubviews: [redButton, greenButton, blueButton, yellowButton]) - super.init(frame: frame) - setup() - } - - internal required init?(coder aDecoder: NSCoder) { - buttonStackView = UIStackView(arrangedSubviews: [redButton, greenButton, blueButton, yellowButton]) - super.init(coder: aDecoder) - setup() - } - - internal func setup() { - self.translatesAutoresizingMaskIntoConstraints = false - buttonStackView.translatesAutoresizingMaskIntoConstraints = false - buttonStackView.spacing = buttonStackViewSpacing - buttonStackView.axis = .horizontal - self.addSubview(colorLabel) - self.addSubview(buttonStackView) - setUpConstraints() - } - - internal func setColorLabelText(colorLabelText text: String) { - colorLabelText = text - colorLabel.text = text - setNeedsDisplay() - } - - internal func setColorLabelColor(colorLabelColor color: UIColor) { - colorLabelColor = color - colorLabel.textColor = color - setNeedsDisplay() - } - - internal func getColorLabelText() -> String { - return colorLabel.text! - } - - internal func getColorLabelColor() -> UIColor { - return colorLabel.textColor - } - - internal func setUpConstraints() { - - var constraints = [NSLayoutConstraint]() - var views = [String: Any]() - views["colorLabel"] = colorLabel - views["buttonStackView"] = buttonStackView - - constraints += NSLayoutConstraint.constraints(withVisualFormat: "V:|-(==30)-[colorLabel]-(>=10)-[buttonStackView]-(==30)-|", - options: .alignAllCenterX, - metrics: nil, - views: views) - - constraints += [ - NSLayoutConstraint(item: buttonStackView as Any, - attribute: .height, - relatedBy: .equal, - toItem: nil, - attribute: .notAnAttribute, - multiplier: 1.0, - constant: minimumButtonHeight), - NSLayoutConstraint(item: buttonStackView as Any, - attribute: .centerX, - relatedBy: .equal, - toItem: self, - attribute: .centerX, - multiplier: 1.0, - constant: 0.0) - ] - - for button in [redButton, greenButton, blueButton, yellowButton] { - constraints += [ - NSLayoutConstraint(item: button, - attribute: .width, - relatedBy: .equal, - toItem: button, - attribute: .height, - multiplier: 1.0, - constant: 0.0) - ] - } - - self.addConstraints(constraints) - NSLayoutConstraint.activate(constraints) - } -} diff --git a/ResearchKit/ActiveTasks/ORKSwiftStroopResult.swift b/ResearchKit/ActiveTasks/ORKSwiftStroopResult.swift deleted file mode 100644 index a277db32de..0000000000 --- a/ResearchKit/ActiveTasks/ORKSwiftStroopResult.swift +++ /dev/null @@ -1,106 +0,0 @@ -/* - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -import ResearchKit.Private - -public class ORKSwiftStroopResult: ORKResult { - - public var startTime: TimeInterval? - public var endTime: TimeInterval? - public var color: String? - public var text: String? - public var colorSelected: String? - - enum Keys: String { - case startTime - case endTime - case color - case text - case colorSelected - } - - public override init(identifier: String) { - super.init(identifier: identifier) - } - - public override func encode(with aCoder: NSCoder) { - super.encode(with: aCoder) - aCoder.encode(startTime, forKey: Keys.startTime.rawValue) - aCoder.encode(endTime, forKey: Keys.endTime.rawValue) - aCoder.encode(color, forKey: Keys.color.rawValue) - aCoder.encode(text, forKey: Keys.text.rawValue) - aCoder.encode(colorSelected, forKey: Keys.colorSelected.rawValue) - } - - public required init(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - startTime = aDecoder.decodeObject(forKey: Keys.startTime.rawValue) as? Double - endTime = aDecoder.decodeObject(forKey: Keys.endTime.rawValue) as? Double - color = aDecoder.decodeObject(forKey: Keys.color.rawValue) as? String - text = aDecoder.decodeObject(forKey: Keys.text.rawValue) as? String - colorSelected = aDecoder.decodeObject(forKey: Keys.colorSelected.rawValue) as? String - } - - public class func supportsSecureCoding() -> Bool { - return true - } - - override public func isEqual(_ object: Any?) -> Bool { - let isParentSame = super.isEqual(object) - - if let castObject = object as? ORKSwiftStroopResult { - return (isParentSame && - (startTime == castObject.startTime) && - (endTime == castObject.endTime) && - (color == castObject.color) && - (text == castObject.text) && - (colorSelected == castObject.colorSelected)) - } - return true - } - - override public func copy(with zone: NSZone? = nil) -> Any { - if let result = super.copy(with: zone) as? ORKSwiftStroopResult { - result.startTime = startTime - result.endTime = endTime - result.color = color - result.text = text - result.colorSelected = colorSelected - return result - } else { - return super.copy(with: zone) - } - } - - public override func description(withNumberOfPaddingSpaces numberOfPaddingSpaces: UInt) -> String { - return "\(descriptionPrefix(withNumberOfPaddingSpaces: numberOfPaddingSpaces)); color: \(color ?? "") text: \(text ?? "") colorSelected: \(colorSelected ?? "") \(descriptionSuffix())" - } -} diff --git a/ResearchKit/ActiveTasks/ORKSwiftStroopStep.swift b/ResearchKit/ActiveTasks/ORKSwiftStroopStep.swift deleted file mode 100644 index 1251938e64..0000000000 --- a/ResearchKit/ActiveTasks/ORKSwiftStroopStep.swift +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -import Foundation - -public class ORKSwiftStroopStep: ORKActiveStep { - - public var numberOfAttempts = 0 - private let minimumAttempts = 10 - - enum Key: String { - case numberOfAttempts - } - - public override class func stepViewControllerClass() -> AnyClass { - return ORKSwiftStroopStepViewController.self - } - - public class func supportsSecureCoding() -> Bool { - return true - } - - public override init(identifier: String) { - super.init(identifier: identifier) - - shouldVibrateOnStart = true - shouldShowDefaultTimer = false - shouldContinueOnFinish = true - stepDuration = TimeInterval(NSIntegerMax) - } - - public override func validateParameters() { - super.validateParameters() - assert(numberOfAttempts >= minimumAttempts, "number of attempts should be greater or equal to \(minimumAttempts)") - } - - public override func startsFinished() -> Bool { - return false - } - - public override var allowsBackNavigation: Bool { - return false - } - - public override func copy(with zone: NSZone? = nil) -> Any { - let stroopStep = super.copy(with: zone) - return stroopStep - } - - required init(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - numberOfAttempts = aDecoder.decodeInteger(forKey: Key.numberOfAttempts.rawValue) - } - - public override func encode(with aCoder: NSCoder) { - super.encode(with: aCoder) - aCoder.encode(numberOfAttempts, forKey: Key.numberOfAttempts.rawValue) - } - - public override func isEqual(_ object: Any?) -> Bool { - if let object = object as? ORKSwiftStroopStep { - return numberOfAttempts == object.numberOfAttempts - } - return false - } -} diff --git a/ResearchKit/ActiveTasks/ORKSwiftStroopStepViewController.swift b/ResearchKit/ActiveTasks/ORKSwiftStroopStepViewController.swift deleted file mode 100644 index b3e3bec049..0000000000 --- a/ResearchKit/ActiveTasks/ORKSwiftStroopStepViewController.swift +++ /dev/null @@ -1,213 +0,0 @@ -/* - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -import ResearchKit.Private - -public class ORKSwiftStroopStepViewController: ORKActiveStepViewController { - - private let stroopContentView = ORKSwiftStroopContentView() - private var colors = [String: UIColor]() - private var differentColorLabels = [String: [UIColor]]() - private var questionNumber = 0 - - private let red = UIColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 1.0) - private let green = UIColor(red: 0.0, green: 1.0, blue: 0.0, alpha: 1.0) - private let blue = UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 1.0) - private let yellow = UIColor(red: 1.0, green: 1.0, blue: 0.0, alpha: 1.0) - - private let redString = ORKSwiftLocalizedString("STROOP_COLOR_RED", "") - private let greenString = ORKSwiftLocalizedString("STROOP_COLOR_GREEN", "") - private let blueString = ORKSwiftLocalizedString("STROOP_COLOR_BLUE", "") - private let yellowString = ORKSwiftLocalizedString("STROOP_COLOR_YELLOW", "") - - private var nextQuestionTimer: Timer? - private var results: NSMutableArray? - private var startTime: TimeInterval? - private var endTime: TimeInterval? - - public override init(step: ORKStep?) { - super.init(step: step) - suspendIfInactive = true - } - - internal required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - private func stroopStep() -> ORKSwiftStroopStep { - return step as! ORKSwiftStroopStep - } - - public override func viewDidLoad() { - super.viewDidLoad() - - results = NSMutableArray() - - colors[redString] = red - colors[blueString] = blue - colors[yellowString] = yellow - colors[greenString] = green - - differentColorLabels[redString] = [blue, green, yellow] - differentColorLabels[blueString] = [red, green, yellow] - differentColorLabels[yellowString] = [red, blue, green] - differentColorLabels[greenString] = [red, blue, yellow] - - activeStepView?.activeCustomView = stroopContentView - activeStepView?.customContentFillsAvailableSpace = true - - stroopContentView.redButton.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside) - stroopContentView.greenButton.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside) - stroopContentView.blueButton.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside) - stroopContentView.yellowButton.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside) - } - - @objc - private func buttonPressed(sender: Any) { - - if stroopContentView.colorLabelText != " " { - setButtonDisabled() - if let button = sender as? ORKBorderedButton { - - if button == stroopContentView.redButton { - createResult(color: (colors as NSDictionary).allKeys(for: stroopContentView.colorLabelColor!).first - as? String ?? "", withText: stroopContentView.colorLabelText!, - withColorSelected: redString) - } else if button == stroopContentView.greenButton { - createResult(color: (colors as NSDictionary).allKeys(for: stroopContentView.colorLabelColor!).first - as? String ?? "", withText: stroopContentView.colorLabelText!, - withColorSelected: greenString) - } else if button == stroopContentView.blueButton { - createResult(color: (colors as NSDictionary).allKeys(for: stroopContentView.colorLabelColor!).first - as? String ?? "", withText: stroopContentView.colorLabelText!, - withColorSelected: blueString) - } else if button == stroopContentView.yellowButton { - createResult(color: (colors as NSDictionary).allKeys(for: stroopContentView.colorLabelColor!).first - as? String ?? "", withText: stroopContentView.colorLabelText!, - withColorSelected: yellowString) - } - - nextQuestionTimer = Timer.scheduledTimer(timeInterval: 0.5, - target: self, - selector: #selector(startNextQuestionOrFinish), - userInfo: nil, - repeats: false) - } - } - } - - public override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - start() - } - - public override func stepDidFinish() { - super.stepDidFinish() - stroopContentView.finishStep(self) - goForward() - } - - public override var result: ORKStepResult? { - let stepResult = super.result - if results != nil { - stepResult?.results = results?.copy() as? [ORKResult] - } - return stepResult! - } - - public override func start() { - super.start() - startQuestion() - } - - private func createResult(color: String, withText text: String, withColorSelected colorSelected: String) { - let stroopResult = ORKSwiftStroopResult(identifier: (step!.identifier)) - stroopResult.startTime = startTime - stroopResult.endTime = ProcessInfo.processInfo.systemUptime - stroopResult.color = color - stroopResult.text = text - stroopResult.colorSelected = colorSelected - results?.add(stroopResult) - } - - @objc - private func startNextQuestionOrFinish() { - if nextQuestionTimer != nil { - nextQuestionTimer?.invalidate() - nextQuestionTimer = nil - } - questionNumber += 1 - if questionNumber == stroopStep().numberOfAttempts { - finish() - } else { - startQuestion() - } - } - - private func startQuestion() { - let pattern: Int = Int(arc4random()) % 2 - if pattern == 0 { - let index: Int = Int(arc4random()) % differentColorLabels.keys.count - let text = Array(differentColorLabels.keys)[index] - stroopContentView.setColorLabelText(colorLabelText: text) - let color = colors[text]! - stroopContentView.colorLabelColor = color - stroopContentView.setColorLabelColor(colorLabelColor: color) - } else { - let index: Int = Int(arc4random()) % differentColorLabels.keys.count - let text = Array(differentColorLabels.keys)[index] - stroopContentView.setColorLabelText(colorLabelText: text) - let colorArray = differentColorLabels[text]! - let randomColorIndex = Int(arc4random()) % colorArray.count - let color = colorArray[randomColorIndex] - stroopContentView.setColorLabelColor(colorLabelColor: color) - } - - setButtonsEnabled() - startTime = ProcessInfo.processInfo.systemUptime - } - - private func setButtonDisabled() { - - stroopContentView.redButton.isEnabled = false - stroopContentView.greenButton.isEnabled = false - stroopContentView.blueButton.isEnabled = false - stroopContentView.yellowButton.isEnabled = false - } - - private func setButtonsEnabled() { - - stroopContentView.redButton.isEnabled = true - stroopContentView.greenButton.isEnabled = true - stroopContentView.blueButton.isEnabled = true - stroopContentView.yellowButton.isEnabled = true - } -} diff --git a/ResearchKit/ActiveTasks/ORKTouchRecorder.h b/ResearchKit/ActiveTasks/ORKTouchRecorder.h deleted file mode 100644 index cbf89156d8..0000000000 --- a/ResearchKit/ActiveTasks/ORKTouchRecorder.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import - - -NS_ASSUME_NONNULL_BEGIN - -/** - The `ORKTouchRecorder` class defines the attributes and behavior of touch events recorder. - - This class is considered private because its interface is not yet considered - stable. It is not currently used by any of the pre-defined active tasks. - */ -ORK_CLASS_AVAILABLE -@interface ORKTouchRecorder : ORKRecorder - -/** - The `ORKTouchRecorder` attaches a gesture recognizer to `touchView` to receive touch events. - - Use `-viewController:willStartStepWithView:` to set the `touchView` property before - the touch recorder starts. - */ -@property (nonatomic, strong, readonly, nullable) UIView *touchView; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/TrackLayer.swift b/ResearchKit/ActiveTasks/TrackLayer.swift deleted file mode 100644 index 2376aaea31..0000000000 --- a/ResearchKit/ActiveTasks/TrackLayer.swift +++ /dev/null @@ -1,105 +0,0 @@ -/* - Copyright (c) 2019, Novartis. - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -internal class TrackLayer: CAShapeLayer { - - struct Setting { - var startAngle = Double() - var barWidth = CGFloat() - var barColor = UIColor() - var trackingColor = UIColor() - } - - internal var setting = Setting() - internal var degree: Double = 0 - internal var hollowRadius: CGFloat { - return (bounds.width * 0.5) - setting.barWidth - } - internal var currentCenter: CGPoint { - return CGPoint(x: bounds.midX, y: bounds.midY) - } - internal var hollowRect: CGRect { - return CGRect( - x: currentCenter.x - hollowRadius, - y: currentCenter.y - hollowRadius, - width: hollowRadius * 2.0, - height: hollowRadius * 2.0) - } - internal init(bounds: CGRect, setting: Setting) { - super.init() - self.bounds = bounds - self.setting = setting - cornerRadius = bounds.size.width * 0.5 - masksToBounds = true - position = currentCenter - backgroundColor = setting.barColor.cgColor - mask() - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override internal func draw(in ctx: CGContext) { - drawTrack(ctx: ctx) - } - - private func mask() { - let maskLayer = CAShapeLayer() - maskLayer.bounds = bounds - let ovalRect = hollowRect - let path = UIBezierPath(ovalIn: ovalRect) - path.append(UIBezierPath(rect: maskLayer.bounds)) - maskLayer.path = path.cgPath - maskLayer.position = currentCenter - maskLayer.fillRule = CAShapeLayerFillRule.evenOdd - mask = maskLayer - } - - private func drawTrack(ctx: CGContext) { - let adjustDegree = Math.adjustDegree(setting.startAngle, degree: degree) - let centerX = currentCenter.x - let centerY = currentCenter.y - let radius = min(centerX, centerY) - ctx.setFillColor(setting.trackingColor.cgColor) - ctx.beginPath() - ctx.move(to: CGPoint(x: centerX, y: centerY)) - ctx.addArc(center: CGPoint(x: centerX, y: centerY), - radius: radius, - startAngle: CGFloat(Math.degreesToRadians(setting.startAngle)), - endAngle: CGFloat(Math.degreesToRadians(adjustDegree)), - clockwise: false) - - ctx.closePath() - ctx.fillPath() - } -} - diff --git a/ResearchKit/Animations/phone@2x/consent_01@2x.m4v b/ResearchKit/Animations/phone@2x/consent_01@2x.m4v deleted file mode 100644 index bb5c8baf9b..0000000000 Binary files a/ResearchKit/Animations/phone@2x/consent_01@2x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@2x/consent_02@2x.m4v b/ResearchKit/Animations/phone@2x/consent_02@2x.m4v deleted file mode 100644 index 5629fa66b2..0000000000 Binary files a/ResearchKit/Animations/phone@2x/consent_02@2x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@2x/consent_03@2x.m4v b/ResearchKit/Animations/phone@2x/consent_03@2x.m4v deleted file mode 100644 index bb13aca827..0000000000 Binary files a/ResearchKit/Animations/phone@2x/consent_03@2x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@2x/consent_04@2x.m4v b/ResearchKit/Animations/phone@2x/consent_04@2x.m4v deleted file mode 100644 index 6855d612a6..0000000000 Binary files a/ResearchKit/Animations/phone@2x/consent_04@2x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@2x/consent_05@2x.m4v b/ResearchKit/Animations/phone@2x/consent_05@2x.m4v deleted file mode 100644 index 6292b22c96..0000000000 Binary files a/ResearchKit/Animations/phone@2x/consent_05@2x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@2x/consent_06@2x.m4v b/ResearchKit/Animations/phone@2x/consent_06@2x.m4v deleted file mode 100644 index dc4b128774..0000000000 Binary files a/ResearchKit/Animations/phone@2x/consent_06@2x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@2x/consent_07@2x.m4v b/ResearchKit/Animations/phone@2x/consent_07@2x.m4v deleted file mode 100644 index 39822841ee..0000000000 Binary files a/ResearchKit/Animations/phone@2x/consent_07@2x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@3x/consent_01@3x.m4v b/ResearchKit/Animations/phone@3x/consent_01@3x.m4v deleted file mode 100644 index ab3cbda670..0000000000 Binary files a/ResearchKit/Animations/phone@3x/consent_01@3x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@3x/consent_02@3x.m4v b/ResearchKit/Animations/phone@3x/consent_02@3x.m4v deleted file mode 100644 index dd836ec1f1..0000000000 Binary files a/ResearchKit/Animations/phone@3x/consent_02@3x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@3x/consent_03@3x.m4v b/ResearchKit/Animations/phone@3x/consent_03@3x.m4v deleted file mode 100644 index 851058cd03..0000000000 Binary files a/ResearchKit/Animations/phone@3x/consent_03@3x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@3x/consent_04@3x.m4v b/ResearchKit/Animations/phone@3x/consent_04@3x.m4v deleted file mode 100644 index 3c8bebd2e8..0000000000 Binary files a/ResearchKit/Animations/phone@3x/consent_04@3x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@3x/consent_05@3x.m4v b/ResearchKit/Animations/phone@3x/consent_05@3x.m4v deleted file mode 100644 index 5d8c223887..0000000000 Binary files a/ResearchKit/Animations/phone@3x/consent_05@3x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@3x/consent_06@3x.m4v b/ResearchKit/Animations/phone@3x/consent_06@3x.m4v deleted file mode 100644 index 2905564db2..0000000000 Binary files a/ResearchKit/Animations/phone@3x/consent_06@3x.m4v and /dev/null differ diff --git a/ResearchKit/Animations/phone@3x/consent_07@3x.m4v b/ResearchKit/Animations/phone@3x/consent_07@3x.m4v deleted file mode 100644 index 64700cb989..0000000000 Binary files a/ResearchKit/Animations/phone@3x/consent_07@3x.m4v and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/Contents.json deleted file mode 100644 index d32c91bc1b..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "ContrastExam.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "ContrastExam@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "ContrastExam@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam.png b/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam.png deleted file mode 100644 index 0c2c182b22..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam@2x.png b/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam@2x.png deleted file mode 100644 index 73dd7a6b08..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam@3x.png b/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam@3x.png deleted file mode 100644 index 60da0ba53e..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/ContrastExam.imageset/ContrastExam@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/Contents.json deleted file mode 100644 index e85b5adb87..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "VisualExam.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "VisualExam@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "VisualExam@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam.png b/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam.png deleted file mode 100644 index c64546cd30..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam@2x.png b/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam@2x.png deleted file mode 100644 index 429ff25791..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam@3x.png b/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam@3x.png deleted file mode 100644 index e1cd1ba45f..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/VisualExam.imageset/VisualExam@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/Contents.json deleted file mode 100644 index 211ea106e9..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilityHorizontalScroll.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityHorizontalScroll@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityHorizontalScroll@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll.png deleted file mode 100644 index 79610a225d..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll@2x.png deleted file mode 100644 index 135776ab7a..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll@3x.png deleted file mode 100644 index 1a3e19dc7f..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityHorizontalScroll.imageset/touchAbilityHorizontalScroll@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/Contents.json deleted file mode 100644 index be18f5a724..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilityInstruction.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityInstruction@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityInstruction@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction.png deleted file mode 100644 index 37c2217e7c..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction@2x.png deleted file mode 100644 index 42937572c0..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction@3x.png deleted file mode 100644 index e837a09e29..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityInstruction.imageset/touchAbilityInstruction@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/Contents.json deleted file mode 100644 index b02a0182bc..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilityPinch.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityPinch@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityPinch@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch.png deleted file mode 100644 index b544a8a531..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch@2x.png deleted file mode 100644 index 0b245d095f..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch@3x.png deleted file mode 100644 index f4279145f0..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityPinch.imageset/touchAbilityPinch@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/Contents.json deleted file mode 100644 index bd528fba92..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilityRotation.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityRotation@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityRotation@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation.png deleted file mode 100644 index 89bbb4d572..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation@2x.png deleted file mode 100644 index 71a0e1635b..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation@3x.png deleted file mode 100644 index f79b5b0891..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityRotation.imageset/touchAbilityRotation@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/Contents.json deleted file mode 100644 index 45687ab89a..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe1.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe1@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe1@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1.png deleted file mode 100644 index 7fc9f5dd3a..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1@2x.png deleted file mode 100644 index b5913c8593..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1@3x.png deleted file mode 100644 index cce3f15bfc..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe1.imageset/touchAbilitySwipe1@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/Contents.json deleted file mode 100644 index 5c59270051..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe2.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe2@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe2@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2.png deleted file mode 100644 index a3826b55bf..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2@2x.png deleted file mode 100644 index 2f4dda39bd..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2@3x.png deleted file mode 100644 index 765c1470e3..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe2.imageset/touchAbilitySwipe2@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/Contents.json deleted file mode 100644 index a3937bd3fd..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe3.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe3@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe3@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3.png deleted file mode 100644 index 5072e31742..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3@2x.png deleted file mode 100644 index ebfa6ca374..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3@3x.png deleted file mode 100644 index dc0541c5f9..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe3.imageset/touchAbilitySwipe3@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/Contents.json deleted file mode 100644 index 307df5648a..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe4.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe4@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilitySwipe4@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4.png deleted file mode 100644 index b054a6f4e1..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4@2x.png deleted file mode 100644 index d3fd681849..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4@3x.png deleted file mode 100644 index f691744da4..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilitySwipe4.imageset/touchAbilitySwipe4@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/Contents.json deleted file mode 100644 index fe3d48231b..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilityTap.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityTap@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityTap@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap.png deleted file mode 100644 index f8e54c49a5..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap@2x.png deleted file mode 100644 index 4ab09bc4ae..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap@3x.png deleted file mode 100644 index cb4c85706a..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityTap.imageset/touchAbilityTap@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/Contents.json b/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/Contents.json deleted file mode 100644 index ed2a285aa4..0000000000 --- a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "touchAbilityVerticalScroll.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityVerticalScroll@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "touchAbilityVerticalScroll@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll.png deleted file mode 100644 index 4bed673d5e..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll@2x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll@2x.png deleted file mode 100644 index f29c1f9b49..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll@2x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll@3x.png b/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll@3x.png deleted file mode 100644 index 238a435ba0..0000000000 Binary files a/ResearchKit/Artwork.xcassets/Active/touchAbilityVerticalScroll.imageset/touchAbilityVerticalScroll@3x.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/iCNDialPointerWithShadow.imageset/Contents.json b/ResearchKit/Artwork.xcassets/iCNDialPointerWithShadow.imageset/Contents.json deleted file mode 100644 index ed2b414595..0000000000 --- a/ResearchKit/Artwork.xcassets/iCNDialPointerWithShadow.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "iCNDialPointerWithShadow.pdf", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/iCNDialPointerWithShadow.imageset/iCNDialPointerWithShadow.pdf b/ResearchKit/Artwork.xcassets/iCNDialPointerWithShadow.imageset/iCNDialPointerWithShadow.pdf deleted file mode 100644 index 4c1415ddc0..0000000000 Binary files a/ResearchKit/Artwork.xcassets/iCNDialPointerWithShadow.imageset/iCNDialPointerWithShadow.pdf and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/iCNLandoltC.imageset/Contents.json b/ResearchKit/Artwork.xcassets/iCNLandoltC.imageset/Contents.json deleted file mode 100644 index b31bec61e9..0000000000 --- a/ResearchKit/Artwork.xcassets/iCNLandoltC.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "iCNLandoltC.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/iCNLandoltC.imageset/iCNLandoltC.png b/ResearchKit/Artwork.xcassets/iCNLandoltC.imageset/iCNLandoltC.png deleted file mode 100644 index 33a321e6be..0000000000 Binary files a/ResearchKit/Artwork.xcassets/iCNLandoltC.imageset/iCNLandoltC.png and /dev/null differ diff --git a/ResearchKit/Artwork.xcassets/orangeGrayCircle.imageset/Contents.json b/ResearchKit/Artwork.xcassets/orangeGrayCircle.imageset/Contents.json deleted file mode 100644 index 7efe8f72fe..0000000000 --- a/ResearchKit/Artwork.xcassets/orangeGrayCircle.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "orangeGrayCircle.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/ResearchKit/Artwork.xcassets/orangeGrayCircle.imageset/orangeGrayCircle.png b/ResearchKit/Artwork.xcassets/orangeGrayCircle.imageset/orangeGrayCircle.png deleted file mode 100644 index b183e4fbb5..0000000000 Binary files a/ResearchKit/Artwork.xcassets/orangeGrayCircle.imageset/orangeGrayCircle.png and /dev/null differ diff --git a/ResearchKit/Charts/ORKBarGraphChartView.h b/ResearchKit/Charts/ORKBarGraphChartView.h deleted file mode 100644 index ed291943b1..0000000000 --- a/ResearchKit/Charts/ORKBarGraphChartView.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (c) 2015, Ramsundar Shandilya. - Copyright (c) 2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import - - -/** - The `ORKBarGraphChartView` class presents the data provided by an object conforming to the - `ORKValueStackGraphChartViewDataSource` protocol as a bar graph. - - By default, the primary plot is colored by the `tintColor`, and any additional plots are colored - using the `referenceLineColor` property. You can customize the plot colors by implementing the - `-graphChartView:colorForPlotIndex:` method in the data source. - */ -ORK_CLASS_AVAILABLE -@interface ORKBarGraphChartView : ORKGraphChartView - -/** - The data source responsible for providing the data required to populate the graph chart view. - - See the `ORKValueStackGraphChartViewDataSource` protocol. - */ -@property (nonatomic, weak) id dataSource; - -@end diff --git a/ResearchKit/Charts/ORKBarGraphChartView.m b/ResearchKit/Charts/ORKBarGraphChartView.m deleted file mode 100644 index cfeded958c..0000000000 --- a/ResearchKit/Charts/ORKBarGraphChartView.m +++ /dev/null @@ -1,290 +0,0 @@ -/* - Copyright (c) 2015, Ramsundar Shandilya. - Copyright (c) 2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKBarGraphChartView.h" - -#import "ORKGraphChartView_Internal.h" - -#import "ORKHelpers_Internal.h" - - -#if TARGET_INTERFACE_BUILDER - -@interface ORKIBBarGraphChartViewDataSource : ORKIBGraphChartViewDataSource - -+ (instancetype)sharedInstance; - -@end - - -@implementation ORKIBBarGraphChartViewDataSource - -+ (instancetype)sharedInstance { - static id sharedInstance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInstance = [[self class] new]; - }); - return sharedInstance; -} - -- (instancetype)init { - self = [super init]; - if (self) { - self.plotPoints = @[ - @[ - [[ORKValueStack alloc] initWithStackedValues:@[ @4, @6 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @2, @4, @4 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @2, @6, @3, @6 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @3, @8, @10, @12 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @5, @10, @12, @8 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @8, @13, @18 ]], - ], - @[ - [[ORKValueStack alloc] initWithStackedValues:@[ @14 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @6, @6 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @3, @10, @12 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @5, @11, @14 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @7, @13, @20 ]], - [[ORKValueStack alloc] initWithStackedValues:@[ @10, @13, @25 ]], - ] - ]; - } - return self; -} - -- (ORKValueStack *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex { - return self.plotPoints[plotIndex][pointIndex]; -} - -@end - -#endif - -static const CGFloat BarWidth = 10.0; - - -@interface ORKBarGraphChartView () - -@property (nonatomic) NSMutableArray *> *dataPoints; // Actual data - -@property (nonatomic) NSMutableArray *> *yAxisPoints; // Normalized for the plot view height - -@end - - -@implementation ORKBarGraphChartView - -@dynamic dataSource; -@dynamic dataPoints; -@dynamic yAxisPoints; - -#pragma mark - Draw - -- (ORKValueStack *)dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex { - return [self.dataSource graphChartView:self dataPointForPointIndex:pointIndex plotIndex:plotIndex]; -} - -- (ORKValueStack *)dummyPoint { - return [ORKValueStack new]; -} - -- (BOOL)shouldDrawLinesForPlotIndex:(NSInteger)plotIndex { - return YES; -} - -- (NSMutableArray *)normalizedCanvasDataPointsForPlotIndex:(NSInteger)plotIndex canvasHeight:(CGFloat)viewHeight { - NSMutableArray *normalizedDataPoints = [NSMutableArray new]; - - if (plotIndex < self.dataPoints.count) { - NSUInteger pointCount = self.dataPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - - NSMutableArray *normalizedDoubleStackValues = [NSMutableArray new]; - ORKValueStack *dataPointValue = self.dataPoints[plotIndex][pointIndex]; - - if (!dataPointValue.isUnset) { - double range = self.maximumValue - self.minimumValue; - double sum = 0; - for (NSNumber *value in dataPointValue.stackedValues) { - // normalizedDoubleStackValues holds absolute canvas y-positions corresponding to each point - // (rather than incremental y-positions as the dataPoints valueStacks hold). - // E.g. (canvas height = 100) - // dataPoint valueStack = {10, 10, 20} - // -> - // normalized valueStack = {25, 50, 100} - sum += value.doubleValue; - double normalizedValue = (sum - self.minimumValue) / range * viewHeight; - normalizedValue = floor(viewHeight - normalizedValue); - - [normalizedDoubleStackValues addObject:@(normalizedValue)]; - } - } - [normalizedDataPoints addObject:[[ORKValueStack alloc] initWithStackedValues:normalizedDoubleStackValues]]; - } - } - - return normalizedDataPoints; -} - -- (void)calculateMinAndMaxValues { - self.minimumValue = ORKDoubleInvalidValue; - self.maximumValue = ORKDoubleInvalidValue; - - BOOL maximumValueProvided = NO; - - if ([self.dataSource respondsToSelector:@selector(minimumValueForGraphChartView:)]) { - self.minimumValue = [self.dataSource minimumValueForGraphChartView:self]; - } else { - self.minimumValue = 0; - } - - if ([self.dataSource respondsToSelector:@selector(maximumValueForGraphChartView:)]) { - self.maximumValue = [self.dataSource maximumValueForGraphChartView:self]; - maximumValueProvided = YES; - } - - if (!maximumValueProvided) { - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - NSInteger numberOfPlotPoints = self.dataPoints[plotIndex].count; - for (NSInteger pointIndex = 0; pointIndex < numberOfPlotPoints; pointIndex++) { - ORKValueStack *point = self.dataPoints[plotIndex][pointIndex]; - if (!maximumValueProvided && - point.totalValue != ORKDoubleInvalidValue && - ((self.maximumValue == ORKDoubleInvalidValue) || (point.totalValue > self.maximumValue))) { - self.maximumValue = point.totalValue; - } - } - } - } - - if (self.maximumValue == ORKDoubleInvalidValue) { - self.maximumValue = 0; - } -} - -- (UIColor *)colorForPlotIndex:(NSInteger)plotIndex subpointIndex:(NSInteger)subpointIndex totalSubpoints:(NSInteger)totalSubpoints { - return ORKOpaqueColorWithReducedAlphaFromBaseColor([super colorForPlotIndex:plotIndex subpointIndex:subpointIndex totalSubpoints:(NSInteger)totalSubpoints], subpointIndex, totalSubpoints); -} - -- (void)updateLineLayersForPlotIndex:(NSInteger)plotIndex { - NSUInteger pointCount = self.dataPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - ORKValueStack *dataPointValue = self.dataPoints[plotIndex][pointIndex]; - NSMutableArray *lineLayers = [NSMutableArray new]; - if (!dataPointValue.isUnset) { - NSUInteger numberOfStackedValues = dataPointValue.stackedValues.count; - for (NSUInteger index = 0; index < numberOfStackedValues; index++) { - CAShapeLayer *lineLayer = [CAShapeLayer layer]; - lineLayer.strokeColor = [self colorForPlotIndex:plotIndex subpointIndex:index totalSubpoints:numberOfStackedValues].CGColor; - lineLayer.lineWidth = BarWidth; - [self.plotView.layer addSublayer:lineLayer]; - [lineLayers addObject:lineLayer]; - } - } - [self.lineLayers[plotIndex] addObject:lineLayers]; - } -} - -- (void)layoutLineLayersForPlotIndex:(NSInteger)plotIndex { - NSUInteger lineLayerIndex = 0; - double positionOnXAxis = ORKDoubleInvalidValue; - ORKValueStack *positionsOnYAxis = nil; - NSUInteger pointCount = self.yAxisPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - float previousYValue = self.plotView.bounds.size.height; - - ORKValueStack *dataPointValue = self.dataPoints[plotIndex][pointIndex]; - positionsOnYAxis = self.yAxisPoints[plotIndex][pointIndex]; - - if (!dataPointValue.isUnset) { - NSUInteger numberOfSubpoints = positionsOnYAxis.stackedValues.count; - for (NSUInteger subpointIndex = 0; subpointIndex < numberOfSubpoints; subpointIndex++) { - double positionOnYAxis = positionsOnYAxis.stackedValues[subpointIndex].doubleValue; - UIBezierPath *linePath = [UIBezierPath bezierPath]; - - double barHeight = fabs(positionOnYAxis - previousYValue); - - positionOnXAxis = xAxisPoint(pointIndex, self.numberOfXAxisPoints, self.plotView.bounds.size.width); - positionOnXAxis += [self xOffsetForPlotIndex:plotIndex]; - - [linePath moveToPoint:CGPointMake(positionOnXAxis, previousYValue + scalePixelAdjustment())]; - [linePath addLineToPoint:CGPointMake(positionOnXAxis, previousYValue + scalePixelAdjustment() - barHeight)]; - - previousYValue = positionOnYAxis; - - CAShapeLayer *lineLayer = self.lineLayers[plotIndex][pointIndex][subpointIndex]; - lineLayer.path = linePath.CGPath; - lineLayerIndex++; - } - } - } -} - -#pragma mark - Scrubbing - -- (double)scrubbingValueForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex { - return self.dataPoints[plotIndex][pointIndex].totalValue; -} - -- (double)scrubbingYAxisPointForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex { - return self.yAxisPoints[plotIndex][pointIndex].stackedValues.lastObject.doubleValue; // totalValue is not normalized to canvas coordinates -} - -- (CGFloat)xOffsetForPlotIndex:(NSInteger)plotIndex { - return xOffsetForPlotIndex(plotIndex, [self numberOfPlots], BarWidth); -} - -- (CGFloat)snappedXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - return [super snappedXPosition:xPosition plotIndex:plotIndex] + [self xOffsetForPlotIndex:plotIndex]; -} - -- (NSInteger)pointIndexForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - return [super pointIndexForXPosition:xPosition - [self xOffsetForPlotIndex:plotIndex] plotIndex:plotIndex]; -} - -- (BOOL)isXPositionSnapped:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - return [super isXPositionSnapped:xPosition - [self xOffsetForPlotIndex:plotIndex] plotIndex:plotIndex]; -} - -#pragma mark - Interface Builder designable - -- (void)prepareForInterfaceBuilder { - [super prepareForInterfaceBuilder]; -#if TARGET_INTERFACE_BUILDER - self.dataSource = [ORKIBBarGraphChartViewDataSource sharedInstance]; -#endif -} - - -@end diff --git a/ResearchKit/Charts/ORKChartTypes.h b/ResearchKit/Charts/ORKChartTypes.h deleted file mode 100644 index b890d39a3a..0000000000 --- a/ResearchKit/Charts/ORKChartTypes.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ramsundar Shandilya. - Copyright (c) 2015-2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import - - -NS_ASSUME_NONNULL_BEGIN -/** - Defines the common attributes of chart values. - */ -@protocol ORKValueCollectionType - -/** - A Boolean value indicating that the value is unset. (read-only) - */ -@property (nonatomic, readonly) BOOL isUnset; - -@end - - -/** - The `ORKValueRange` class represents a range between two values of the double type. It can be used - in graph chart plots to draw value ranges. - */ -ORK_CLASS_AVAILABLE -@interface ORKValueRange : NSObject - -/** - Returns a value range initialized using the specified `minimumValue` and `maximumValue`. - - @param minimumValue The `minimumValue` to set. - @param maximumValue The `maximumValue` to set. - - @return A value range object. - */ -- (instancetype)initWithMinimumValue:(double)minimumValue maximumValue:(double)maximumValue NS_DESIGNATED_INITIALIZER; - -/** - Returns a value range initialized using the specified `value` for both `minimumValue` and - `maximumValue`. This is useful for plotting data points that model a single value with no range. - - This method is a convenience initializer. - - @param value The `minimumValue` and `maximumValue` to set. - - @return A value range object. - */ -- (instancetype)initWithValue:(double)value; - -/** - Returns a value range initialized using the `ORKDoubleInvalidValue` value for both `minimumValue` - and `maximumValue`. This denotes an unset or invalid value range. It is useful, for example, for - representing unavailable data in discontinous graph chart plots. - - This method is a convenience initializer. - - @return A value range object initialized with the `ORKDoubleInvalidValue` value. - */ -- (instancetype)init; - -/** - The upper limit of the value range. - */ -@property (nonatomic) double maximumValue; - -/** - The lower limit of the value range. - */ -@property (nonatomic) double minimumValue; - -/** - A Boolean value indicating that `minimumValue` is equal to `maximumValue`. (read-only) - */ -@property (nonatomic, readonly) BOOL isEmptyRange; - -/** - A Boolean value indicating that both `minimum value` and `maximum value` are equal to the - `ORKDoubleInvalidValue` value. (read-only) - */ -@property (nonatomic, readonly) BOOL isUnset; - -@end - - -/** - The `ORKValueStack` class represents an arbitrary list of values of the double type. It can be used - in graph chart plots to draw stacked values. - */ -ORK_CLASS_AVAILABLE -@interface ORKValueStack : NSObject - -/** - Returns an empty value stack. - - @return An empty value stack object. - */ -- (instancetype)init; - -/** - Returns a value stack initialized with the passed `NSNumber` array. - - @param stackedValues An array containing `NSNumber` objects. - - @return A value stack object initialized with the passed `NSNumber` values. - */ -- (instancetype)initWithStackedValues:(NSArray *)stackedValues NS_DESIGNATED_INITIALIZER; - -/** - An array of `NSNumber` objects, each one representing a stacked double value. - */ -@property (nonatomic, copy, readonly) NSArray *stackedValues; - -/** - The total sum of the stacked double values - */ -@property (nonatomic) double totalValue; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKChartTypes.m b/ResearchKit/Charts/ORKChartTypes.m deleted file mode 100644 index 27d93c997f..0000000000 --- a/ResearchKit/Charts/ORKChartTypes.m +++ /dev/null @@ -1,163 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ramsundar Shandilya. - Copyright (c) 2015-2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKChartTypes.h" - -#import "ORKHelpers_Internal.h" - - -@implementation ORKValueRange - -- (instancetype)initWithMinimumValue:(double)minimumValue maximumValue:(double)maximumValue { - if (maximumValue < minimumValue) { - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:@"maximumValue cannot be lower than minimumValue" - userInfo:nil]; - } - - self = [super init]; - if (self) { - _minimumValue = minimumValue; - _maximumValue = maximumValue; - } - return self; -} - -- (instancetype)init { - return [self initWithMinimumValue:ORKDoubleInvalidValue maximumValue:ORKDoubleInvalidValue]; -} - -- (instancetype)initWithValue:(double)value { - return [self initWithMinimumValue:value maximumValue:value]; -} - -- (BOOL)isUnset { - return (_minimumValue == ORKDoubleInvalidValue && _maximumValue == ORKDoubleInvalidValue); -} - -- (BOOL)isEmptyRange { - return (_minimumValue == _maximumValue); -} - -- (NSString *)description { - NSString *minimumValueString = (_minimumValue == ORKDoubleInvalidValue) ? @"ORKDoubleInvalidValue" : [NSString stringWithFormat:@"%0.0f", _minimumValue] ; - NSString *maximumValueString = (_maximumValue == ORKDoubleInvalidValue) ? @"ORKDoubleInvalidValue" : [NSString stringWithFormat:@"%0.0f", _maximumValue] ; - return [NSString stringWithFormat:@"<%@: %p; min = %@; max = %@>", self.class.description, self, minimumValueString, maximumValueString]; -} - -#pragma mark - Accessibility - -- (NSString *)accessibilityLabel { - if (self.isUnset) { - return nil; - } - - if (self.isEmptyRange || _minimumValue == _maximumValue) { - return @(_maximumValue).stringValue; - } else { - NSString *rangeFormat = ORKLocalizedString(@"AX_GRAPH_RANGE_FORMAT_%@_%@", nil); - return [NSString stringWithFormat:rangeFormat, @(_minimumValue).stringValue, @(_maximumValue).stringValue]; - } -} - -@end - - -@implementation ORKValueStack - -- (instancetype)init { - return [self initWithStackedValues:@[]]; -} - -- (instancetype)initWithStackedValues:(NSArray *)stackedValues { - self = [super init]; - if (self) { - if (stackedValues.count == 0) { - _totalValue = ORKDoubleInvalidValue; - } else { - _totalValue = 0; - for (NSNumber *number in stackedValues) { - if (![number isKindOfClass:[NSNumber class]]) { - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:@"stackedValues must only contain NSNumber objects" - userInfo:nil]; - } - _totalValue += number.doubleValue; - } - } - _stackedValues = [stackedValues copy]; - } - return self; -} - -- (BOOL)isUnset { - return !_stackedValues || _stackedValues.count == 0; -} - -- (NSString *)description { - NSMutableString *mutableString = [NSMutableString new]; - [mutableString appendFormat:@"<%@: %p; (", self.class.description, self]; - NSUInteger numberOfStackedValues = _stackedValues.count; - for (NSInteger index = 0; index < numberOfStackedValues; index++) { - [mutableString appendFormat:@"%0.0f", _stackedValues[index].doubleValue]; - if (index < numberOfStackedValues - 1) { - [mutableString appendString:@", "]; - } - } - [mutableString appendString:@")>"]; - return [mutableString copy]; -} - -#pragma mark - Accessibility - -- (NSString *)accessibilityLabel { - if (self.isUnset) { - return nil; - } - - NSMutableString *mutableString = [[NSMutableString alloc] initWithFormat:@"%@ %@", - ORKLocalizedString(@"AX_GRAPH_STACK_PREFIX", nil), _stackedValues[0].stringValue]; - - NSUInteger numberOfStackedValues = _stackedValues.count; - for (NSInteger index = 1; index < numberOfStackedValues; index++) { - [mutableString appendString:@", "]; - if (index == (numberOfStackedValues - 1)) { - [mutableString appendString:ORKLocalizedString(@"AX_GRAPH_AND_SEPARATOR", nil)]; - } - [mutableString appendFormat:@"%@", _stackedValues[index].stringValue]; - } - return [mutableString copy]; -} - -@end diff --git a/ResearchKit/Charts/ORKDiscreteGraphChartView.h b/ResearchKit/Charts/ORKDiscreteGraphChartView.h deleted file mode 100644 index de9413578a..0000000000 --- a/ResearchKit/Charts/ORKDiscreteGraphChartView.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import - - -NS_ASSUME_NONNULL_BEGIN - -/** - The `ORKDiscreteGraphChartView` class presents data provided by an object conforming to the - `ORKValueRangeGraphChartViewDataSource` protocol as a discrete graph of ranged points. - - You can optionally display a line connecting each ranged point pair. - - By default, the primary plot is colored by the `tintColor`, and any additional plots are colored - using the `referenceLineColor` property. You can customize the plot colors by implementing the - `-graphChartView:colorForPlotIndex:` method in the data source. - */ -ORK_CLASS_AVAILABLE -@interface ORKDiscreteGraphChartView : ORKValueRangeGraphChartView - -/** - A Boolean value indicating whether to draw a line connecting the minimum value and maximum value of - each ranged point represented by the graph view. - - The default value for this property is `YES`. - */ -@property (nonatomic) IBInspectable BOOL drawsConnectedRanges; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKDiscreteGraphChartView.m b/ResearchKit/Charts/ORKDiscreteGraphChartView.m deleted file mode 100644 index 2d75274402..0000000000 --- a/ResearchKit/Charts/ORKDiscreteGraphChartView.m +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#import "ORKDiscreteGraphChartView.h" - -#import "ORKChartTypes.h" -#import "ORKGraphChartView_Internal.h" - -#import "ORKHelpers_Internal.h" - - -#if TARGET_INTERFACE_BUILDER - -@interface ORKIBDiscreteGraphChartViewDataSource : ORKIBValueRangeGraphChartViewDataSource - -+ (instancetype)sharedInstance; - -@end - - -@implementation ORKIBDiscreteGraphChartViewDataSource - -+ (instancetype)sharedInstance { - static id sharedInstance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInstance = [[self class] new]; - }); - return sharedInstance; -} - -- (instancetype)init { - self = [super init]; - if (self) { - self.plotPoints = @[ - @[ - [[ORKValueRange alloc] initWithMinimumValue:0 maximumValue: 2], - [[ORKValueRange alloc] initWithMinimumValue:1 maximumValue: 4], - [[ORKValueRange alloc] initWithMinimumValue:2 maximumValue: 6], - [[ORKValueRange alloc] initWithMinimumValue:3 maximumValue: 8], - [[ORKValueRange alloc] initWithMinimumValue:5 maximumValue:10], - [[ORKValueRange alloc] initWithMinimumValue:8 maximumValue:13] - ], - @[ - [[ORKValueRange alloc] initWithValue:1], - [[ORKValueRange alloc] initWithMinimumValue:2 maximumValue:6], - [[ORKValueRange alloc] initWithMinimumValue:3 maximumValue:10], - [[ORKValueRange alloc] initWithMinimumValue:5 maximumValue:11], - [[ORKValueRange alloc] initWithMinimumValue:7 maximumValue:13], - [[ORKValueRange alloc] initWithMinimumValue:10 maximumValue:13] - ] - ]; - } - return self; -} - -@end - -#endif - - -@implementation ORKDiscreteGraphChartView - -#pragma mark - Init - -- (void)sharedInit { - [super sharedInit]; - _drawsConnectedRanges = YES; -} - -- (void)setDrawsConnectedRanges:(BOOL)drawsConnectedRanges { - _drawsConnectedRanges = drawsConnectedRanges; - [super updateLineLayers]; - [super updatePointLayers]; - [super layoutLineLayers]; - [super layoutPointLayers]; -} - -#pragma mark - Draw - -- (BOOL)shouldDrawLinesForPlotIndex:(NSInteger)plotIndex { - return [self numberOfValidValuesForPlotIndex:plotIndex] > 0 && _drawsConnectedRanges; -} - -- (void)updateLineLayersForPlotIndex:(NSInteger)plotIndex { - NSUInteger pointCount = self.dataPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - ORKValueRange *dataPointValue = self.dataPoints[plotIndex][pointIndex]; - if (!dataPointValue.isUnset && !dataPointValue.isEmptyRange) { - CAShapeLayer *lineLayer = graphLineLayer(); - lineLayer.strokeColor = [self colorForPlotIndex:plotIndex].CGColor; - lineLayer.lineWidth = ORKGraphChartViewPointAndLineWidth; - - [self.plotView.layer addSublayer:lineLayer]; - [self.lineLayers[plotIndex] addObject:[NSMutableArray arrayWithObject:lineLayer]]; - } - } -} - -- (void)layoutLineLayersForPlotIndex:(NSInteger)plotIndex { - NSUInteger lineLayerIndex = 0; - CGFloat positionOnXAxis = ORKCGFloatInvalidValue; - ORKValueRange *positionOnYAxis = nil; - NSUInteger pointCount = self.yAxisPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - - ORKValueRange *dataPointValue = self.dataPoints[plotIndex][pointIndex]; - - if (!dataPointValue.isUnset && !dataPointValue.isEmptyRange) { - - UIBezierPath *linePath = [UIBezierPath bezierPath]; - - positionOnXAxis = xAxisPoint(pointIndex, self.numberOfXAxisPoints, self.plotView.bounds.size.width); - positionOnXAxis += [self xOffsetForPlotIndex:plotIndex]; - positionOnYAxis = self.yAxisPoints[plotIndex][pointIndex]; - - [linePath moveToPoint:CGPointMake(positionOnXAxis, positionOnYAxis.minimumValue)]; - [linePath addLineToPoint:CGPointMake(positionOnXAxis, positionOnYAxis.maximumValue)]; - - CAShapeLayer *lineLayer = self.lineLayers[plotIndex][lineLayerIndex][0]; - lineLayer.path = linePath.CGPath; - lineLayerIndex++; - } - } -} - -- (CGFloat)xOffsetForPlotIndex:(NSInteger)plotIndex { - return xOffsetForPlotIndex(plotIndex, [self numberOfPlots], ORKGraphChartViewPointAndLineWidth); -} - -- (CGFloat)snappedXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - return [super snappedXPosition:xPosition plotIndex:plotIndex] + [self xOffsetForPlotIndex:plotIndex]; -} - -- (NSInteger)pointIndexForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - return [super pointIndexForXPosition:xPosition - [self xOffsetForPlotIndex:plotIndex] plotIndex:plotIndex]; - } - -- (BOOL)isXPositionSnapped:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - return [super isXPositionSnapped:xPosition - [self xOffsetForPlotIndex:plotIndex] plotIndex:plotIndex]; -} - -#pragma mark - Interface Builder designable - -- (void)prepareForInterfaceBuilder { - [super prepareForInterfaceBuilder]; -#if TARGET_INTERFACE_BUILDER - self.dataSource = [ORKIBDiscreteGraphChartViewDataSource sharedInstance]; -#endif -} - -@end diff --git a/ResearchKit/Charts/ORKGraphChartView.h b/ResearchKit/Charts/ORKGraphChartView.h deleted file mode 100644 index 06583a31fb..0000000000 --- a/ResearchKit/Charts/ORKGraphChartView.h +++ /dev/null @@ -1,558 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - Copyright (c) 2017, Macro Yau. - Copyright (c) 2018, Brian Ganninger. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -@import UIKit; -#import - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKValueRange; -@class ORKValueStack; -@class ORKGraphChartView; - -/** - The graph chart view delegate protocol forwards pan gesture events occuring - within the bounds of an `ORKGraphChartView` object. -*/ -ORK_AVAILABLE_DECL -@protocol ORKGraphChartViewDelegate - -@optional -/** - Notifies the delegate that a pan gesture has begun within the bounds of an `ORKGraphChartView` - object. - - @param graphChartView The graph chart view in which the gesture occurred. -*/ -- (void)graphChartViewTouchesBegan:(ORKGraphChartView *)graphChartView; - -/** - Notifies the delegate of updates in the x-coordinate of an ongoing pan gesture within the bounds - of an `ORKGraphChartView` object. - - @param graphChartView The graph chart view object in which the gesture occurred. - @param xPosition The updated x-coordinate of the ongoing pan gesture. -*/ -- (void)graphChartView:(ORKGraphChartView *)graphChartView touchesMovedToXPosition:(CGFloat)xPosition; - -/** - Notifies the delegate that a pan gesture that began within the bounds of an `ORKGraphChartView` - object has ended. - -@param graphChartView The graph chart view object in which the gesture occurred. -*/ -- (void)graphChartViewTouchesEnded:(ORKGraphChartView *)graphChartView; - -@end - - -/** - The abstract `ORKGraphChartViewDataSource` protocol is the base protocol which conforms the basis - for the `ORKValueRangeGraphChartViewDataSource` and `ORKValueStackGraphChartViewDataSource` - protocols, required to populate the concrete `ORKGraphChartView` subclass. - - At a minimum, a data source object must implement the `graphChartView:numberOfPointsInPlot:` and - `graphChartView:plot:valueForPointAtIndex:` methods. These methods return - the number of points in a plot and the points themselves. Each point in a plot is represented by - an object of the `ORKValueRange` or `ORKValueStack` class, depending on the concrete subprotocol. - - A data source object may provide additional information to the graph chart view by implementing the - optional methods. - - When configuring an `ORKGraphChartView` object, assign your data source to its `dataSource` - property. -*/ -@protocol ORKGraphChartViewDataSource - -@required -/** - Asks the data source for the number of value points to be plotted by the graph chart view at the - specified plot index. - - @param graphChartView The graph chart view asking for the number of value points. - @param plotIndex An index number identifying the plot in the graph chart view. This index - is 0 in a single-plot graph chart view. - - @return The number of range points in the plot at `plotIndex`. -*/ -- (NSInteger)graphChartView:(ORKGraphChartView *)graphChartView numberOfDataPointsForPlotIndex:(NSInteger)plotIndex; - - -/** - Asks the data source for the number of plots to be plotted by the graph chart view. - - @param graphChartView The graph chart view asking for the number of plots. - - @return The number of plots in the graph chart view. -*/ -- (NSInteger)numberOfPlotsInGraphChartView:(ORKGraphChartView *)graphChartView; - -@optional -/** - Asks the data source for the color of the specified plot. - - If this method is not implemented, the first plot uses the graph chart view `tintColor`, and - all subsequent plots uses the current `referenceLineColor`. - - @param graphChartView The graph chart view asking for the color of the segment. - @param plotIndex An index number identifying the plot in the graph chart view. This index - is always 0 in single-plot graph chart views. - - @return The color of the segment at the specified index in a pie chart view. - */ -- (UIColor *)graphChartView:(ORKGraphChartView *)graphChartView colorForPlotIndex:(NSInteger)plotIndex; - -/** - Asks the data source for the fill color of the specified plot. - - The fill color is only used by `ORKLineGraphChartView`. If this method is not implemented, the - chart uses the main color of the specified plot with a 0.4 opacity value. - - @param graphChartView The graph chart view asking for the color of the segment. - @param plotIndex An index number identifying the plot in the graph chart view. This index - is always 0 in single-plot graph chart views. - - @return The color of the fill layer at the specified index in a line chart view. - */ -- (UIColor *)graphChartView:(ORKGraphChartView *)graphChartView fillColorForPlotIndex:(NSInteger)plotIndex; - -/** - Asks the data source which plot the scrubber should snap to in multigraph chart views. - - If this method is not implemented, the scrubber snaps over the first plot. - - @param graphChartView The graph chart view asking for the scrubbing plot index. - - @return The index of the plot that the scrubber should snap to. - */ -- (NSInteger)scrubbingPlotIndexForGraphChartView:(ORKGraphChartView *)graphChartView; - -/** - Asks the data source for the upper limit of the y-axis drawn by the graph chart view. - - If this method is not implemented, the greatest `maximumValue` of all `ORKValueRange` instances - returned in `graphChartView:plot:valueForPointAtIndex:` is used. - - See also: `graphChartView:plot:valueForPointAtIndex:`. - - @param graphChartView The graph chart view asking for the maximum value. - - @return The maximum value of the y-axis drawn by `graphChartView`. -*/ -- (double)maximumValueForGraphChartView:(ORKGraphChartView *)graphChartView; - -/** - Asks the data source for the lower limit of the y-axis drawn by the graph chart view. - - If this method is not implemented, the smallest `minimumValue` of all ORKValueRange instances - returned in `graphChartView:plot:valueForPointAtIndex:` is used. - - See also: `graphChartView:plot:valueForPointAtIndex:`. - - @param graphChartView The graph chart view asking for the minimum value. - - @return The minimum value of the y-axis drawn by `graphChartView`. -*/ -- (double)minimumValueForGraphChartView:(ORKGraphChartView *)graphChartView; - -/** - Asks the data source for the number of divisions in the x-axis. The value is ignored if it is lower - than the number of data points. A title appearing adjacent to each - division may optionally be returned by the `graphChartView:titleForXAxisAtPointIndex:` method. - - @param graphChartView The graph chart view asking for the number of divisions in its x-axis. - - @return The number of divisions in the x-axis for `graphChartView`. -*/ -- (NSInteger)numberOfDivisionsInXAxisForGraphChartView:(ORKGraphChartView *)graphChartView; - -/** - Asks the data source for the title to be displayed adjacent to each division in the x-axis (the - number returned by `numberOfDivisionsInXAxisForGraphChartView:`). You can return `nil` from this - method if you don't want to display a title for the specified point index. - - If this method is not implemented, the x-axis has no titles. - - See also: `numberOfDivisionsInXAxisForGraphChartView:`. - - @param graphChartView The graph chart view asking for the title. - @param pointIndex The index of the specified x-axis division. - - @return The title string to be displayed adjacent to each division of the x-axis of the graph chart - view. -*/ -- (nullable NSString *)graphChartView:(ORKGraphChartView *)graphChartView titleForXAxisAtPointIndex:(NSInteger)pointIndex; - -/** - Asks the data source if the vertical reference line at the specified point index should be drawn.. - - If this method is not implemented, the graph chart view will draw all vertical reference lines. - - @param graphChartView The graph view asking for the tile. - @param pointIndex The index corresponding to the number returned by - `numberOfDivisionsInXAxisForGraphChartView:`. - - @return Whether the graph chart view should draw the vertical reference line. - */ -- (BOOL)graphChartView:(ORKGraphChartView *)graphChartView drawsVerticalReferenceLineAtPointIndex:(NSInteger)pointIndex; - - -/** - Asks the data source if the plot at specified index should display circular indicators on its data points. - - This only applys to `ORKLineGrapthChartView`. - If this method is not implemented, point indicators will be drawn for all plots. - - @param graphChartView The graph view asking whether point indicators should be drawn. - @param plotIndex An index number identifying the plot in the graph chart view. This index - is always 0 in single-plot graph chart views. - - @return Whether the graph chart view should draw point indicators for its points. - */ -- (BOOL)graphChartView:(ORKGraphChartView *)graphChartView drawsPointIndicatorsForPlotIndex:(NSInteger)plotIndex; - - -/** - Asks the data source for the unit label for the given plot index so VoiceOver's description of the graph can be read with units. - - If this method is not implemented, VoiceOver will speak the graph value without units. - - @param graphChartView The graph view asking for its unit label - @param plotIndex An index number identifying the plot in the graph chart view. This index - is always 0 in single-plot graph chart views. - - @return An appropriate unit label for the given plot. - */ -- (NSString *)graphChartView:(ORKGraphChartView *)graphChartView accessibilityUnitLabelForPlotIndex:(NSInteger)plotIndex; - - -/** - Asks the data source for the accessibilityLabel at a given point on the x-axis - - This is used in cases where the UI may be displaying a shortened form (e.g. M, T, W, etc. for days of the week), but VoiceOver should be speaking the longer form. If this method isn't implemented, VoiceOver will speak the label displayed in the UI for the given index. - - @param graphChartView The graph view asking for its unit label - @param pointIndex The index corresponding to the number returned by `numberOfDivisionsInXAxisForGraphChartView:`. - - @return An appropriate accessibility label for the given index of the graph. - */ -- (NSString *)graphChartView:(ORKGraphChartView *)graphChartView accessibilityLabelForXAxisAtPointIndex:(NSInteger)pointIndex; - -@end - - -/** - An object that adopts the `ORKValueRangeGraphChartViewDataSource` protocol is responsible for - providing data in the form of `ORKValueRange` values required to populate an - `ORKValueRangeGraphChartView` concrete subclass, such as `ORKLineGraphChartView` and - `ORKDiscreteGraphChartView`. - */ -ORK_AVAILABLE_DECL -@protocol ORKValueRangeGraphChartViewDataSource - -@required - -/** - Asks the data source for the value range to be plotted at the specified point index for the - specified plot. - - @param graphChartView The graph chart view that is asking for the value range. - @param pointIndex An index number identifying the value range in the graph chart view. - @param plotIndex An index number identifying the plot in the graph chart view. This index - is 0 in a single-plot graph chart view. - - @return The value range specified by `pointIndex` in the plot specified by `plotIndex` for the - specified graph chart view`. - */ -- (ORKValueRange *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex; - -@end - - -/** - An object that adopts the `ORKValueStackGraphChartViewDataSource` protocol is responsible for - providing data in the form of `ORKValueStack` values required to populate an `ORKBarGraphChartView` - object. - */ -ORK_AVAILABLE_DECL -@protocol ORKValueStackGraphChartViewDataSource - -@required - -/** - Asks the data source for the value stack to be plotted at the specified point index for the - specified plot. - - @param graphChartView The graph chart view that is asking for the value stack. - @param pointIndex An index number identifying the value stack in the graph chart view. - @param plotIndex An index number identifying the plot in the graph chart view. This index - is 0 in a single-plot graph chart view. - - @return The value stack specified by `pointIndex` in the plot specified by `plotIndex` for the - specified graph chart view`. - */ -- (ORKValueStack *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex; - -@end - - -/** - The `ORKGraphChartView` class is an abstract class which holds properties and methods common to - concrete subclasseses. - - You should not instantiate this class directly; use one of the subclasses instead. The concrete - subclasses are `ORKLineGraphChartView`, `ORKDiscreteGraphChartView`, and `ORKBarGraphChartView`. -*/ -ORK_CLASS_AVAILABLE -IB_DESIGNABLE -@interface ORKGraphChartView : UIView - -/** - The minimum value of the y-axis. - - You can provide this value to an instance of `ORKGraphChartView` by implementing the optional - `minimumValueForGraphChartView:` method of the `ORKGraphChartViewDataSource` protocol. - - If `minimumValueForGraphChartView:` is not implemented, the minimum value is assigned to the - smallest value of the `minimumValue` property of all `ORKValueRange` instances returned by the - graph chart view data source. -*/ -@property (nonatomic, readonly) double minimumValue; - -/** - The maximum value of the y-axis. - - You can provide this value instance of `ORKGraphChartView` by implementing the - optional `maximumValueForGraphChartView:` method of the `ORKGraphChartViewDataSource` protocol. - - If `maximumValueForGraphChartView:` is not implemented, the maximum value is assigned to the - largest value of the `maximumValue` property of all `ORKValueRange` instances returned by the - graph chart view data source. -*/ -@property (nonatomic, readonly) double maximumValue; - -/** - A Boolean value indicating whether the graph chart view should draw horizontal reference lines. - - The default value of this property is NO. - */ -@property (nonatomic) IBInspectable BOOL showsHorizontalReferenceLines; - -/** - A Boolean value indicating whether the graph chart view should draw vertical reference lines. - - The default value of this property is NO. -*/ -@property (nonatomic) IBInspectable BOOL showsVerticalReferenceLines; - -/** - The delegate is notified of pan gesture events occuring within the bounds of the graph chart - view. - - See the `ORKGraphChartViewDelegate` protocol. -*/ -@property (nonatomic, weak, nullable) id delegate; - -/** - The data source responsible for providing the data required to populate the graph chart view. - - See the `ORKGraphChartViewDataSource` protocol. -*/ -@property (nonatomic, weak) id dataSource; - -/** - The color of the axes drawn by the graph chart view. - - The default value for this property is a light gray color. Setting this property to `nil` - resets it to its default value. -*/ -@property (nonatomic, strong, null_resettable) IBInspectable UIColor *axisColor; - -/** - The color of the vertical axis titles. - - The default value for this property is a light gray color. Setting this property to `nil` resets it - to its default value. - - @note The horizontal axis titles use the current `tintColor`. -*/ -@property (nonatomic, strong, null_resettable) IBInspectable UIColor *verticalAxisTitleColor; - -/** - The color of the reference lines. - - The default value for this property is a light gray color. Setting this property to `nil` resets it - to its default value. -*/ -@property (nonatomic, strong, null_resettable) IBInspectable UIColor *referenceLineColor; - -/** - The background color of the thumb on the scrubber line. - - The default value for this property is a white color. Setting this property to `nil` resets it to - its default value. -*/ -@property (nonatomic, strong, null_resettable) IBInspectable UIColor *scrubberThumbColor; - -/** - The color of the scrubber line. - - The default value for this property is a gray color. Setting this property to `nil` resets it to - its default value. -*/ -@property (nonatomic, strong, null_resettable) IBInspectable UIColor *scrubberLineColor; - -/** - The string that is displayed if no data points are provided by the data source. - - The default value for this property is an appropriate message string. Setting this property to - `nil` resets it to its default value. -*/ -@property (nonatomic, copy, null_resettable) IBInspectable NSString *noDataText; - -/** - An image to be optionally displayed in place of the maximum value label on the y-axis. - - The default value for this property is `nil`. -*/ -@property (nonatomic, strong, nullable) IBInspectable UIImage *maximumValueImage; - -/** - An image to be optionally displayed in place of the minimum value label on the y-axis. - - The default value for this property is `nil`. -*/ -@property (nonatomic, strong, nullable) IBInspectable UIImage *minimumValueImage; - -/** - The font used to for the x-axis of the chart. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *xAxisFont; - -/** - The font used to for the y-axis of the chart. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *yAxisFont; - -/** - The font used to display the value when scrubbing the chart. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *scrubberFont; - -/** - The font used for the "no data" label in the chart. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *noDataFont; - -/** - The long press gesture recognizer that is used for scrubbing by the graph chart view. You can use - this property to prioritize your own gesture recognizers. - - This object is instatiated and added to the view when it is created. - */ -@property (nonatomic, strong, readonly) UILongPressGestureRecognizer *longPressGestureRecognizer; - -/** - The gesture recognizer that is used for scrubbing by the graph chart view. - - This object is instatiated and added to the view when it is created. - */ -@property (nonatomic, strong, readonly) UIPanGestureRecognizer *panGestureRecognizer; - -/** - The number of decimal places that is used on the y-axis and scrubber value labels. - - The default value of this property is 0. - */ -@property (nonatomic) NSUInteger decimalPlaces; - -/** - An array of factors for adding Y-Axis labels - */ -@property (nonatomic)NSArray *yAxisLabelFactors; - -/** - Animates the graph when it first displays on the screen. - - You can optionally call this method from the `viewWillAppear:` implementation of the view - controller that owns the graph chart view. - - @param animationDuration The duration of the appearing animation. - */ -- (void)animateWithDuration:(NSTimeInterval)animationDuration; - -/** - Reloads the plotted data. - - Call this method to reload the data and re-plot the graph. You should call it if the data provided by the dataSource changes. -*/ -- (void)reloadData; - -@end - - -/** - The `ORKValueRangeGraphChartView` class is an abstract class which holds a data source comforming - to the `ORKValueRangeGraphChartViewDataSource` protocol, common to concrete subclasseses. - - You should not instantiate this class directly; use one of the subclasses instead. The concrete - subclasses are `ORKLineGraphChartView` and `ORKDiscreteGraphChartView`. - */ -ORK_CLASS_AVAILABLE -@interface ORKValueRangeGraphChartView : ORKGraphChartView - -/** - The data source responsible for providing the data required to populate the graph chart view. - - See the `ORKValueRangeGraphChartViewDataSource` protocol. - */ -@property (nonatomic, weak) id dataSource; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKGraphChartView.m b/ResearchKit/Charts/ORKGraphChartView.m deleted file mode 100644 index 509513fbe7..0000000000 --- a/ResearchKit/Charts/ORKGraphChartView.m +++ /dev/null @@ -1,1331 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - Copyright (c) 2017, Macro Yau. - Copyright (c) 2018, Brian Ganninger. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKGraphChartView.h" -#import "ORKGraphChartView_Internal.h" - -#import "ORKChartTypes.h" -#import "ORKLineGraphChartView.h" -#import "ORKXAxisView.h" -#import "ORKYAxisView.h" - -#import "ORKAccessibility.h" -#import "ORKSkin.h" - - -#if TARGET_INTERFACE_BUILDER - -@implementation ORKIBGraphChartViewDataSource - -- (NSInteger)numberOfPlotsInGraphChartView:(ORKGraphChartView *)graphChartView { - return self.plotPoints.count; -} - -- (NSInteger)graphChartView:(ORKGraphChartView *)graphChartView numberOfDataPointsForPlotIndex:(NSInteger)plotIndex { - return self.plotPoints[plotIndex].count; -} - -- (NSString *)graphChartView:(ORKGraphChartView *)graphChartView titleForXAxisAtPointIndex:(NSInteger)pointIndex { - return [@(pointIndex + 1) stringValue]; -} - -@end - - -@implementation ORKIBValueRangeGraphChartViewDataSource - -- (ORKValueRange *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex { - return self.plotPoints[plotIndex][pointIndex]; -} - -@end - -#endif - - -const CGFloat ORKGraphChartViewLeftPadding = 10.0; -const CGFloat ORKGraphChartViewPointAndLineWidth = 8.0; -const CGFloat ORKGraphChartViewScrubberMoveAnimationDuration = 0.1; -const CGFloat ORKGraphChartViewAxisTickLength = 12.0; -const CGFloat ORKGraphChartViewYAxisTickPadding = 2.0; - -static const CGFloat TopPadding = 7.0; -static const CGFloat XAxisViewHeight = 30.0; -static const CGFloat YAxisViewWidth = 45.0; -static const CGFloat SnappingClosenessFactor = 0.3; -static const CGSize ScrubberThumbSize = (CGSize){10.0, 10.0}; -static const CGFloat ScrubberFadeAnimationDuration = 0.2; -static const CGFloat ScrubberLineToLabelPadding = 6.0; -static const CGFloat ScrubberLabelCornerRadius = 4.0; -static const CGFloat ScrubberLabelHorizontalPadding = 12.0; -static const CGFloat ScrubberLabelVerticalPadding = 4.0; -#define ScrubberLabelColor ([UIColor colorWithWhite:0.98 alpha:0.8]) - -@interface ORKGraphChartView () - -@end - - -@implementation ORKGraphChartView { - UIView *_referenceLinesView; - UILabel *_noDataLabel; - ORKXAxisView *_xAxisView; - ORKYAxisView *_yAxisView; - CAShapeLayer *_horizontalReferenceLineLayer; - NSMutableArray *_verticalReferenceLineLayers; - UILabel *_scrubberLabel; - UIView *_scrubberThumbView; - NSString *_decimalFormat; -} - -#pragma mark - Init - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self sharedInit]; - } - return self; -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - if (self = [super initWithCoder:aDecoder]) { - [self sharedInit]; - } - return self; -} - -- (void)sharedInit { - _numberOfXAxisPoints = -1; - _showsHorizontalReferenceLines = NO; - _showsVerticalReferenceLines = NO; - _dataPoints = [NSMutableArray new]; - _yAxisPoints = [NSMutableArray new]; - _lineLayers = [NSMutableArray new]; - _hasDataPoints = NO; - - // init null resetable properties - _axisColor = ORKColor(ORKGraphAxisColorKey); - _verticalAxisTitleColor = ORKColor(ORKGraphAxisTitleColorKey); - _referenceLineColor = ORKColor(ORKGraphReferenceLineColorKey); - _scrubberLineColor = ORKColor(ORKGraphScrubberLineColorKey); - _scrubberThumbColor = ORKColor(ORKGraphScrubberThumbColorKey); - _noDataText = ORKLocalizedString(@"CHART_NO_DATA_TEXT", nil); - - // nil reset to default fonts - self.xAxisFont = nil; - self.yAxisFont = nil; - self.scrubberFont = nil; - self.noDataFont = nil; - - [self setDecimalPlaces:0]; - - _longPressGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleScrubbingGesture:)]; - _longPressGestureRecognizer.delaysTouchesBegan = YES; - _longPressGestureRecognizer.delegate = self; - [self addGestureRecognizer:_longPressGestureRecognizer]; - - _panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleScrubbingGesture:)]; - _panGestureRecognizer.delaysTouchesBegan = YES; - _panGestureRecognizer.delegate = self; - [self addGestureRecognizer:_panGestureRecognizer]; - - [self setUpViews]; - - [self updateContentSizeCategoryFonts]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(updateContentSizeCategoryFonts) - name:UIContentSizeCategoryDidChangeNotification - object:nil]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(_axVoiceOverStatusChanged:) - name:UIAccessibilityVoiceOverStatusDidChangeNotification - object:nil]; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)reloadData { - _numberOfXAxisPoints = -1; // reset cached number of x axis points - [self updateAndLayoutVerticalReferenceLineLayers]; - [self obtainDataPoints]; - [self calculateMinAndMaxValues]; - [_xAxisView updateTitles]; - [_yAxisView updateTicksAndLabels]; - [self updateLineLayers]; - [self updateNoDataLabel]; - - [self _axCreateAccessibilityElementsIfNeeded]; - - [self setNeedsLayout]; -} - -- (void)setDataSource:(id)dataSource { - _dataSource = dataSource; - [self reloadData]; -} - -#pragma mark - Configuration - -- (void)setAxisColor:(UIColor *)axisColor { - if (!axisColor) { - axisColor = ORKColor(ORKGraphAxisColorKey); - } - _axisColor = axisColor; - _xAxisView.axisColor = _axisColor; - _yAxisView.axisColor = _axisColor; -} - -- (void)setVerticalAxisTitleColor:(UIColor *)verticalAxisTitleColor { - if (!verticalAxisTitleColor) { - verticalAxisTitleColor = ORKColor(ORKGraphAxisTitleColorKey); - } - _verticalAxisTitleColor = verticalAxisTitleColor; - _yAxisView.titleColor = _verticalAxisTitleColor; -} - -- (void)setReferenceLineColor:(UIColor *)referenceLineColor { - if (!referenceLineColor) { - referenceLineColor = ORKColor(ORKGraphReferenceLineColorKey); - } - _referenceLineColor = referenceLineColor; - _horizontalReferenceLineLayer.strokeColor = referenceLineColor.CGColor; - [self updateAndLayoutVerticalReferenceLineLayers]; - [self updatePlotColors]; -} - -- (void)setScrubberLineColor:(UIColor *)scrubberLineColor { - if (!scrubberLineColor) { - scrubberLineColor = ORKColor(ORKGraphScrubberLineColorKey); - } - _scrubberLineColor = scrubberLineColor; - _scrubberLine.backgroundColor = _scrubberLineColor; - _scrubberThumbView.layer.borderColor = _scrubberLineColor.CGColor; - _scrubberLabel.layer.borderColor = _scrubberLineColor.CGColor; -} - -- (void)setScrubberThumbColor:(UIColor *)scrubberThumbColor { - if (!scrubberThumbColor) { - scrubberThumbColor = ORKColor(ORKGraphScrubberThumbColorKey); - } - _scrubberThumbColor = scrubberThumbColor; - _scrubberThumbView.backgroundColor = _scrubberThumbColor; -} - -- (void)setNoDataText:(NSString *)noDataText { - if (!noDataText) { - noDataText = ORKLocalizedString(@"CHART_NO_DATA_TEXT", nil); - } - _noDataText = [noDataText copy]; - _noDataLabel.text = _noDataText; -} - -- (void)setMaximumValueImage:(UIImage *)maximumValueImage { - _maximumValueImage = maximumValueImage; - [_yAxisView updateTicksAndLabels]; -} - -- (void)setMinimumValueImage:(UIImage *)minimumValueImage { - _minimumValueImage = minimumValueImage; - [_yAxisView updateTicksAndLabels]; -} - -- (void)setXAxisFont:(UIFont *)xAxisFont { - if (!xAxisFont) { - xAxisFont = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]; - } - _xAxisFont = xAxisFont; - _xAxisView.titleFont = _xAxisFont; -} - -- (void)setYAxisFont:(UIFont *)yAxisFont { - if (!yAxisFont) { - yAxisFont = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2]; - } - _yAxisFont = yAxisFont; - _yAxisView.titleFont = _yAxisFont; -} - -- (void)setScrubberFont:(UIFont *)scrubberFont { - if (!scrubberFont) { - scrubberFont = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]; - } - _scrubberFont = scrubberFont; - _scrubberLabel.font = _scrubberFont; -} - -- (void)setNoDataFont:(UIFont *)noDataFont { - if (!noDataFont) { - noDataFont = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; - } - _noDataFont = noDataFont; - _noDataLabel.font = _noDataFont; -} - -- (void)setDecimalPlaces:(NSUInteger)decimalPlaces { - _decimalPlaces = decimalPlaces; - _decimalFormat = [NSString stringWithFormat:@"%%.%luf", (unsigned long)_decimalPlaces]; - [_yAxisView setDecimalPlaces:_decimalPlaces]; -} - -- (void)setYAxisLabelFactors:(NSArray *)yAxisLabelFactors { - _yAxisLabelFactors = yAxisLabelFactors; - _yAxisView.yAxisLabelFactors = yAxisLabelFactors; - [_yAxisView updateTicksAndLabels]; -} - -- (void)setShowsHorizontalReferenceLines:(BOOL)showsHorizontalReferenceLines { - _showsHorizontalReferenceLines = showsHorizontalReferenceLines; - [self updateHorizontalReferenceLines]; - [self layoutHorizontalReferenceLineLayers]; -} - -- (void)setShowsVerticalReferenceLines:(BOOL)showsVerticalReferenceLines { - _showsVerticalReferenceLines = showsVerticalReferenceLines; - [self updateAndLayoutVerticalReferenceLineLayers]; -} - -- (void)tintColorDidChange { - _xAxisView.tintColor = self.tintColor; - [self updatePlotColors]; -} - -- (UIColor *)colorForPlotIndex:(NSInteger)plotIndex subpointIndex:(NSInteger)subpointIndex totalSubpoints:(NSInteger)totalSubpoints { - // pointIndex and totalSubpoints only affect the derived color on the ORKBarGraphChartView subclass - UIColor *color = nil; - if ([_dataSource respondsToSelector:@selector(graphChartView:colorForPlotIndex:)]) { - color = [_dataSource graphChartView:self colorForPlotIndex:plotIndex]; - } else { - color = (plotIndex == 0) ? self.tintColor : _referenceLineColor; - } - return color; -} - -- (UIColor *)colorForPlotIndex:(NSInteger)plotIndex { - return [self colorForPlotIndex:plotIndex subpointIndex:0 totalSubpoints:0]; -} - -- (void)updatePlotColors { - for (NSUInteger plotIndex = 0; plotIndex < _lineLayers.count; plotIndex++) { - [self updatePlotColorsForPlotIndex:plotIndex]; - } -} - -- (void)updatePlotColorsForPlotIndex:(NSInteger)plotIndex { - NSUInteger numberOfPoints = _lineLayers[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < numberOfPoints; pointIndex++) { - NSUInteger numberOfSubpoints = _lineLayers[plotIndex][pointIndex].count; - for (NSUInteger subpointIndex = 0; subpointIndex < numberOfSubpoints; subpointIndex++) { - UIColor *color = [self colorForPlotIndex:plotIndex subpointIndex:subpointIndex totalSubpoints:numberOfSubpoints]; - CAShapeLayer *lineLayer = _lineLayers[plotIndex][pointIndex][subpointIndex]; - lineLayer.strokeColor = color.CGColor; - } - } -} - -- (void)updateContentSizeCategoryFonts { - _xAxisView.titleFont = self.xAxisFont; - _yAxisView.titleFont = self.yAxisFont; - _scrubberLabel.font = self.scrubberFont; - _noDataLabel.font = self.noDataFont; -} - -- (void)setUpViews { - _referenceLinesView = [UIView new]; - [self addSubview:_referenceLinesView]; - - _xAxisView = [[ORKXAxisView alloc] initWithParentGraphChartView:self]; - [self addSubview:_xAxisView]; - - _yAxisView = [[ORKYAxisView alloc] initWithParentGraphChartView:self]; - [self addSubview:_yAxisView]; - - _plotView = [UIView new]; - _plotView.backgroundColor = [UIColor clearColor]; - [self addSubview:_plotView]; - - [self updateHorizontalReferenceLines]; - - _scrubberLine = [UIView new]; - _scrubberLine.backgroundColor = _scrubberLineColor; - _scrubberLine.alpha = 0; - [self addSubview:_scrubberLine]; - - _scrubberLabel = [UILabel new]; - _scrubberLabel.alpha = 0; - _scrubberLabel.layer.cornerRadius = ScrubberLabelCornerRadius; - _scrubberLabel.layer.borderColor = _scrubberLineColor.CGColor; - _scrubberLabel.layer.borderWidth = 1.0f; - _scrubberLabel.textColor = [UIColor darkGrayColor]; - _scrubberLabel.textAlignment = NSTextAlignmentCenter; - _scrubberLabel.backgroundColor = ScrubberLabelColor; - [self addSubview:_scrubberLabel]; - - _scrubberThumbView = [[UIView alloc] initWithFrame:CGRectMake(0, - 0, - ScrubberThumbSize.width, - ScrubberThumbSize.height)]; - _scrubberThumbView.layer.cornerRadius = _scrubberThumbView.bounds.size.height / 2; - _scrubberThumbView.layer.borderWidth = 1.0; - _scrubberThumbView.backgroundColor = _scrubberThumbColor; - _scrubberThumbView.layer.borderColor = _scrubberLineColor.CGColor; - _scrubberThumbView.alpha = 0; - [self addSubview:_scrubberThumbView]; -} - -- (void)updateHorizontalReferenceLines { - [_horizontalReferenceLineLayer removeFromSuperlayer]; - _horizontalReferenceLineLayer = nil; - if (_showsHorizontalReferenceLines) { - _horizontalReferenceLineLayer = [CAShapeLayer layer]; - _horizontalReferenceLineLayer.strokeColor = _referenceLineColor.CGColor; - _horizontalReferenceLineLayer.lineDashPattern = @[@6, @4]; - - [_referenceLinesView.layer insertSublayer:_horizontalReferenceLineLayer atIndex:0]; - } -} - -ORK_INLINE UIImage *graphVerticalReferenceLineLayerImageWithColor(UIColor *color, CGFloat height) { - static UIImage *lineImage = nil; - static UIColor *lineImageColor = nil; - static CGFloat lineImageHeight = 0.0; - if (height > 0 && (!lineImage || ![lineImageColor isEqual:color] || lineImageHeight != height)) { - lineImageColor = color; - lineImageHeight = height; - UIBezierPath *referenceLinePath = [UIBezierPath bezierPath]; - [referenceLinePath moveToPoint:CGPointMake(0, 0)]; - [referenceLinePath addLineToPoint:CGPointMake(0, height)]; - - CAShapeLayer *referenceLineLayer = [CAShapeLayer new]; - referenceLineLayer.path = referenceLinePath.CGPath; - referenceLineLayer.lineWidth = [UIScreen mainScreen].scale; - referenceLineLayer.strokeColor = color.CGColor; - referenceLineLayer.lineDashPattern = @[@6, @4]; - - UIGraphicsBeginImageContextWithOptions((CGSize){1, height}, NO, [UIScreen mainScreen].scale); - [referenceLineLayer renderInContext:UIGraphicsGetCurrentContext()]; - lineImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - } - return lineImage; -} - -ORK_INLINE CALayer *graphVerticalReferenceLineLayerWithColor(UIColor *color, CGFloat height) { - CALayer *referenceLineLayer = [CALayer new]; - referenceLineLayer.frame = (CGRect){{0, 0}, {1, height}}; - referenceLineLayer.anchorPoint = CGPointMake(0, 0); - referenceLineLayer.contents = (__bridge id)(graphVerticalReferenceLineLayerImageWithColor(color, height).CGImage); - - return referenceLineLayer; -} - -- (void)obtainDataPoints { - [_dataPoints removeAllObjects]; - _hasDataPoints = NO; - - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - [self obtainDataPointsForPlotIndex:plotIndex]; - } -} - -- (void)obtainDataPointsForPlotIndex:(NSInteger)plotIndex { - [self.dataPoints addObject:[NSMutableArray new]]; - NSInteger numberOfPoints = [self.dataSource graphChartView:self numberOfDataPointsForPlotIndex:plotIndex]; - for (NSInteger pointIndex = 0; pointIndex < numberOfPoints; pointIndex++) { - NSObject *value = [self dataPointForPointIndex:pointIndex plotIndex:plotIndex]; - [self.dataPoints[plotIndex] addObject:value]; - if (!value.isUnset) { - self.hasDataPoints = YES; - } - } - // Add dummy points for empty data points - NSInteger emptyPointsCount = self.numberOfXAxisPoints - self.dataPoints[plotIndex].count; - for (NSInteger idx = 0; idx < emptyPointsCount; idx++) { - [self.dataPoints[plotIndex] addObject:[self dummyPoint]]; - } -} - -#pragma mark - Layout & Drawing - -- (void)setBounds:(CGRect)bounds { - BOOL sizeChanged = !CGSizeEqualToSize(bounds.size, self.bounds.size); - [super setBounds:bounds]; - if (sizeChanged) { - [self setNeedsLayout]; - } -} - -- (void)setFrame:(CGRect)frame { - BOOL sizeChanged = !CGSizeEqualToSize(frame.size, self.frame.size); - [super setFrame:frame]; - if (sizeChanged) { - [self setNeedsLayout]; - } -} - -- (void)layoutSubviews { - [super layoutSubviews]; - - CGRect plotViewFrame = CGRectMake(ORKGraphChartViewLeftPadding, - TopPadding, - CGRectGetWidth(self.frame) - YAxisViewWidth - ORKGraphChartViewLeftPadding, - CGRectGetHeight(self.frame) - XAxisViewHeight - TopPadding); - - _referenceLinesView.frame = plotViewFrame; - _plotView.frame = plotViewFrame; - - _xAxisView.frame = CGRectMake(CGRectGetMinX(_plotView.frame), - CGRectGetMaxY(_plotView.frame), - CGRectGetWidth(_plotView.frame), - XAxisViewHeight); - - _yAxisView.frame = CGRectMake(CGRectGetWidth(self.frame) - YAxisViewWidth, - TopPadding, - YAxisViewWidth, - CGRectGetHeight(_plotView.frame)); - - [self layoutHorizontalReferenceLineLayers]; - [self updateAndLayoutVerticalReferenceLineLayers]; - - if (_noDataLabel) { - _noDataLabel.frame = CGRectMake(0, - 0, - CGRectGetWidth(_plotView.frame), - CGRectGetHeight(_plotView.frame)); - } - - // Scrubber Views - _scrubberLine.frame = CGRectMake(CGRectGetMinX(_scrubberLine.frame), - TopPadding, - 1, - CGRectGetHeight(_plotView.frame)); - - [self updateYAxisPoints]; - [self layoutLineLayers]; -} - -- (void)updateYAxisPoints { - [_yAxisPoints removeAllObjects]; - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - [_yAxisPoints addObject:[self normalizedCanvasDataPointsForPlotIndex:plotIndex canvasHeight:_plotView.bounds.size.height]]; - } -} - -- (void)layoutHorizontalReferenceLineLayers { - if (_showsHorizontalReferenceLines) { - CGSize plotViewSize = _plotView.bounds.size; - UIBezierPath *horizontalReferenceLinePath = [UIBezierPath bezierPath]; - [horizontalReferenceLinePath moveToPoint:CGPointMake(0 - scalePixelAdjustment(), - floor(plotViewSize.height / 2))]; - [horizontalReferenceLinePath addLineToPoint:CGPointMake(plotViewSize.width + _yAxisView.bounds.size.width, - floor(plotViewSize.height / 2))]; - _horizontalReferenceLineLayer.path = horizontalReferenceLinePath.CGPath; - } -} - -- (void)updateAndLayoutVerticalReferenceLineLayers { - [_verticalReferenceLineLayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; - _verticalReferenceLineLayers = nil; - if (_showsVerticalReferenceLines) { - _verticalReferenceLineLayers = [NSMutableArray new]; - CGFloat plotViewHeight = _plotView.bounds.size.height; - CGFloat plotViewWidth = _plotView.bounds.size.width; - NSInteger numberOfXAxisPoints = self.numberOfXAxisPoints; - for (NSUInteger pointIndex = 1; pointIndex < numberOfXAxisPoints; pointIndex++) { - if (![_dataSource respondsToSelector:@selector(graphChartView:drawsVerticalReferenceLineAtPointIndex:)] - || [_dataSource graphChartView:self drawsVerticalReferenceLineAtPointIndex:pointIndex]) { - CALayer *verticalReferenceLineLayer = graphVerticalReferenceLineLayerWithColor(_referenceLineColor, plotViewHeight); - CGFloat positionOnXAxis = xAxisPoint(pointIndex, self.numberOfXAxisPoints, plotViewWidth); - verticalReferenceLineLayer.position = CGPointMake(positionOnXAxis - scalePixelAdjustment(), 0); - [_referenceLinesView.layer insertSublayer:verticalReferenceLineLayer atIndex:0]; - [_verticalReferenceLineLayers addObject:verticalReferenceLineLayer]; - } - } - } -} - -ORK_INLINE UIImage *graphPointLayerImageWithColor(UIColor *color) { - const CGFloat pointSize = ORKGraphChartViewPointAndLineWidth; - const CGFloat pointLineWidth = 2.0; - - static UIImage *pointImage = nil; - static UIColor *pointImageColor = nil; - if (!pointImage || ![pointImageColor isEqual:color]) { - pointImageColor = color; - UIBezierPath *circlePath = [UIBezierPath bezierPathWithOvalInRect: - (CGRect){{0 + (pointLineWidth / 2), 0 + (pointLineWidth / 2)}, {pointSize - pointLineWidth, pointSize - pointLineWidth}}]; - CAShapeLayer *pointLayer = [CAShapeLayer new]; - pointLayer.path = circlePath.CGPath; - pointLayer.fillColor = [UIColor whiteColor].CGColor; - pointLayer.strokeColor = color.CGColor; - pointLayer.lineWidth = pointLineWidth; - - UIGraphicsBeginImageContextWithOptions((CGSize){pointSize, pointSize}, NO, [UIScreen mainScreen].scale); - [pointLayer renderInContext:UIGraphicsGetCurrentContext()]; - pointImage = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - } - return pointImage; -} - -ORK_INLINE CALayer *graphPointLayerWithColor(UIColor *color, BOOL drawPointIndicator) { - const CGFloat pointSize = ORKGraphChartViewPointAndLineWidth; - CALayer *pointLayer = [CALayer new]; - pointLayer.frame = (CGRect){{0, 0}, {pointSize, pointSize}}; - if (drawPointIndicator) { - pointLayer.contents = (__bridge id)(graphPointLayerImageWithColor(color).CGImage); - } - - return pointLayer; -} - -- (BOOL)shouldDrawPointIndicatorForPointWithIndex:(NSInteger)pointIndex inPlotWithIndex:(NSInteger)plotIndex { - ORKValueRange *dataPoint = (ORKValueRange *)_dataPoints[plotIndex][pointIndex]; - if (dataPoint.isUnset) { - return NO; - } - if (!dataPoint.isEmptyRange) { - return YES; - } - if ([self isKindOfClass:[ORKLineGraphChartView class]] - && [_dataSource respondsToSelector:@selector(graphChartView:drawsPointIndicatorsForPlotIndex:)]) { - return [_dataSource graphChartView:self drawsPointIndicatorsForPlotIndex:plotIndex]; - } - return YES; -} - -- (void)updateLineLayers { - for (NSInteger plotIndex = 0; plotIndex < _lineLayers.count; plotIndex++) { - for (NSMutableArray *sublineLayers in self.lineLayers[plotIndex]) { - [sublineLayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; - } - } - [_lineLayers removeAllObjects]; - - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - // Add array even if it should not draw lines so all layer arays have the same number of elements for animating purposes - NSMutableArray *> *currentPlotLineLayers = [NSMutableArray new]; - [_lineLayers addObject:currentPlotLineLayers]; - if ([self shouldDrawLinesForPlotIndex:plotIndex]) { - [self updateLineLayersForPlotIndex:plotIndex]; - } - } -} - -- (void)layoutLineLayers { - - NSInteger numberOfPlots = [self numberOfPlots]; - if (_yAxisPoints.count != numberOfPlots) { - // avoid layout if points have not been normalized yet - return; - } - - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - if ([self shouldDrawLinesForPlotIndex:plotIndex]) { - [self layoutLineLayersForPlotIndex:plotIndex]; - } - } -} - -- (void)updateNoDataLabel { - if (!_hasDataPoints && !_noDataLabel) { - _noDataLabel = [[UILabel alloc] initWithFrame:CGRectZero]; - _noDataLabel.text = _noDataText; - _noDataLabel.textAlignment = NSTextAlignmentCenter; - _noDataLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; - _noDataLabel.textColor = [UIColor lightGrayColor]; - [_plotView addSubview:_noDataLabel]; - } else if (_hasDataPoints && _noDataLabel) { - [_noDataLabel removeFromSuperview]; - _noDataLabel = nil; - } -} - -- (CGFloat)xOffsetForPlotIndex:(NSInteger)plotIndex { - return 0; -} - -#pragma mark - Plotting Points - -- (NSInteger)numberOfPlots { - NSInteger numberOfPlots = 0; - - if ([_dataSource respondsToSelector:@selector(numberOfPlotsInGraphChartView:)]) { - numberOfPlots = [_dataSource numberOfPlotsInGraphChartView:self]; - } - - return numberOfPlots; -} - -- (NSInteger)numberOfXAxisPoints { - if (_numberOfXAxisPoints != -1) { - return _numberOfXAxisPoints; - } - - _numberOfXAxisPoints = 0; - - if ([_dataSource respondsToSelector:@selector(numberOfDivisionsInXAxisForGraphChartView:)]) { - _numberOfXAxisPoints = [_dataSource numberOfDivisionsInXAxisForGraphChartView:self]; - } - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSInteger idx = 0; idx < numberOfPlots; idx++) { - NSInteger numberOfPlotPoints = [_dataSource graphChartView:self numberOfDataPointsForPlotIndex:idx]; - if (_numberOfXAxisPoints < numberOfPlotPoints) { - _numberOfXAxisPoints = numberOfPlotPoints; - } - } - - return _numberOfXAxisPoints; -} - -#pragma mark - Scrubbing - -- (NSInteger)scrubbingPlotIndex { - NSInteger plotIndex = 0; - if ([_dataSource respondsToSelector:@selector(scrubbingPlotIndexForGraphChartView:)]) { - plotIndex = [_dataSource scrubbingPlotIndexForGraphChartView:self]; - if (plotIndex >= [self numberOfPlots]) { - plotIndex = 0; - } - } - return plotIndex; -} - -- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { - BOOL shouldBegin = NO; - if (gestureRecognizer == _panGestureRecognizer) { - CGPoint translation = [(UIPanGestureRecognizer *)gestureRecognizer translationInView:self]; - if (fabs(translation.x) > fabs(translation.y)) { - shouldBegin = YES; - } - } else if (gestureRecognizer == _longPressGestureRecognizer) { - shouldBegin = YES; - } - return shouldBegin; -} - -- (void)handleScrubbingGesture:(UIGestureRecognizer *)gestureRecognizer { - NSInteger scrubbingPlotIndex = [self scrubbingPlotIndex]; - if ((_dataPoints.count > scrubbingPlotIndex) && ([self numberOfValidValuesForPlotIndex:scrubbingPlotIndex] > 0)) { - - CGPoint location = [gestureRecognizer locationInView:_plotView]; - CGFloat maxX = round(CGRectGetWidth(_plotView.bounds)); - CGFloat normalizedX = MAX(MIN(location.x, maxX), 0); - location = CGPointMake(normalizedX, location.y); - CGFloat snappedXPosition = [self snappedXPosition:location.x plotIndex:scrubbingPlotIndex]; - [self updateScrubberViewForXPosition:snappedXPosition plotIndex:scrubbingPlotIndex]; - - if (gestureRecognizer.state == UIGestureRecognizerStateBegan) { - [self setScrubberViewsHidden:NO animated:YES]; - if ([_delegate respondsToSelector:@selector(graphChartViewTouchesBegan:)]) { - [_delegate graphChartViewTouchesBegan:self]; - } - } else if (gestureRecognizer.state == UIGestureRecognizerStateChanged) { - if ([_delegate respondsToSelector:@selector(graphChartView:touchesMovedToXPosition:)]) { - [_delegate graphChartView:self touchesMovedToXPosition:snappedXPosition]; - } - } else if (gestureRecognizer.state == UIGestureRecognizerStateEnded) { - [self setScrubberViewsHidden:YES animated:YES]; - if ([_delegate respondsToSelector:@selector(graphChartViewTouchesEnded:)]) { - [_delegate graphChartViewTouchesEnded:self]; - } - } - } -} - -- (void)updateScrubberViewForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - void (^updateScrubberLinePosition)(void) = ^{ - self.scrubberLine.center = CGPointMake(xPosition + ORKGraphChartViewLeftPadding, self.scrubberLine.center.y); - }; - BOOL scrubberlineAnimated = (self.scrubberLine.alpha > 0); - BOOL scrubberlineAccessoriesAnimated = !self.scrubberAccessoryViewsHidden; - if (scrubberlineAnimated || scrubberlineAccessoriesAnimated) { - [UIView animateWithDuration:ORKGraphChartViewScrubberMoveAnimationDuration animations:^{ - if (scrubberlineAnimated) { - updateScrubberLinePosition(); - } - if (scrubberlineAccessoriesAnimated) { - [self updateScrubberLineAccessories:xPosition plotIndex:plotIndex]; - } - }]; - } - if (!scrubberlineAnimated) { - updateScrubberLinePosition(); - } - if (!scrubberlineAccessoriesAnimated) { - [self updateScrubberLineAccessories:xPosition plotIndex:plotIndex]; - } -} - -- (BOOL)scrubberAccessoryViewsHidden { - return _scrubberLabel.hidden && _scrubberThumbView.hidden; -} - -- (void)setScrubberAccessoryViewsHidden:(BOOL)hidden { - _scrubberLabel.hidden = hidden; - _scrubberThumbView.hidden = hidden; -} - -- (void)updateScrubberLineAccessories:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - double scrubberYPosition = [self canvasYPositionForXPosition:xPosition plotIndex:plotIndex]; - double scrubbingValue = [self scrubbingLabelValueForCanvasXPosition:xPosition plotIndex:plotIndex]; - - if (scrubberYPosition == scrubberYPosition) { - _scrubberThumbView.center = CGPointMake(xPosition + ORKGraphChartViewLeftPadding, scrubberYPosition + TopPadding); - _scrubberLabel.text = [NSString stringWithFormat:_decimalFormat, scrubbingValue == ORKDoubleInvalidValue ? 0.0 : scrubbingValue ]; - CGSize textSize = [_scrubberLabel.text boundingRectWithSize:CGSizeMake(_plotView.bounds.size.width, - _plotView.bounds.size.height) - options:(NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin) - attributes:@{NSFontAttributeName: _scrubberLabel.font} - context:nil].size; - _scrubberLabel.frame = CGRectMake(xPosition + ORKGraphChartViewLeftPadding + ScrubberLineToLabelPadding, - CGRectGetMinY(_scrubberLine.frame), - textSize.width + ScrubberLabelHorizontalPadding, - textSize.height + ScrubberLabelVerticalPadding); - - if (scrubbingValue == ORKDoubleInvalidValue) { - [self setScrubberAccessoryViewsHidden:YES]; - } else { - [self setScrubberAccessoryViewsHidden:NO]; - } - } -} - -- (void)setScrubberViewsHidden:(BOOL)hidden animated:(BOOL)animated { - void (^updateAlpha)(BOOL) = ^(BOOL isHidden) { - CGFloat alpha = isHidden ? 0.0 : 1.0; - _scrubberThumbView.alpha = alpha; - _scrubberLine.alpha = alpha; - _scrubberLabel.alpha = alpha; - }; - - if (animated) { - [UIView animateWithDuration:ScrubberFadeAnimationDuration animations:^{ - updateAlpha(hidden); - }]; - } else { - updateAlpha(hidden); - } -} - -- (NSInteger)pointIndexForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - NSInteger pointIndex = 0; - NSInteger numberOfXAxisPoints = self.numberOfXAxisPoints; - for (pointIndex = 0; pointIndex < (numberOfXAxisPoints - 1); pointIndex++) { - CGFloat xAxisPointValue = xAxisPoint(pointIndex, numberOfXAxisPoints, _plotView.bounds.size.width); - if (xAxisPointValue >= xPosition) { - break; - } - } - return pointIndex; -} - -- (NSInteger)numberOfValidValuesForPlotIndex:(NSInteger)plotIndex { - NSInteger count = 0; - - if (plotIndex < _dataPoints.count) { - for (ORKValueRange *rangePoint in _dataPoints[plotIndex]) { - if (!rangePoint.isUnset) { - count++; - } - } - } - return count; -} - -- (BOOL)isXPositionSnapped:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - BOOL snapped = NO; - CGFloat viewWidth = _plotView.bounds.size.width; - NSInteger numberOfXAxisPoints = self.numberOfXAxisPoints; - for (NSInteger idx = 0; idx < numberOfXAxisPoints; idx++) { - if (xPosition == xAxisPoint(idx, numberOfXAxisPoints, viewWidth)) { - snapped = YES; - break; - } - } - return snapped; -} - -- (CGFloat)snappedXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - NSInteger numberOfXAxisPoints = self.numberOfXAxisPoints; - CGFloat widthBetweenPoints = CGRectGetWidth(self.plotView.frame) / numberOfXAxisPoints; - NSUInteger positionCount = self.dataPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < positionCount; pointIndex++) { - - double scrubbingValue = [self scrubbingValueForPlotIndex:plotIndex pointIndex:pointIndex]; - - if (scrubbingValue != ORKDoubleInvalidValue) { - CGFloat snappedXPosition = xAxisPoint(pointIndex, numberOfXAxisPoints, self.plotView.bounds.size.width); - - if (fabs(snappedXPosition - xPosition) < (widthBetweenPoints * SnappingClosenessFactor)) { - xPosition = snappedXPosition; - } - } - } - return xPosition; -} - -- (double)scrubbingLabelValueForCanvasXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - double value = ORKDoubleInvalidValue; - BOOL snapped = [self isXPositionSnapped:xPosition plotIndex:(NSInteger)plotIndex]; - if (snapped) { - NSInteger pointIndex = [self pointIndexForXPosition:xPosition plotIndex:plotIndex]; - value = [self scrubbingValueForPlotIndex:plotIndex pointIndex:pointIndex];; - } - return value; -} - -- (double)canvasYPositionForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - BOOL snapped = [self isXPositionSnapped:xPosition plotIndex:plotIndex]; - double canvasYPosition = 0; - if (snapped) { - NSInteger pointIndex = [self pointIndexForXPosition:xPosition plotIndex:plotIndex]; - canvasYPosition = [self scrubbingYAxisPointForPlotIndex:plotIndex pointIndex:pointIndex]; - } - return canvasYPosition; -} - -#pragma mark - Animation - -- (void)animateWithDuration:(NSTimeInterval)duration { - if (duration < 0) { - @throw [NSException exceptionWithName:NSGenericException reason:@"animationDuration cannot be lower than 0" userInfo:nil]; - } - for (NSUInteger plotIndex = 0; plotIndex < [self numberOfPlots]; plotIndex++) { - [self prepareAnimationsForPlotIndex:plotIndex]; - [self animateLayersSequentiallyWithDuration:duration plotIndex:plotIndex]; - } - } - -- (void)prepareAnimationsForPlotIndex:(NSInteger)plotIndex { - for (NSMutableArray *sublineLayers in self.lineLayers[plotIndex]) { - [sublineLayers makeObjectsPerformSelector:@selector(removeAllAnimations)]; - for (CAShapeLayer *lineLayer in sublineLayers) { - lineLayer.strokeEnd = 0; - } -} - } - -- (void)animateLayersSequentiallyWithDuration:(NSTimeInterval)duration plotIndex:(NSInteger)plotIndex { - NSUInteger numberOfLines = self.lineLayers[plotIndex].count; - if (numberOfLines > 0) { - CGFloat lineFadeDuration = duration / numberOfLines; - CGFloat lineDelay = 0.0; - for (NSUInteger lineIndex = 0; lineIndex < numberOfLines; lineIndex++) { - NSUInteger numberOfSublines = self.lineLayers[plotIndex][lineIndex].count; - if (numberOfSublines > 0) { - CGFloat sublineFadeDuration = lineFadeDuration / numberOfSublines; - CGFloat sublineDelay = 0.0; - for (NSUInteger sublineIndex = 0; sublineIndex < numberOfSublines; sublineIndex++) { - CAShapeLayer *layer = self.lineLayers[plotIndex][lineIndex][sublineIndex]; - [self animateLayer:layer keyPath:@"strokeEnd" duration:sublineFadeDuration startDelay:lineDelay + sublineDelay]; - sublineDelay += sublineFadeDuration; - } - lineDelay += sublineDelay; - } - } - } -} - -- (void)animateLayer:(CALayer *)layer - keyPath:(NSString *)keyPath - duration:(CGFloat)duration - startDelay:(CGFloat)startDelay { - [self animateLayer:layer - keyPath:keyPath - duration:duration - startDelay:startDelay - timingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; -} - -- (void)animateLayer:(CALayer *)layer - keyPath:(NSString *)keyPath - duration:(CGFloat)duration - startDelay:(CGFloat)startDelay - timingFunction:(CAMediaTimingFunction *)timingFunction -{ - NSCAssert(layer && keyPath && duration >= 0.0 && startDelay >= 0.0 && timingFunction, @""); - - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:keyPath]; - animation.beginTime = CACurrentMediaTime() + startDelay; - animation.fromValue = @(0.0); - animation.toValue = @(1.0); - animation.duration = duration; - animation.timingFunction = timingFunction; - animation.fillMode = kCAFillModeForwards; - animation.removedOnCompletion = NO; - [layer addAnimation:animation forKey:keyPath]; -} - -#pragma mark - Abstract - -- (void)throwOverrideException { - @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:[NSString stringWithFormat:@"%s must be overridden in a subclass/category", __PRETTY_FUNCTION__] - userInfo:nil]; -} - -- (NSObject *)dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex { - [self throwOverrideException]; - return nil; -} - -- (NSObject *)dummyPoint { - [self throwOverrideException]; - return nil; -} - -- (NSMutableArray *> *)normalizedCanvasDataPointsForPlotIndex:(NSInteger)plotIndex canvasHeight:(CGFloat)viewHeight { - [self throwOverrideException]; - return nil; -} - -- (void)updateLineLayersForPlotIndex:(NSInteger)plotIndex { - [self throwOverrideException]; -} - -- (void)layoutLineLayersForPlotIndex:(NSInteger)plotIndex { - [self throwOverrideException]; -} - -- (BOOL)shouldDrawLinesForPlotIndex:(NSInteger)plotIndex { - [self throwOverrideException]; - return NO; -} - -- (void)calculateMinAndMaxValues { - [self throwOverrideException]; -} - -- (double)scrubbingValueForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex { - [self throwOverrideException]; - return 0; -} - -- (double)scrubbingYAxisPointForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex { - [self throwOverrideException]; - return 0; -} - -- (void)updatePointLayers { - [self throwOverrideException]; -} - -- (void)layoutPointLayers { - [self throwOverrideException]; -} - -#pragma mark - Accessibility - -- (BOOL)isAccessibilityElement { - return NO; -} - -#pragma mark - Accessibility Helpers - -- (void)_axVoiceOverStatusChanged:(NSNotification *)notification { - [self _axCreateAccessibilityElementsIfNeeded]; -} - -- (void)_axCreateAccessibilityElementsIfNeeded { - if (!UIAccessibilityIsVoiceOverRunning()) { - // No need to creating accessibility elements if Voice Over is not running - return; - } - - NSInteger maxNumberOfPoints = [[_dataPoints valueForKeyPath:@"@max.@count.self"] integerValue]; - NSMutableArray *accessibilityElements = [[NSMutableArray alloc] initWithCapacity:maxNumberOfPoints]; - - for (NSInteger pointIndex = 0; pointIndex < maxNumberOfPoints; pointIndex++) { - ORKGraphChartAccessibilityElement *element = [[ORKGraphChartAccessibilityElement alloc] initWithAccessibilityContainer:self index:pointIndex maxIndex:maxNumberOfPoints]; - - // Data points for all plots at any given pointIndex must be included (eg "2 and 4" or "range from 1-2 and range from 4-5"). - NSString *value = @""; - for (NSInteger plotIndex = 0; plotIndex < _dataPoints.count; plotIndex++) { - - // Boundary check - if (pointIndex < _dataPoints[plotIndex].count) { - NSString *and = (value.length == 0 ? @"" : ORKLocalizedString(@"AX_GRAPH_AND_SEPARATOR", nil)); - NSObject *dataPoint = _dataPoints[plotIndex][pointIndex]; - value = ORKAccessibilityStringForVariables(value, and, dataPoint.accessibilityLabel); - } - } - - if ([_dataSource respondsToSelector:@selector(graphChartView:titleForXAxisAtPointIndex:)]) { - element.accessibilityLabel = [self.dataSource graphChartView:self titleForXAxisAtPointIndex:pointIndex]; - } else { - element.accessibilityLabel = [NSString stringWithFormat:ORKLocalizedString(@"AX_GRAPH_POINT_%@", nil), ORKLocalizedStringFromNumber(@(pointIndex))]; - } - element.accessibilityValue = value; - [accessibilityElements addObject:element]; - } - - self.accessibilityElements = accessibilityElements; -} - -@end - - -@implementation ORKValueRangeGraphChartView { - NSMutableArray *> *_pointLayers; - } - -@dynamic dataSource; -@dynamic dataPoints; -@dynamic yAxisPoints; - -- (void)sharedInit { - [super sharedInit]; - _pointLayers = [NSMutableArray new]; - } - -- (void)reloadData { - [super reloadData]; - [self updatePointLayers]; - [self setNeedsLayout]; - } - -- (ORKValueRange *)dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex { - return [self.dataSource graphChartView:self dataPointForPointIndex:pointIndex plotIndex:plotIndex]; - } - -- (ORKValueRange *)dummyPoint { - return [ORKValueRange new]; -} - -- (NSMutableArray *)normalizedCanvasDataPointsForPlotIndex:(NSInteger)plotIndex canvasHeight:(CGFloat)viewHeight { - NSMutableArray *normalizedPoints = [NSMutableArray new]; - - if (plotIndex < self.dataPoints.count) { - NSUInteger pointCount = self.dataPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - - ORKValueRange *normalizedRangePoint = [ORKValueRange new]; - ORKValueRange *dataPointValue = self.dataPoints[plotIndex][pointIndex]; - - if (dataPointValue.isUnset) { - normalizedRangePoint.minimumValue = normalizedRangePoint.maximumValue = viewHeight; - } else if (self.minimumValue == self.maximumValue) { - normalizedRangePoint.minimumValue = normalizedRangePoint.maximumValue = viewHeight / 2; - } else { - double range = self.maximumValue - self.minimumValue; - double normalizedMinimumValue = (dataPointValue.minimumValue - self.minimumValue) / range * viewHeight; - double normalizedMaximumValue = (dataPointValue.maximumValue - self.minimumValue) / range * viewHeight; - - normalizedRangePoint.minimumValue = viewHeight - normalizedMinimumValue; - normalizedRangePoint.maximumValue = viewHeight - normalizedMaximumValue; - } - [normalizedPoints addObject:normalizedRangePoint]; - } - } - - return normalizedPoints; -} - -- (void)calculateMinAndMaxValues { - self.minimumValue = ORKDoubleInvalidValue; - self.maximumValue = ORKDoubleInvalidValue; - - BOOL minimumValueProvided = NO; - BOOL maximumValueProvided = NO; - - if ([self.dataSource respondsToSelector:@selector(minimumValueForGraphChartView:)]) { - self.minimumValue = [self.dataSource minimumValueForGraphChartView:self]; - minimumValueProvided = YES; - } - - if ([self.dataSource respondsToSelector:@selector(maximumValueForGraphChartView:)]) { - self.maximumValue = [self.dataSource maximumValueForGraphChartView:self]; - maximumValueProvided = YES; - } - - if (!minimumValueProvided || !maximumValueProvided) { - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - NSInteger numberOfPlotPoints = self.dataPoints[plotIndex].count; - for (NSInteger pointIndex = 0; pointIndex < numberOfPlotPoints; pointIndex++) { - ORKValueRange *point = self.dataPoints[plotIndex][pointIndex]; - if (!minimumValueProvided && - point.minimumValue != ORKDoubleInvalidValue && - ((self.minimumValue == ORKDoubleInvalidValue) || (point.minimumValue < self.minimumValue))) { - self.minimumValue = point.minimumValue; - } - if (!maximumValueProvided && - point.maximumValue != ORKDoubleInvalidValue && - ((self.maximumValue == ORKDoubleInvalidValue) || (point.maximumValue > self.maximumValue))) { - self.maximumValue = point.maximumValue; - } - } - } - } - - if (self.minimumValue == ORKDoubleInvalidValue) { - self.minimumValue = 0; - } - if (self.maximumValue == ORKDoubleInvalidValue) { - self.maximumValue = 0; - } -} - -#pragma mark - Layout & Drawing - -- (void)updatePointLayersForPlotIndex:(NSInteger)plotIndex { - if (plotIndex < self.dataPoints.count) { - UIColor *color = [self colorForPlotIndex:plotIndex]; - NSUInteger pointCount = self.dataPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - ORKValueRange *dataPoint = self.dataPoints[plotIndex][pointIndex]; - if (!dataPoint.isUnset) { - BOOL drawPointIndicator = [self shouldDrawPointIndicatorForPointWithIndex:pointIndex inPlotWithIndex:plotIndex]; - CALayer *pointLayer = graphPointLayerWithColor(color, drawPointIndicator); - [self.plotView.layer addSublayer:pointLayer]; - [_pointLayers[plotIndex] addObject:pointLayer]; - - if (!dataPoint.isEmptyRange) { - pointLayer = graphPointLayerWithColor(color, drawPointIndicator); - [self.plotView.layer addSublayer:pointLayer]; - [_pointLayers[plotIndex] addObject:pointLayer]; - } - } - } - } -} - -- (void)updatePlotColorsForPlotIndex:(NSInteger)plotIndex { - [super updatePlotColorsForPlotIndex:plotIndex]; - UIColor *color = [self colorForPlotIndex:plotIndex]; - for (NSUInteger pointIndex = 0; pointIndex < _pointLayers[plotIndex].count; pointIndex++) { - CALayer *pointLayer = _pointLayers[plotIndex][pointIndex]; - if (pointLayer.contents) { - pointLayer.contents = (__bridge id)(graphPointLayerImageWithColor(color).CGImage); - } - } - } - -- (void)updatePointLayers { - for (NSInteger plotIndex = 0; plotIndex < _pointLayers.count; plotIndex++) { - [_pointLayers[plotIndex] makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; - } - [_pointLayers removeAllObjects]; - - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - NSMutableArray *currentPlotPointLayers = [NSMutableArray new]; - [_pointLayers addObject:currentPlotPointLayers]; - [self updatePointLayersForPlotIndex:plotIndex]; - } - } - -- (void)layoutSubviews { - [super layoutSubviews]; - [self layoutPointLayers]; -} - -- (void)layoutPointLayers { - NSInteger numberOfPlots = [self numberOfPlots]; - - if (self.yAxisPoints.count != numberOfPlots) { - // avoid layout if points have not been normalized yet - return; - } - - for (NSInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - [self layoutPointLayersForPlotIndex:plotIndex]; - } -} - -- (void)layoutPointLayersForPlotIndex:(NSInteger)plotIndex { - if (plotIndex < self.dataPoints.count) { - NSUInteger pointLayerIndex = 0; - for (NSUInteger pointIndex = 0; pointIndex < self.dataPoints[plotIndex].count; pointIndex++) { - ORKValueRange *dataPointValue = self.dataPoints[plotIndex][pointIndex]; - if (!dataPointValue.isUnset) { - CGFloat positionOnXAxis = xAxisPoint(pointIndex, self.numberOfXAxisPoints, self.plotView.bounds.size.width); - positionOnXAxis += [self xOffsetForPlotIndex:plotIndex]; - ORKValueRange *yAxisValueRange = self.yAxisPoints[plotIndex][pointIndex]; - CALayer *pointLayer = _pointLayers[plotIndex][pointLayerIndex]; - pointLayer.position = CGPointMake(positionOnXAxis, yAxisValueRange.minimumValue); - pointLayerIndex++; - - if (!yAxisValueRange.isEmptyRange) { - pointLayer = _pointLayers[plotIndex][pointLayerIndex]; - pointLayer.position = CGPointMake(positionOnXAxis, yAxisValueRange.maximumValue); - pointLayerIndex++; - } - } - } - } -} - -#pragma mark - Scrubbing - -- (double)scrubbingValueForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex { - return self.dataPoints[plotIndex][pointIndex].maximumValue; -} - -- (double)scrubbingYAxisPointForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex { - return self.yAxisPoints[plotIndex][pointIndex].maximumValue; -} - -#pragma mark - Animation - -- (void)prepareAnimationsForPlotIndex:(NSInteger)plotIndex { - [super prepareAnimationsForPlotIndex:plotIndex]; - [_pointLayers[plotIndex] makeObjectsPerformSelector:@selector(removeAllAnimations)]; - for (CAShapeLayer *pointLayer in _pointLayers[plotIndex]) { - pointLayer.opacity = 0; - } -} - -- (void)animateLayersSequentiallyWithDuration:(NSTimeInterval)duration plotIndex:(NSInteger)plotIndex { - [super animateLayersSequentiallyWithDuration:duration plotIndex:plotIndex]; - NSUInteger numberOfPoints = _pointLayers[plotIndex].count; - if (numberOfPoints > 0) { - CGFloat pointFadeDuration = duration / numberOfPoints; - CGFloat pointDelay = 0.0; - for (NSUInteger pointIndex = 0; pointIndex < numberOfPoints; pointIndex++) { - CALayer *layer = _pointLayers[plotIndex][pointIndex]; - [self animateLayer:layer keyPath:@"opacity" duration:pointFadeDuration startDelay:pointDelay]; - pointDelay += pointFadeDuration; - } - } -} - -@end diff --git a/ResearchKit/Charts/ORKGraphChartView_Internal.h b/ResearchKit/Charts/ORKGraphChartView_Internal.h deleted file mode 100644 index 2d011c222c..0000000000 --- a/ResearchKit/Charts/ORKGraphChartView_Internal.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - Copyright (c) 2015, James Cox. All rights reserved. - Copyright (c) 2016, Ricardo Sánchez-Sáez. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKGraphChartView.h" -#import "ORKChartTypes.h" -#import "ORKHelpers_Private.h" - - -NS_ASSUME_NONNULL_BEGIN - -#if TARGET_INTERFACE_BUILDER - -@interface ORKIBGraphChartViewDataSource : NSObject - -@property (nonatomic, strong, nullable) NSArray *plotPoints; - -@end - - -@interface ORKIBValueRangeGraphChartViewDataSource : ORKIBGraphChartViewDataSource - -@end - -#endif - - -@class ORKXAxisView; - -typedef NS_ENUM(NSUInteger, ORKGraphAnimationType) { - ORkGraphAnimationTypeNone, - ORKGraphAnimationTypeFade, - ORKGraphAnimationTypeGrow, - ORKGraphAnimationTypePop -}; - -extern const CGFloat ORKGraphChartViewLeftPadding; -extern const CGFloat ORKGraphChartViewPointAndLineWidth; -extern const CGFloat ORKGraphChartViewScrubberMoveAnimationDuration; -extern const CGFloat ORKGraphChartViewAxisTickLength; -extern const CGFloat ORKGraphChartViewYAxisTickPadding; - -ORK_INLINE CGFloat scalePixelAdjustment() { - return (1.0 / [UIScreen mainScreen].scale); -} - -ORK_INLINE CAShapeLayer *graphLineLayer() { - CAShapeLayer *lineLayer = [CAShapeLayer layer]; - lineLayer.fillColor = [UIColor clearColor].CGColor; - lineLayer.lineJoin = kCALineJoinRound; - lineLayer.lineCap = kCALineCapRound; - lineLayer.opacity = 1.0; - return lineLayer; -} - -ORK_INLINE CGFloat xAxisPoint(NSInteger pointIndex, NSInteger numberOfXAxisPoints, CGFloat canvasWidth) { - return floor((canvasWidth / MAX(1, numberOfXAxisPoints - 1)) * pointIndex); -} - -ORK_INLINE CGFloat xOffsetForPlotIndex(NSInteger plotIndex, NSInteger numberOfPlots, CGFloat plotWidth) { - CGFloat offset = 0; - if (numberOfPlots % 2 == 0) { - // Even - offset = (plotIndex - numberOfPlots / 2 + 0.5) * plotWidth; - } else { - // Odd - offset = (plotIndex - numberOfPlots / 2) * plotWidth; - } - return offset; -} - - -@interface ORKGraphChartView () - -@property (nonatomic) NSMutableArray *> *> *lineLayers; - -@property (nonatomic) NSInteger numberOfXAxisPoints; - -@property (nonatomic) NSMutableArray *> *> *dataPoints; // Actual data - -@property (nonatomic) NSMutableArray *> *> *yAxisPoints; // Normalized for the plot view height - -@property (nonatomic) UIView *plotView; // Holds the plots - -@property (nonatomic) UIView *scrubberLine; - -@property (nonatomic) BOOL scrubberAccessoryViewsHidden; - -@property (nonatomic) BOOL hasDataPoints; - -@property (nonatomic) double minimumValue; - -@property (nonatomic) double maximumValue; - -- (void)sharedInit; - -- (void)calculateMinAndMaxValues; - -- (NSMutableArray *> *)normalizedCanvasDataPointsForPlotIndex:(NSInteger)plotIndex canvasHeight:(CGFloat)viewHeight; - -- (NSInteger)numberOfPlots; - -- (NSInteger)numberOfValidValuesForPlotIndex:(NSInteger)plotIndex; - -- (NSInteger)scrubbingPlotIndex; - -- (double)scrubbingValueForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex; - -- (double)scrubbingYAxisPointForPlotIndex:(NSInteger)plotIndex pointIndex:(NSInteger)pointIndex; - -- (double)scrubbingLabelValueForCanvasXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex; - -- (NSInteger)pointIndexForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex; - -- (void)updateScrubberViewForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex; - -- (void)updateScrubberLineAccessories:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex; - -- (CGFloat)snappedXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex; - -- (BOOL)isXPositionSnapped:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex; - -- (void)updatePlotColors; - -- (void)updateLineLayers; - -- (void)layoutLineLayers; - -- (UIColor *)colorForPlotIndex:(NSInteger)plotIndex subpointIndex:(NSInteger)subpointIndex totalSubpoints:(NSInteger)totalSubpoints; - -- (UIColor *)colorForPlotIndex:(NSInteger)plotIndex; - -- (void)prepareAnimationsForPlotIndex:(NSInteger)plotIndex; - -- (void)animateLayersSequentiallyWithDuration:(NSTimeInterval)duration plotIndex:(NSInteger)plotIndex; - -- (void)animateLayer:(CALayer *)layer - keyPath:(NSString *)keyPath - duration:(CGFloat)duration - startDelay:(CGFloat)startDelay - timingFunction:(CAMediaTimingFunction *)timingFunction; - -@end - - -// Abstract base class for ORKDiscreteGraphChartView and ORKLineGraphChartView -@interface ORKValueRangeGraphChartView () - -@property (nonatomic) NSMutableArray *> *dataPoints; // Actual data - -@property (nonatomic) NSMutableArray *> *yAxisPoints; // Normalized for the plot view height - -- (void)updatePointLayers; - -- (void)layoutPointLayers; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKLineGraphChartView.h b/ResearchKit/Charts/ORKLineGraphChartView.h deleted file mode 100644 index 9c05c1e47a..0000000000 --- a/ResearchKit/Charts/ORKLineGraphChartView.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import - - -NS_ASSUME_NONNULL_BEGIN - -/** - The `ORKLineGraphChartView` class presents the data provided by an object conforming to the - `ORKValueRangeGraphChartViewDataSource` protocol as a line graph. - - The primary plot is colored by the `tintColor`, and any additional plots are colored using the - `referenceLineColor` property. - */ -ORK_CLASS_AVAILABLE -@interface ORKLineGraphChartView : ORKValueRangeGraphChartView - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKLineGraphChartView.m b/ResearchKit/Charts/ORKLineGraphChartView.m deleted file mode 100644 index 575064a46a..0000000000 --- a/ResearchKit/Charts/ORKLineGraphChartView.m +++ /dev/null @@ -1,367 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKLineGraphChartView.h" - -#import "ORKChartTypes.h" -#import "ORKGraphChartView_Internal.h" - -#import "ORKHelpers_Internal.h" - - -#if TARGET_INTERFACE_BUILDER - -@interface ORKIBLineGraphChartViewDataSource : ORKIBValueRangeGraphChartViewDataSource - -+ (instancetype)sharedInstance; - -@end - - -@implementation ORKIBLineGraphChartViewDataSource - -+ (instancetype)sharedInstance { - static id sharedInstance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInstance = [[self class] new]; - }); - return sharedInstance; -} - -- (instancetype)init { - self = [super init]; - if (self) { - self.plotPoints = @[ - @[ - [[ORKValueRange alloc] initWithValue:10], - [[ORKValueRange alloc] initWithValue:20], - [[ORKValueRange alloc] initWithValue:25], - [[ORKValueRange alloc] init], - [[ORKValueRange alloc] initWithValue:30], - [[ORKValueRange alloc] initWithValue:40] - ], - @[ - [[ORKValueRange alloc] initWithValue:2], - [[ORKValueRange alloc] initWithValue:4], - [[ORKValueRange alloc] initWithValue:8], - [[ORKValueRange alloc] initWithValue:16], - [[ORKValueRange alloc] initWithValue:32], - [[ORKValueRange alloc] initWithValue:64] - ] - ]; - } - return self; -} - -- (CGFloat)minimumValueForGraphChartView:(ORKGraphChartView *)graphChartView { - return 0; -} - -- (CGFloat)maximumValueForGraphChartView:(ORKGraphChartView *)graphChartView { - return 70; -} - -@end - -#endif - - -const CGFloat FillColorAlpha = 0.4; - -@implementation ORKLineGraphChartView { - NSMutableDictionary *_fillLayers; -} - -#pragma mark - Init - -- (void)sharedInit { - [super sharedInit]; - _fillLayers = [NSMutableDictionary new]; -} - -- (BOOL)shouldDrawLinesForPlotIndex:(NSInteger)plotIndex { - return [self numberOfValidValuesForPlotIndex:plotIndex] > 1; -} - -#pragma mark - Drawing - -- (UIColor *)fillColorForPlotIndex:(NSInteger)plotIndex { - UIColor *color = nil; - if ([self.dataSource respondsToSelector:@selector(graphChartView:fillColorForPlotIndex:)]) { - color = [self.dataSource graphChartView:self fillColorForPlotIndex:plotIndex]; - } else { - color = [[self colorForPlotIndex:plotIndex] colorWithAlphaComponent:FillColorAlpha]; - } - return color; -} - -- (void)updatePlotColors { - [super updatePlotColors]; - NSInteger numberOfPlots = [self numberOfPlots]; - for (NSUInteger plotIndex = 0; plotIndex < numberOfPlots; plotIndex++) { - CAShapeLayer *fillLayer = _fillLayers[@(plotIndex)]; - fillLayer.fillColor = [self fillColorForPlotIndex:plotIndex].CGColor; - } -} - -- (void)updateLineLayers { - [_fillLayers.allValues makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; - [_fillLayers removeAllObjects]; - [super updateLineLayers]; -} - -- (void)updateLineLayersForPlotIndex:(NSInteger)plotIndex { - // Fill - CAShapeLayer *fillLayer = [CAShapeLayer layer]; - fillLayer.fillColor = [self fillColorForPlotIndex:plotIndex].CGColor; - - [self.plotView.layer addSublayer:fillLayer]; - _fillLayers[@(plotIndex)] = fillLayer; - - // Lines - BOOL previousPointExists = NO; - BOOL emptyDataPresent = NO; - NSUInteger pointCount = self.dataPoints[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < pointCount; pointIndex++) { - [self.lineLayers[plotIndex] addObject:[NSMutableArray new]]; - if (self.dataPoints[plotIndex][pointIndex].isUnset) { - emptyDataPresent = YES; - continue; - } - - if (!previousPointExists) { - previousPointExists = YES; - emptyDataPresent = NO; - continue; - } - - CAShapeLayer *lineLayer = graphLineLayer(); - lineLayer.strokeColor = [self colorForPlotIndex:plotIndex].CGColor; - lineLayer.lineWidth = 2.0; - - if (emptyDataPresent) { - lineLayer.lineDashPattern = @[@12, @6]; - emptyDataPresent = NO; - } - - [self.plotView.layer addSublayer:lineLayer]; - [self.lineLayers[plotIndex][pointIndex - 1] addObject:lineLayer]; - } -} - -- (void)layoutLineLayersForPlotIndex:(NSInteger)plotIndex { - CAShapeLayer *fillLayer = _fillLayers[@(plotIndex)]; - - if (fillLayer == nil) { - // Skip for a nil fillLayer - return; - } - - UIBezierPath *fillPath = [UIBezierPath bezierPath]; - CGFloat positionOnXAxis = ORKCGFloatInvalidValue; - ORKValueRange *positionOnYAxis = nil; - BOOL previousPointExists = NO; - NSUInteger numberOfPoints = self.lineLayers[plotIndex].count; - for (NSUInteger pointIndex = 0; pointIndex < numberOfPoints; pointIndex++) { - if (self.dataPoints[plotIndex][pointIndex].isUnset) { - continue; - } - UIBezierPath *linePath = [UIBezierPath bezierPath]; - - if (positionOnXAxis != ORKCGFloatInvalidValue) { - [linePath moveToPoint:CGPointMake(positionOnXAxis, positionOnYAxis.minimumValue)]; - if ([fillPath isEmpty]) { - // Substract scalePixelAdjustment() to the first horizontal position of the fillPath so if fully covers the start of the x axis - [fillPath moveToPoint:CGPointMake(positionOnXAxis - scalePixelAdjustment(), - CGRectGetHeight(self.plotView.frame) + scalePixelAdjustment())]; - [fillPath addLineToPoint:CGPointMake(positionOnXAxis - scalePixelAdjustment(), - positionOnYAxis.minimumValue)]; - } else { - [fillPath addLineToPoint:CGPointMake(positionOnXAxis, positionOnYAxis.minimumValue)]; - } - } - - positionOnXAxis = xAxisPoint(pointIndex, self.numberOfXAxisPoints, self.plotView.bounds.size.width); - positionOnYAxis = self.yAxisPoints[plotIndex][pointIndex]; - - if (!previousPointExists) { - if (positionOnXAxis != ORKCGFloatInvalidValue) { - previousPointExists = YES; - } - continue; - } - - [linePath addLineToPoint:CGPointMake(positionOnXAxis, positionOnYAxis.minimumValue)]; - // Add scalePixelAdjustment() to the last vertical position of the fillPath so if fully covers the end of the x axis - [fillPath addLineToPoint:CGPointMake(positionOnXAxis + ( (pointIndex == (numberOfPoints - 1)) ? scalePixelAdjustment() : 0 ), - positionOnYAxis.minimumValue)]; - - CAShapeLayer *lineLayer = self.lineLayers[plotIndex][pointIndex - 1][0]; - lineLayer.path = linePath.CGPath; - } - - [fillPath addLineToPoint:CGPointMake(positionOnXAxis + scalePixelAdjustment(), - CGRectGetHeight(self.plotView.frame) + scalePixelAdjustment())]; - - fillLayer.path = fillPath.CGPath; -} - -#pragma mark - Graph Calculations - -- (double)scrubbingLabelValueForCanvasXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - double value = [super scrubbingLabelValueForCanvasXPosition:xPosition plotIndex:plotIndex]; - - if (value == ORKDoubleInvalidValue) { - CGFloat viewWidth = self.plotView.bounds.size.width; - NSInteger numberOfXAxisPoints = self.numberOfXAxisPoints; - NSInteger pointIndex = 0; - for (pointIndex = 0; pointIndex < (numberOfXAxisPoints - 1); pointIndex++) { - CGFloat xAxisPointValue = xAxisPoint(pointIndex, numberOfXAxisPoints, viewWidth); - if (xAxisPointValue > xPosition) { - break; - } - } - - NSInteger previousValidIndex = [self previousValidPointIndexForPointIndex:pointIndex plotIndex:plotIndex]; - NSInteger nextValidIndex = [self nextValidPointIndexForPointIndex:pointIndex plotIndex:plotIndex]; - - CGFloat x1 = xAxisPoint(previousValidIndex, numberOfXAxisPoints, viewWidth); - CGFloat x2 = xAxisPoint(nextValidIndex, numberOfXAxisPoints, viewWidth); - - double y1 = self.dataPoints[plotIndex][previousValidIndex].minimumValue; - double y2 = self.dataPoints[plotIndex][nextValidIndex].minimumValue; - - if (y1 == ORKDoubleInvalidValue || y2 == ORKDoubleInvalidValue) { - return ORKDoubleInvalidValue; - } - - double slope = (y2 - y1)/(x2 - x1); - - // (y2 - y3)/(x2 - x3) = m - value = y2 - (slope * (x2 - xPosition)); - } - return value; -} - -- (double)canvasYPositionForXPosition:(CGFloat)xPosition plotIndex:(NSInteger)plotIndex { - NSInteger pointIndex = [self pointIndexForXPosition:xPosition plotIndex:plotIndex]; - NSInteger nextValidIndex = [self nextValidPointIndexForPointIndex:pointIndex plotIndex:plotIndex]; - NSInteger previousValidIndex = [self previousValidPointIndexForPointIndex:pointIndex plotIndex:plotIndex]; - - double canvasYPosition = 0; - if (nextValidIndex == previousValidIndex) { - canvasYPosition = self.yAxisPoints[plotIndex][previousValidIndex].minimumValue; - } else { - CGFloat viewWidth = self.plotView.bounds.size.width; - NSInteger numberOfXAxisPoints = self.numberOfXAxisPoints; - - CGFloat x1 = xAxisPoint(previousValidIndex, numberOfXAxisPoints, viewWidth); - CGFloat x2 = xAxisPoint(nextValidIndex, numberOfXAxisPoints, viewWidth); - - double y1 = self.yAxisPoints[plotIndex][previousValidIndex].minimumValue; - double y2 = self.yAxisPoints[plotIndex][nextValidIndex].minimumValue; - - double slope = (y2 - y1)/(x2 - x1); - - // (y2 - y3)/(x2 - x3) = m - canvasYPosition = y2 - (slope * (x2 - xPosition)); - } - return canvasYPosition; -} - -- (NSInteger)nextValidPointIndexForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex { - NSUInteger validPosition = pointIndex; - - NSUInteger pointCountMinusOne = (self.dataPoints[plotIndex].count - 1); - while (validPosition < pointCountMinusOne) { - if (self.dataPoints[plotIndex][validPosition].minimumValue != ORKDoubleInvalidValue) { - break; - } - validPosition++; - } - - return validPosition; -} - -- (NSInteger)previousValidPointIndexForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex { - NSInteger validPosition = pointIndex - 1; - if (validPosition < 0) { - validPosition = 0; - } - while (validPosition > 0) { - if (self.dataPoints[plotIndex][validPosition].minimumValue != ORKDoubleInvalidValue) { - break; - } - validPosition--; - } - return validPosition; -} - -#pragma mark - Animations - -- (void)prepareAnimationsForPlotIndex:(NSInteger)plotIndex { - [super prepareAnimationsForPlotIndex:plotIndex]; - // animate all fill layers at once at the beginning - if (plotIndex == 0) { - [_fillLayers enumerateKeysAndObjectsUsingBlock:^(id key, CAShapeLayer *fillLayer, BOOL *stop) { - [fillLayer removeAllAnimations]; - fillLayer.opacity = 0; - }]; - } -} - -- (void)animateLayersSequentiallyWithDuration:(NSTimeInterval)duration plotIndex:(NSInteger)plotIndex { - [super animateLayersSequentiallyWithDuration:duration plotIndex:plotIndex]; - // animate all fill layers at once at the beginning - if (plotIndex == 0) { - [_fillLayers enumerateKeysAndObjectsUsingBlock:^(id key, CAShapeLayer *layer, BOOL *stop) { - [self animateLayer:layer - keyPath:@"opacity" - duration:duration * (1.0 / 3.0) - startDelay:duration * (2.0 / 3.0) - timingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]]; - }]; - } -} - -#pragma mark - Interface Builder designable - -- (void)prepareForInterfaceBuilder { - [super prepareForInterfaceBuilder]; -#if TARGET_INTERFACE_BUILDER - self.dataSource = [ORKIBLineGraphChartViewDataSource sharedInstance]; -#endif -} - -@end diff --git a/ResearchKit/Charts/ORKPieChartLegendCell.h b/ResearchKit/Charts/ORKPieChartLegendCell.h deleted file mode 100644 index 7440af0521..0000000000 --- a/ResearchKit/Charts/ORKPieChartLegendCell.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (c) 2015, James Cox. All rights reserved. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -@interface ORKPieChartLegendCell : UICollectionViewCell - -@property (nonatomic, strong) UILabel *titleLabel; - -@property (nonatomic, strong) UIView *dotView; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKPieChartLegendCell.m b/ResearchKit/Charts/ORKPieChartLegendCell.m deleted file mode 100644 index 3131de6385..0000000000 --- a/ResearchKit/Charts/ORKPieChartLegendCell.m +++ /dev/null @@ -1,133 +0,0 @@ -/* - Copyright (c) 2015, James Cox. All rights reserved. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKPieChartLegendCell.h" - -#import "ORKSkin.h" - - -const CGFloat DotViewSize = 10.0; -const CGFloat DotToLabelPadding = 6.0; - -@implementation ORKPieChartLegendCell - -#pragma mark - Init - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - if (self = [super initWithCoder:aDecoder]) { - [self sharedInit]; - } - return self; -} - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self sharedInit]; - } - return self; -} - -- (void)sharedInit { - _titleLabel = [UILabel new]; - _titleLabel.textColor = ORKColor(ORKChartDefaultTextColorKey); - _titleLabel.textAlignment = NSTextAlignmentCenter; - _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; - _titleLabel.isAccessibilityElement = NO; - _dotView = [UIView new]; - _dotView.translatesAutoresizingMaskIntoConstraints = NO; - _dotView.layer.cornerRadius = DotViewSize * 0.5; - _dotView.layer.masksToBounds = YES; - [self.contentView addSubview:_titleLabel]; - [self.contentView addSubview:_dotView]; - - [self setUpConstraints]; -} - -#pragma mark - Layout - -- (void)setUpConstraints { - NSMutableArray *constraints = [NSMutableArray new]; - NSDictionary *views = NSDictionaryOfVariableBindings(_titleLabel, _dotView); - - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=0)-[_titleLabel]-(>=0)-|" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:views]]; - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(>=0)-[_dotView]-(>=0)-|" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:views]]; - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_dotView]-DotToLabelPadding-[_titleLabel]|" - options:(NSLayoutFormatOptions)0 - metrics:@{@"DotToLabelPadding": @(DotToLabelPadding)} - views:views]]; - - [constraints addObject:[NSLayoutConstraint constraintWithItem:_dotView - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:0 - multiplier:1.0 - constant:DotViewSize]]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_dotView - attribute:NSLayoutAttributeWidth - relatedBy:NSLayoutRelationEqual - toItem:_dotView - attribute:NSLayoutAttributeHeight - multiplier:1.0 - constant:0.0]]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_dotView - attribute:NSLayoutAttributeCenterY - relatedBy:NSLayoutRelationEqual - toItem:_titleLabel - attribute:NSLayoutAttributeCenterY - multiplier:1.0 - constant:0.0]]; - - [NSLayoutConstraint activateConstraints:constraints]; -} - -+ (BOOL)requiresConstraintBasedLayout { - return YES; -} - -#pragma mark - Accessibility - -- (BOOL)isAccessibilityElement { - return YES; -} - -- (NSString *)accessibilityLabel { - return _titleLabel.accessibilityLabel; -} - -@end diff --git a/ResearchKit/Charts/ORKPieChartLegendCollectionViewLayout.h b/ResearchKit/Charts/ORKPieChartLegendCollectionViewLayout.h deleted file mode 100644 index 7b3cf9c4d6..0000000000 --- a/ResearchKit/Charts/ORKPieChartLegendCollectionViewLayout.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (c) 2015, James Cox. All rights reserved. - Copyright (c) 2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import - - -// This class implements a centered collection view layout, -// in which the cells are distributed as equally as possible between rows -// and each row is laid out as compactly as possible within its center -// (rather than spreading to take all available space like in the UICollectionViewFlowLayout) -@interface ORKPieChartLegendCollectionViewLayout : UICollectionViewFlowLayout - -@end diff --git a/ResearchKit/Charts/ORKPieChartLegendCollectionViewLayout.m b/ResearchKit/Charts/ORKPieChartLegendCollectionViewLayout.m deleted file mode 100644 index 9943d7a905..0000000000 --- a/ResearchKit/Charts/ORKPieChartLegendCollectionViewLayout.m +++ /dev/null @@ -1,97 +0,0 @@ -/* - Copyright (c) 2015, James Cox. All rights reserved. - Copyright (c) 2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKPieChartLegendCollectionViewLayout.h" - -#import "ORKPieChartLegendView.h" - - -@interface ORKPieChartLegendCollectionViewLayout () - -@property (nonatomic, readonly) ORKPieChartLegendView *collectionView; - -@end - - -@implementation ORKPieChartLegendCollectionViewLayout - -@dynamic collectionView; - -- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { - NSArray *attributesArray = [super layoutAttributesForElementsInRect:rect]; - for (UICollectionViewLayoutAttributes *attributes in attributesArray) { - attributes.frame = [self layoutAttributesForItemAtIndexPath:attributes.indexPath].frame; - } - return attributesArray; -} - -- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath { - UICollectionViewLayoutAttributes *currentItemAttributes = [super layoutAttributesForItemAtIndexPath:indexPath]; - NSInteger numberOfItems = [self.collectionView.dataSource collectionView:self.collectionView numberOfItemsInSection:indexPath.section]; - - // Spread items evenly between rows - NSInteger numberOfRows = ceil(self.collectionView.totalCellWidth / self.collectionView.bounds.size.width); - NSInteger numberOfItemsPerRow = ceil((float)numberOfItems / numberOfRows); - - // Calculate the row in which the current item sits - NSInteger currentItemIndex = indexPath.row; - NSInteger currentItemRow = currentItemIndex / numberOfItemsPerRow; - - // Adjust the Y position of the current item to the corresponding row - CGRect currentItemFrame = currentItemAttributes.frame; - currentItemFrame.origin.y = currentItemRow * (currentItemFrame.size.height + self.minimumLineSpacing); // Assume all items have the same height - - // Calculate the X position of the current item according to the width of preceding items in the same row - CGFloat xPosition = 0; - NSInteger currentRowItemIndex = currentItemRow * numberOfItemsPerRow; - NSInteger currentRowLastItemIndex = MIN(currentRowItemIndex + numberOfItemsPerRow - 1, numberOfItems - 1); - while (currentRowItemIndex < currentItemIndex) { - xPosition += self.collectionView.cellSizes[currentRowItemIndex].CGSizeValue.width + self.minimumInteritemSpacing; - currentRowItemIndex++; - } - currentItemFrame.origin.x = xPosition; - - // Adjust the frame according to the trailing padding of the current rown so all the items gather around the center - while (currentRowItemIndex < currentRowLastItemIndex) { - xPosition += self.collectionView.cellSizes[currentRowItemIndex].CGSizeValue.width + self.minimumInteritemSpacing; - currentRowItemIndex++; - } - CGFloat currentRowLastItemMaxXPosition = xPosition + self.collectionView.cellSizes[currentRowItemIndex].CGSizeValue.width; - CGFloat currentRowTrailingPadding = self.collectionView.bounds.size.width - currentRowLastItemMaxXPosition; - currentItemFrame = CGRectOffset(currentItemFrame, currentRowTrailingPadding * 0.5, 0); - - currentItemAttributes.frame = currentItemFrame; - - return currentItemAttributes; -} - -@end diff --git a/ResearchKit/Charts/ORKPieChartLegendView.h b/ResearchKit/Charts/ORKPieChartLegendView.h deleted file mode 100644 index 76775c4097..0000000000 --- a/ResearchKit/Charts/ORKPieChartLegendView.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015-2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKPieChartView; - -@interface ORKPieChartLegendView : UICollectionView - -@property (nonatomic) UIFont *labelFont; -@property (nonatomic, readonly) NSMutableArray *cellSizes; -@property (nonatomic, readonly) CGFloat totalCellWidth; - -- (instancetype)initWithFrame:(CGRect)frame - collectionViewLayout:(UICollectionViewLayout *)collectionViewLayout NS_UNAVAILABLE; - -- (instancetype)initWithParentPieChartView:(ORKPieChartView *)parentPieChartView NS_DESIGNATED_INITIALIZER; - -- (void)animateWithDuration:(NSTimeInterval)animationDuration; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKPieChartLegendView.m b/ResearchKit/Charts/ORKPieChartLegendView.m deleted file mode 100644 index c9bffd5d29..0000000000 --- a/ResearchKit/Charts/ORKPieChartLegendView.m +++ /dev/null @@ -1,195 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015-2016, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKPieChartLegendView.h" - -#import "ORKPieChartLegendCell.h" -#import "ORKPieChartLegendCollectionViewLayout.h" -#import "ORKPieChartView_Internal.h" - -#import "ORKHelpers_Internal.h" - - -static const CGFloat MinimumInteritemSpacing = 10.0; -static const CGFloat MinimumLineSpacing = 6.0; -static NSString *const CellIdentifier = @"ORKPieChartLegendCell"; - -@implementation ORKPieChartLegendView { - __weak ORKPieChartView *_parentPieChartView; - ORKPieChartLegendCell *_sizingCell; - CGFloat _sumOfValues; -} - -- (instancetype)initWithFrame:(CGRect)frame - collectionViewLayout:(UICollectionViewLayout *)collectionViewLayout { - ORKThrowMethodUnavailableException(); -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-designated-initializers" -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - ORKThrowMethodUnavailableException(); -} -#pragma clang diagnostic pop - -- (instancetype)initWithParentPieChartView:(ORKPieChartView *)parentPieChartView { - ORKPieChartLegendCollectionViewLayout *pieChartLegendCollectionViewLayout = [[ORKPieChartLegendCollectionViewLayout alloc] init]; - pieChartLegendCollectionViewLayout.minimumInteritemSpacing = MinimumInteritemSpacing; - pieChartLegendCollectionViewLayout.minimumLineSpacing = MinimumLineSpacing; - pieChartLegendCollectionViewLayout.estimatedItemSize = CGSizeMake(100.0, 30.0); - self = [super initWithFrame:CGRectZero collectionViewLayout:pieChartLegendCollectionViewLayout]; - if (self) { - [self registerClass:[ORKPieChartLegendCell class] forCellWithReuseIdentifier:CellIdentifier]; - _sizingCell = [[ORKPieChartLegendCell alloc] initWithFrame:CGRectZero]; - - _parentPieChartView = parentPieChartView; - _sumOfValues = 0; - NSInteger numberOfSegments = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - for (NSInteger index = 0; index < numberOfSegments; index++) { - // Numerical value - CGFloat value = [_parentPieChartView.dataSource pieChartView:_parentPieChartView valueForSegmentAtIndex:index]; - _sumOfValues += value; - } - [self cacheCellSizes]; - - self.backgroundColor = [UIColor clearColor]; - self.translatesAutoresizingMaskIntoConstraints = NO; - self.dataSource = self; - self.delegate = self; - - [self setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical]; - [self setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical]; - - } - return self; -} - -- (NSArray *)_validIndexesWithReportedSegmentCount:(NSInteger)reportedSegmentCount { - NSMutableArray *validIndexes = [NSMutableArray new]; - for (NSInteger currentIndex = 0; currentIndex < reportedSegmentCount; currentIndex++) { - NSString *title = [_parentPieChartView.dataSource pieChartView:_parentPieChartView titleForSegmentAtIndex:currentIndex]; - if (title) { - [validIndexes addObject:@(currentIndex)]; - } - } - return [validIndexes copy]; -} - -- (void)cacheCellSizes { - _cellSizes = [NSMutableArray new]; - _totalCellWidth = 0; - NSArray *validIndexes = [self _validIndexesWithReportedSegmentCount:[_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]]; - for (NSNumber *indexNumber in validIndexes) { - NSInteger index = indexNumber.integerValue; - _sizingCell.titleLabel.text = [_parentPieChartView.dataSource pieChartView:_parentPieChartView titleForSegmentAtIndex:index]; - CGSize size = [_sizingCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; - [_cellSizes addObject:[NSValue valueWithCGSize:size]]; - _totalCellWidth += size.width; - if (index != validIndexes.count - 1) { - _totalCellWidth += MinimumInteritemSpacing; - } - } -} - -- (void)setLabelFont:(UIFont *)labelFont { - _labelFont = labelFont; - _sizingCell.titleLabel.font = _labelFont; - [self cacheCellSizes]; - [self reloadData]; - [self invalidateIntrinsicContentSize]; -} - -- (CGSize)intrinsicContentSize { - CGSize size = CGSizeMake(UIViewNoIntrinsicMetric, [self.collectionViewLayout collectionViewContentSize].height); - return size; -} - -- (void)animateWithDuration:(NSTimeInterval)animationDuration { - NSArray *sortedCells = [self.visibleCells sortedArrayUsingComparator:^NSComparisonResult(UICollectionViewCell *cell1, UICollectionViewCell *cell2) { - return cell1.tag > cell2.tag; - }]; - NSUInteger cellCount = sortedCells.count; - NSTimeInterval interAnimationDelay = 0.05; - NSTimeInterval singleAnimationDuration = animationDuration - (interAnimationDelay * (cellCount - 1)); - if (singleAnimationDuration < 0) { - interAnimationDelay = 0; - singleAnimationDuration = animationDuration; - } - for (NSUInteger index = 0; index < cellCount; index++) { - UICollectionViewCell *cell = sortedCells[index]; - cell.transform = CGAffineTransformMakeScale(0, 0); - [UIView animateWithDuration:singleAnimationDuration - delay:interAnimationDelay * index - options:(UIViewAnimationOptions)0 - animations:^{ - cell.transform = CGAffineTransformIdentity; - } completion:nil]; - } -} - -#pragma mark - UICollectionViewDataSource / UICollectionViewDelegate - -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - NSAssert(indexPath.section == 0, @"Section cannot be non-zero on an ORKPieChartView."); - - NSArray *validIndexes = [self _validIndexesWithReportedSegmentCount:[_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]]; - - NSAssert(validIndexes.count > indexPath.item, @"A valid index path has not been found for item: %ld", (long)indexPath.item); - - NSInteger correctedIndex = validIndexes[indexPath.item].integerValue; - NSString *title = [_parentPieChartView.dataSource pieChartView:_parentPieChartView titleForSegmentAtIndex:correctedIndex]; - CGFloat value = [_parentPieChartView.dataSource pieChartView:_parentPieChartView valueForSegmentAtIndex:correctedIndex]; - ORKPieChartLegendCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:CellIdentifier forIndexPath:indexPath]; - cell.tag = correctedIndex; - cell.titleLabel.text = title; - cell.titleLabel.font = _labelFont; - cell.dotView.backgroundColor = [_parentPieChartView colorForSegmentAtIndex:correctedIndex]; - - cell.accessibilityLabel = title; - cell.accessibilityValue = [NSString stringWithFormat:@"%0.0f%%", (value < .01) ? 1 : value / _sumOfValues * 100]; - return cell; -} - -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - NSInteger numberOfReportedCells = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - return (NSInteger)[self _validIndexesWithReportedSegmentCount:numberOfReportedCells].count; -} - -- (CGSize)collectionView:(UICollectionView *)collectionView - layout:(UICollectionViewLayout *)collectionViewLayout - sizeForItemAtIndexPath:(NSIndexPath *)indexPath { - CGSize size = _cellSizes[indexPath.row].CGSizeValue; - return size; -} - -@end diff --git a/ResearchKit/Charts/ORKPieChartPieView.h b/ResearchKit/Charts/ORKPieChartPieView.h deleted file mode 100644 index 720a9d278f..0000000000 --- a/ResearchKit/Charts/ORKPieChartPieView.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKPieChartView; - -@interface ORKPieChartPieView : UIView - -@property (nonatomic) UIFont *percentageLabelFont; - -@property (nonatomic) CGFloat radiusScaleFactor; - -- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; - -- (instancetype)initWithParentPieChartView:(ORKPieChartView *)parentPieChartView NS_DESIGNATED_INITIALIZER; - -- (CGFloat)normalizeValues; - -- (void)updatePieLayers; - -- (void)updatePercentageLabels; - -- (void)updateColors; - -- (void)animateWithDuration:(NSTimeInterval)animationDuration; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKPieChartPieView.m b/ResearchKit/Charts/ORKPieChartPieView.m deleted file mode 100644 index 89e479e3bb..0000000000 --- a/ResearchKit/Charts/ORKPieChartPieView.m +++ /dev/null @@ -1,406 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKPieChartPieView.h" - -#import "ORKPieChartView_Internal.h" - -#import "ORKHelpers_Internal.h" - - -static const CGFloat OriginAngle = -M_PI_2; -static const CGFloat PercentageLabelOffset = 10.0; -static const CGFloat InterAnimationDelay = 0.05; - -@implementation ORKPieChartPieView { - __weak ORKPieChartView *_parentPieChartView; - - CAShapeLayer *_circleLayer; - NSMutableArray *_normalizedValues; - NSMutableArray *_segmentLayers; - NSMutableArray *_pieSections; -} - -- (instancetype)initWithFrame:(CGRect)frame { - ORKThrowMethodUnavailableException(); -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-designated-initializers" -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - ORKThrowMethodUnavailableException(); -} -#pragma clang diagnostic pop - -- (instancetype)initWithParentPieChartView:(ORKPieChartView *)parentPieChartView { - self = [super initWithFrame:CGRectZero]; - if (self) { - _parentPieChartView = parentPieChartView; - self.translatesAutoresizingMaskIntoConstraints = NO; - - _circleLayer = [CAShapeLayer layer]; - _circleLayer.fillColor = [UIColor clearColor].CGColor; - _circleLayer.strokeColor = [UIColor colorWithWhite:0.96 alpha:1.000].CGColor; - [self.layer addSublayer:_circleLayer]; - - _normalizedValues = [NSMutableArray new]; - _segmentLayers = [NSMutableArray new]; - _pieSections = [NSMutableArray new]; - _radiusScaleFactor = 0.5; - } - return self; -} - -- (void)setPercentageLabelFont:(UIFont *)percentageLabelFont { - _percentageLabelFont = percentageLabelFont; - for (ORKPieChartSection *pieSection in _pieSections) { - pieSection.label.font = percentageLabelFont; - [pieSection.label sizeToFit]; - } - [self setNeedsLayout]; -} - -#pragma mark - Data Normalization - -- (CGFloat)normalizeValues { - [_normalizedValues removeAllObjects]; - - CGFloat sumOfValues = 0; - NSInteger numberOfSegments = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - for (NSInteger idx = 0; idx < numberOfSegments; idx++) { - CGFloat value = [_parentPieChartView.dataSource pieChartView:_parentPieChartView valueForSegmentAtIndex:idx]; - sumOfValues += value; - } - - for (NSInteger idx = 0; idx < numberOfSegments; idx++) { - CGFloat value = 0; - if (sumOfValues != 0) { - value = [_parentPieChartView.dataSource pieChartView:_parentPieChartView valueForSegmentAtIndex:idx] / sumOfValues; - } - [_normalizedValues addObject:@(value)]; - } - return sumOfValues; -} - -#pragma mark - Layout and drawing - -- (void)layoutSubviews { - [super layoutSubviews]; - CGRect bounds = self.bounds; - CGFloat startAngle = OriginAngle; - CGFloat endAngle = startAngle + (2 * M_PI); - CGFloat outerRadius = bounds.size.height * _radiusScaleFactor; - CGFloat labelHeight = [@"100%" boundingRectWithSize:CGRectInfinite.size - options:(NSStringDrawingOptions)0 - attributes:@{NSFontAttributeName : _percentageLabelFont} - context:nil].size.height; - CGFloat innerRadius = outerRadius - (labelHeight + PercentageLabelOffset); - CGFloat targetRadius = _parentPieChartView.showsPercentageLabels ? innerRadius : outerRadius; - CGFloat lineWidth = MIN(_parentPieChartView.lineWidth, targetRadius); - _circleLayer.lineWidth = lineWidth; - CGFloat drawingRadius = targetRadius - (lineWidth * 0.5); - - if (!_parentPieChartView.drawsClockwise) { - startAngle = 3 * M_PI_2; - endAngle = -M_PI_2; - } - UIBezierPath *circularArcBezierPath = [UIBezierPath bezierPathWithArcCenter:CGPointMake(CGRectGetMidX(bounds), - CGRectGetMidY(bounds)) - radius:drawingRadius - startAngle:startAngle - endAngle:endAngle - clockwise:_parentPieChartView.drawsClockwise]; - - _circleLayer.path = circularArcBezierPath.CGPath; - - [self layoutPieChartLayers]; - if (_parentPieChartView.showsPercentageLabels) { - [self layoutPercentageLabelsWithRadius:innerRadius]; - } -} - -- (void)updatePieLayers { - [_segmentLayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; - [_segmentLayers removeAllObjects]; - - CGFloat cumulativeValue = 0; - NSInteger numberOfSegments = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - for (NSInteger idx = 0; idx < numberOfSegments; idx++) { - - CAShapeLayer *segmentLayer = [CAShapeLayer layer]; - segmentLayer.fillColor = [[UIColor clearColor] CGColor]; - segmentLayer.frame = _circleLayer.bounds; - segmentLayer.path = _circleLayer.path; - segmentLayer.lineWidth = _circleLayer.lineWidth; - segmentLayer.strokeColor = [_parentPieChartView colorForSegmentAtIndex:idx].CGColor; - CGFloat value = _normalizedValues[idx].floatValue; - - segmentLayer.strokeStart = cumulativeValue; - [_circleLayer addSublayer:segmentLayer]; - [_segmentLayers addObject:segmentLayer]; - segmentLayer.strokeEnd = cumulativeValue + value; - - cumulativeValue += value; - } -} - -- (void)updatePercentageLabels { - for (ORKPieChartSection *pieSection in _pieSections) { - [pieSection.label removeFromSuperview]; - } - [_pieSections removeAllObjects]; - - if (_parentPieChartView.showsPercentageLabels) { - CGFloat cumulativeValue = 0; - NSInteger numberOfSegments = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - for (NSInteger idx = 0; idx < numberOfSegments; idx++) { - CGFloat value = _normalizedValues[idx].floatValue; - - // Create a label - UILabel *label = [UILabel new]; - label.text = [NSString stringWithFormat:@"%0.0f%%", value * 100]; - label.font = _percentageLabelFont; - label.textColor = [_parentPieChartView colorForSegmentAtIndex:idx]; - [label sizeToFit]; - - // Only if there are no legends - label.isAccessibilityElement = ![_parentPieChartView.dataSource respondsToSelector:@selector(pieChartView:titleForSegmentAtIndex:)]; - - // Calculate the angle to the centre of this segment in radians - CGFloat angle = 0; - if (_parentPieChartView.drawsClockwise) { - angle = (value / 2 + cumulativeValue) * M_PI * 2; - } else { - angle = (value / 2 + cumulativeValue) * - M_PI * 2; - } - - cumulativeValue += value; - ORKPieChartSection *pieSection = [[ORKPieChartSection alloc] initWithLabel:label angle:angle]; - [_pieSections addObject:pieSection]; - [self addSubview:label]; - } - } -} - -- (void)updateColors { - NSInteger numberOfSegments = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - for (NSInteger idx = 0; idx < numberOfSegments; idx++) { - if (_segmentLayers.count == numberOfSegments) { - CAShapeLayer *segmentLayer = _segmentLayers[idx]; - segmentLayer.strokeColor = [_parentPieChartView colorForSegmentAtIndex:idx].CGColor; - } - if (_pieSections.count == numberOfSegments) { - ORKPieChartSection *pieSection = _pieSections[idx]; - UILabel *label = pieSection.label; - label.textColor = [_parentPieChartView colorForSegmentAtIndex:idx]; - } - } -} - -- (void)layoutPieChartLayers { - NSInteger numberOfSegments = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - for (NSInteger idx = 0; idx < numberOfSegments; idx++) { - CAShapeLayer *segmentLayer = _segmentLayers[idx]; - segmentLayer.frame = _circleLayer.bounds; - segmentLayer.path = _circleLayer.path; - segmentLayer.lineWidth = _circleLayer.lineWidth; - } -} - -- (void)layoutPercentageLabelsWithRadius:(CGFloat)pieRadius { - CGFloat cumulativeValue = 0; - NSInteger numberOfSegments = [_parentPieChartView.dataSource numberOfSegmentsInPieChartView:_parentPieChartView]; - for (NSInteger idx = 0; idx < numberOfSegments; idx++) { - CGFloat value = _normalizedValues[idx].floatValue; - - // Get a label - ORKPieChartSection *pieSection = _pieSections[idx]; - UILabel *label = pieSection.label; - - // Calculate the angle to the centre of this segment in radians - CGFloat angle = (value / 2 + cumulativeValue) * M_PI * 2; - if (!_parentPieChartView.drawsClockwise) { - angle = (value / 2 + cumulativeValue) * - M_PI * 2; - } - - label.center = [self percentageLabel:label calculateCenterForAngle:angle pieRadius:pieRadius]; - cumulativeValue += value; - } - [self adjustIntersectionsOfPercentageLabels:_pieSections pieRadius:pieRadius]; -} - -- (CGPoint)percentageLabel:(UILabel *)label calculateCenterForAngle:(CGFloat)angle pieRadius:(CGFloat)pieRadius { - // Calculate the desired distance from the circle's centre. - const CGFloat offset = 10; - CGFloat length = pieRadius + offset; - - // Calculate x and y coordinates for the point at this distance at the specified angle. - CGSize size = self.bounds.size; - CGFloat cosine = cos(angle + OriginAngle); - CGFloat sine = sin(angle + OriginAngle); - CGFloat x = cosine * length + size.width / 2; - CGFloat y = sine * length + size.height / 2; - - // Offset (x,y) to normalise the spacing from the circle's centre to the intersection with the label's frame rather than its centre. - CGSize labelSize = [label systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; - CGFloat xIn = cosine * labelSize.width / 2; - CGFloat yIn = sine * labelSize.height / 2; - x += xIn; - y += yIn; - - return CGPointMake(x, y); -} - -- (void)adjustIntersectionsOfPercentageLabels:(NSArray *)pieSections pieRadius:(CGFloat)pieRadius { - if (pieSections.count == 0) { - return; - } - // Adjust labels while we have intersections - BOOL intersections = YES; - // We alternate directions in each iteration - BOOL shiftClockwise = NO; - CGFloat rotateDirection = _parentPieChartView.drawsClockwise ? 1 : -1; - // We use totalAngle to prevent from infinite loop - CGFloat totalAngle = 0; - while (intersections) { - intersections = NO; - shiftClockwise = !shiftClockwise; - - if (shiftClockwise) { - for (NSUInteger idx = 0; idx < (pieSections.count - 1); idx++) { - // Prevent from infinite loop - if (!idx) { - totalAngle += 0.01; - if (totalAngle >= 2 * M_PI) { - return; - } - } - ORKPieChartSection *pieLabel = pieSections[idx]; - ORKPieChartSection *nextPieLabel = pieSections[(idx + 1)]; - if ([self shiftSectionLabel:nextPieLabel fromSectionLabel:pieLabel direction:rotateDirection pieRadius:pieRadius]) { - intersections = YES; - } - } - } else { - for (NSInteger idx = pieSections.count - 1; idx > 0; idx--) { - ORKPieChartSection *pieLabel = pieSections[idx]; - ORKPieChartSection *nextPieLabel = pieSections[idx - 1]; - if ([self shiftSectionLabel:nextPieLabel fromSectionLabel:pieLabel direction:-rotateDirection pieRadius:pieRadius]) { - intersections = YES; - } - } - } - - // Adjust space between last and first element - ORKPieChartSection *firstPieLabel = pieSections.firstObject; - ORKPieChartSection *lastPieLabel = pieSections.lastObject; - UILabel *firstLabel = firstPieLabel.label; - UILabel *lastLabel = lastPieLabel.label; - if (CGRectIntersectsRect(lastLabel.frame, firstLabel.frame)) { - CGFloat firstLabelAngle = firstPieLabel.angle; - CGFloat lastLabelAngle = lastPieLabel.angle; - firstLabelAngle += rotateDirection * 0.01; - lastLabelAngle -= rotateDirection * 0.01; - firstPieLabel.angle = firstLabelAngle; - lastPieLabel.angle = lastLabelAngle; - } - } -} - -- (BOOL)shiftSectionLabel:(ORKPieChartSection *)nextPieSection - fromSectionLabel:(ORKPieChartSection *)fromPieSection - direction:(CGFloat)direction - pieRadius:(CGFloat)pieRadius { - CGFloat shiftStep = 0.01; - UILabel *label = fromPieSection.label; - UILabel *nextLabel = nextPieSection.label; - if (CGRectIntersectsRect(label.frame, nextLabel.frame)) { - CGFloat nextLabelAngle = nextPieSection.angle; - nextLabelAngle += direction * shiftStep; - nextPieSection.angle = nextLabelAngle; - nextLabel.center = [self percentageLabel:nextLabel calculateCenterForAngle:nextLabelAngle pieRadius:pieRadius]; - return YES; - } - return NO; -} - -- (void)animateWithDuration:(NSTimeInterval)animationDuration { - NSUInteger numberOfSegmentLayers = _segmentLayers.count; - NSTimeInterval interAnimationDelay = InterAnimationDelay; - NSTimeInterval singleAnimationDuration = animationDuration - (interAnimationDelay * (numberOfSegmentLayers - 1)); - if (singleAnimationDuration < 0) { - interAnimationDelay = 0; - singleAnimationDuration = animationDuration; - } - - CGFloat cumulativeValue = 0; - for (NSInteger idx = 0; idx < numberOfSegmentLayers ; idx++) { - CAShapeLayer *segmentLayer = _segmentLayers[idx]; - CGFloat value = _normalizedValues[idx].floatValue; - CABasicAnimation *strokeAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; - strokeAnimation.fromValue = @(segmentLayer.strokeStart); - strokeAnimation.toValue = @(cumulativeValue + value); - strokeAnimation.duration = animationDuration; - strokeAnimation.removedOnCompletion = NO; - strokeAnimation.fillMode = kCAFillModeForwards; - strokeAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - [segmentLayer addAnimation:strokeAnimation forKey:@"strokeAnimation"]; - - if (_parentPieChartView.showsPercentageLabels && _pieSections.count == numberOfSegmentLayers) { - ORKPieChartSection *pieSection = _pieSections[idx]; - UILabel *label = pieSection.label; - label.alpha = 0; - [UIView animateWithDuration:singleAnimationDuration - delay:interAnimationDelay * idx - options:(UIViewAnimationOptions)0 - animations:^{ - label.alpha = 1.0; - } - completion:nil]; - } - - cumulativeValue += value; - } -} - -- (void)setRadiusScaleFactor:(CGFloat)radiusScaleFactor { - _radiusScaleFactor = radiusScaleFactor; -} - -#pragma mark - Accessibility - -- (NSArray *)accessibilityElements { - return _pieSections; -} - -@end diff --git a/ResearchKit/Charts/ORKPieChartTitleTextView.h b/ResearchKit/Charts/ORKPieChartTitleTextView.h deleted file mode 100644 index 77c58b9bd6..0000000000 --- a/ResearchKit/Charts/ORKPieChartTitleTextView.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKPieChartView; - -@interface ORKPieChartTitleTextView : UIView - -@property (nonatomic) UILabel *titleLabel; -@property (nonatomic) UILabel *textLabel; -@property (nonatomic) UILabel *noDataLabel; - -- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; - -- (instancetype)initWithParentPieChartView:(ORKPieChartView *)parentPieChartView NS_DESIGNATED_INITIALIZER; - -- (void)showNoDataLabel:(BOOL)showNoDataLabel; - -- (void)animateWithDuration:(NSTimeInterval)animationDuration; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKPieChartTitleTextView.m b/ResearchKit/Charts/ORKPieChartTitleTextView.m deleted file mode 100644 index 786eefeb7f..0000000000 --- a/ResearchKit/Charts/ORKPieChartTitleTextView.m +++ /dev/null @@ -1,182 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKPieChartTitleTextView.h" - -#import "ORKPieChartView_Internal.h" - -#import "ORKHelpers_Internal.h" -#import "ORKSkin.h" - - -@implementation ORKPieChartTitleTextView { - __weak ORKPieChartView *_parentPieChartView; - - NSMutableArray *_variableConstraints; -} - -- (instancetype)initWithFrame:(CGRect)frame { - ORKThrowMethodUnavailableException(); -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-designated-initializers" -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - ORKThrowMethodUnavailableException(); -} -#pragma clang diagnostic pop - -- (instancetype)initWithParentPieChartView:(ORKPieChartView *)parentPieChartView { - self = [super initWithFrame:CGRectZero]; - if (self) { - _parentPieChartView = parentPieChartView; - self.translatesAutoresizingMaskIntoConstraints = NO; - - _titleLabel = [UILabel new]; - _titleLabel.textColor = ORKColor(ORKChartDefaultTextColorKey); - [_titleLabel setTextAlignment:NSTextAlignmentCenter]; - - _textLabel = [UILabel new]; - _textLabel.textColor = ORKColor(ORKChartDefaultTextColorKey); - [_textLabel setTextAlignment:NSTextAlignmentCenter]; - - _noDataLabel = [UILabel new]; - _noDataLabel.textColor = [UIColor lightGrayColor]; - _noDataLabel.text = ORKLocalizedString(@"CHART_NO_DATA_TEXT", nil); - _noDataLabel.textAlignment = NSTextAlignmentCenter; - _noDataLabel.hidden = YES; - - [self addSubview:_titleLabel]; - [self addSubview:_textLabel]; - [self addSubview:_noDataLabel]; - - _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; - _textLabel.translatesAutoresizingMaskIntoConstraints = NO; - _noDataLabel.translatesAutoresizingMaskIntoConstraints = NO; - - [self setUpConstraints]; - [self setNeedsUpdateConstraints]; - } - return self; -} - -- (void)setUpConstraints { - NSMutableArray *constraints = [NSMutableArray new]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_titleLabel - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeCenterX - multiplier:1.0 - constant:0.0]]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_textLabel - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeCenterX - multiplier:1.0 - constant:0.0]]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_noDataLabel - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeCenterX - multiplier:1.0 - constant:0.0]]; - [NSLayoutConstraint activateConstraints:constraints]; -} - -- (void)updateConstraints { - [NSLayoutConstraint deactivateConstraints:_variableConstraints]; - [_variableConstraints removeAllObjects]; - if (!_variableConstraints) { - _variableConstraints = [NSMutableArray new]; - } - - NSDictionary *views = NSDictionaryOfVariableBindings(_titleLabel, _textLabel, _noDataLabel); - if (_noDataLabel.hidden) { - [_variableConstraints addObjectsFromArray: - [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_titleLabel][_textLabel]|" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:views]]; - } else { - [_variableConstraints addObjectsFromArray: - [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_noDataLabel]|" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:views]]; - } - - [NSLayoutConstraint activateConstraints:_variableConstraints]; - [super updateConstraints]; -} - -- (void)showNoDataLabel:(BOOL)showNoDataLabel { - _titleLabel.hidden = showNoDataLabel; - _textLabel.hidden = showNoDataLabel; - _noDataLabel.hidden = !showNoDataLabel; - [self setNeedsUpdateConstraints]; -} - -- (void)animateWithDuration:(NSTimeInterval)animationDuration { - _titleLabel.alpha = 0.0; - _textLabel.alpha = 0.0; - _noDataLabel.alpha = 0.0; - [UIView animateWithDuration:animationDuration - animations:^{ - _titleLabel.alpha = 1.0; - _textLabel.alpha = 1.0; - _noDataLabel.alpha = 1.0; - }]; -} - -#pragma mark - Accessibility - -- (NSArray *)accessibilityElements { - if (!_titleLabel || !_textLabel || !_noDataLabel) { - return nil; - } - - NSMutableArray *accessibilityElements = [[NSMutableArray alloc] init]; - if (!_noDataLabel.hidden) { - [accessibilityElements addObject:_noDataLabel]; - } else { - [accessibilityElements addObject:_titleLabel]; - [accessibilityElements addObject:_textLabel]; - } - - return accessibilityElements; -} - -@end diff --git a/ResearchKit/Charts/ORKPieChartView.h b/ResearchKit/Charts/ORKPieChartView.h deleted file mode 100644 index 46979614c3..0000000000 --- a/ResearchKit/Charts/ORKPieChartView.h +++ /dev/null @@ -1,263 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - Copyright (c) 2018, Brian Ganninger. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -@import UIKit; -#import - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKPieChartView; - -/** - An object that adopts the `ORKPieChartViewDataSource` protocol is responsible for providing the - data required to populate an `ORKPieChartView` object. - - At a minimumm, a data source object must implement the `numberOfSegmentsInPieChartView` and - `pieChartView:valueForSegmentAtIndex:` methods. These methods are responsible for returning the - number of segments in a pie chart view and the value for each segment. A data source object may - provide additional information to the pie chart by implementing the optional - `ORKPieChartViewDataSource` methods. - - When configuring an `ORKPieChartView` object, assign your data source to its `dataSource` property. -*/ -ORK_AVAILABLE_DECL -@protocol ORKPieChartViewDataSource - -@required -/** - Asks the data source for the number of segments in the pie chart view. - - @param pieChartView The pie chart view asking for the number of segments. - - @return The number of segments in the pie chart view. -*/ -- (NSInteger)numberOfSegmentsInPieChartView:(ORKPieChartView *)pieChartView; - -/** - Asks the data source for the value of a segment in the pie chart view. - - The value can be any arbitrary integer: the pie chart view normalizes them by the sum of all - returned values. - - @param pieChartView The pie chart view asking for the value of the segment. - @param index An index number specifying the segment in the pie chart view. - - @return The value of the segment at the specified `index` in the pie chart view. -*/ -- (CGFloat)pieChartView:(ORKPieChartView *)pieChartView valueForSegmentAtIndex:(NSInteger)index; - -@optional -/** - Asks the data source for the color of a segment in the pie chart view. - - If this method is not implemented, the pie chart view uses a unique shade of the current - tint color for each segment. - - @param pieChartView The pie chart view asking for the color of the segment. - @param index An index number specifying the segment in the pie chart view. - - @return The color of the segment at the specified `index` in the pie chart view. -*/ -- (UIColor *)pieChartView:(ORKPieChartView *)pieChartView colorForSegmentAtIndex:(NSInteger)index; - -/** - Asks the data source for the title to appear in the legend for a segment in the pie chart view. - - If this method is not implemented, the pie chart view does not display the legend. If you return - `nil` for a segment index, the label for that segment won't be displayed in the legend. - - @param pieChartView The pie chart view asking for the title. - @param index An index number specifying the segment in the pie chart view. - - @return The title of the segment at the specified index in the pie chat view's - legend. -*/ -- (nullable NSString *)pieChartView:(ORKPieChartView *)pieChartView titleForSegmentAtIndex:(NSInteger)index; - -@end - -/** - The `ORKPieChartView` class presents data provided by an object conforming to the - `ORKPieChartViewDataSource` protocol as a pie chart. -*/ -ORK_CLASS_AVAILABLE -IB_DESIGNABLE -@interface ORKPieChartView : UIView - -/** - The data source object responsible for populating the pie chart with data. -*/ -@property (nonatomic, weak, nullable) id dataSource; - -/** - The width of the line used to draw the circular sections of the pie chart. - - If you do not set a value for this property, the pie chart view assumes a sensible value. If - you set a number higher than the radius of the pie chart, the pie chart draws a completely - filled pie. -*/ -@property (nonatomic) IBInspectable CGFloat lineWidth; - -/** - The text to display as a title in the pie chart view. - - If you do not set a value for this property, the pie chart does not display a title. -*/ -@property (nonatomic, copy, nullable) IBInspectable NSString *title; - -/** - The text to display beneath the title in the pie chart view. - - If you do not set a value for this property, the pie chart does not display any text beneath the - title. -*/ -@property (nonatomic, copy, nullable) IBInspectable NSString *text; - -/** - The color used for the text of the title label. - - The default value for this property is a light gray color. Setting this property to `nil` resets it - to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIColor *titleColor; - -/** - The color used for the text of the text label. - - The default value for this property is a light gray color. Setting this property to `nil` resets it - to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIColor *textColor; - -/** - A Boolean value indicating whether the title and text labels should be drawn above the chart. - - If this value of this property is `NO`, the title and text are drawn at the center of the chart. - The default value for this property is `NO`. - */ -@property (nonatomic) IBInspectable BOOL showsTitleAboveChart; - -/** - A Boolean value indicating whether the pie chart should draw percentage labels next to each - segement. - - The default value for this property is YES. -*/ -@property (nonatomic) IBInspectable BOOL showsPercentageLabels; - -/** - A Boolean value indicating whether the pie chart drawing animation draws clockwise or - counterclockwise. - - The default value for this property is YES. -*/ -@property (nonatomic) IBInspectable BOOL drawsClockwise; - -/** - The string that will be displayed if the sum of the values of all segments is zero. - - The default value for this property is an appropriate message string. Setting this property to - `nil` resets it to its default value. -*/ -@property (nonatomic, copy, null_resettable) IBInspectable NSString *noDataText; - -/** - The font used for the title text of the header. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *titleFont; - -/** - The font used for the subtitle text of the header. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *subtitleFont; - -/** - The font used for the "no data" label in the chart. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *noDataFont; - -/** - The font used for the percentage label of each segment of the pie chart. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *percentageLabelFont; - -/** - The font used for the legend that describes each color<->segment pair in the pie chart. - - The default value for this property is the appropriate font. Setting this property to - `nil` resets it to its default value. - */ -@property (nonatomic, strong, null_resettable) IBInspectable UIFont *legendFont; - -/** - Animates the pie chart when it is first displayed on the screen. - - You can optionally call this method from the `viewWillAppear:` implementation of the view - controller that owns the pie chart view. - - @param animationDuration The duration of the appearing animation. -*/ -- (void)animateWithDuration:(NSTimeInterval)animationDuration; - -/** - Reloads the plotted data. - - Call this method to reload the data and re-plot the graph. You should call it if the data provided by the dataSource changes. - */ -- (void)reloadData; - -/** - A scaling factor for the radius of the pie chart. - Increase it to increase the radius of the pie chart and vice versa. - - Defaults to 0.5. - */ -@property (nonatomic) CGFloat radiusScaleFactor; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKPieChartView.m b/ResearchKit/Charts/ORKPieChartView.m deleted file mode 100644 index a869d1c7e7..0000000000 --- a/ResearchKit/Charts/ORKPieChartView.m +++ /dev/null @@ -1,530 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - Copyright (c) 2018, Brian Ganninger. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#import "ORKPieChartView.h" -#import "ORKPieChartView_Internal.h" - -#import "ORKPieChartLegendView.h" -#import "ORKPieChartPieView.h" -#import "ORKPieChartTitleTextView.h" - -#import "ORKHelpers_Internal.h" -#import "ORKSkin.h" - - -#if TARGET_INTERFACE_BUILDER - -@interface ORKIBPieChartViewDataSourceSegment : NSObject - -@property (nonatomic, assign) CGFloat value; - -@property (nonatomic, copy, nullable) NSString *title; - -@property (nonatomic, strong, nullable) UIColor *color; - -@end - - -@interface ORKIBPieChartViewDataSource : NSObject - -+ (instancetype)sharedInstance; - -@property (nonatomic, strong, nullable) NSArray *segments; - -@end - - -@implementation ORKIBPieChartViewDataSourceSegment - -@end - - -@implementation ORKIBPieChartViewDataSource - -+ (instancetype)sharedInstance { - static ORKIBPieChartViewDataSource *sharedInstance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedInstance = [[self class] new]; - }); - return sharedInstance; -} - -- (instancetype)init { - self = [super init]; - if (self) { - ORKIBPieChartViewDataSourceSegment *segment1 = [ORKIBPieChartViewDataSourceSegment new]; - segment1.value = 10.0; - segment1.title = @"Title 1"; - segment1.color = [UIColor colorWithRed:217.0/225 green:217.0/255 blue:217.0/225 alpha:1]; - - ORKIBPieChartViewDataSourceSegment *segment2 = [ORKIBPieChartViewDataSourceSegment new]; - segment2.value = 25.0; - segment2.title = @"Title 2"; - segment2.color = [UIColor colorWithRed:142.0/255 green:142.0/255 blue:147.0/255 alpha:1]; - - ORKIBPieChartViewDataSourceSegment *segment3 = [ORKIBPieChartViewDataSourceSegment new]; - segment3.value = 45.0; - segment3.title = @"Title 3"; - segment3.color = [UIColor colorWithRed:244.0/225 green:190.0/255 blue:74.0/225 alpha:1]; - - _segments = @[segment1, segment2, segment3]; - } - return self; -} -- (NSInteger)numberOfSegmentsInPieChartView:(ORKPieChartView *)pieChartView { - return self.segments.count; -} -- (CGFloat)pieChartView:(ORKPieChartView *)pieChartView valueForSegmentAtIndex:(NSInteger)index { - return self.segments[index].value; -} - -- (UIColor *)pieChartView:(ORKPieChartView *)pieChartView colorForSegmentAtIndex:(NSInteger)index { - return self.segments[index].color; -} - -- (NSString *)pieChartView:(ORKPieChartView *)pieChartView titleForSegmentAtIndex:(NSInteger)index { - return self.segments[index].title; -} - -@end - -#endif - - -static const CGFloat TitleToPiePadding = 8.0; -static const CGFloat PieToLegendPadding = 8.0; - - -@implementation ORKPieChartSection - -- (instancetype)initWithLabel:(UILabel *)label angle:(CGFloat)angle { - if (self = [super init]) { - _label = label; - _angle = angle; - } - return self; -} - -#pragma mark - Accessibility - -- (BOOL)isAccessibilityElement { - return self.label.isAccessibilityElement; -} - -- (NSString *)accessibilityLabel { - return self.label.accessibilityLabel; -} - -- (CGRect)accessibilityFrame { - return self.label.accessibilityFrame; -} - -@end - - -@implementation ORKPieChartView { - NSMutableArray *_variableConstraints; - - ORKPieChartPieView *_pieView; - ORKPieChartLegendView *_legendView; - ORKPieChartTitleTextView *_titleTextView; - BOOL _shouldInvalidateLegendViewIntrinsicContentSize; -} - -#pragma mark - Init - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self sharedInit]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - [self sharedInit]; - } - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)sharedInit { - _lineWidth = 10; - _showsTitleAboveChart = NO; - _showsPercentageLabels = YES; - _drawsClockwise = YES; - - // nil reset to default fonts - self.titleFont = nil; - self.subtitleFont = nil; - self.noDataFont = nil; - self.percentageLabelFont = nil; - self.legendFont = nil; - - _legendView = nil; // legend lazily initialized on demand - - _pieView = [[ORKPieChartPieView alloc] initWithParentPieChartView:self]; - [self addSubview:_pieView]; - - _titleTextView = [[ORKPieChartTitleTextView alloc] initWithParentPieChartView:self]; - [self addSubview:_titleTextView]; - - [self updateContentSizeCategoryFonts]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(updateContentSizeCategoryFonts) - name:UIContentSizeCategoryDidChangeNotification - object:nil]; - [self setUpConstraints]; - [self setNeedsUpdateConstraints]; -} - -#pragma mark - API - -- (void)reloadData { - CGFloat sumOfValues = [_pieView normalizeValues]; - [_pieView updatePieLayers]; - [_pieView updatePercentageLabels]; - [_titleTextView showNoDataLabel:(sumOfValues == 0)]; - [self updateLegendView]; -} - -- (void)setDataSource:(id)dataSource { - _dataSource = dataSource; - [self reloadData]; -} - -- (void)tintColorDidChange { - [_pieView updateColors]; - [_legendView reloadData]; -} - -- (void)setFrame:(CGRect)frame { - [super setFrame:frame]; - _shouldInvalidateLegendViewIntrinsicContentSize = YES; - [self setNeedsLayout]; -} - -- (void)setBounds:(CGRect)bounds { - [super setBounds:bounds]; - [self setNeedsLayout]; -} - -#pragma mark - Configuration - -- (void)setRadiusScaleFactor:(CGFloat)radiusScaleFactor { - _pieView.radiusScaleFactor = radiusScaleFactor; - [_pieView setNeedsLayout]; -} - -- (void)setLineWidth:(CGFloat)lineWidth { - _lineWidth = lineWidth; - [_pieView setNeedsLayout]; -} - -- (void)setTitle:(NSString *)title { - _titleTextView.titleLabel.text = title; -} - -- (NSString *)title { - return _titleTextView.titleLabel.text; -} - -- (void)setText:(NSString *)text { - _titleTextView.textLabel.text = text; -} - -- (NSString *)text { - return _titleTextView.textLabel.text; -} - -- (void)setNoDataText:(NSString *)noDataText { - if (!noDataText) { - noDataText = ORKLocalizedString(@"CHART_NO_DATA_TEXT", nil); - } - _titleTextView.noDataLabel.text = noDataText; -} - -- (NSString *)noDataText { - return _titleTextView.noDataLabel.text; -} - -- (void)setTitleFont:(UIFont *)titleFont { - if (!titleFont) { - titleFont = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; - } - _titleFont = titleFont; - _titleTextView.titleLabel.font = _titleFont; -} - -- (void)setSubtitleFont:(UIFont *)subtitleFont { - if (!subtitleFont) { - subtitleFont = [UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]; - } - _subtitleFont = subtitleFont; - _titleTextView.textLabel.font = _subtitleFont; -} - -- (void)setNoDataFont:(UIFont *)noDataFont { - if (!noDataFont) { - noDataFont = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; - } - _noDataFont = noDataFont; - _titleTextView.noDataLabel.font = _noDataFont; -} - -- (void)setPercentageLabelFont:(UIFont *)percentageLabelFont { - if (!percentageLabelFont) { - percentageLabelFont = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2]; - } - _percentageLabelFont = percentageLabelFont; - _pieView.percentageLabelFont = _percentageLabelFont; -} - -- (void)setLegendFont:(UIFont *)legendFont { - if (!legendFont) { - legendFont = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]; - } - _legendFont = legendFont; - _legendView.labelFont = _legendFont; -} - -- (void)setTitleColor:(UIColor *)titleColor { - if (!titleColor) { - titleColor = ORKColor(ORKChartDefaultTextColorKey); - } - _titleTextView.titleLabel.textColor = titleColor; -} - -- (UIColor *)titleColor { - return _titleTextView.titleLabel.textColor; -} - -- (void)setTextColor:(UIColor *)textColor { - if (!textColor) { - textColor = ORKColor(ORKChartDefaultTextColorKey); - } - _titleTextView.textLabel.textColor = textColor; -} - -- (UIColor *)textColor { - return _titleTextView.textLabel.textColor; -} - -- (void)setShowsTitleAboveChart:(BOOL)showsTitleAboveChart { - _showsTitleAboveChart = showsTitleAboveChart; - [self setNeedsUpdateConstraints]; -} - -- (void)setShowsPercentageLabels:(BOOL)showsPercentageLabels { - _showsPercentageLabels = showsPercentageLabels; - [_pieView updatePercentageLabels]; - [_pieView setNeedsLayout]; -} - -- (void)setDrawsClockwise:(BOOL)drawsClockwise { - _drawsClockwise = drawsClockwise; - [_pieView setNeedsLayout]; -} - -#pragma mark - Presentation - -- (void)updateContentSizeCategoryFonts { - _titleTextView.titleLabel.font = self.titleFont; - _titleTextView.textLabel.font = self.subtitleFont; - _titleTextView.noDataLabel.font = self.noDataFont; - _pieView.percentageLabelFont = self.percentageLabelFont; - _legendView.labelFont = self.legendFont; -} - -- (void)setUpConstraints { - NSMutableArray *constraints = [NSMutableArray new]; - NSDictionary *views = NSDictionaryOfVariableBindings(_pieView); - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_pieView]|" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:views]]; - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|->=0-[_pieView]->=0-|" - options:(NSLayoutFormatOptions)0 - metrics:@{ @"PlotToLegendPadding": @(PieToLegendPadding) } - views:views]]; - - NSLayoutConstraint *maximumHeightConstraint = [NSLayoutConstraint constraintWithItem:_pieView - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:ORKScreenMetricMaxDimension]; - maximumHeightConstraint.priority = UILayoutPriorityDefaultLow - 1; - [constraints addObject:maximumHeightConstraint]; - - [constraints addObject:[NSLayoutConstraint constraintWithItem:_titleTextView - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:_pieView - attribute:NSLayoutAttributeCenterX - multiplier:1.0 - constant:0.0]]; - - [NSLayoutConstraint activateConstraints:constraints]; -} - -- (void)updateConstraints { - [NSLayoutConstraint deactivateConstraints:_variableConstraints]; - [_variableConstraints removeAllObjects]; - if (!_variableConstraints) { - _variableConstraints = [NSMutableArray new]; - } - - if (_showsTitleAboveChart) { - NSDictionary *views = NSDictionaryOfVariableBindings(_pieView, _titleTextView); - [_variableConstraints addObjectsFromArray: - [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_titleTextView]-TitleToPiePading-[_pieView]" - options:(NSLayoutFormatOptions)0 - metrics:@{ @"TitleToPiePading": @(TitleToPiePadding) } - views:views]]; - - } else { - [_variableConstraints addObject:[NSLayoutConstraint constraintWithItem:_titleTextView - attribute:NSLayoutAttributeCenterY - relatedBy:NSLayoutRelationEqual - toItem:_pieView - attribute:NSLayoutAttributeCenterY - multiplier:1.0 - constant:0.0]]; - } - - if (_legendView) { - NSDictionary *views = NSDictionaryOfVariableBindings(_pieView, _legendView); - [_variableConstraints addObjectsFromArray: - [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_legendView]|" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:views]]; - [_variableConstraints addObjectsFromArray: - [NSLayoutConstraint constraintsWithVisualFormat:@"V:[_pieView]-PlotToLegendPadding-[_legendView]|" - options:(NSLayoutFormatOptions)0 - metrics:@{ @"PlotToLegendPadding": @(PieToLegendPadding) } - views:views]]; - } - - [NSLayoutConstraint activateConstraints:_variableConstraints]; - [super updateConstraints]; -} - -- (void)updateLegendView { - if ([_dataSource respondsToSelector:@selector(pieChartView:titleForSegmentAtIndex:)]) { - if (_legendView) { - [_legendView removeFromSuperview]; - ORKRemoveConstraintsForRemovedViews(_variableConstraints, @[_legendView]); - } - _legendView = [[ORKPieChartLegendView alloc] initWithParentPieChartView:self]; - [self addSubview:_legendView]; - _legendView.labelFont = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1]; - _shouldInvalidateLegendViewIntrinsicContentSize = YES; - } else { - [_legendView removeFromSuperview]; - _legendView = nil; - } - [self setNeedsUpdateConstraints]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - if (_shouldInvalidateLegendViewIntrinsicContentSize) { - _shouldInvalidateLegendViewIntrinsicContentSize = NO; - [_legendView invalidateIntrinsicContentSize]; - } -} - -#pragma mark - DataSource - -- (UIColor *)colorForSegmentAtIndex:(NSInteger)index { - UIColor *color = nil; - if ([_dataSource respondsToSelector:@selector(pieChartView:colorForSegmentAtIndex:)]) { - color = [_dataSource pieChartView:self colorForSegmentAtIndex:index]; - } else { - // Default colors: use tintColor reducing alpha progressively - NSInteger numberOfSegments = [_dataSource numberOfSegmentsInPieChartView:self]; - color = ORKOpaqueColorWithReducedAlphaFromBaseColor(self.tintColor, index, numberOfSegments); - } - return color; -} - -- (void)animateWithDuration:(NSTimeInterval)animationDuration { - if (animationDuration < 0) { - @throw [NSException exceptionWithName:NSGenericException reason:@"animationDuration cannot be lower than 0" userInfo:nil]; - } - [self layoutIfNeeded]; // layout pass needed so _legendView (a UICollectionView subclass) dequees and displays the cells - [_pieView animateWithDuration:animationDuration]; - [_legendView animateWithDuration:animationDuration]; - [_titleTextView animateWithDuration:animationDuration]; -} - -#pragma mark - Accessibility - -- (BOOL)isAccessibilityElement { - return NO; -} - -- (NSArray *)accessibilityElements { - NSMutableArray *accessibilityElements = [[NSMutableArray alloc] init]; - [accessibilityElements addObjectsFromArray:_titleTextView.accessibilityElements]; - - // Use legends if there are any and percentage labels if not - if (_legendView) { - [accessibilityElements addObject:_legendView]; - } else { - [accessibilityElements addObjectsFromArray:_pieView.accessibilityElements]; - } - - return accessibilityElements; -} - -#pragma mark - Interface Builder designable - -- (void)prepareForInterfaceBuilder { - [super prepareForInterfaceBuilder]; -#if TARGET_INTERFACE_BUILDER - self.dataSource = [ORKIBPieChartViewDataSource sharedInstance]; -#endif -} - -@end diff --git a/ResearchKit/Charts/ORKPieChartView_Internal.h b/ResearchKit/Charts/ORKPieChartView_Internal.h deleted file mode 100644 index 752bc51fc8..0000000000 --- a/ResearchKit/Charts/ORKPieChartView_Internal.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - - -#import "ORKPieChartView.h" - - -NS_ASSUME_NONNULL_BEGIN - -@interface ORKPieChartSection : NSObject - -- (instancetype)initWithLabel:(UILabel *)label angle:(CGFloat)angle; - -@property (nonatomic, readonly) UILabel *label; -@property (nonatomic) CGFloat angle; - -@end - - -@interface ORKPieChartView () - -- (UIColor *)colorForSegmentAtIndex:(NSInteger)index; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKXAxisView.h b/ResearchKit/Charts/ORKXAxisView.h deleted file mode 100644 index f8cce22a86..0000000000 --- a/ResearchKit/Charts/ORKXAxisView.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKGraphChartView; - -@interface ORKXAxisView : UIView - -@property (nonatomic) UIFont *titleFont; - -@property (nonatomic) UIColor *axisColor; - -- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; - -- (instancetype)initWithParentGraphChartView:(ORKGraphChartView *)parentGraphChartView NS_DESIGNATED_INITIALIZER; - -- (void)updateTitles; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKXAxisView.m b/ResearchKit/Charts/ORKXAxisView.m deleted file mode 100644 index d64ac2ac53..0000000000 --- a/ResearchKit/Charts/ORKXAxisView.m +++ /dev/null @@ -1,230 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, James Cox. - Copyright (c) 2015, Ricardo Sánchez-Sáez. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKXAxisView.h" - -#import "ORKGraphChartView_Internal.h" - -#import "ORKHelpers_Internal.h" - - -static const CGFloat LastLabelHeight = 20.0; - -@implementation ORKXAxisView { - __weak ORKGraphChartView *_parentGraphChartView; - CALayer *_lineLayer; - NSMutableArray *_titleLabels; - NSMutableArray *_titleTickLayers; -} - -- (instancetype)initWithFrame:(CGRect)frame { - ORKThrowMethodUnavailableException(); -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-designated-initializers" -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - ORKThrowMethodUnavailableException(); -} -#pragma clang diagnostic pop - -- (instancetype)initWithParentGraphChartView:(ORKGraphChartView *)parentGraphChartView { - self = [super initWithFrame:CGRectZero]; - if (self) { - _parentGraphChartView = parentGraphChartView; - _axisColor = _parentGraphChartView.axisColor; - - _lineLayer = [CALayer layer]; - _lineLayer.backgroundColor = _axisColor.CGColor; - [self.layer addSublayer:_lineLayer]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - CGFloat width = self.bounds.size.width; - _lineLayer.frame = CGRectMake(0, -0.5, width, 1); - NSUInteger index = 0; - NSUInteger numberOfTitleLabels = _titleTickLayers.count; - for (CALayer *titleTickLayer in _titleTickLayers) { - CGFloat positionOnXAxis = xAxisPoint(index, numberOfTitleLabels, width); - titleTickLayer.frame = CGRectMake(positionOnXAxis - scalePixelAdjustment(), -ORKGraphChartViewAxisTickLength + scalePixelAdjustment(), 1, ORKGraphChartViewAxisTickLength); - index++; - } - _titleLabels.lastObject.layer.cornerRadius = LastLabelHeight * 0.5; -} - -- (void)setUpConstraints { - NSMutableArray *constraints = [NSMutableArray new]; - - NSUInteger numberOfTitleLabels = _titleLabels.count; - for (NSUInteger i = 0; i < numberOfTitleLabels; i++) { - UILabel *label = _titleLabels[i]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:label - attribute:NSLayoutAttributeCenterY - relatedBy:NSLayoutRelationEqual - toItem:label.superview - attribute:NSLayoutAttributeCenterY - multiplier:1.0 - constant:0.0]]; - - if ((int)i == 0) { - [constraints addObject:[NSLayoutConstraint constraintWithItem:label - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:label.superview - attribute:NSLayoutAttributeLeading - multiplier:1.0 - constant:0.0]]; - } else { - // This "magic" multiplier constraints evenly space the labels among - // the superview without having to manually specify its width. - CGFloat multiplier = 1.0 - ((CGFloat)(numberOfTitleLabels - i - 1) / (numberOfTitleLabels - 1)); - [constraints addObject:[NSLayoutConstraint constraintWithItem:label - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:label.superview - attribute:NSLayoutAttributeTrailing - multiplier:multiplier - constant:0.0]]; - } - - if ((int)i == _titleLabels.count - 1) { - NSLayoutConstraint *constraint = nil; - - constraint = [NSLayoutConstraint constraintWithItem:label - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:LastLabelHeight]; - constraint.priority = UILayoutPriorityRequired - 1; - [constraints addObject:constraint]; - - constraint = [NSLayoutConstraint constraintWithItem:label - attribute:NSLayoutAttributeWidth - relatedBy:NSLayoutRelationGreaterThanOrEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:LastLabelHeight]; - constraint.priority = UILayoutPriorityRequired - 1; - [constraints addObject:constraint]; - } - } - [NSLayoutConstraint activateConstraints:constraints]; -} - -- (void)updateTitles { - [_titleLabels makeObjectsPerformSelector:@selector(removeFromSuperview)]; // Old constraints automatically removed when removing the views - [_titleTickLayers makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; - _titleLabels = nil; - _titleTickLayers = nil; - - if ([_parentGraphChartView.dataSource respondsToSelector:@selector(graphChartView:titleForXAxisAtPointIndex:)]) { - _titleLabels = [NSMutableArray new]; - _titleTickLayers = [NSMutableArray new]; - - NSInteger numberOfTitleLabels = _parentGraphChartView.numberOfXAxisPoints; - for (NSInteger i = 0; i < numberOfTitleLabels; i++) { - NSString *title = [_parentGraphChartView.dataSource graphChartView:_parentGraphChartView titleForXAxisAtPointIndex:i]; - UILabel *label = [UILabel new]; - label.text = title; - label.font = _titleFont; - label.numberOfLines = 2; - label.textAlignment = NSTextAlignmentCenter; - label.adjustsFontSizeToFitWidth = YES; - label.minimumScaleFactor = 0.7; - label.translatesAutoresizingMaskIntoConstraints = NO; - - if (i < (numberOfTitleLabels - 1)) { - label.textColor = self.tintColor; - } else { - label.textColor = [UIColor whiteColor]; - label.backgroundColor = self.tintColor; - label.layer.cornerRadius = LastLabelHeight * 0.5; - label.layer.masksToBounds = YES; - } - - [self addSubview:label]; - [_titleLabels addObject:label]; - } - - // Add vertical tick layers above labels - for (NSInteger i = 0; i < numberOfTitleLabels; i++) { - CALayer *titleTickLayer = [CALayer layer]; - CGFloat positionOnXAxis = xAxisPoint(i, numberOfTitleLabels, self.bounds.size.width); - titleTickLayer.frame = CGRectMake(positionOnXAxis - 0.5, -ORKGraphChartViewAxisTickLength, 1, ORKGraphChartViewAxisTickLength); - titleTickLayer.backgroundColor = _axisColor.CGColor; - - [self.layer addSublayer:titleTickLayer]; - [_titleTickLayers addObject:titleTickLayer]; - } - - [self setUpConstraints]; - } -} - -- (void)tintColorDidChange { - NSUInteger numberOfTitleLabels = _titleLabels.count; - for (NSUInteger i = 0; i < numberOfTitleLabels; i++) { - UILabel *label = _titleLabels[i]; - if (i < (numberOfTitleLabels - 1)) { - label.textColor = self.tintColor; - } else { - label.textColor = [UIColor whiteColor]; - label.backgroundColor = self.tintColor; - } - } -} - -- (void)setTitleFont:(UIFont *)titleFont { - _titleFont = titleFont; - for (UILabel *label in _titleLabels) { - label.font = _titleFont; - [label sizeToFit]; - } - [self setNeedsLayout]; -} - -- (void)setAxisColor:(UIColor *)axisColor { - _axisColor = axisColor; - _lineLayer.backgroundColor = _axisColor.CGColor; - for (CALayer *titleTickLayer in _titleTickLayers) { - titleTickLayer.backgroundColor = _axisColor.CGColor; - } -} - -@end diff --git a/ResearchKit/Charts/ORKYAxisView.h b/ResearchKit/Charts/ORKYAxisView.h deleted file mode 100644 index 39d4996397..0000000000 --- a/ResearchKit/Charts/ORKYAxisView.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - Copyright (c) 2015, Ricardo Sánchez-Sáez. - Copyright (c) 2017, Macro Yau. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKGraphChartView; - -@interface ORKYAxisView : UIView - -@property (nonatomic) UIFont *titleFont; - -@property (nonatomic) UIColor *titleColor; - -@property (nonatomic) UIColor *axisColor; - -@property (nonatomic) NSUInteger decimalPlaces; - -@property (nonatomic) NSArray *yAxisLabelFactors; - -- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; - -- (instancetype)initWithParentGraphChartView:(ORKGraphChartView *)parentGraphChartView NS_DESIGNATED_INITIALIZER; - -- (void)updateTicksAndLabels; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Charts/ORKYAxisView.m b/ResearchKit/Charts/ORKYAxisView.m deleted file mode 100644 index 60a8fb1989..0000000000 --- a/ResearchKit/Charts/ORKYAxisView.m +++ /dev/null @@ -1,221 +0,0 @@ -/* - Copyright (c) 2015, Ricardo Sánchez-Sáez. - Copyright (c) 2017, Macro Yau. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKYAxisView.h" - -#import "ORKGraphChartView_Internal.h" - -#import "ORKHelpers_Internal.h" - - -static const CGFloat ImageVerticalPadding = 3.0; - -@implementation ORKYAxisView { - __weak ORKGraphChartView *_parentGraphChartView; - UIImageView *_maxImageView; - UIImageView *_minImageView; - - NSMutableDictionary *_tickLayersByFactor; - NSMutableDictionary *_tickLabelsByFactor; - - NSString *_decimalFormat; -} - -- (instancetype)initWithFrame:(CGRect)frame { - ORKThrowMethodUnavailableException(); -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-designated-initializers" -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - ORKThrowMethodUnavailableException(); -} -#pragma clang diagnostic pop - -- (instancetype)initWithParentGraphChartView:(ORKGraphChartView *)parentGraphChartView { - self = [super initWithFrame:CGRectZero]; - if (self) { - _parentGraphChartView = parentGraphChartView; - _axisColor = _parentGraphChartView.axisColor; - _titleColor = _parentGraphChartView.verticalAxisTitleColor; - [self setDecimalPlaces:0]; - } - return self; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - [self layoutTicksAndLabels]; -} - -- (void)updateTicksAndLabels { - [_maxImageView removeFromSuperview]; - _maxImageView = nil; - [_minImageView removeFromSuperview]; - _minImageView = nil; - - [_tickLayersByFactor.allValues makeObjectsPerformSelector:@selector(removeFromSuperlayer)]; - [_tickLabelsByFactor.allValues makeObjectsPerformSelector:@selector(removeFromSuperview)]; - _tickLayersByFactor = nil; - _tickLabelsByFactor = nil; - - CGRect bounds = self.bounds; - CGFloat width = bounds.size.width; - if (_parentGraphChartView.maximumValueImage && _parentGraphChartView.minimumValueImage) { - // Use image icons as legends - CGFloat halfWidth = width / 2; - - _maxImageView = [[UIImageView alloc] initWithImage:_parentGraphChartView.maximumValueImage]; - _maxImageView.contentMode = UIViewContentModeScaleAspectFit; - _maxImageView.frame = CGRectMake(width - halfWidth, - -halfWidth / 2, - halfWidth, - halfWidth); - [self addSubview:_maxImageView]; - - _minImageView = [[UIImageView alloc] initWithImage:_parentGraphChartView.minimumValueImage]; - _minImageView.contentMode = UIViewContentModeScaleAspectFit; - _minImageView.frame = CGRectMake(width - halfWidth, - CGRectGetMaxY(bounds) - halfWidth - ImageVerticalPadding, - halfWidth, - halfWidth); - [self addSubview:_minImageView]; - - } else { - _tickLayersByFactor = [NSMutableDictionary new]; - _tickLabelsByFactor = [NSMutableDictionary new]; - - CGFloat minimumValue = _parentGraphChartView.minimumValue; - CGFloat maximumValue = _parentGraphChartView.maximumValue; - if (!_yAxisLabelFactors) { - if (minimumValue == maximumValue) { - _yAxisLabelFactors = @[ @0.5f ]; - } else { - _yAxisLabelFactors = @[ @0.2f, @1.0f ]; - } - } - - for (NSNumber *factorNumber in _yAxisLabelFactors) { - - CGFloat factor = factorNumber.floatValue; - - CALayer *tickLayer = [CALayer layer]; - CGFloat tickYPosition = CGRectGetHeight(self.bounds) * (1 - factor); - CGFloat tickXOrigin = CGRectGetWidth(self.bounds) - ORKGraphChartViewAxisTickLength; - tickLayer.frame = CGRectMake(tickXOrigin, - tickYPosition - 0.5, - ORKGraphChartViewAxisTickLength, - 1); - tickLayer.backgroundColor = _parentGraphChartView.axisColor.CGColor; - - [self.layer addSublayer:tickLayer]; - _tickLayersByFactor[factorNumber] = tickLayer; - - CGFloat labelHeight = 20; - CGFloat labelYPosition = tickYPosition - labelHeight / 2; - UILabel *tickLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, - labelYPosition, - width - (ORKGraphChartViewAxisTickLength + ORKGraphChartViewYAxisTickPadding), - labelHeight)]; - - CGFloat yValue = minimumValue + (maximumValue - minimumValue) * factor; - if (yValue != 0) { - tickLabel.text = [NSString stringWithFormat:_decimalFormat, yValue]; - } - tickLabel.backgroundColor = [UIColor clearColor]; - tickLabel.textColor = _titleColor; - tickLabel.textAlignment = NSTextAlignmentRight; - tickLabel.font = _titleFont; - tickLabel.minimumScaleFactor = 0.8; - [tickLabel sizeToFit]; - [self addSubview:tickLabel]; - _tickLabelsByFactor[factorNumber] = tickLabel; - } - } -} - -- (void)layoutTicksAndLabels { - CGRect bounds = self.bounds; - CGFloat width = bounds.size.width; - CGFloat halfWidth = width / 2; - _maxImageView.frame = CGRectMake(width - halfWidth, - -halfWidth / 2, - halfWidth, - halfWidth); - _minImageView.frame = CGRectMake(width - halfWidth, - CGRectGetMaxY(bounds) - halfWidth - ImageVerticalPadding, - halfWidth, - halfWidth); - - for (NSNumber *factorNumber in _tickLayersByFactor.allKeys) { - CGFloat factor = factorNumber.floatValue; - CALayer *tickLayer = _tickLayersByFactor[factorNumber]; - CGFloat tickYPosition = CGRectGetHeight(self.bounds) * (1 - factor); - CGFloat tickXOrigin = CGRectGetWidth(self.bounds) - ORKGraphChartViewAxisTickLength; - tickLayer.frame = CGRectMake(tickXOrigin, - tickYPosition - 0.5, - ORKGraphChartViewAxisTickLength, - 1); - - UILabel *tickLabel = _tickLabelsByFactor[factorNumber]; - tickLabel.center = CGPointMake(tickXOrigin - (ORKGraphChartViewYAxisTickPadding + tickLabel.bounds.size.width / 2), tickYPosition); - } -} - -- (void)setTitleFont:(UIFont *)titleFont { - _titleFont = titleFont; - for (UILabel *label in _tickLabelsByFactor.allValues) { - label.font = _titleFont; - [label sizeToFit]; - } -} - -- (void)setTitleColor:(UIColor *)titleColor { - _titleColor = titleColor; - for (UILabel *label in _tickLabelsByFactor.allValues) { - label.textColor = titleColor; - } -} - -- (void)setAxisColor:(UIColor *)axisColor { - _axisColor = axisColor; - for (CALayer *tickLayer in _tickLayersByFactor.allValues) { - tickLayer.backgroundColor = _axisColor.CGColor; - } -} - -- (void)setDecimalPlaces:(NSUInteger)decimalPlaces { - _decimalPlaces = decimalPlaces; - _decimalFormat = [NSString stringWithFormat:@"%%.%luf", (unsigned long)_decimalPlaces]; -} - -@end diff --git a/ResearchKit/Common/CLLocationManager+ResearchKit.h b/ResearchKit/Common/CLLocationManager+ResearchKit.h new file mode 100644 index 0000000000..6a52ede9e6 --- /dev/null +++ b/ResearchKit/Common/CLLocationManager+ResearchKit.h @@ -0,0 +1,56 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface CLLocationManager (ResearchKit) + +/** + These categories on CLLocationManager provide ResearchKit code with a common way of requesting authorization that can be disabled by + an Xcode build setting. Callers don't have to add compile-time conditional #if blocks. Instead callers should interpret return value of YES to mean + the authorization request was made, and NO to mean the ResearchKit binary was built with CLLocationManager authorization request calls + compiled out. + + The impetus for this approach was to prevent apps using ResearchKit, but not ResearchKit's CoreLocation-powered features, from needlessly + defining an NSLocationWhenInUseUsageDescription Info.plist entry to silence build errors. + */ +- (BOOL)ork_requestWhenInUseAuthorization; +- (BOOL)ork_requestAlwaysAuthorization; + +- (void)ork_startUpdatingLocation; +- (void)ork_stopUpdatingLocation; + +@end + +NS_ASSUME_NONNULL_END +#endif diff --git a/ResearchKit/Common/CLLocationManager+ResearchKit.m b/ResearchKit/Common/CLLocationManager+ResearchKit.m new file mode 100644 index 0000000000..8de3408820 --- /dev/null +++ b/ResearchKit/Common/CLLocationManager+ResearchKit.m @@ -0,0 +1,57 @@ +/* + Copyright (c) 2016, Sage Bionetworks + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +#import "CLLocationManager+ResearchKit.h" + +#import "ORKDefines.h" + +@implementation CLLocationManager (ResearchKit) + +- (BOOL)ork_requestWhenInUseAuthorization { + [self requestWhenInUseAuthorization]; + return YES; +} + +- (BOOL)ork_requestAlwaysAuthorization { + [self requestAlwaysAuthorization]; + return YES; +} + +- (void)ork_startUpdatingLocation { + [self startUpdatingLocation]; +} + +- (void)ork_stopUpdatingLocation { + [self stopUpdatingLocation]; +} + +@end +#endif diff --git a/ResearchKit/ActiveTasks/CMMotionActivity+ORKJSONDictionary.h b/ResearchKit/Common/CMMotionActivity+ORKJSONDictionary.h similarity index 98% rename from ResearchKit/ActiveTasks/CMMotionActivity+ORKJSONDictionary.h rename to ResearchKit/Common/CMMotionActivity+ORKJSONDictionary.h index 8c599f3199..e9ddddc9c6 100644 --- a/ResearchKit/ActiveTasks/CMMotionActivity+ORKJSONDictionary.h +++ b/ResearchKit/Common/CMMotionActivity+ORKJSONDictionary.h @@ -29,7 +29,7 @@ */ -@import CoreMotion; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/CMMotionActivity+ORKJSONDictionary.m b/ResearchKit/Common/CMMotionActivity+ORKJSONDictionary.m similarity index 100% rename from ResearchKit/ActiveTasks/CMMotionActivity+ORKJSONDictionary.m rename to ResearchKit/Common/CMMotionActivity+ORKJSONDictionary.m diff --git a/ResearchKit/ActiveTasks/HKSample+ORKJSONDictionary.h b/ResearchKit/Common/HKSample+ORKJSONDictionary.h similarity index 96% rename from ResearchKit/ActiveTasks/HKSample+ORKJSONDictionary.h rename to ResearchKit/Common/HKSample+ORKJSONDictionary.h index 3cb4f06279..fce4a30fe4 100644 --- a/ResearchKit/ActiveTasks/HKSample+ORKJSONDictionary.h +++ b/ResearchKit/Common/HKSample+ORKJSONDictionary.h @@ -29,7 +29,8 @@ */ -@import HealthKit; +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import NS_ASSUME_NONNULL_BEGIN @@ -60,3 +61,5 @@ typedef NS_OPTIONS(NSInteger, ORKSampleJSONOptions) { @end NS_ASSUME_NONNULL_END + +#endif diff --git a/ResearchKit/ActiveTasks/HKSample+ORKJSONDictionary.m b/ResearchKit/Common/HKSample+ORKJSONDictionary.m similarity index 98% rename from ResearchKit/ActiveTasks/HKSample+ORKJSONDictionary.m rename to ResearchKit/Common/HKSample+ORKJSONDictionary.m index 0edddbac73..2a20e511b3 100644 --- a/ResearchKit/ActiveTasks/HKSample+ORKJSONDictionary.m +++ b/ResearchKit/Common/HKSample+ORKJSONDictionary.m @@ -45,7 +45,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static NSString *const HKCorrelatedObjectsKey = @"objects"; // static NSString *const HKSourceIdentifierKey = @"sourceBundleIdentifier"; - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @implementation HKSample (ORKJSONDictionary) - (NSMutableDictionary *)ork_JSONMutableDictionaryWithOptions:(ORKSampleJSONOptions)options unit:(HKUnit *)unit { @@ -167,3 +167,4 @@ - (NSDictionary *)ork_JSONDictionaryWithOptions:(ORKSampleJSONOptions)options sa } @end +#endif // ORK_FEATURE_HEALTHKIT_AUTHORIZATION diff --git a/ResearchKit/ActiveTasks/ORKActiveStep.h b/ResearchKit/Common/ORKActiveStep.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKActiveStep.h rename to ResearchKit/Common/ORKActiveStep.h index 8ea323b7f2..a51c0594e7 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStep.h +++ b/ResearchKit/Common/ORKActiveStep.h @@ -29,8 +29,7 @@ */ -@import UIKit; -@import HealthKit; +#import #import @@ -39,9 +38,10 @@ NS_ASSUME_NONNULL_BEGIN /** - The `ORKActiveStep` class is the base class for steps in active tasks, which - are steps that collect sensor data in a semi-controlled environment, as opposed - to the purely passive data collection enabled by HealthKit, or the more subjective data + A base class for steps in an active task. + + Active Steps collect sensor data in a semi-controlled environment, as opposed + to the passive data collection enabled by HealthKit, or the more subjective data collected when users fill in surveys. In addition to the behaviors of `ORKStep`, active steps have the concept of diff --git a/ResearchKit/ActiveTasks/ORKActiveStep.m b/ResearchKit/Common/ORKActiveStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKActiveStep.m rename to ResearchKit/Common/ORKActiveStep.m index 485c9b53da..a58171b85e 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStep.m +++ b/ResearchKit/Common/ORKActiveStep.m @@ -32,7 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKActiveStep.h" #import "ORKActiveStep_Internal.h" -#import "ORKActiveStepViewController.h" #import "ORKRecorder_Private.h" #import "ORKStep_Private.h" @@ -42,14 +41,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKActiveStep -+ (Class)stepViewControllerClass { - return [ORKActiveStepViewController class]; -} - - (BOOL)startsFinished { return (_stepDuration == 0); } +- (BOOL)hasAudioRecording { + return NO; +} + - (BOOL)hasCountDown { return (_stepDuration > 0) && _shouldShowDefaultTimer; } @@ -99,8 +98,8 @@ - (instancetype)copyWithZone:(NSZone *)zone { step.shouldVibrateOnFinish = self.shouldVibrateOnFinish; step.shouldUseNextAsSkipButton = self.shouldUseNextAsSkipButton; step.shouldContinueOnFinish = self.shouldContinueOnFinish; - step.spokenInstruction = self.spokenInstruction; - step.finishedSpokenInstruction = self.finishedSpokenInstruction; + step.spokenInstruction = [self.spokenInstruction copy]; + step.finishedSpokenInstruction = [self.finishedSpokenInstruction copy]; step.recorderConfigurations = [self.recorderConfigurations copy]; return step; } @@ -165,6 +164,7 @@ - (BOOL)isEqual:(id)object { (self.shouldUseNextAsSkipButton == castObject.shouldUseNextAsSkipButton)); } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (NSSet *)requestedHealthKitTypesForReading { NSMutableSet *set = [NSMutableSet set]; for (ORKRecorderConfiguration *config in self.recorderConfigurations) { @@ -175,6 +175,7 @@ - (BOOL)isEqual:(id)object { } return set; } +#endif - (ORKPermissionMask)requestedPermissions { ORKPermissionMask mask = [super requestedPermissions]; diff --git a/ResearchKit/ActiveTasks/ORKActiveStep_Internal.h b/ResearchKit/Common/ORKActiveStep_Internal.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKActiveStep_Internal.h rename to ResearchKit/Common/ORKActiveStep_Internal.h index 51a039d082..a73f5d69cd 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStep_Internal.h +++ b/ResearchKit/Common/ORKActiveStep_Internal.h @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN - (BOOL)hasTitle; - (BOOL)hasText; - (BOOL)hasVoice; - +- (BOOL)hasAudioRecording; @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKActiveTaskResult.h b/ResearchKit/Common/ORKActiveTaskResult.h deleted file mode 100644 index 71cf5281f8..0000000000 --- a/ResearchKit/Common/ORKActiveTaskResult.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import diff --git a/ResearchKit/Common/ORKAnswerFormat+FormStepViewControllerAdditions.h b/ResearchKit/Common/ORKAnswerFormat+FormStepViewControllerAdditions.h new file mode 100644 index 0000000000..9666127721 --- /dev/null +++ b/ResearchKit/Common/ORKAnswerFormat+FormStepViewControllerAdditions.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKAnswerFormat (FormStepViewControllerAdditions) + +@property(nonatomic, nullable, readonly) Class formStepViewControllerCellClass; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKAnswerFormat+FormStepViewControllerAdditions.m b/ResearchKit/Common/ORKAnswerFormat+FormStepViewControllerAdditions.m new file mode 100644 index 0000000000..94fa40e252 --- /dev/null +++ b/ResearchKit/Common/ORKAnswerFormat+FormStepViewControllerAdditions.m @@ -0,0 +1,156 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKAnswerFormat+FormStepViewControllerAdditions.h" + +#import "ORKFormItemCell.h" + +#import + +NS_ASSUME_NONNULL_BEGIN + +@implementation ORKAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + Class result = nil; + + ORKQuestionType type = self.questionType; + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeDateAndTime); + matchesType = matchesType || (type == ORKQuestionTypeDate); + matchesType = matchesType || (type == ORKQuestionTypeTimeOfDay); + matchesType = matchesType || (type == ORKQuestionTypeTimeInterval); + matchesType = matchesType || (type == ORKQuestionTypeMultiplePicker); + matchesType = matchesType || (type == ORKQuestionTypeHeight); + matchesType = matchesType || (type == ORKQuestionTypeWeight); + matchesType = matchesType || (type == ORKQuestionTypeAge); + matchesType = matchesType || (type == ORKQuestionTypeYear); + result = matchesType ? [ORKFormItemPickerCell class] : result; + } + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeDecimal); + matchesType = matchesType || (type == ORKQuestionTypeInteger); + result = matchesType ? [ORKFormItemNumericCell class] : result; + } + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeScale); + result = matchesType ? [ORKFormItemScaleCell class] : result; + } + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeLocation); + result = matchesType ? [ORKFormItemLocationCell class] : result; + } + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeSES); + result = matchesType ? [ORKFormItemSESCell class] : result; + } + + return result; +} + +@end + +@implementation ORKImageChoiceAnswerFormat (FormStepViewControllerAdditions) + + +- (nullable Class)formStepViewControllerCellClass { + ORKQuestionType type = self.questionType; + + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeSingleChoice); + matchesType = matchesType || (type == ORKQuestionTypeMultipleChoice); + + Class result = matchesType ? [ORKFormItemImageSelectionCell class] : [super formStepViewControllerCellClass]; + return result; +} + +@end + +@implementation ORKValuePickerAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + ORKQuestionType type = self.questionType; + + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeSingleChoice); + matchesType = matchesType || (type == ORKQuestionTypeMultipleChoice); + + Class result = matchesType ? [ORKFormItemPickerCell class] : [super formStepViewControllerCellClass]; + return result; +} + +@end + +@implementation ORKConfirmTextAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + ORKQuestionType type = self.questionType; + + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeText); + + Class result = matchesType ? [ORKFormItemConfirmTextCell class] : [super formStepViewControllerCellClass]; + return result; +} + +@end + +@implementation ORKTextAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + Class result = nil; + + ORKQuestionType type = self.questionType; + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeText); + + if (matchesType == YES) { + result = (self.multipleLines == YES) ? [ORKFormItemTextCell class] : [ORKFormItemTextFieldCell class]; + } else { + result = [super formStepViewControllerCellClass]; + } + + return result; +} + + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKAnswerFormat.h b/ResearchKit/Common/ORKAnswerFormat.h index 2d20065fe3..ec0b928dcb 100644 --- a/ResearchKit/Common/ORKAnswerFormat.h +++ b/ResearchKit/Common/ORKAnswerFormat.h @@ -33,10 +33,12 @@ */ -@import UIKit; +#import + #if TARGET_OS_IOS #import + @class ORKScaleAnswerFormat; @class ORKContinuousScaleAnswerFormat; @class ORKTextScaleAnswerFormat; @@ -58,9 +60,10 @@ NS_ASSUME_NONNULL_BEGIN -@class ORKTextChoiceAnswerFormat; @class ORKBooleanAnswerFormat; - +@class ORKColorChoiceAnswerFormat; +@class ORKColorChoice; +@class ORKTextChoiceAnswerFormat; @class ORKTextChoice; /** @@ -100,17 +103,18 @@ ORK_CLASS_AVAILABLE /** Determines if the "I Don't Know" button will show. - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldShowDontKnowButton) BOOL showDontKnowButton; /** Custom text that will be shown inside of the "I Don't Know" button if showDontKnowButton is set to true. - Defults to nil. + Defaults to nil. */ @property (nonatomic, nullable) NSString *customDontKnowButtonText; + @property (nonatomic) ORKDontKnowButtonStyle dontKnowButtonStyle; + (ORKBooleanAnswerFormat *)booleanAnswerFormat; @@ -121,6 +125,9 @@ ORK_CLASS_AVAILABLE + (ORKTextChoiceAnswerFormat *)choiceAnswerFormatWithStyle:(ORKChoiceAnswerStyle)style textChoices:(NSArray *)textChoices; ++ (ORKColorChoiceAnswerFormat *)choiceAnswerFormatWithStyle:(ORKChoiceAnswerStyle)style + colorChoices:(NSArray *)colorChoices; + /// @name Validation /** @@ -186,6 +193,27 @@ ORK_CLASS_AVAILABLE */ @property (copy, readonly) NSArray *textChoices; +/** + Returns YES if the answer is no longer valid, specifically used in the ORKFormStep Restoration + */ +- (BOOL)isAnswerInvalid:(id)answer; + +@end + + +ORK_CLASS_AVAILABLE +@interface ORKColorChoiceAnswerFormat : ORKAnswerFormat + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +- (instancetype)initWithStyle:(ORKChoiceAnswerStyle)style + colorChoices:(NSArray *)colorChoices NS_DESIGNATED_INITIALIZER; + +@property (readonly) ORKChoiceAnswerStyle style; + +@property (copy, readonly) NSArray *colorChoices; + @end @@ -368,6 +396,7 @@ ORK_CLASS_AVAILABLE /** The image that will be presented to the left of the text provided for the textChoice */ + @property (strong, nullable) UIImage *image; /** @@ -380,6 +409,37 @@ ORK_CLASS_AVAILABLE @end + +ORK_CLASS_AVAILABLE +@interface ORKColorChoice: NSObject + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +- (instancetype)initWithColor:(nullable UIColor *)color + text:(nullable NSString *)text + detailText:(nullable NSString *)detailText + value:(NSObject *)value; + +- (instancetype)initWithColor:(nullable UIColor *)color + text:(nullable NSString *)text + detailText:(nullable NSString *)detailText + value:(NSObject *)value + exclusive:(BOOL)exclusive; + +@property (nonatomic, copy, readonly, nullable) UIColor *color; + +@property (nonatomic, copy, readonly, nullable) NSString *text; + +@property (nonatomic, copy, readonly, nullable) NSString *detailText; + +@property (nonatomic, copy, readonly) NSObject *value; + +@property (readonly) BOOL exclusive; + +@end + + #pragma mark - iOS #if TARGET_OS_IOS @@ -472,8 +532,9 @@ ORK_CLASS_AVAILABLE minimumValue:(double)minimumValue maximumValue:(double)maximumValue defaultValue:(double)defaultValue; - +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + (ORKLocationAnswerFormat *)locationAnswerFormat; +#endif + (ORKSESAnswerFormat *)socioEconomicAnswerFormatWithTopRungText:(NSString *)topRungText bottomRungText:(NSString *)bottomRungText; @@ -638,7 +699,7 @@ ORK_CLASS_AVAILABLE /** The colors to use when drawing a color gradient above the slider. Colors are drawn such that lower indexes correspond to the minimum side of the scale, while colors at higher indexes in - the array corresond to the maximum side of the scale. + the array correspond to the maximum side of the scale. Setting this value to nil results in no gradient being drawn. Defaults to nil. @@ -658,21 +719,21 @@ ORK_CLASS_AVAILABLE /** Determines if the minimum and maximum numbers are hidden on the slider. - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideRanges) BOOL hideRanges; /** Determines if the bottom left and bottom right description labels are hidden - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideLabels) BOOL hideLabels; /** Determines if the value markers on the slider are hidden - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideValueMarkers) BOOL hideValueMarkers; @@ -739,7 +800,7 @@ ORK_CLASS_AVAILABLE vertical:(BOOL)vertical; /** - Returns an initialized horizontal continous scale answer format using the specified values. + Returns an initialized horizontal continuous scale answer format using the specified values. This method is a convenience initializer. @@ -825,7 +886,7 @@ ORK_CLASS_AVAILABLE /** The colors to use when drawing a color gradient above the slider. Colors are drawn such that lower indexes correspond to the minimum side of the scale, while colors at higher indexes in - the array corresond to the maximum side of the scale. + the array correspond to the maximum side of the scale. Setting this value to nil results in no gradient being drawn. Defaults to nil. @@ -845,14 +906,14 @@ ORK_CLASS_AVAILABLE /** Determines if the minimum and maximum numbers are hidden on the slider. - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideRanges) BOOL hideRanges; /** Determines if the bottom left and bottom right description labels are hidden - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideLabels) BOOL hideLabels; @@ -934,7 +995,7 @@ ORK_CLASS_AVAILABLE /** The colors to use when drawing a color gradient above the slider. Colors are drawn such that lower indexes correspond to the minimum side of the scale, while colors at higher indexes in - the array corresond to the maximum side of the scale. + the array correspond to the maximum side of the scale. Setting this value to nil results in no gradient being drawn. Defaults to nil. @@ -954,21 +1015,21 @@ ORK_CLASS_AVAILABLE /** Determines if the minimum and maximum numbers are hidden on the slider. - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideRanges) BOOL hideRanges; /** Determines if the bottom left and bottom right description labels are hidden - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideLabels) BOOL hideLabels; /** Determines if the value markers on the slider are hidden - Defults to false. + Defaults to false. */ @property (nonatomic, assign, getter=shouldHideValueMarkers) BOOL hideValueMarkers; @@ -1166,7 +1227,7 @@ ORK_CLASS_AVAILABLE @param exclusive Whether this choice is to be considered exclusive within the set of choices. @param textViewPlaceholderText The placeholder text for the text view. @param textViewInputOptional Whether the user is required to provide additional text when selecting this choice. - @param textViewStartsHidden Whether the text view should be hidden untill the cell is selected. + @param textViewStartsHidden Whether the text view should be hidden until the cell is selected. @return An initialized text choice other object. */ @@ -1393,7 +1454,7 @@ Returns an initialized numeric answer format using the specified style, unit des @property (readonly) ORKNumericAnswerStyle style; /** - A string that displays the unit designation next to the numeric value in the results. + A string that displays a the unit designation next to the numeric value in the results. (read-only) If displayUnit is not set, the answerFormat will display the unit instead @@ -1449,9 +1510,9 @@ Returns an initialized numeric answer format using the specified style, unit des @property (assign) BOOL hideUnitWhenAnswerIsEmpty; /** -The placeholder to dislpay when the answer is empty. +The placeholder to display when the answer is empty. -Overrides any specified step placeholder. Setting it to `nil` displays the default placeholeder. +Overrides any specified step placeholder. Setting it to `nil` displays the default placeholder. */ @property (copy, nullable) NSString *placeholder; @@ -1659,6 +1720,7 @@ ORK_CLASS_AVAILABLE */ - (instancetype)initWithMaximumLength:(NSInteger)maximumLength NS_DESIGNATED_INITIALIZER; + /** The regular expression used to validate user's input. @@ -1722,9 +1784,9 @@ This By default, the value of this property is `NO`. @property (nonatomic,getter=isSecureTextEntry) BOOL secureTextEntry; /** - The placeholder to dislpay when the answer is empty. + The placeholder to display when the answer is empty. - Overrides any specified step placeholder. Setting it to `nil` displays the default placeholeder. + Overrides any specified step placeholder. Setting it to `nil` displays the default placeholder. */ @property (copy, nullable) NSString *placeholder; @@ -1767,7 +1829,7 @@ This By default, the value of this property is `NO`. /** The password generation rules to use for Automatic Secure Passwords. - If specified, overrides the default passsword generation rules for fields with secureTextEntry. + If specified, overrides the default password generation rules for fields with secureTextEntry. */ @property (nonatomic, copy, nullable) UITextInputPasswordRules *passwordRules API_AVAILABLE(ios(12)); @@ -1957,7 +2019,7 @@ ORK_CLASS_AVAILABLE metric measurement system and 1,450 lbs when using the USC measurement system. @param defaultValue The default value to be initially selected in the picker. If you - specify `ORKDefaultValue`, the initally selected values are + specify `ORKDefaultValue`, the initially selected values are 60 kg when using the metric measurement system and 133 lbs when using the USC measurement system. This value must be between `minimumValue` and `maximumValue`. @@ -2009,7 +2071,7 @@ ORK_CLASS_AVAILABLE /** The default value to initially selected in the picker. - When this property has a value equal to `ORKDefaultValue`, the initally selected values are 60 kg + When this property has a value equal to `ORKDefaultValue`, the initially selected values are 60 kg when using the metric measurement system and 133 lbs when using the USC measurement system. This value must be between `minimumValue` and `maximumValue`. */ @@ -2017,6 +2079,134 @@ ORK_CLASS_AVAILABLE @end +/** + The `ORKAgeAnswerFormat` class represents the answer format for questions that require users + to enter a weight. + + A weight answer format produces an `ORKNumericQuestionResult` object. The result is always reported + in the metric system using the `kg` unit. + */ +ORK_CLASS_AVAILABLE +@interface ORKAgeAnswerFormat : ORKAnswerFormat + +/** + Returns an initialized weight answer format using the measurement system specified in the current + locale. + + @return An initialized weight answer format. + */ +- (instancetype)init; + +- (instancetype)initWithMinimumAge:(NSInteger)minimumAge + maximumAge:(NSInteger)maximumAge; + +- (instancetype)initWithMinimumAge:(NSInteger)minimumAge + maximumAge:(NSInteger)maximumAge + minimumAgeCustomText:(nullable NSString *)minimumAgeCustomText + maximumAgeCustomText:(nullable NSString *)maximumAgeCustomText + showYear:(BOOL)showYear + useYearForResult:(BOOL)useYearForResult + defaultValue:(NSInteger)defaultValue; + +- (instancetype)initWithMinimumAge:(NSInteger)minimumAge + maximumAge:(NSInteger)maximumAge + minimumAgeCustomText:(nullable NSString *)minimumAgeCustomText + maximumAgeCustomText:(nullable NSString *)maximumAgeCustomText + showYear:(BOOL)showYear + useYearForResult:(BOOL)useYearForResult + treatMinAgeAsRange:(BOOL)treatMinAgeAsRange + treatMaxAgeAsRange:(BOOL)treatMaxAgeAsRange + defaultValue:(NSInteger)defaultValue; + ++ (int)minimumAgeSentinelValue; ++ (int)maximumAgeSentinelValue; + +/** + Minimum age value presented in the picker + + By default, the value of this property is 0. + */ +@property (readonly) NSInteger minimumAge; + + +/** + Maximum age value presented in the picker. + + By default, the value of this property is 125. + */ +@property (readonly) NSInteger maximumAge; + + +/** + Custom text that will replace the minimumAge value. + + By default, the value of this property is nil. + */ + +@property (readonly, nullable) NSString *minimumAgeCustomText; + +/** + Custom text that will replace the maximumAge value. + + By default, the value of this property is nil. + */ + +@property (readonly, nullable) NSString *maximumAgeCustomText; + + +/** + Boolean that determines if the year should be shown alongside the age value. + + By default, the value of this property is nil. + */ + +@property (readonly) BOOL showYear; + +/** + The year at which the picker will base all of its ages from. + + By default, the value of this property will be the current year. + */ + +@property (nonatomic) NSInteger relativeYear; + + +/** + Boolean that determines if the year for the selected age should be used in the result. + + By default, the value of this property is NO. + */ + +@property (readonly) BOOL useYearForResult; + +/** + Boolean that determines if the minimumAge property should be treated as range. + + -1 will be returned if minimumAge is selected + + By default, the value of this property is NO. + */ + +@property (readonly) BOOL treatMinAgeAsRange; + +/** + Boolean that determines if the maximumAge property should be treated as range. + + -2 will be returned if maximumAge is selected + + By default, the value of this property is NO. + */ + +@property (readonly) BOOL treatMaxAgeAsRange; + +/** + The default value for the picker. + */ + +@property (readonly) NSInteger defaultValue; + +@end + /** The `ORKLocationAnswerFormat` class represents the answer format for questions that collect a location response @@ -2024,6 +2214,7 @@ ORK_CLASS_AVAILABLE An `ORKLocationAnswerFormat` object produces an `ORKLocationQuestionResult` object. */ +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION ORK_CLASS_AVAILABLE @interface ORKLocationAnswerFormat : ORKAnswerFormat @@ -2035,13 +2226,14 @@ ORK_CLASS_AVAILABLE @property (nonatomic, assign) BOOL useCurrentLocation; /** - The placeholder to dislpay when the answer is empty. + The placeholder to display when the answer is empty. - Overrides any specified step placeholder. Setting it to `nil` displays the default placeholeder. + Overrides any specified step placeholder. Setting it to `nil` displays the default placeholder. */ @property (copy, nullable) NSString *placeholder; @end +#endif /** Socio-Economic Ladder Answer Format. diff --git a/ResearchKit/Common/ORKAnswerFormat.m b/ResearchKit/Common/ORKAnswerFormat.m index 0dcbca8993..982a6f5649 100644 --- a/ResearchKit/Common/ORKAnswerFormat.m +++ b/ResearchKit/Common/ORKAnswerFormat.m @@ -41,15 +41,19 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #if TARGET_OS_IOS #import "ORKHealthAnswerFormat.h" +#import "ResearchKit/ResearchKit-Swift.h" +#endif + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import #endif -@import HealthKit; @import MapKit; @import Contacts; NSString *const EmailValidationRegularExpressionPattern = @"^[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$"; -id ORKNullAnswerValue() { +id ORKNullAnswerValue(void) { return [NSNull null]; } @@ -79,6 +83,8 @@ BOOL ORKIsAnswerEmpty(id answer) { SQT_CASE(Weight); SQT_CASE(Location); SQT_CASE(SES); + SQT_CASE(Age); + SQT_CASE(Year); } #undef SQT_CASE } @@ -93,6 +99,7 @@ @implementation ORKAnswerDefaultSource { NSMutableDictionary *_unitsTable; } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @synthesize healthStore=_healthStore; + (instancetype)sourceWithHealthStore:(HKHealthStore *)healthStore { @@ -201,8 +208,10 @@ - (void)fetchDefaultValueForQuantityType:(HKQuantityType *)quantityType unit:(HK [healthStore executeQuery:sampleQuery]; }); } +#endif // ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (void)fetchDefaultValueForAnswerFormat:(ORKAnswerFormat *)answerFormat handler:(void(^)(id defaultValue, NSError *error))handler { +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION HKObjectType *objectType = [answerFormat healthKitObjectType]; BOOL handled = NO; if (objectType) { @@ -223,8 +232,12 @@ - (void)fetchDefaultValueForAnswerFormat:(ORKAnswerFormat *)answerFormat handler if (!handled) { handler(nil, nil); } +#else + handler(nil, nil); +#endif } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (HKUnit *)defaultHealthKitUnitForAnswerFormat:(ORKAnswerFormat *)answerFormat { __block HKUnit *unit = [answerFormat healthKitUnit]; HKObjectType *objectType = [answerFormat healthKitObjectType]; @@ -266,10 +279,11 @@ - (void)updateHealthKitUnitForAnswerFormat:(ORKAnswerFormat *)answerFormat force [answerFormat setHealthKitUserUnit:healthKitDefault]; } } +#endif // ORK_FEATURE_HEALTHKIT_AUTHORIZATION @end -#endif +#endif // TARGET_OS_IOS #pragma mark - ORKAnswerFormat @@ -317,6 +331,7 @@ + (ORKTextScaleAnswerFormat *)textScaleAnswerFormatWithTextChoices:(NSArray *)textChoices { return [[ORKValuePickerAnswerFormat alloc] initWithTextChoices:textChoices]; } @@ -474,15 +489,18 @@ + (ORKWeightAnswerFormat *)weightAnswerFormatWithMeasurementSystem:(ORKMeasureme defaultValue:defaultValue]; } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + (ORKLocationAnswerFormat *)locationAnswerFormat { return [ORKLocationAnswerFormat new]; } +#endif + (ORKSESAnswerFormat *)socioEconomicAnswerFormatWithTopRungText:(NSString *)topRungText bottomRungText:(NSString *)bottomRungText { return [[ORKSESAnswerFormat alloc] initWithTopRungText:topRungText bottomRungText:bottomRungText]; } + #endif + (ORKBooleanAnswerFormat *)booleanAnswerFormat { @@ -498,6 +516,11 @@ + (ORKTextChoiceAnswerFormat *)choiceAnswerFormatWithStyle:(ORKChoiceAnswerStyle return [[ORKTextChoiceAnswerFormat alloc] initWithStyle:style textChoices:textChoices]; } ++ (ORKColorChoiceAnswerFormat *)choiceAnswerFormatWithStyle:(ORKChoiceAnswerStyle)style + colorChoices:(NSArray *)colorChoices { + return [[ORKColorChoiceAnswerFormat alloc] initWithStyle:style colorChoices:colorChoices]; +} + - (void)validateParameters { } @@ -552,6 +575,7 @@ - (BOOL)isHealthKitAnswerFormat { return NO; } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (HKObjectType *)healthKitObjectType { return nil; } @@ -571,6 +595,7 @@ - (HKUnit *)healthKitUserUnit { - (void)setHealthKitUserUnit:(HKUnit *)unit { } +#endif - (ORKQuestionType)questionType { return ORKQuestionTypeNone; @@ -626,9 +651,8 @@ - (BOOL)shouldShowDontKnowButton { return _showDontKnowButton; } -- (NSArray *)choices { - NSString *exceptionReason = [NSString stringWithFormat:@"%@ is not a currently supported answer format for the choice answer format helper.", NSStringFromClass([self class])]; - @throw [NSException exceptionWithName:NSGenericException reason:exceptionReason userInfo:nil]; +- (nullable NSArray *)choices { + return nil; } - (BOOL)isValuePicker { @@ -655,7 +679,6 @@ static void ork_validateChoices(NSArray *choices) { if (![textObject isKindOfClass:[ORKTextChoice class]]) { @throw [NSException exceptionWithName:NSGenericException reason:@"The textChoices array should only containt objects of the ORKTextChoice kind." userInfo:@{@"nonConformingObject": textObject}]; } - #if TARGET_OS_IOS [choices addObject:[textObject isKindOfClass:[ORKTextChoiceOther class]] ? [textObject copyWithZone:nil] : textObject]; #else @@ -1103,6 +1126,116 @@ - (NSArray *)choices { return self.textChoices; } +- (BOOL)isAnswerInvalid:(id)answer { + @try + { + [_helper selectedIndexesForAnswer: answer]; + return NO; + } @catch(id anException) { + ORK_Log_Error("%@ exception thrown for isAnswerInvalid: for answer:%@", anException, answer); + return YES; + } +} + +@end + + +#pragma mark - ORKColorChoiceAnswerFormat + +@interface ORKColorChoiceAnswerFormat () { + + ORKChoiceAnswerFormatHelper *_helper; +} + +@end + + +@implementation ORKColorChoiceAnswerFormat + ++ (instancetype)new { + ORKThrowMethodUnavailableException(); +} + +- (instancetype)init { + ORKThrowMethodUnavailableException(); +} + +- (instancetype)initWithStyle:(ORKChoiceAnswerStyle)style + colorChoices:(NSArray *)colorChoices { + self = [super init]; + if (self) { + _style = style; + _colorChoices = [colorChoices copy]; + _helper = [[ORKChoiceAnswerFormatHelper alloc] initWithAnswerFormat:self]; + } + return self; +} + +- (void)validateParameters { + [super validateParameters]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + ORKColorChoiceAnswerFormat *answerFormat = [[[self class] allocWithZone:zone] initWithStyle:_style + colorChoices:[_colorChoices copy]]; + return answerFormat; +} + +- (BOOL)isEqual:(id)object { + BOOL isParentSame = [super isEqual:object]; + + __typeof(self) castObject = object; + return (isParentSame && + ORKEqualObjects(_colorChoices, castObject.colorChoices) && + (_style == castObject.style)); +} + +- (NSUInteger)hash { + return super.hash ^ _colorChoices.hash ^ _style; +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + ORK_DECODE_OBJ_ARRAY(aDecoder, colorChoices, ORKColorChoice); + ORK_DECODE_ENUM(aDecoder, style); + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [super encodeWithCoder:aCoder]; + ORK_ENCODE_OBJ(aCoder, colorChoices); + ORK_ENCODE_ENUM(aCoder, style); + +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (ORKQuestionType)questionType { + return (_style == ORKChoiceAnswerStyleSingleChoice) ? ORKQuestionTypeSingleChoice : ORKQuestionTypeMultipleChoice; +} + +- (Class)questionResultClass { + return [ORKChoiceQuestionResult class]; +} + +- (NSString *)stringForAnswer:(id)answer { + return [_helper stringForChoiceAnswer:answer]; +} + +- (BOOL)shouldShowDontKnowButton { + return NO; +} + +- (NSArray *)choices { + return self.colorChoices; +} + @end @@ -1265,7 +1398,97 @@ - (BOOL)shouldShowDontKnowButton { @end +#pragma mark - ORKColorChoice + +@implementation ORKColorChoice + ++ (instancetype)new { + ORKThrowMethodUnavailableException(); +} + +- (instancetype)init { + ORKThrowMethodUnavailableException(); +} + +- (instancetype)initWithColor:(UIColor *)color + text:(NSString *)text + detailText:(NSString *)detailText + value:(NSObject *)value + exclusive:(BOOL)exclusive { + self = [super init]; + + if (self) { + _color = [color copy]; + _text = [text copy]; + _detailText = [detailText copy]; + _value = [value copy]; + _exclusive = exclusive; + } + + return self; +} + +- (instancetype)initWithColor:(UIColor *)color + text:(NSString *)text + detailText:(NSString *)detailText + value:(NSObject *)value { + return [self initWithColor:color text:text detailText:detailText value:value exclusive:NO]; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return self; +} + +- (BOOL)isEqual:(id)object { + if ([self class] != [object class]) { + return NO; + } + + __typeof(self) castObject = object; + return (ORKEqualObjects(self.text, castObject.text) + && ORKEqualObjects(self.detailText, castObject.detailText) + && ORKEqualObjects(self.value, castObject.value) + && ORKEqualObjects(self.color, castObject.color) + && self.exclusive == castObject.exclusive); +} + +- (NSUInteger)hash { + return _text.hash ^ _detailText.hash ^ _value.hash ^ _color.hash; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self) { + ORK_DECODE_OBJ_CLASS(aDecoder, text, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, color, UIColor); + ORK_DECODE_OBJ_CLASS(aDecoder, detailText, NSString); + ORK_DECODE_OBJ_CLASSES(aDecoder, value, ORKAllowableValueClasses()); + ORK_DECODE_BOOL(aDecoder, exclusive); + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + ORK_ENCODE_OBJ(aCoder, text); + ORK_ENCODE_OBJ(aCoder, color); + ORK_ENCODE_OBJ(aCoder, detailText); + ORK_ENCODE_OBJ(aCoder, value); + ORK_ENCODE_BOOL(aCoder, exclusive); +} + +- (BOOL)shouldShowDontKnowButton { + return NO; +} + +@end + + #pragma mark - ORKTextChoiceOther +#if TARGET_OS_IOS @implementation ORKTextChoiceOther + (instancetype)new { @@ -1281,6 +1504,7 @@ + (instancetype)choiceWithText:(NSString *)text value:(NSObject *)value exclusive:(BOOL)exclusive textViewPlaceholderText:(NSString *)textViewPlaceholderText { + ORKThrowInvalidArgumentExceptionIfNotEqual(text, value); ORKTextChoiceOther *option = [[ORKTextChoiceOther alloc] initWithText:text primaryTextAttributedString:nil detailText:detailText @@ -1379,7 +1603,6 @@ - (BOOL)shouldShowDontKnowButton { return NO; } - @end @@ -1489,6 +1712,7 @@ - (BOOL)shouldShowDontKnowButton { } @end +#endif #pragma mark - ORKBooleanAnswerFormat @@ -1696,19 +1920,29 @@ - (instancetype)initWithStyle:(ORKDateAnswerStyle)style return self; } +- (void)_setCurrentDateOverride:(NSDate *)currentDateOverride { + _currentDateOverride = currentDateOverride; +} + +- (NSDate *)_currentDate { + return _currentDateOverride ? : [NSDate date]; +} + - (void)setIsMaxDateCurrentTime:(BOOL)isMaxDateCurrentTime { _isMaxDateCurrentTime = isMaxDateCurrentTime; if (isMaxDateCurrentTime) { - _maximumDate = [NSDate date]; + _maximumDate = [self _currentDate]; } } - (void)setDaysBeforeCurrentDateToSetMinimumDate:(NSInteger)daysBefore { + _daysBeforeCurrentDateToSetMinimumDate = daysBefore; _minimumDate = [self fetchDateBasedOnDays:daysBefore forBefore:YES]; } - (void)setDaysAfterCurrentDateToSetMinimumDate:(NSInteger)daysAfter { + _daysAfterCurrentDateToSetMinimumDate = daysAfter; _maximumDate = [self fetchDateBasedOnDays:daysAfter forBefore:NO]; } @@ -1717,7 +1951,7 @@ - (NSDate *)fetchDateBasedOnDays:(NSInteger)days forBefore:(BOOL)forBefore { @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"The value passed in for daysBeforeCurrentDateToSetMinimumDate must be greater than 0." userInfo:nil]; } - NSDate *currentDate = [NSDate date]; + NSDate *currentDate = [self _currentDate]; NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; [dateComponents setDay:forBefore ? -days : days]; @@ -1800,7 +2034,7 @@ - (NSDate *)dateFromString:(NSString *)string { } - (NSDate *)pickerDefaultDate { - return (self.defaultDate ? : [NSDate date]); + return (self.defaultDate ? : [self _currentDate]); } @@ -2803,13 +3037,20 @@ - (NSArray *)choices { } @end + #endif #pragma mark - ORKTextAnswerFormat +@interface ORKTextAnswerFormat() + + +@end + @implementation ORKTextAnswerFormat + - (Class)questionResultClass { return [ORKTextQuestionResult class]; } @@ -2825,8 +3066,10 @@ - (void)commonInit { _multipleLines = NO; _hideClearButton = NO; _hideCharacterCountLabel = NO; + } + - (instancetype)initWithMaximumLength:(NSInteger)maximumLength { self = [super init]; if (self) { @@ -2888,7 +3131,7 @@ - (instancetype)copyWithZone:(NSZone *)zone { answerFormat->_spellCheckingType = _spellCheckingType; answerFormat->_keyboardType = _keyboardType; answerFormat->_textContentType = _textContentType; - + if (@available(iOS 12.0, *)) { answerFormat->_passwordRules = _passwordRules; } @@ -2965,6 +3208,7 @@ - (ORKAnswerFormat *)confirmationAnswerFormatWithOriginalItemIdentifier:(NSStrin answerFormat->_keyboardType = _keyboardType; answerFormat->_autocapitalizationType = _autocapitalizationType; answerFormat->_textContentType = _textContentType; + if (@available(iOS 12.0, *)) { answerFormat->_passwordRules = _passwordRules; } @@ -3062,7 +3306,8 @@ - (BOOL)isEqual:(id)object { self.hideClearButton == castObject.hideClearButton && self.hideCharacterCountLabel == castObject.hideCharacterCountLabel) && self.secureTextEntry == castObject.secureTextEntry) && - ORKEqualObjects(self.placeholder, castObject.placeholder); + ORKEqualObjects(self.placeholder, castObject.placeholder) + ; } static NSString *const kSecureTextEntryEscapeString = @"*"; @@ -3544,6 +3789,237 @@ - (NSString *)stringForAnswer:(id)answer { @end +#pragma mark - ORKAgeAnswerFormat + +static const NSInteger ORKAgeAnswerDefaultMinAge = 1; +static const NSInteger ORKAgeAnswerDefaultMaxAge = 125; + +@implementation ORKAgeAnswerFormat + +- (Class)questionResultClass { + return [ORKNumericQuestionResult class]; +} + +- (instancetype)init { + + return [self initWithMinimumAge:ORKAgeAnswerDefaultMinAge + maximumAge:ORKAgeAnswerDefaultMaxAge + minimumAgeCustomText:nil + maximumAgeCustomText:nil + showYear:NO + useYearForResult:NO + defaultValue:ORKAgeAnswerDefaultMinAge]; +} + +- (instancetype)initWithMinimumAge:(NSInteger)minimumAge maximumAge:(NSInteger)maximumAge { + return [self initWithMinimumAge:minimumAge + maximumAge:maximumAge + minimumAgeCustomText:nil + maximumAgeCustomText:nil + showYear:NO + useYearForResult:NO + defaultValue:minimumAge]; + +} + +- (instancetype)initWithMinimumAge:(NSInteger)minimumAge + maximumAge:(NSInteger)maximumAge + minimumAgeCustomText:(nullable NSString *)minimumAgeCustomText + maximumAgeCustomText:(nullable NSString *)maximumAgeCustomText + showYear:(BOOL)showYear + useYearForResult:(BOOL)useYearForResult + defaultValue:(NSInteger)defaultValue { + return [self initWithMinimumAge:minimumAge + maximumAge:maximumAge + minimumAgeCustomText:minimumAgeCustomText + maximumAgeCustomText:maximumAgeCustomText + showYear:showYear + useYearForResult:useYearForResult + treatMinAgeAsRange:NO + treatMaxAgeAsRange:NO + defaultValue:defaultValue]; +} + +- (instancetype)initWithMinimumAge:(NSInteger)minimumAge + maximumAge:(NSInteger)maximumAge + minimumAgeCustomText:(nullable NSString *)minimumAgeCustomText + maximumAgeCustomText:(nullable NSString *)maximumAgeCustomText + showYear:(BOOL)showYear + useYearForResult:(BOOL)useYearForResult + treatMinAgeAsRange:(BOOL)treatMinAgeAsRange + treatMaxAgeAsRange:(BOOL)treatMaxAgeAsRange + defaultValue:(NSInteger)defaultValue { + if (minimumAge < 0) { + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason: [NSString stringWithFormat:@"minimumAge must be greater than 0. (%li) - (%li)", minimumAge, maximumAge] + userInfo:nil]; + + } + + if (maximumAge > 150) { + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason:@"maximumAge must be lower than 150." + userInfo:nil]; + } + + if (minimumAge >= maximumAge) { + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason:[NSString stringWithFormat:@"minimumAge must be less than maximumAge. (%li) - (%li)", minimumAge, maximumAge] + userInfo:nil]; + } + + + self = [super init]; + + if (self) { + _minimumAge = minimumAge; + _maximumAge = maximumAge; + _minimumAgeCustomText = [minimumAgeCustomText copy]; + _maximumAgeCustomText = [maximumAgeCustomText copy]; + _showYear = showYear; + _useYearForResult = useYearForResult; + _treatMinAgeAsRange = treatMinAgeAsRange; + _treatMaxAgeAsRange = treatMaxAgeAsRange; + _relativeYear = [self currentYear]; + _defaultValue = defaultValue; + } + + return self; +} + ++ (int)minimumAgeSentinelValue { + return -1; +} + ++ (int)maximumAgeSentinelValue { + return -2; +} + +- (NSInteger)currentYear { + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + NSDateComponents *components = [calendar components:NSCalendarUnitYear fromDate:[NSDate date]]; + return [components year]; +} + +- (NSString *)stringForAnswer:(id)answer { + NSString *answerString = nil; + + if (!ORKIsAnswerEmpty(answer)) { + NSNumberFormatter *formatter = ORKDecimalNumberFormatter(); + answerString = [formatter stringFromNumber:(NSNumber *)answer]; + } + + if (answerString) { + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + NSDateComponents *components = [calendar components:NSCalendarUnitYear fromDate:[NSDate date]]; + NSInteger currentYear = [components year]; + + int maxYear = currentYear - _minimumAge; + int minYear = currentYear - _maximumAge; + + NSString *minAgeText = _minimumAgeCustomText ? : [NSString stringWithFormat:ORKLocalizedString(@"AGEPICKER_OR_YOUNGER", ""), (long)_minimumAge]; + NSString *maxAgeText = _maximumAgeCustomText ? : [NSString stringWithFormat:ORKLocalizedString(@"AGEPICKER_OR_OLDER", ""), (long)_maximumAge]; + + int value = [answerString intValue]; + + if (value < 0) { + // pass back necessary text if sentinel value is selected + answerString = value == [ORKAgeAnswerFormat minimumAgeSentinelValue] ? minAgeText : maxAgeText; + } else if (_useYearForResult) { + // pass back necessary text if min or max year is selected + if ((value >= maxYear || value <= minYear)) { + answerString = value <= minYear ? maxAgeText : minAgeText; + } + } else if ((value == _minimumAge && _minimumAgeCustomText ) || (value == _maximumAge && _maximumAgeCustomText)) { + answerString = value == _minimumAge ? _minimumAgeCustomText : _maximumAgeCustomText; + } else if ((value == minYear && _minimumAgeCustomText) || (value == maxYear && _maximumAgeCustomText)) { + answerString = value == minYear ? _minimumAgeCustomText : _maximumAgeCustomText; + } + } + + return answerString; +} + +- (ORKQuestionType)questionType { + return _useYearForResult ? ORKQuestionTypeYear : ORKQuestionTypeAge; +} + + +- (instancetype)copyWithZone:(NSZone *)zone { + ORKAgeAnswerFormat *ageAnswerFormat = [super copyWithZone:zone]; + ageAnswerFormat->_minimumAge = _minimumAge; + ageAnswerFormat->_maximumAge = _maximumAge; + ageAnswerFormat->_minimumAgeCustomText = [_minimumAgeCustomText copy]; + ageAnswerFormat->_maximumAgeCustomText = [_maximumAgeCustomText copy]; + ageAnswerFormat->_showYear = _showYear; + ageAnswerFormat->_useYearForResult = _useYearForResult; + ageAnswerFormat->_treatMinAgeAsRange = _treatMinAgeAsRange; + ageAnswerFormat->_treatMaxAgeAsRange = _treatMaxAgeAsRange; + ageAnswerFormat->_relativeYear = _relativeYear; + ageAnswerFormat->_defaultValue = _defaultValue; + return ageAnswerFormat; +} + +- (BOOL)isEqual:(id)object { + BOOL isParentSame = [super isEqual:object]; + + __typeof(self) castObject = object; + return (isParentSame && + (_minimumAge == castObject->_minimumAge) && + (_maximumAge == castObject->_maximumAge) && + (_relativeYear == castObject->_relativeYear) && + ORKEqualObjects(_minimumAgeCustomText, castObject->_minimumAgeCustomText) && + ORKEqualObjects(_maximumAgeCustomText, castObject->_maximumAgeCustomText) && + (_showYear == castObject->_showYear) && + (_useYearForResult == castObject->_useYearForResult) && + (_treatMinAgeAsRange == castObject->_treatMinAgeAsRange) && + (_treatMaxAgeAsRange == castObject->_treatMaxAgeAsRange) && + (_defaultValue == castObject->_defaultValue)); +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + ORK_DECODE_INTEGER(aDecoder, minimumAge); + ORK_DECODE_INTEGER(aDecoder, maximumAge); + ORK_DECODE_OBJ_CLASS(aDecoder, minimumAgeCustomText, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, maximumAgeCustomText, NSString); + ORK_DECODE_BOOL(aDecoder, showYear); + ORK_DECODE_BOOL(aDecoder, useYearForResult); + ORK_DECODE_BOOL(aDecoder, treatMinAgeAsRange); + ORK_DECODE_BOOL(aDecoder, treatMaxAgeAsRange); + ORK_DECODE_BOOL(aDecoder, useYearForResult); + ORK_DECODE_INTEGER(aDecoder, defaultValue); + ORK_DECODE_INTEGER(aDecoder, relativeYear); + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [super encodeWithCoder:aCoder]; + ORK_ENCODE_INTEGER(aCoder, minimumAge); + ORK_ENCODE_INTEGER(aCoder, maximumAge); + ORK_ENCODE_OBJ(aCoder, minimumAgeCustomText); + ORK_ENCODE_OBJ(aCoder, maximumAgeCustomText); + ORK_ENCODE_BOOL(aCoder, showYear); + ORK_ENCODE_BOOL(aCoder, useYearForResult); + ORK_ENCODE_BOOL(aCoder, treatMinAgeAsRange); + ORK_ENCODE_BOOL(aCoder, treatMaxAgeAsRange); + ORK_ENCODE_INTEGER(aCoder, defaultValue); + ORK_ENCODE_INTEGER(aCoder, relativeYear); +} + +- (NSUInteger)hash { + return super.hash ^ _minimumAgeCustomText.hash ^ _maximumAgeCustomText.hash ^ _minimumAge ^ _maximumAge ^ _showYear ^ _useYearForResult ^ _treatMinAgeAsRange ^ _treatMaxAgeAsRange ^ _relativeYear ^ _defaultValue; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} +@end + + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION #pragma mark - ORKLocationAnswerFormat @implementation ORKLocationAnswerFormat @@ -3614,6 +4090,7 @@ - (BOOL)shouldShowDontKnowButton { } @end +#endif #pragma mark ORKSESAnswerFormat diff --git a/ResearchKit/Common/ORKAnswerFormat_Internal.h b/ResearchKit/Common/ORKAnswerFormat_Internal.h index f167001f00..cd096508e4 100644 --- a/ResearchKit/Common/ORKAnswerFormat_Internal.h +++ b/ResearchKit/Common/ORKAnswerFormat_Internal.h @@ -29,18 +29,26 @@ */ -@import HealthKit; -#import "ORKAnswerFormat_Private.h" -#import "ORKChoiceAnswerFormatHelper.h" +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import +#endif + +#if TARGET_OS_IOS +#import +#import +#endif +@class ORKChoiceAnswerFormatHelper; NS_ASSUME_NONNULL_BEGIN BOOL ORKIsAnswerEmpty(_Nullable id answer); #if TARGET_OS_IOS +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION NSString *ORKHKBiologicalSexString(HKBiologicalSex biologicalSex); NSString *ORKHKBloodTypeString(HKBloodType bloodType); -#endif +#endif // ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#endif // TARGET_OS_IOS NSString *ORKQuestionTypeString(ORKQuestionType questionType); // Need to mark these as designated initializers to avoid warnings once we designate the others. @@ -66,6 +74,7 @@ ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKTextAnswerFormat) ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKTimeIntervalAnswerFormat) ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKHeightAnswerFormat) ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKWeightAnswerFormat) +ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKAgeAnswerFormat) #endif ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKTextChoiceAnswerFormat) ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKTextChoice) @@ -80,13 +89,15 @@ ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKTextChoice) #if TARGET_OS_IOS - (BOOL)isHealthKitAnswerFormat; +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (nullable HKObjectType *)healthKitObjectType; - (nullable HKObjectType *)healthKitObjectTypeForAuthorization; @property (nonatomic, strong, readonly, nullable) HKUnit *healthKitUnit; @property (nonatomic, strong, nullable) HKUnit *healthKitUserUnit; -#endif +#endif // ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#endif // TARGET_OS_IOS - (nullable NSString *)localizedInvalidValueStringWithAnswerString:(nullable NSString *)text; @@ -149,7 +160,6 @@ ORK_DESIGNATE_CODING_AND_SERIALIZATION_INITIALIZERS(ORKTextChoice) @end - @protocol ORKTextScaleAnswerFormatProvider - (NSArray *)textChoices; @@ -209,7 +219,9 @@ NSArray *ORKAllowableValueClasses(void); @end -@interface ORKDateAnswerFormat () +@interface ORKDateAnswerFormat () { + NSDate *_currentDateOverride; +} - (NSDate *)pickerDefaultDate; - (nullable NSDate *)pickerMinimumDate; @@ -217,6 +229,8 @@ NSArray *ORKAllowableValueClasses(void); - (NSCalendar *)currentCalendar; +- (void)_setCurrentDateOverride:(NSDate *)currentDateOverride; + @end @@ -248,16 +262,16 @@ NSArray *ORKAllowableValueClasses(void); @interface ORKAnswerDefaultSource : NSObject +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + (instancetype)sourceWithHealthStore:(HKHealthStore *)healthStore; - (instancetype)initWithHealthStore:(HKHealthStore *)healthStore NS_DESIGNATED_INITIALIZER; @property (nonatomic, strong, readonly, nullable) HKHealthStore *healthStore; - -- (void)fetchDefaultValueForAnswerFormat:(nullable ORKAnswerFormat *)answerFormat handler:(void(^)(id defaultValue, NSError *error))handler; - - (nullable HKUnit *)defaultHealthKitUnitForAnswerFormat:(ORKAnswerFormat *)answerFormat; - (void)updateHealthKitUnitForAnswerFormat:(ORKAnswerFormat *)answerFormat force:(BOOL)force; +#endif +- (void)fetchDefaultValueForAnswerFormat:(nullable ORKAnswerFormat *)answerFormat handler:(void(^)(id defaultValue, NSError *error))handler; @end @interface ORKTextChoiceOther() diff --git a/ResearchKit/Common/ORKAnswerFormat_Private.h b/ResearchKit/Common/ORKAnswerFormat_Private.h index fc80990de3..351cfc0c24 100644 --- a/ResearchKit/Common/ORKAnswerFormat_Private.h +++ b/ResearchKit/Common/ORKAnswerFormat_Private.h @@ -28,7 +28,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + + +#if TARGET_OS_IOS #import +#endif NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKBodyItem.h b/ResearchKit/Common/ORKBodyItem.h index e6051313c9..8fbe7401c0 100644 --- a/ResearchKit/Common/ORKBodyItem.h +++ b/ResearchKit/Common/ORKBodyItem.h @@ -28,12 +28,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; +#import #import #import NS_ASSUME_NONNULL_BEGIN +/** + An enumeration for body item style options. + */ + typedef NS_ENUM(NSInteger, ORKBodyItemStyle) { /** text style body item @@ -63,6 +67,11 @@ typedef NS_ENUM(NSInteger, ORKBodyItemStyle) { @class ORKLearnMoreItem; +/** + An object that represents textual information to + attach to a step. + */ + ORK_CLASS_AVAILABLE @interface ORKBodyItem : NSObject @@ -70,6 +79,8 @@ ORK_CLASS_AVAILABLE - (instancetype)initWithText:(nullable NSString *)text detailText:(nullable NSString *)detailText image:(nullable UIImage *)image learnMoreItem:(nullable ORKLearnMoreItem *)learnMoreItem bodyItemStyle:(ORKBodyItemStyle)bodyItemStyle useCardStyle:(BOOL)useCardStyle; +- (instancetype)initWithText:(nullable NSString *)text detailText:(nullable NSString *)detailText image:(nullable UIImage *)image learnMoreItem:(nullable ORKLearnMoreItem *)learnMoreItem bodyItemStyle:(ORKBodyItemStyle)bodyItemStyle useCardStyle:(BOOL)useCardStyle alignImageToTop:(BOOL)alignImageToTop; + - (instancetype)initWithHorizontalRule; @property (nonatomic, nullable) NSString *text; @@ -86,6 +97,8 @@ ORK_CLASS_AVAILABLE @property (nonatomic) BOOL useSecondaryColor; +@property (nonatomic) BOOL alignImageToTop; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKBodyItem.m b/ResearchKit/Common/ORKBodyItem.m index 93f5860e1b..14244d010b 100644 --- a/ResearchKit/Common/ORKBodyItem.m +++ b/ResearchKit/Common/ORKBodyItem.m @@ -61,6 +61,10 @@ - (instancetype)initWithText:(NSString *)text detailText:(NSString *)detailText } - (instancetype)initWithText:(NSString *)text detailText:(NSString *)detailText image:(nullable UIImage *)image learnMoreItem:(nullable ORKLearnMoreItem *)learnMoreItem bodyItemStyle:(ORKBodyItemStyle)bodyItemStyle useCardStyle:(BOOL)useCardStyle { + return [self initWithText:text detailText:detailText image:image learnMoreItem:learnMoreItem bodyItemStyle:bodyItemStyle useCardStyle:NO alignImageToTop:false]; +} + +- (instancetype)initWithText:(NSString *)text detailText:(NSString *)detailText image:(nullable UIImage *)image learnMoreItem:(nullable ORKLearnMoreItem *)learnMoreItem bodyItemStyle:(ORKBodyItemStyle)bodyItemStyle useCardStyle:(BOOL)useCardStyle alignImageToTop:(BOOL)alignImageToTop { self = [super init]; if (self) { self.text = text; @@ -70,6 +74,7 @@ - (instancetype)initWithText:(NSString *)text detailText:(NSString *)detailText self.image = image; self.useCardStyle = useCardStyle; self.useSecondaryColor = NO; + self.alignImageToTop = alignImageToTop; } [self validateParameters]; return self; @@ -127,6 +132,7 @@ - (nonnull id)copyWithZone:(nullable NSZone *)zone { bodyItem->_image = [self.image copy]; bodyItem->_useCardStyle = self.useCardStyle; bodyItem->_useSecondaryColor = self.useSecondaryColor; + bodyItem->_alignImageToTop = self.alignImageToTop; return bodyItem; } @@ -146,7 +152,8 @@ - (BOOL)isEqual:(id)object { && (self.bodyItemStyle == castObject.bodyItemStyle) && ORKEqualObjects(self.image, castObject.image) && (self.useCardStyle == castObject.useCardStyle) - && (self.useSecondaryColor == castObject.useSecondaryColor)); + && (self.useSecondaryColor == castObject.useSecondaryColor) + && (self.alignImageToTop == castObject.alignImageToTop)); } @end diff --git a/ResearchKit/Common/ORKBodyItem_Internal.h b/ResearchKit/Common/ORKBodyItem_Internal.h index bad2af540d..a1dd41cc3c 100644 --- a/ResearchKit/Common/ORKBodyItem_Internal.h +++ b/ResearchKit/Common/ORKBodyItem_Internal.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "ORKBodyItem.h" +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKBundleAsset.m b/ResearchKit/Common/ORKBundleAsset.m index f4a89170d6..8aac100a84 100644 --- a/ResearchKit/Common/ORKBundleAsset.m +++ b/ResearchKit/Common/ORKBundleAsset.m @@ -85,6 +85,7 @@ - (NSUInteger)hash { } - (nullable NSURL *)url { + NSBundle *bundle = (self.bundleIdentifier) ? [NSBundle bundleWithIdentifier:self.bundleIdentifier] : [NSBundle mainBundle]; diff --git a/ResearchKit/Common/ORKCheckmarkView.m b/ResearchKit/Common/ORKCheckmarkView.m deleted file mode 100644 index 463b69d124..0000000000 --- a/ResearchKit/Common/ORKCheckmarkView.m +++ /dev/null @@ -1,155 +0,0 @@ -/* - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import "ORKCheckmarkView.h" -#import "ORKHelpers_Internal.h" -#import "ORKSkin.h" - -static const CGFloat CheckmarkViewBorderWidth = 2.0; - -@implementation ORKCheckmarkView { - CGFloat _dimension; - BOOL _shouldShowCircle; -} - -- (instancetype)initWithRadius:(CGFloat)radius checkedImage:(UIImage *)checkedImage uncheckedImage:(UIImage *)uncheckedImage shouldShowCircle:(BOOL)shouldShowCircle { - self = [super init]; - if (self) { - _dimension = 2*radius; - _checkedImage = checkedImage; - _uncheckedImage = uncheckedImage; - _shouldShowCircle = shouldShowCircle; - } - [self setupView]; - return self; -} - -- (instancetype)initWithRadius:(CGFloat)radius checkedImage:(UIImage *)checkedImage uncheckedImage:(UIImage *)uncheckedImage { - return [self initWithRadius:CheckmarkViewDimension*0.5 - checkedImage:[ORKCheckmarkView checkedImage] - uncheckedImage:[ORKCheckmarkView unCheckedImage] - shouldShowCircle:YES]; -} - -- (instancetype)initWithDefaults { - return [self initWithRadius:CheckmarkViewDimension*0.5 - checkedImage:[ORKCheckmarkView checkedImage] - uncheckedImage:[ORKCheckmarkView unCheckedImage]]; -} - -- (instancetype)initWithDefaultsWithoutCircle { - return [self initWithRadius:CheckmarkViewDimension*0.5 - checkedImage:[ORKCheckmarkView checkedImageWithoutCircle] - uncheckedImage:nil - shouldShowCircle:NO]; -} - -- (CGFloat)getDimension { - return _dimension; -} - -+ (UIImage *)unCheckedImage { - if (@available(iOS 13.0, *)) { - UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody] scale:UIImageSymbolScaleLarge]; - return [UIImage systemImageNamed:@"circle" withConfiguration:configuration]; - } else { - return nil; - } -} - -+ (UIImage *)checkedImage { - if (@available(iOS 13.0, *)) { - UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody] scale:UIImageSymbolScaleLarge]; - return [UIImage systemImageNamed:@"checkmark.circle.fill" withConfiguration:configuration]; - } else { - return [[UIImage imageNamed:@"checkmark" inBundle:ORKBundle() compatibleWithTraitCollection:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - } -} - -+ (UIImage *)checkedImageWithoutCircle { - if (@available(iOS 13.0, *)) { - UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody] scale:UIImageSymbolScaleLarge]; - return [UIImage systemImageNamed:@"checkmark" withConfiguration:configuration]; - } else { - return [[UIImage imageNamed:@"checkmark" inBundle:ORKBundle() compatibleWithTraitCollection:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - } -} - -- (void)updateCheckView { - if (_checked) { - self.image = _checkedImage; - // FIXME: Need to be replaced. - if (@available(iOS 13.0, *)) { - self.tintColor = ORKViewTintColor(self); - } else { - self.backgroundColor = [self tintColor]; - self.tintColor = UIColor.whiteColor; - } - } - else { - self.image = _uncheckedImage; - if (@available(iOS 13.0, *)) { - self.tintColor = [UIColor systemGray3Color]; - } else { - self.tintColor = nil; - self.image = nil; - self.backgroundColor = UIColor.clearColor; - } - } -} - -- (void)setupView { - [[self.widthAnchor constraintEqualToConstant:_dimension] setActive:YES]; - [[self.heightAnchor constraintEqualToConstant:_dimension] setActive:YES]; - - if (@available(iOS 13.0, *)) { - // use SFSymbols directly - } else { - self.layer.cornerRadius = _dimension * 0.5; - self.layer.borderWidth = CheckmarkViewBorderWidth; - self.layer.borderColor = self.tintColor.CGColor; - self.layer.masksToBounds = YES; - } - - self.contentMode = UIViewContentModeCenter; -} - -- (void)setChecked:(BOOL)checked { - _checked = checked; - [self updateCheckView]; -} - -- (void)tintColorDidChange { - [super tintColorDidChange]; - [self updateCheckView]; -} - -@end - diff --git a/ResearchKit/Common/ORKChoiceAnswerFormatHelper.h b/ResearchKit/Common/ORKChoiceAnswerFormatHelper.h index d72b66851d..02cbd62127 100644 --- a/ResearchKit/Common/ORKChoiceAnswerFormatHelper.h +++ b/ResearchKit/Common/ORKChoiceAnswerFormatHelper.h @@ -28,18 +28,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import NS_ASSUME_NONNULL_BEGIN @class ORKAnswerFormat; @class ORKImageChoice; @class ORKTextChoice; +@class ORKColorChoice; + @protocol ORKAnswerOption; @protocol ORKChoiceAnswerFormatHelper -- (NSArray *)choices; +- (nullable NSArray *)choices; - (BOOL)isValuePicker; @@ -72,6 +74,8 @@ NS_ASSUME_NONNULL_BEGIN - (nullable ORKImageChoice *)imageChoiceAtIndex:(NSUInteger)index; +- (nullable ORKColorChoice *)colorChoiceAtIndex:(NSUInteger)index; + @end #endif diff --git a/ResearchKit/Common/ORKChoiceAnswerFormatHelper.m b/ResearchKit/Common/ORKChoiceAnswerFormatHelper.m index 6efcd0ac39..bca15b0da7 100644 --- a/ResearchKit/Common/ORKChoiceAnswerFormatHelper.m +++ b/ResearchKit/Common/ORKChoiceAnswerFormatHelper.m @@ -46,7 +46,7 @@ @implementation ORKChoiceAnswerFormatHelper { - (instancetype)initWithAnswerFormat:(ORKAnswerFormat *)answerFormat { self = [super init]; if (self) { - _choices = [[answerFormat choices] copy]; + _choices = [answerFormat choices]; _isValuePicker = [answerFormat isValuePicker]; } return self; @@ -68,6 +68,11 @@ - (ORKImageChoice *)imageChoiceAtIndex:(NSUInteger)index { id option = [self answerOptionAtIndex:index]; return option && [option isKindOfClass:[ORKImageChoice class]] ? (ORKImageChoice *) option : nil; } + +- (ORKColorChoice *)colorChoiceAtIndex:(NSUInteger)index { + id option = [self answerOptionAtIndex:index]; + return option && [option isKindOfClass:[ORKColorChoice class]] ? (ORKColorChoice *) option : nil; +} #endif - (ORKTextChoice *)textChoiceAtIndex:(NSUInteger)index { @@ -91,7 +96,6 @@ - (id)answerForSelectedIndexes:(NSArray *)indexes { } id choice = _choices[index]; - #if TARGET_OS_IOS ORKTextChoiceOther *textChoiceOther; if ([choice isKindOfClass: [ORKTextChoiceOther class]]) { @@ -101,7 +105,6 @@ - (id)answerForSelectedIndexes:(NSArray *)indexes { #else id value = choice.value; #endif - if (value == nil) { value = _isValuePicker ? @(index - 1) : @(index); } @@ -138,6 +141,8 @@ - (NSArray *)selectedIndexesForAnswer:(nullable id)answer { for (id answerValue in (NSArray *)answer) { id matchedChoice = nil; + BOOL isTextChoiceOtherResult = [self _isTextChoiceOtherResult:answerValue choices:_choices]; + for ( id choice in _choices) { #if TARGET_OS_IOS if ([choice isKindOfClass:[ORKTextChoiceOther class]]) { @@ -148,7 +153,12 @@ - (NSArray *)selectedIndexesForAnswer:(nullable id)answer { } else if (textChoiceOther.textViewInputOptional && textChoiceOther.textViewText.length <= 0 && [textChoiceOther.value isEqual:answerValue]) { matchedChoice = choice; break; + } else if (isTextChoiceOtherResult) { + textChoiceOther.textViewText = answerValue; + matchedChoice = choice; + break; } + } else if ([choice.value isEqual:answerValue]) { matchedChoice = choice; break; @@ -165,7 +175,7 @@ - (NSArray *)selectedIndexesForAnswer:(nullable id)answer { if (![answerValue isKindOfClass:[NSNumber class]]) { @throw [NSException exceptionWithName:@"No matching choice found" - reason:[NSString stringWithFormat:@"Provided choice of type %@ not found in available choices", [answerValue class]] + reason:[NSString stringWithFormat:@"Provided choice of type %@ not found in available choices. Answer is %@ and choices are %@", [answerValue class], answer, _choices] userInfo:nil]; } @@ -191,6 +201,20 @@ - (NSArray *)selectedIndexesForAnswer:(nullable id)answer { } +- (BOOL)_isTextChoiceOtherResult:(id)answerValue choices:(NSArray *)choices { + if (answerValue == nil) { + return NO; + } + + for (id choice in _choices) { + if ([choice.value isEqual:answerValue]){ + return NO; + } + } + + return YES; +} + - (NSString *)stringForChoiceAnswer:(id)answer { NSMutableArray *answerStrings = [[NSMutableArray alloc] init]; NSArray *indexes = [self selectedIndexesForAnswer:answer]; diff --git a/ResearchKit/Common/ORKChoiceViewCell+ORKTextChoice.h b/ResearchKit/Common/ORKChoiceViewCell+ORKTextChoice.h new file mode 100644 index 0000000000..0d17eb64bd --- /dev/null +++ b/ResearchKit/Common/ORKChoiceViewCell+ORKTextChoice.h @@ -0,0 +1,43 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKChoiceViewCell.h" +#import "ORKTextChoiceCellGroup.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKChoiceViewCell (ORKTextChoice) + +- (void)configureWithTextChoice:(ORKTextChoice *)textChoice + isLastItem:(BOOL)isLastItem; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKChoiceViewCell.m b/ResearchKit/Common/ORKChoiceViewCell.m deleted file mode 100644 index 6282fc4f5b..0000000000 --- a/ResearchKit/Common/ORKChoiceViewCell.m +++ /dev/null @@ -1,700 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKChoiceViewCell_Internal.h" - -#import "ORKSelectionTitleLabel.h" -#import "ORKSelectionSubTitleLabel.h" - -#import "ORKAccessibility.h" -#import "ORKHelpers_Internal.h" -#import "ORKAnswerTextView.h" -#import "ORKSkin.h" -#import "ORKCheckmarkView.h" - -static const CGFloat CardTopBottomMargin = 2.0; -static const CGFloat LabelTopBottomMargin = 14.0; -static const CGFloat TextViewTopMargin = 20.0; -static const CGFloat TextViewHeight = 100.0; -static const CGFloat LabelCheckViewPadding = 10.0; - -@interface ORKChoiceViewCell() - -@property (nonatomic) UIView *containerView; -@property (nonatomic) ORKSelectionTitleLabel *primaryLabel; -@property (nonatomic) ORKSelectionSubTitleLabel *detailLabel; -@property (nonatomic) ORKCheckmarkView *checkView; -@property (nonatomic) NSMutableArray *containerConstraints; -@property (nonatomic, readonly) CGFloat leftRightMargin; -@property (nonatomic, readonly) CGFloat intraCellSpacing; - -@end - -@implementation ORKChoiceViewCell { - - CGFloat _topBottomMargin; - CAShapeLayer *_contentMaskLayer; - UIColor *_fillColor; - CAShapeLayer *_foreLayer; - CAShapeLayer *_animationLayer; - CGRect _foreLayerBounds; -} - -- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - if (self) { - self.clipsToBounds = YES; - _topBottomMargin = 0.0; - [self setupContainerView]; - [self setupCheckView]; - } - return self; -} - -- (void)drawRect:(CGRect)rect { - [super drawRect:rect]; - [self setMaskLayers]; -} - -- (CGFloat)leftRightMargin { - return self.useCardView ? ORKCardLeftRightMarginForWindow(self.window) : 0.0; -} - -- (CGFloat)intraCellSpacing { - return 0; -} - -- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { - [super traitCollectionDidChange:previousTraitCollection]; - _fillColor = [self __fillColor]; -} - -- (void)clearLayerIfNeeded:(CALayer *)layer { - - if (layer) { - for (CALayer *sublayer in [layer.sublayers mutableCopy]) { - [sublayer removeFromSuperlayer]; - } - - [layer removeFromSuperlayer]; - layer = nil; - } -} - -- (UIColor *)__fillColor { - - UIColor *color; - - if (@available(iOS 13.0, *)) { - - color = [UIColor secondarySystemGroupedBackgroundColor]; - - if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { - color = [UIColor colorWithRed:0.173 green:0.173 blue:0.180 alpha:1.0]; - } - - } else { - color = [UIColor ork_borderGrayColor]; - } - - return color; -} - -- (UIColor *)__borderColor { - if (@available(iOS 13.0, *)) { - return UIColor.separatorColor; - } else { - return [UIColor ork_midGrayTintColor]; - } -} - -- (UIRectCorner)roundedCorners { - - if (_isLastItem && !_isFirstItemInSectionWithoutTitle) { - - return UIRectCornerBottomLeft | UIRectCornerBottomRight; - - } else if (!_isLastItem && _isFirstItemInSectionWithoutTitle) { - - return UIRectCornerTopLeft | UIRectCornerTopRight; - - } else { - - return UIRectCornerAllCorners; - } -} - -- (BOOL)shouldApplyMaskLayers { - return _isLastItem || _isFirstItemInSectionWithoutTitle; -} - -- (void)setMaskLayers { - - if (_useCardView && !_animationLayer) { - - UIColor *borderColor = [self __borderColor]; - _fillColor = [self __fillColor]; - - [self clearLayerIfNeeded:_contentMaskLayer]; - _contentMaskLayer = [[CAShapeLayer alloc] init]; - [_contentMaskLayer setFillColor:[_fillColor CGColor]]; - - [self clearLayerIfNeeded:_foreLayer]; - _foreLayer = [CAShapeLayer layer]; - [_foreLayer setFillColor:[_fillColor CGColor]]; - _foreLayer.zPosition = 0.0f; - - if ([self shouldApplyMaskLayers]) { - - UIRectCorner rectCorners = [self roundedCorners]; - - _foreLayerBounds = CGRectMake(ORKCardDefaultBorderWidth, 0, self.containerView.bounds.size.width - 2 * ORKCardDefaultBorderWidth, self.containerView.bounds.size.height - ORKCardDefaultBorderWidth); - - _contentMaskLayer.path = [UIBezierPath bezierPathWithRoundedRect: self.containerView.bounds - byRoundingCorners:rectCorners - cornerRadii: (CGSize){ORKCardDefaultCornerRadii, ORKCardDefaultCornerRadii}].CGPath; - - CGFloat foreLayerCornerRadii = ORKCardDefaultCornerRadii >= ORKCardDefaultBorderWidth ? ORKCardDefaultCornerRadii - ORKCardDefaultBorderWidth : ORKCardDefaultCornerRadii; - - _foreLayer.path = [UIBezierPath bezierPathWithRoundedRect: _foreLayerBounds - byRoundingCorners: rectCorners - cornerRadii: (CGSize){foreLayerCornerRadii, foreLayerCornerRadii}].CGPath; - } else { - - _foreLayerBounds = CGRectMake(ORKCardDefaultBorderWidth, 0, self.containerView.bounds.size.width - 2 * ORKCardDefaultBorderWidth, self.containerView.bounds.size.height); - _foreLayer.path = [UIBezierPath bezierPathWithRect:_foreLayerBounds].CGPath; - _contentMaskLayer.path = [UIBezierPath bezierPathWithRect:self.containerView.bounds].CGPath; - } - - if (_cardViewStyle == ORKCardViewStyleBordered) { - _contentMaskLayer.fillColor = borderColor.CGColor; - } - - [_contentMaskLayer addSublayer:_foreLayer]; - - [_contentMaskLayer addSublayer:[self lineLayer]]; - - [_containerView.layer insertSublayer:_contentMaskLayer atIndex:0]; - } -} - -- (nullable CAShapeLayer *)lineLayer { - CAShapeLayer *lineLayer = [CAShapeLayer layer]; - if (!_isLastItem) { - CGRect lineBounds = CGRectMake(ORKSurveyItemMargin, self.containerView.bounds.size.height - 1.0, self.containerView.bounds.size.width - ORKSurveyItemMargin, 0.5); - lineLayer.path = [UIBezierPath bezierPathWithRect:lineBounds].CGPath; - lineLayer.zPosition = 0.0f; - } - lineLayer.fillColor = [self __borderColor].CGColor; - - return lineLayer; -} - -- (void)setupContainerView { - if (!_containerView) { - _containerView = [UIView new]; - } - - [self.contentView addSubview:_containerView]; -} - -- (void)addContainerViewToSelfConstraints { - [_containerConstraints addObjectsFromArray:@[ - [NSLayoutConstraint constraintWithItem:_containerView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:self.contentView - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:0], - [NSLayoutConstraint constraintWithItem:_containerView - attribute:NSLayoutAttributeLeft - relatedBy:NSLayoutRelationEqual - toItem:self.contentView - attribute:NSLayoutAttributeLeft - multiplier:1.0 - constant:self.leftRightMargin], - [NSLayoutConstraint constraintWithItem:_containerView - attribute:NSLayoutAttributeRight - relatedBy:NSLayoutRelationEqual - toItem:self.contentView - attribute:NSLayoutAttributeRight - multiplier:1.0 - constant:-self.leftRightMargin], - [NSLayoutConstraint constraintWithItem:_containerView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self.contentView - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:-self.intraCellSpacing], - ]]; -} - -- (void)addPrimaryLabelToContainerViewConstraints { - if (_primaryLabel) { - - [_containerConstraints addObjectsFromArray:@[ - [NSLayoutConstraint constraintWithItem:_primaryLabel - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:_containerView - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:LabelTopBottomMargin], - [NSLayoutConstraint constraintWithItem:_primaryLabel - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:_checkView - attribute:NSLayoutAttributeLeading - multiplier:1.0 - constant:-LabelCheckViewPadding], - [NSLayoutConstraint constraintWithItem:_primaryLabel - attribute:NSLayoutAttributeLeading - relatedBy:NSLayoutRelationEqual - toItem:_containerView - attribute:NSLayoutAttributeLeading - multiplier:1.0 - constant:ORKSurveyItemMargin] - ]]; - } -} - -- (void)addDetailLabelConstraints { - if (_detailLabel) { - [_containerConstraints addObjectsFromArray:@[ - [NSLayoutConstraint constraintWithItem:_detailLabel - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:_primaryLabel ? : _containerView - attribute:_primaryLabel ? NSLayoutAttributeBottom : NSLayoutAttributeTop - multiplier:1.0 - constant:_primaryLabel ? 0.0 : LabelTopBottomMargin], - [NSLayoutConstraint constraintWithItem:_detailLabel - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:_checkView - attribute:NSLayoutAttributeLeading - multiplier:1.0 - constant:-LabelCheckViewPadding], - [NSLayoutConstraint constraintWithItem:_detailLabel - attribute:NSLayoutAttributeLeading - relatedBy:NSLayoutRelationEqual - toItem:_containerView - attribute:NSLayoutAttributeLeading - multiplier:1.0 - constant:ORKSurveyItemMargin] - ]]; - } -} - -- (void)addContainerViewBottomConstraint { - [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_containerView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:_detailLabel ? : _primaryLabel - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:LabelTopBottomMargin]]; -} - -- (void)setupConstraints { - if (!_primaryLabel && !_detailLabel) { - return; - } - - if (_containerConstraints) { - [NSLayoutConstraint deactivateConstraints:_containerConstraints]; - } - - _containerView.translatesAutoresizingMaskIntoConstraints = NO; - _containerConstraints = [[NSMutableArray alloc] init]; - [self addContainerViewToSelfConstraints]; - [self addPrimaryLabelToContainerViewConstraints]; - [self addDetailLabelConstraints]; - [self addCheckViewToContainerViewConstraints]; - [self addContainerViewBottomConstraint]; - [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:self - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:_containerView - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:self.intraCellSpacing]]; - - [NSLayoutConstraint activateConstraints:_containerConstraints]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - [self updateSelectedItem]; - [self setMaskLayers]; - [self setPrimaryLabelFont]; -} - -- (void)setUseCardView:(bool)useCardView { - _useCardView = useCardView; - _topBottomMargin = CardTopBottomMargin; - [self setBackgroundColor:[UIColor clearColor]]; - self.selectionStyle = UITableViewCellSelectionStyleNone; - [self setupConstraints]; -} - -- (void)tintColorDidChange { - [super tintColorDidChange]; - [self updateSelectedItem]; -} - -- (void)updateSelectedItem { - [self updateCheckView]; -} - -- (void)setImmediateNavigation:(BOOL)immediateNavigation { - _immediateNavigation = immediateNavigation; -} - -- (void)setCellSelected:(BOOL)cellSelected highlight:(BOOL)highlight -{ - _cellSelected = cellSelected; - - [self updateSelectedItem]; - - if (highlight) - { - _animationLayer = [CAShapeLayer layer]; - [_animationLayer setOpaque:NO]; - _animationLayer.frame = CGRectMake(_foreLayerBounds.origin.x, _foreLayerBounds.origin.y, _foreLayerBounds.size.width, _foreLayerBounds.size.height - 1.0); - _animationLayer.zPosition = 1.0f; - [_contentMaskLayer addSublayer:_animationLayer]; - - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"]; - - if (@available(iOS 13.0, *)) - { - if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) - { - animation.fromValue = (__bridge id _Nullable)(UIColor.systemGray5Color.CGColor); - } - else - { - animation.fromValue = (__bridge id _Nullable)(UIColor.systemGray3Color.CGColor); - } - } - else - { - animation.fromValue = (__bridge id _Nullable)([UIColor colorWithRed:0.282 green:0.282 blue:0.235 alpha:1.0].CGColor); - } - - animation.toValue = (__bridge id _Nullable)(_fillColor.CGColor); - animation.beginTime = 0.0; - animation.duration = 0.45; - animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; - animation.removedOnCompletion = YES; - animation.delegate = self; - - [_animationLayer addAnimation:animation forKey:@"backgroundColor"]; - - _animationLayer.backgroundColor = _fillColor.CGColor; - } -} - -- (void)setupPrimaryLabel { - if (!_primaryLabel) { - _primaryLabel = [ORKSelectionTitleLabel new]; - _primaryLabel.numberOfLines = 0; - if (@available(iOS 13.0, *)) { - _primaryLabel.textColor = [UIColor labelColor]; - } else { - _primaryLabel.textColor = [UIColor blackColor]; - } - [self.containerView addSubview:_primaryLabel]; - [self setPrimaryLabelFont]; - _primaryLabel.translatesAutoresizingMaskIntoConstraints = NO; - [self setupConstraints]; - } -} - -- (void)setupDetailLabel { - if (!_detailLabel) { - _detailLabel = [ORKSelectionSubTitleLabel new]; - _detailLabel.numberOfLines = 0; - _detailLabel.textColor = [UIColor ork_darkGrayColor]; - [self.containerView addSubview:_detailLabel]; - _detailLabel.translatesAutoresizingMaskIntoConstraints = NO; - [self setupConstraints]; - } -} - -- (void)setupCheckView { - if (!_checkView) { - _checkView = [[ORKCheckmarkView alloc] initWithDefaults]; - } - [_checkView setChecked:NO]; - [self.containerView addSubview:_checkView]; -} - -- (void)addCheckViewToContainerViewConstraints { - if (_checkView) { - _checkView.translatesAutoresizingMaskIntoConstraints = NO; - [_containerConstraints addObjectsFromArray:@[ - [NSLayoutConstraint constraintWithItem:_checkView - attribute:NSLayoutAttributeCenterY - relatedBy:NSLayoutRelationEqual - toItem:_containerView - attribute:NSLayoutAttributeCenterY - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_checkView - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:_containerView - attribute:NSLayoutAttributeTrailing - multiplier:1.0 - constant:-ORKSurveyItemMargin] - ]]; - } -} - -- (void)setPrimaryText:(NSString *)primaryText { - if (primaryText) { - [self setupPrimaryLabel]; - _primaryLabel.text = primaryText; - } -} - -- (void)setPrimaryAttributedText:(NSAttributedString *)primaryAttributedText { - if (primaryAttributedText) { - [self setupPrimaryLabel]; - _primaryLabel.attributedText = primaryAttributedText; - } -} - -- (void)setDetailText:(NSString *)detailText { - if (detailText) { - [self setupDetailLabel]; - _detailLabel.text = detailText; - } -} - -- (void)setDetailAttributedText:(NSAttributedString *)detailAttributedText { - if (detailAttributedText) { - [self setupDetailLabel]; - _detailLabel.attributedText = detailAttributedText; - } -} - -- (void)setPrimaryLabelFont { - if (!_primaryLabel.attributedText) { - UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; - [_primaryLabel setFont:[UIFont fontWithDescriptor:descriptor size:[[descriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]]; - } -} - -- (void)updateCheckView { - if (_checkView) { - _checkView.tintColor = self.tintColor; - [_checkView setChecked:_cellSelected]; - } -} - - -#pragma mark - Accessibility - -- (NSString *)accessibilityLabel { - return ORKAccessibilityStringForVariables(_primaryLabel.accessibilityLabel, _detailLabel.accessibilityLabel); -} - -- (UIAccessibilityTraits)accessibilityTraits { - return UIAccessibilityTraitButton | (self.isCellSelected ? UIAccessibilityTraitSelected : 0); -} - -- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { - [super setHighlighted:highlighted - animated:animated]; - - if (highlighted) { - if (@available(iOS 13.0, *)) { - [_foreLayer setFillColor:UIColor.systemGray5Color.CGColor]; - } else { - self.layer.backgroundColor = [UIColor colorWithRed:0.282 green:0.282 blue:0.235 alpha:1.0].CGColor; - } - } - else { - _foreLayer.fillColor = _fillColor.CGColor; - } -} - -#pragma mark - Animation Delegate - -- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { - [_animationLayer removeFromSuperlayer]; - _animationLayer = nil; - [self setMaskLayers]; -} - -@end - - -@implementation ORKChoiceOtherViewCell - -- (instancetype)initWithStyle:(UITableViewCellStyle)style - reuseIdentifier:(NSString *)reuseIdentifier { - self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - _textViewHidden = NO; - [self setupAnswerTextView]; - return self; -} - -- (void)setupAnswerTextView { - if (!_textView) { - _textView = [[ORKAnswerTextView alloc] init]; - _textView.delegate = self; - _textView.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - _textView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; - } - [self.containerView addSubview:_textView]; - [self updateTextView]; - } -} - -- (void)hideTextView:(BOOL)textViewHidden { - _textViewHidden = textViewHidden; - [self updateTextView]; - [self setupConstraints]; -} - -- (void)updateTextView { - [self.textView setHidden:_textViewHidden]; -} - -- (void)addOtherAnswerTextViewConstraints { - - NSLayoutConstraint *textViewHeightConstraint = [NSLayoutConstraint constraintWithItem:_textView - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:MAX(_textView.font.pointSize, TextViewHeight)]; - textViewHeightConstraint.priority = UILayoutPriorityDefaultLow; - - [self.containerConstraints addObjectsFromArray:@[ - [NSLayoutConstraint constraintWithItem:_textView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:self.detailLabel ? : self.primaryLabel - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:TextViewTopMargin], - [NSLayoutConstraint constraintWithItem:_textView - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem:self.checkView - attribute:NSLayoutAttributeLeading - multiplier:1.0 - constant:-LabelCheckViewPadding], - [NSLayoutConstraint constraintWithItem:_textView - attribute:NSLayoutAttributeLeading - relatedBy:NSLayoutRelationEqual - toItem:self.containerView - attribute:NSLayoutAttributeLeading - multiplier:1.0 - constant:ORKSurveyItemMargin], - textViewHeightConstraint, - [NSLayoutConstraint constraintWithItem:self.containerView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:_textView - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:LabelTopBottomMargin] - ]]; -} - -// Overriding ContainerView Bottom Constraints -- (void)addContainerViewBottomConstraint { - if (_textViewHidden) { - [super addContainerViewBottomConstraint]; - } - else { - [self addOtherAnswerTextViewConstraints]; - } -} - -- (void)setMaskLayers { - [super setMaskLayers]; - _textView.layer.borderWidth = 0.25; - [_textView.layer setBorderColor:[UIColor lightGrayColor].CGColor]; - _textView.layer.cornerRadius = 10.0; -} - -# pragma mark - UITextViewDelegate - -- (BOOL)textViewShouldBeginEditing:(UITextView *)textView { - if (self.delegate && [self.delegate respondsToSelector:@selector(textChoiceOtherCellDidBecomeFirstResponder:)]) { - [self.delegate textChoiceOtherCellDidBecomeFirstResponder:self]; - } - - return YES; -} - -- (void) textViewDidEndEditing:(UITextView *)textView { - if (self.delegate && [self.delegate respondsToSelector:@selector(textChoiceOtherCellDidResignFirstResponder:)]) { - [self.delegate textChoiceOtherCellDidResignFirstResponder:self]; - } -} - -@end - -#pragma mark - ORKChoiceViewPlatterCell - -@implementation ORKChoiceViewPlatterCell - -#pragma mark - ORKTextChoiceCell Overrides - -- (BOOL)shouldApplyMaskLayers { - return YES; -} - -- (UIRectCorner)roundedCorners { - return UIRectCornerAllCorners; -} - -- (CGFloat)intraCellSpacing { - return 10; -} - -- (nullable CAShapeLayer *)lineLayer { - return nil; -} - -@end diff --git a/ResearchKit/Common/ORKCollectionResult.h b/ResearchKit/Common/ORKCollectionResult.h index 1f5ea0d419..2cdb6aba5e 100644 --- a/ResearchKit/Common/ORKCollectionResult.h +++ b/ResearchKit/Common/ORKCollectionResult.h @@ -28,15 +28,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN @class ORKStepResult; /** - The `ORKCollectionResult` class represents a result that contains an array of - child results. + A result object that contains an array of child results. `ORKCollectionResult` is the superclass of `ORKTaskResult` and `ORKStepResult`. @@ -74,7 +76,7 @@ ORK_CLASS_AVAILABLE /** - `ORKTaskResultSource` is the protocol for `[ORKTaskViewController defaultResultSource]`. + A protocol for the task view controller's default data source. */ @protocol ORKTaskResultSource @@ -109,8 +111,7 @@ ORK_CLASS_AVAILABLE /** - An `ORKTaskResult` object is a collection result that contains all the step results - generated from one run of a task or ordered task (that is, `ORKTask` or `ORKOrderedTask`) in a task view controller. + A collection result that contains all the step results generated from one run of a task. A task result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize it for transmission to a server, @@ -164,8 +165,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKStepResult` class represents a collection result produced by a step view controller to - hold all child results produced by the step. + A collection result produced by a step view controller to hold all child results produced by the step. A step result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize it for transmission to a server, diff --git a/ResearchKit/Common/ORKCollectionResult.m b/ResearchKit/Common/ORKCollectionResult.m index 02df6ae972..fb207b8eaf 100644 --- a/ResearchKit/Common/ORKCollectionResult.m +++ b/ResearchKit/Common/ORKCollectionResult.m @@ -28,9 +28,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if TARGET_OS_WATCH -@import WatchKit; -#endif #import "ORKCollectionResult.h" @@ -244,7 +241,9 @@ - (instancetype)copyWithZone:(NSZone *)zone { } - (ORKStepResult *)stepResultForStepIdentifier:(NSString *)stepIdentifier { - return (ORKStepResult *)[self resultForIdentifier:stepIdentifier]; + ORKResult *genericResult = [self resultForIdentifier:stepIdentifier]; + ORKStepResult *stepResult = ORKDynamicCast(genericResult, ORKStepResult); + return stepResult; } @end @@ -264,11 +263,14 @@ - (instancetype)initWithStepIdentifier:(NSString *)stepIdentifier results:(NSArr } - (void)updateEnabledAssistiveTechnology { +#if TARGET_OS_IOS if (UIAccessibilityIsVoiceOverRunning()) { _enabledAssistiveTechnology = [UIAccessibilityNotificationVoiceOverIdentifier copy]; } else if (UIAccessibilityIsSwitchControlRunning()) { _enabledAssistiveTechnology = [UIAccessibilityNotificationSwitchControlIdentifier copy]; } +#endif + } - (void)encodeWithCoder:(NSCoder *)aCoder { diff --git a/ResearchKit/Common/ORKCollectionResult_Private.h b/ResearchKit/Common/ORKCollectionResult_Private.h index 2f5148cd2b..b35d1c2bc5 100644 --- a/ResearchKit/Common/ORKCollectionResult_Private.h +++ b/ResearchKit/Common/ORKCollectionResult_Private.h @@ -29,7 +29,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + + +#if TARGET_OS_IOS #import +#endif NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKCollector.h b/ResearchKit/Common/ORKCollector.h index 71f05933fb..3a52c9e594 100644 --- a/ResearchKit/Common/ORKCollector.h +++ b/ResearchKit/Common/ORKCollector.h @@ -30,9 +30,11 @@ #import -#import #import +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import +#endif NS_ASSUME_NONNULL_BEGIN @@ -80,11 +82,13 @@ ORK_CLASS_AVAILABLE /** - ORKHealthCollector collects HKSample. + An object that collects HKSample. It cannot be initiated directly. Use `addHealthCollectorWithSampleType:`to add one to a `ORKDataCollectionManager`. */ + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION ORK_CLASS_AVAILABLE @interface ORKHealthCollector : ORKCollector @@ -112,7 +116,7 @@ ORK_CLASS_AVAILABLE /** - ORKHealthCollector collects HKCorrelation. + An object that collects HKCorrelation. It cannot be initiated directly. Use `addHealthCorrelationCollectorWithCorrelationType:`to add one to a `ORKDataCollectionManager`. @@ -146,10 +150,10 @@ ORK_CLASS_AVAILABLE @property (copy, readonly) HKQueryAnchor *lastAnchor; @end - +#endif /** - ORKHealthCollector collects CMMotionActivity. + An object that collects CMMotionActivity. It cannot be initiated directly. Use `addMotionActivityCollectorWithStartDate:`to add one to a `ORKDataCollectionManager`. diff --git a/ResearchKit/Common/ORKCollector.m b/ResearchKit/Common/ORKCollector.m index d9256b92e3..cc018cd175 100644 --- a/ResearchKit/Common/ORKCollector.m +++ b/ResearchKit/Common/ORKCollector.m @@ -112,7 +112,7 @@ - (BOOL)isEqual:(id)object { @end - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @implementation ORKHealthCollector : ORKCollector - (instancetype)initWithSampleType:(HKSampleType*)sampleType unit:(HKUnit*)unit startDate:(NSDate*)startDate { @@ -288,7 +288,7 @@ - (BOOL)isEqual:(id)object { } @end - +#endif @implementation ORKMotionActivityCollector : ORKCollector diff --git a/ResearchKit/Common/ORKCollector_Internal.h b/ResearchKit/Common/ORKCollector_Internal.h index 40079369d6..960d87611d 100644 --- a/ResearchKit/Common/ORKCollector_Internal.h +++ b/ResearchKit/Common/ORKCollector_Internal.h @@ -43,7 +43,7 @@ @end - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @protocol ORKHealthCollectable - (HKSampleType *)sampleType; @@ -71,7 +71,7 @@ @property (copy) HKQueryAnchor *lastAnchor; @end - +#endif @interface ORKMotionActivityCollector() diff --git a/ResearchKit/Common/ORKCompletionStep.h b/ResearchKit/Common/ORKCompletionStep.h index 77d28681a6..48b7094a6b 100644 --- a/ResearchKit/Common/ORKCompletionStep.h +++ b/ResearchKit/Common/ORKCompletionStep.h @@ -29,18 +29,18 @@ */ -@import Foundation; +#import + +#if TARGET_OS_IOS #import -#import +#import +#endif NS_ASSUME_NONNULL_BEGIN - /** - The `ORKCompletionStep` class is a subclass of `ORKInstructionStep` which behaves like - an instruction step, but includes animated imagery that thanks the user - for participating in the task. + A subclass of the instruction step that includes animated imagery for task completion. */ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) @interface ORKCompletionStep : ORKInstructionStep @@ -51,7 +51,7 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) @interface ORKCompletionStep () -@property (nonatomic) ORKTaskViewControllerFinishReason reasonForCompletion; +@property (nonatomic) ORKTaskFinishReason reasonForCompletion; @end diff --git a/ResearchKit/Common/ORKCompletionStep.m b/ResearchKit/Common/ORKCompletionStep.m index 611f0d1ee1..f2732e6fb9 100644 --- a/ResearchKit/Common/ORKCompletionStep.m +++ b/ResearchKit/Common/ORKCompletionStep.m @@ -30,22 +30,15 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKCompletionStep.h" -#if TARGET_OS_IOS -#import "ORKCompletionStepViewController.h" -#endif #import "ORKHelpers_Internal.h" @implementation ORKCompletionStep #if TARGET_OS_IOS -+ (Class)stepViewControllerClass { - return [ORKCompletionStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { - _reasonForCompletion = ORKTaskViewControllerFinishReasonCompleted; + _reasonForCompletion = ORKTaskFinishReasonCompleted; } return self; @@ -82,7 +75,7 @@ - (BOOL)isEqual:(id)object { } - (BOOL)allowsBackNavigation { - return !(_reasonForCompletion == ORKTaskViewControllerFinishReasonDiscarded); + return !(_reasonForCompletion == ORKTaskFinishReasonDiscarded); } #endif @end diff --git a/ResearchKit/Common/ORKConditionStepConfiguration.h b/ResearchKit/Common/ORKConditionStepConfiguration.h new file mode 100644 index 0000000000..070244a901 --- /dev/null +++ b/ResearchKit/Common/ORKConditionStepConfiguration.h @@ -0,0 +1,74 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +#import + +@class ORKTaskResult; +@class ORKHealthCondition; +@class ORKFormItem; + +NS_ASSUME_NONNULL_BEGIN + +/** + The base object for configuring the displayed health conditions + for the family history step. + */ + +ORK_CLASS_AVAILABLE +@interface ORKConditionStepConfiguration : NSObject + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +/** + Creates a new conditions step configuration. + + This method is the primary designated initializer. + + @param stepIdentifier The identifier attached to the form step that displays the health conditions. + @param conditionsFormItemIdentifier The identifier attached to the form item used from the health conditions list. + @param conditions List of health conditions displayed to participants. + @param formItems List of form items that are presented below the health conditions text choice. This is optional. + */ +- (instancetype)initWithStepIdentifier:(NSString *)stepIdentifier + conditionsFormItemIdentifier:(NSString *)conditionsFormItemIdentifier + conditions:(NSArray *)conditions + formItems:(NSArray *)formItems NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, readonly, copy) NSString *stepIdentifier; +@property (nonatomic, readonly, copy) NSString *conditionsFormItemIdentifier; +@property (nonatomic, readonly, copy) NSArray *conditions; +@property (nonatomic, copy) NSArray *formItems; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKConditionStepConfiguration.m b/ResearchKit/Common/ORKConditionStepConfiguration.m new file mode 100644 index 0000000000..a79ff2a43f --- /dev/null +++ b/ResearchKit/Common/ORKConditionStepConfiguration.m @@ -0,0 +1,107 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKConditionStepConfiguration.h" + +#import "ORKCollectionResult.h" +#import "ORKFormStep.h" +#import "ORKHealthCondition.h" +#import "ORKHelpers_Internal.h" + + +@implementation ORKConditionStepConfiguration + +- (instancetype)initWithStepIdentifier:(NSString *)stepIdentifier + conditionsFormItemIdentifier:(NSString *)conditionsFormItemIdentifier + conditions:(NSArray *)conditions + formItems:(nonnull NSArray *)formItems { + self = [super init]; + + if (self) { + _stepIdentifier = [stepIdentifier copy]; + _conditionsFormItemIdentifier = [conditionsFormItemIdentifier copy]; + _conditions = [conditions copy]; + _formItems = [formItems copy]; + } + + return self; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + ORK_ENCODE_OBJ(aCoder, stepIdentifier); + ORK_ENCODE_OBJ(aCoder, conditionsFormItemIdentifier); + ORK_ENCODE_OBJ(aCoder, conditions); + ORK_ENCODE_OBJ(aCoder, formItems); +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self) { + ORK_DECODE_OBJ_CLASS(aDecoder, stepIdentifier, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, conditionsFormItemIdentifier, NSString); + ORK_DECODE_OBJ_ARRAY(aDecoder, conditions, ORKHealthCondition); + ORK_DECODE_OBJ_ARRAY(aDecoder, formItems, ORKFormItem); + } + return self; +} + +- (instancetype)copyWithZone:(nullable NSZone *)zone { + ORKConditionStepConfiguration *conditionStepConfiguration = [[[self class] alloc] init]; + conditionStepConfiguration->_stepIdentifier = [_stepIdentifier copy]; + conditionStepConfiguration->_conditionsFormItemIdentifier = [_conditionsFormItemIdentifier copy]; + conditionStepConfiguration->_conditions = [_conditions copy]; + conditionStepConfiguration->_formItems = [_formItems copy]; + + return conditionStepConfiguration; +} + +- (BOOL)isEqual:(id)object { + if ([self class] != [object class]) { + return NO; + } + + __typeof(self) castObject = object; + return (ORKEqualObjects(_stepIdentifier, castObject->_stepIdentifier) + && ORKEqualObjects(_conditionsFormItemIdentifier, castObject->_conditionsFormItemIdentifier) + && ORKEqualObjects(_conditions, castObject->_conditions) + && ORKEqualObjects(_formItems, castObject->_formItems)); +} + +- (NSUInteger)hash { + return super.hash ^ _stepIdentifier.hash ^ _conditionsFormItemIdentifier.hash ^ _conditions.hash ^ _formItems.hash; +} + +@end diff --git a/ResearchKit/Common/ORKCustomStep.h b/ResearchKit/Common/ORKCustomStep.h index 4b0010d401..d2096c3f5d 100644 --- a/ResearchKit/Common/ORKCustomStep.h +++ b/ResearchKit/Common/ORKCustomStep.h @@ -32,6 +32,10 @@ NS_ASSUME_NONNULL_BEGIN +/** + A step that appears with provided custom content. + */ + ORK_CLASS_AVAILABLE @interface ORKCustomStep : ORKStep diff --git a/ResearchKit/Common/ORKCustomStep.m b/ResearchKit/Common/ORKCustomStep.m index 787d9d0b7d..61e9190f07 100644 --- a/ResearchKit/Common/ORKCustomStep.m +++ b/ResearchKit/Common/ORKCustomStep.m @@ -80,8 +80,4 @@ - (instancetype)copyWithZone:(NSZone *)zone { return step; } -+ (Class)stepViewControllerClass { - return [ORKCustomStepViewController class]; -} - @end diff --git a/ResearchKit/Common/ORKCustomStepView_Internal.h b/ResearchKit/Common/ORKCustomStepView_Internal.h deleted file mode 100644 index c4f2237d3b..0000000000 --- a/ResearchKit/Common/ORKCustomStepView_Internal.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKActiveStepViewController; - -@interface ORKActiveStepCustomView : UIView - -@property (nonatomic, weak, nullable) ORKActiveStepViewController *activeStepViewController; - -- (void)resetStep:(ORKActiveStepViewController *)viewController; -- (void)startStep:(ORKActiveStepViewController *)viewController; -- (void)suspendStep:(ORKActiveStepViewController *)viewController; -- (void)resumeStep:(ORKActiveStepViewController *)viewController; -- (void)finishStep:(ORKActiveStepViewController *)viewController; - -- (void)updateDisplay:(ORKActiveStepViewController *)viewController; - -@end - -NS_ASSUME_NONNULL_END - diff --git a/ResearchKit/Common/ORKDataCollectionManager.h b/ResearchKit/Common/ORKDataCollectionManager.h index d1036f1d2f..f3bf5456ae 100644 --- a/ResearchKit/Common/ORKDataCollectionManager.h +++ b/ResearchKit/Common/ORKDataCollectionManager.h @@ -60,6 +60,7 @@ NS_ASSUME_NONNULL_BEGIN If NO is returned or this method is not implemented, the manager will stop the collection for the collector and repeat this same collection next time, until the data is accepted. */ +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (BOOL)healthCollector:(ORKHealthCollector *)collector didCollectSamples:(NSArray *)samples; /** @@ -73,7 +74,7 @@ NS_ASSUME_NONNULL_BEGIN until the data is accepted. */ - (BOOL)healthCorrelationCollector:(ORKHealthCorrelationCollector *)collector didCollectCorrelations:(NSArray *)correlations; - +#endif /** Method for delivering the collected motion activities. @@ -145,6 +146,7 @@ ORK_CLASS_AVAILABLE @return Initiated health collector. */ +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (ORKHealthCollector *)addHealthCollectorWithSampleType:(HKSampleType *)sampleType unit:(HKUnit *)unit startDate:(NSDate *)startDate @@ -166,7 +168,7 @@ ORK_CLASS_AVAILABLE units:(NSArray *)units startDate:(NSDate *)startDate error:(NSError * _Nullable *)error; - +#endif /** Add a collector for motion activity. @@ -197,13 +199,4 @@ ORK_CLASS_AVAILABLE @end -ORK_CLASS_AVAILABLE -@interface ORKDataCollectionState : NSObject - -@property(nonatomic, nullable, readwrite) NSString *archiveVersion; - -@property(nonatomic, nonnull, readwrite) NSArray *collectors; - -@end - NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKDataCollectionManager.m b/ResearchKit/Common/ORKDataCollectionManager.m index 22f59fe136..ef55751d63 100644 --- a/ResearchKit/Common/ORKDataCollectionManager.m +++ b/ResearchKit/Common/ORKDataCollectionManager.m @@ -35,18 +35,21 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import +#endif -// The file names for persisting the state of our collectors -static NSString *const ORKDataCollectionPersistenceFileNamev1 = @".dataCollection.ork.data"; // pre-secureCoding -static NSString *const ORKDataCollectionPersistenceFileNamev2 = @".dataCollection.ork.archive"; // current +static NSString *const ORKDataCollectionPersistenceFileName = @".dataCollection.ork.data"; @implementation ORKDataCollectionManager { dispatch_queue_t _queue; NSOperationQueue *_operationQueue; NSString * _Nonnull _managedDirectory; NSArray *_collectors; - HKHealthStore *_healthStore; CMMotionActivityManager *_activityManager; +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + HKHealthStore *_healthStore; +#endif NSMutableArray *_completionHandlers; } @@ -119,12 +122,14 @@ - (void)onWorkQueueAsync:(BOOL (^)(ORKDataCollectionManager *manager))block { }); } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (HKHealthStore *)healthStore { if (!_healthStore && [HKHealthStore isHealthDataAvailable]){ _healthStore = [[HKHealthStore alloc] init]; } return _healthStore; } +#endif - (CMMotionActivityManager *)activityManager { if (!_activityManager && [CMMotionActivityManager isActivityAvailable]) { @@ -135,45 +140,31 @@ - (CMMotionActivityManager *)activityManager { - (NSArray *)collectors { if (_collectors == nil) { - NSError *error; NSData *data = [NSData dataWithContentsOfFile:[self persistFilePath]]; - ORKDataCollectionState *state = [NSKeyedUnarchiver unarchivedObjectOfClass:ORKDataCollectionState.self fromData:data error:&error]; - - if (state == nil) { - NSDictionary *userInfo = @{NSUnderlyingErrorKey:error}; - @throw [NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat:@"Failed to read from path %@", [self persistFilePath]] userInfo:userInfo]; - } else { - _collectors = state.collectors ? : @[]; + NSError* error = nil; + _collectors = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSArray class] fromData:data error:&error]; + if (_collectors == nil || error != nil) { + @throw [NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat:@"Failed to read from path %@", [self persistFilePath]] userInfo:nil]; } } return _collectors; } - (NSString * _Nonnull)persistFilePath { - return [_managedDirectory stringByAppendingPathComponent:ORKDataCollectionPersistenceFileNamev2]; + return [_managedDirectory stringByAppendingPathComponent:ORKDataCollectionPersistenceFileName]; } - (void)persistCollectors { NSArray *collectors = self.collectors; - - NSError *error = nil; - ORKDataCollectionState* state = [[ORKDataCollectionState alloc] init]; - state.collectors = collectors; - state.archiveVersion = (NSString *)[[NSBundle bundleForClass:ORKDataCollectionManager.self] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; - NSData *data = [NSKeyedArchiver archivedDataWithRootObject:state requiringSecureCoding:YES error:&error]; - - if (data == nil) { - NSDictionary *userInfo = @{NSUnderlyingErrorKey:error}; - @throw [NSException exceptionWithName:NSGenericException reason:@"Failed to archive collectors" userInfo:userInfo]; + NSError *error; + NSData *data = [NSKeyedArchiver archivedDataWithRootObject:collectors requiringSecureCoding:YES error:&error]; + if (data != nil) { + [data writeToFile:[self persistFilePath] options:NSDataWritingAtomic|NSDataWritingFileProtectionComplete error:&error]; } - error = nil; - BOOL success = [data writeToFile:[self persistFilePath] options:NSDataWritingAtomic|NSDataWritingFileProtectionComplete error:&error]; - - if (success != YES) { - NSDictionary *userInfo = @{NSUnderlyingErrorKey:error}; - @throw [NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat:@"Failed to write to path %@", [self persistFilePath]] userInfo:userInfo]; + if (error) { + @throw [NSException exceptionWithName:NSGenericException reason: [NSString stringWithFormat:@"Failed to write to path %@", [self persistFilePath]] userInfo:nil]; } } @@ -183,6 +174,7 @@ - (void)addCollector:(ORKCollector *)collector { _collectors = [collectors copy]; } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (ORKHealthCollector *)addHealthCollectorWithSampleType:(HKSampleType*)sampleType unit:(HKUnit *)unit startDate:(NSDate *)startDate error:(NSError**)error { if (!sampleType) { @@ -235,6 +227,7 @@ - (ORKHealthCorrelationCollector *)addHealthCorrelationCollectorWithCorrelationT return healthCorrelationCollector; } +#endif - (ORKMotionActivityCollector *)addMotionActivityCollectorWithStartDate:(NSDate *)startDate error:(NSError* __autoreleasing *)error { @@ -335,13 +328,16 @@ - (void)startCollection { if (_delegate && [_delegate respondsToSelector:@selector(dataCollectionManagerDidCompleteCollection:)]) { [_delegate dataCollectionManagerDidCompleteCollection:self]; } - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION for (HKObserverQueryCompletionHandler handler in _completionHandlers) { handler(); } [_completionHandlers removeAllObjects]; return NO; +#else + return NO; +#endif }]; }]; @@ -356,39 +352,6 @@ - (void)startCollection { // No need to persist collectors return NO; }]; - -} - -@end - -@implementation ORKDataCollectionState - -/// Sentinel value for archiveVersion to indicate missing version info -+ (NSString *)absentVersionInfoSentinelValue { - return @"0.0.0"; -} - -+ (BOOL)supportsSecureCoding { - return YES; -} - -- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder { - if (aDecoder.allowsKeyedCoding != YES) { - return nil; - } - - self = [super init]; - - - ORK_DECODE_OBJ_ARRAY(aDecoder, collectors, ORKCollector); - ORK_DECODE_OBJ_CLASS(aDecoder, archiveVersion, NSString); - - return self; -} - -- (void)encodeWithCoder:(NSCoder *)aCoder { - ORK_ENCODE_OBJ(aCoder, archiveVersion ? : [self.class absentVersionInfoSentinelValue]); - ORK_ENCODE_OBJ(aCoder, collectors); } @end diff --git a/ResearchKit/Common/ORKDataCollectionManager_Internal.h b/ResearchKit/Common/ORKDataCollectionManager_Internal.h index 1465471e92..8532ee59e0 100644 --- a/ResearchKit/Common/ORKDataCollectionManager_Internal.h +++ b/ResearchKit/Common/ORKDataCollectionManager_Internal.h @@ -35,7 +35,9 @@ @interface ORKDataCollectionManager () +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @property (nonatomic, strong, readonly) HKHealthStore *healthStore; +#endif @property (nonatomic, strong, readonly) CMMotionActivityManager *activityManager; diff --git a/ResearchKit/ActiveTasks/ORKDataLogger.h b/ResearchKit/Common/ORKDataLogger.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKDataLogger.h rename to ResearchKit/Common/ORKDataLogger.h index 09d4992f90..9dc21f88bc 100644 --- a/ResearchKit/ActiveTasks/ORKDataLogger.h +++ b/ResearchKit/Common/ORKDataLogger.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/ActiveTasks/ORKDataLogger.m b/ResearchKit/Common/ORKDataLogger.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKDataLogger.m rename to ResearchKit/Common/ORKDataLogger.m index 3b02c5a319..558554985c 100644 --- a/ResearchKit/ActiveTasks/ORKDataLogger.m +++ b/ResearchKit/Common/ORKDataLogger.m @@ -32,9 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKDataLogger.h" #import "ORKHelpers_Internal.h" -#import "CMMotionActivity+ORKJSONDictionary.h" -#import "HKSample+ORKJSONDictionary.h" - #include diff --git a/ResearchKit/Common/ORKDefines.h b/ResearchKit/Common/ORKDefines.h index 85c9377fcf..ee242f71e9 100644 --- a/ResearchKit/Common/ORKDefines.h +++ b/ResearchKit/Common/ORKDefines.h @@ -39,3 +39,6 @@ #define ORK_AVAILABLE_DECL #define ORK_IOS_10_WATCHOS_3_AVAILABLE (NSClassFromString(@"HKWorkoutConfiguration") != nil) + +#define ORK_TO_BE_DEPRECATED(message) \ +__deprecated_msg(message) diff --git a/ResearchKit/Common/ORKDevice.h b/ResearchKit/Common/ORKDevice.h index 70198e55ba..a54484461d 100644 --- a/ResearchKit/Common/ORKDevice.h +++ b/ResearchKit/Common/ORKDevice.h @@ -29,7 +29,10 @@ */ #import +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKDevice.m b/ResearchKit/Common/ORKDevice.m index 84e0eb9406..88ebc28a87 100644 --- a/ResearchKit/Common/ORKDevice.m +++ b/ResearchKit/Common/ORKDevice.m @@ -32,7 +32,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKDevice.h" #import "ORKHelpers_Internal.h" +#if TARGET_OS_IOS #import +#endif + + #import #import #import @@ -124,8 +128,11 @@ - (void)_init { self->_product = [self _product]; self->_osBuild = [self _osBuild]; NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; +#if TARGET_OS_IOS self->_platform = [[UIDevice currentDevice] systemName]; self->_osVersion = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)version.majorVersion, (long)version.minorVersion, (long)version.patchVersion]; +#endif + } - (instancetype)initWithProduct:(NSString *)product diff --git a/ResearchKit/Common/ORKDevice_Private.h b/ResearchKit/Common/ORKDevice_Private.h index 6c5f87e347..b7a7134c17 100644 --- a/ResearchKit/Common/ORKDevice_Private.h +++ b/ResearchKit/Common/ORKDevice_Private.h @@ -28,7 +28,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKEarlyTerminationConfiguration.h b/ResearchKit/Common/ORKEarlyTerminationConfiguration.h index caa9ab01b2..a55748bb79 100644 --- a/ResearchKit/Common/ORKEarlyTerminationConfiguration.h +++ b/ResearchKit/Common/ORKEarlyTerminationConfiguration.h @@ -29,12 +29,20 @@ */ #import + +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN @class ORKStep; +/** + A configuration that navigates to a + specific step to end the task early. + */ ORK_CLASS_AVAILABLE @interface ORKEarlyTerminationConfiguration : NSObject diff --git a/ResearchKit/Common/ORKErrors.h b/ResearchKit/Common/ORKErrors.h index 95e0930d86..3244068f00 100644 --- a/ResearchKit/Common/ORKErrors.h +++ b/ResearchKit/Common/ORKErrors.h @@ -29,9 +29,13 @@ */ -@import Foundation; +#import +#if TARGET_OS_IOS #import +#endif + + NS_ASSUME_NONNULL_BEGIN @@ -41,6 +45,9 @@ ORK_EXTERN NSString *const ORKErrorDomain ORK_AVAILABLE_DECL; /// The exception thrown when an invalid argument is passed to a method or function. ORK_EXTERN NSString *const ORKInvalidArgumentException ORK_AVAILABLE_DECL; +/// Standard way to embed NSExceptions from underlying calls +ORK_EXTERN NSString *const ORKUnderlyingExceptionKey ORK_AVAILABLE_DECL; + /// `ORKErrorCode` codes are used for errors in the domain `ORKErrorDomain`. typedef NS_ENUM(NSInteger, ORKErrorCode) { /// No matching object was found. diff --git a/ResearchKit/Common/ORKErrors.m b/ResearchKit/Common/ORKErrors.m index 7572b28e06..27a2c0fd18 100644 --- a/ResearchKit/Common/ORKErrors.m +++ b/ResearchKit/Common/ORKErrors.m @@ -34,3 +34,4 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE NSString *const ORKErrorDomain = @"ORKErrorDomain"; NSString *const ORKInvalidArgumentException = @"ORKInvalidArgumentException"; +NSString *const ORKUnderlyingExceptionKey = @"ORKUnderlyingExceptionKey"; diff --git a/ResearchKit/Common/ORKFamilyHistoryResult.h b/ResearchKit/Common/ORKFamilyHistoryResult.h new file mode 100644 index 0000000000..d5bcdc1760 --- /dev/null +++ b/ResearchKit/Common/ORKFamilyHistoryResult.h @@ -0,0 +1,49 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +@class ORKRelatedPerson; + +NS_ASSUME_NONNULL_BEGIN + +/** + A result object produced by the family history step. + */ + +ORK_CLASS_AVAILABLE +@interface ORKFamilyHistoryResult : ORKResult + +@property (nonatomic, nullable, copy) NSArray *relatedPersons; +@property (nonatomic, nullable, copy) NSArray *displayedConditions; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKFamilyHistoryResult.m b/ResearchKit/Common/ORKFamilyHistoryResult.m new file mode 100644 index 0000000000..a08e8e4566 --- /dev/null +++ b/ResearchKit/Common/ORKFamilyHistoryResult.m @@ -0,0 +1,81 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKFamilyHistoryResult.h" + +#import "ORKHelpers_Internal.h" +#import "ORKRelatedPerson.h" +#import "ORKResult_Private.h" + + +@implementation ORKFamilyHistoryResult + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [super encodeWithCoder:aCoder]; + ORK_ENCODE_OBJ(aCoder, relatedPersons); + ORK_ENCODE_OBJ(aCoder, displayedConditions); +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + ORK_DECODE_OBJ_ARRAY(aDecoder, relatedPersons, ORKRelatedPerson); + ORK_DECODE_OBJ_ARRAY(aDecoder, displayedConditions, NSString); + } + return self; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (BOOL)isEqual:(id)object { + BOOL isParentSame = [super isEqual:object]; + + __typeof(self) castObject = object; + return (isParentSame && + ORKEqualObjects(self.relatedPersons, castObject.relatedPersons) && + ORKEqualObjects(self.displayedConditions, castObject.displayedConditions)); +} + +- (instancetype)copyWithZone:(NSZone *)zone { + ORKFamilyHistoryResult *result = [super copyWithZone:zone]; + + result->_relatedPersons = ORKArrayCopyObjects(_relatedPersons); + result->_displayedConditions = [_displayedConditions copy]; + + return result; +} + +- (NSUInteger)hash { + return super.hash ^ self.relatedPersons.hash ^ self.displayedConditions.hash; +} + +@end diff --git a/ResearchKit/Common/ORKFamilyHistoryStep.h b/ResearchKit/Common/ORKFamilyHistoryStep.h new file mode 100644 index 0000000000..c57a5b2e53 --- /dev/null +++ b/ResearchKit/Common/ORKFamilyHistoryStep.h @@ -0,0 +1,53 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +#import + +@class ORKConditionStepConfiguration; +@class ORKRelativeGroup; + +NS_ASSUME_NONNULL_BEGIN + +/** + A concrete subclass that will provide a participant with a + family history survey. + */ + +ORK_CLASS_AVAILABLE +@interface ORKFamilyHistoryStep : ORKStep + +@property (nonatomic, copy) ORKConditionStepConfiguration *conditionStepConfiguration; +@property (nonatomic, copy) NSArray *relativeGroups; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKFamilyHistoryStep.m b/ResearchKit/Common/ORKFamilyHistoryStep.m new file mode 100644 index 0000000000..685a87758c --- /dev/null +++ b/ResearchKit/Common/ORKFamilyHistoryStep.m @@ -0,0 +1,115 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKFamilyHistoryStep.h" + +#import "ORKAnswerFormat_Internal.h" +#import "ORKCollectionResult.h" +#import "ORKConditionStepConfiguration.h" +#import "ORKFormStep.h" +#import "ORKHelpers_Internal.h" +#import "ORKRelativeGroup.h" + + +@implementation ORKFamilyHistoryStep + +- (instancetype)initWithIdentifier:(NSString *)identifier { + self = [super initWithIdentifier:identifier]; + + return self; +} + +- (void)validateParameters { + [super validateParameters]; + + // validate that atleast one condition has been provided + if (self.conditionStepConfiguration.conditions.count == 0) { + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason:@"At least one ORKHealthCondition must be added to the ORKConditionStepConfiguration object" + userInfo:nil]; + } + + // validate that atleast one relative group has been provided + if (self.relativeGroups.count == 0) { + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason:@"At least one ORKRelativeGroup must be provided" + userInfo:nil]; + } + + // validate that the identifiers for each relative group is unique + NSMutableSet *identifiers = [NSMutableSet new]; + for (ORKRelativeGroup *relativeGroup in self.relativeGroups) { + if ([identifiers containsObject:relativeGroup.identifier]) { + @throw [NSException exceptionWithName:NSInvalidArgumentException + reason:@"Each ORKRelativeGroup must have a unique identifier" + userInfo:nil]; + } else { + [identifiers addObject:relativeGroup.identifier]; + } + } + +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [super encodeWithCoder:aCoder]; + ORK_ENCODE_OBJ(aCoder, conditionStepConfiguration); + ORK_ENCODE_OBJ(aCoder, relativeGroups); +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + ORK_DECODE_OBJ_CLASS(aDecoder, conditionStepConfiguration, ORKConditionStepConfiguration); + ORK_DECODE_OBJ_ARRAY(aDecoder, relativeGroups, ORKRelativeGroup); + } + return self; +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone { + ORKFamilyHistoryStep *step = [super copyWithZone:zone]; + step->_conditionStepConfiguration = [_conditionStepConfiguration copy]; + step->_relativeGroups = [_relativeGroups copy]; + + return step; +} + +- (BOOL)isEqual:(id)object { + BOOL isParentSame = [super isEqual:object]; + + __typeof(self) castObject = object; + return (isParentSame && ORKEqualObjects(_conditionStepConfiguration, castObject->_conditionStepConfiguration) + && ORKEqualObjects(_relativeGroups, castObject->_relativeGroups)); +} + +@end diff --git a/ResearchKit/ActiveTasks/ORKFileResult.h b/ResearchKit/Common/ORKFileResult.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKFileResult.h rename to ResearchKit/Common/ORKFileResult.h index 62653eded0..e861769900 100644 --- a/ResearchKit/ActiveTasks/ORKFileResult.h +++ b/ResearchKit/Common/ORKFileResult.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /** - The `ORKFileResult` class is a result that references the location of a file produced + A result object that references the location of a file produced during a task. A file result is typically generated by the framework as the task proceeds. When the task diff --git a/ResearchKit/ActiveTasks/ORKFileResult.m b/ResearchKit/Common/ORKFileResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKFileResult.m rename to ResearchKit/Common/ORKFileResult.m diff --git a/ResearchKit/Common/ORKFormItemVisibilityRule.h b/ResearchKit/Common/ORKFormItemVisibilityRule.h new file mode 100644 index 0000000000..9fbb9f84c3 --- /dev/null +++ b/ResearchKit/Common/ORKFormItemVisibilityRule.h @@ -0,0 +1,58 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import + +@class ORKTaskResult; + +NS_ASSUME_NONNULL_BEGIN + +/** + An abstract base class for concrete formItem visibility rules. + + FormItem visibility rules are meant to be assigned to an `ORKFormItem` object. The visibility rule's + `formItemVisibilityForTaskResult:` method is invoked to determine whether a formItem should be + visible. `ORKTaskViewController` also uses the result of this visibility method to elide results from its `results`. + + Subclasses must implement the `formItemVisibilityForTaskResult:` method, which returns + YES to allow the parent formItem to be visible in the form UI, and returns NO otherwise. formItems that are not visible + don't have results in the enclosing step or task results either. + + One concrete subclass is included: `ORKPredicateFormItemVisibilityRule` + */ +ORK_CLASS_AVAILABLE +@interface ORKFormItemVisibilityRule: NSObject + +- (BOOL)formItemVisibilityForTaskResult:(nullable ORKTaskResult *)taskResult; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKFormItemVisibilityRule.m b/ResearchKit/Common/ORKFormItemVisibilityRule.m new file mode 100644 index 0000000000..b28d07992d --- /dev/null +++ b/ResearchKit/Common/ORKFormItemVisibilityRule.m @@ -0,0 +1,76 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKFormItemVisibilityRule.h" + +#import + +@implementation ORKFormItemVisibilityRule + +- (instancetype)init { + if ([self isMemberOfClass:[ORKFormItemVisibilityRule class]]) { + ORKThrowMethodUnavailableException(); + } + return [super init]; +} + +- (BOOL)formItemVisibilityForTaskResult:(nullable ORKTaskResult *)taskResult { + @throw [NSException exceptionWithName:NSGenericException reason:@"You should override this method in a subclass" userInfo:nil]; +} + +#pragma mark NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + return [super init]; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + // intentionally left empty +} + +#pragma mark NSCopying + +- (instancetype)copyWithZone:(NSZone *)zone { + __typeof(self) rule = [[[self class] allocWithZone:zone] init]; + return rule; +} + +- (BOOL)isEqual:(id)object { + if ([self class] != [object class]) { + return NO; + } + return YES; +} + +@end diff --git a/ResearchKit/Common/ORKFormStep.h b/ResearchKit/Common/ORKFormStep.h index 6e3c264626..f564b25ad8 100644 --- a/ResearchKit/Common/ORKFormStep.h +++ b/ResearchKit/Common/ORKFormStep.h @@ -29,10 +29,18 @@ */ -@import Foundation; +#import + +#if TARGET_OS_IOS #import #import +#endif + +/** + Values that determine the style + of form cells. + */ typedef NS_ENUM(NSInteger, ORKCardViewStyle) { ORKCardViewStyleDefault, @@ -44,10 +52,9 @@ NS_ASSUME_NONNULL_BEGIN @class ORKAnswerFormat; @class ORKFormItem; @class ORKLearnMoreItem; - +@class ORKFormItemVisibilityRule; /** - The `ORKFormStep` class is a concrete subclass of `ORKStep`, used for presenting multiple questions - on a single scrollable page. + A step used for presenting multiple questions on a single scrollable page. To use `ORKFormStep`, instantiate the object, fill in its properties, and include it in a task. Next, create a task view controller for the task and present it. @@ -104,6 +111,14 @@ ORK_CLASS_AVAILABLE @property (nonatomic) ORKCardViewStyle cardViewStyle; +/** + A boolean to determine if the form will auto scroll when a + answer is selected. + + The default value is YES. + */ +@property (nonatomic) BOOL autoScrollEnabled; + @end @@ -161,6 +176,7 @@ ORK_CLASS_AVAILABLE @param learnMoreItem The `ORKLearnMoreItem` to be presented when button is pressed. @param showsProgress A Boolean that determines if the formItem will display a progress indicator @param answerFormat The answer format for the form item. + @param tagText The tag text to be presented in the card header view. @param optional A Boolean that determines whether the item is optional @return An initialized form item. @@ -250,6 +266,18 @@ ORK_CLASS_AVAILABLE */ @property (nonatomic, copy, readonly, nullable) ORKAnswerFormat *answerFormat; + +/** + An ORKFormItemVisibilityRule on the current formItem and determines if the formItem should show based on the current task result + + The rule will apply its predicates based on the results specified, and determine if the form item is visible + + The formItem visibility rule to be used when determining if the item should display. + + A copy to the rule is kept by the formItem. + */ +@property (nullable, copy, readwrite) ORKFormItemVisibilityRule *visibilityRule; + /** Returns an form item that can be used for confirming a text entry. diff --git a/ResearchKit/Common/ORKFormStep.m b/ResearchKit/Common/ORKFormStep.m index 5f5a4498c7..1a0a0bf4e4 100644 --- a/ResearchKit/Common/ORKFormStep.m +++ b/ResearchKit/Common/ORKFormStep.m @@ -31,7 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKFormStep.h" -#import "ORKFormStepViewController.h" #import "ORKBodyItem.h" #import "ORKLearnMoreItem.h" @@ -40,14 +39,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" - +#import "ORKFormItemVisibilityRule.h" @implementation ORKFormStep -+ (Class)stepViewControllerClass { - return [ORKFormStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier title:(NSString *)title text:(NSString *)text { @@ -58,6 +53,7 @@ - (instancetype)initWithIdentifier:(NSString *)identifier self.optional = YES; self.useSurveyMode = YES; self.useCardView = YES; + self.autoScrollEnabled = YES; self.cardViewStyle = ORKCardViewStyleDefault; } return self; @@ -69,6 +65,7 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { self.optional = YES; self.useSurveyMode = YES; self.useCardView = YES; + self.autoScrollEnabled = YES; self.cardViewStyle = ORKCardViewStyleDefault; } return self; @@ -98,6 +95,7 @@ - (instancetype)copyWithZone:(NSZone *)zone { ORKFormStep *step = [super copyWithZone:zone]; step.formItems = ORKArrayCopyObjects(_formItems); step.cardViewStyle = self.cardViewStyle; + step.autoScrollEnabled = self.autoScrollEnabled; return step; } @@ -107,7 +105,8 @@ - (BOOL)isEqual:(id)object { __typeof(self) castObject = object; return (isParentSame && (ORKEqualObjects(self.formItems, castObject.formItems)) && - self.cardViewStyle == castObject.cardViewStyle); + self.cardViewStyle == castObject.cardViewStyle && + self.autoScrollEnabled == castObject.autoScrollEnabled); } - (NSUInteger)hash { @@ -150,6 +149,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { if (self) { ORK_DECODE_OBJ_ARRAY(aDecoder, formItems, ORKFormItem); ORK_DECODE_BOOL(aDecoder, useCardView); + ORK_DECODE_BOOL(aDecoder, autoScrollEnabled); ORK_DECODE_OBJ_CLASS(aDecoder, footerText, NSString); ORK_DECODE_ENUM(aDecoder, cardViewStyle); } @@ -160,6 +160,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { [super encodeWithCoder:aCoder]; ORK_ENCODE_OBJ(aCoder, formItems); ORK_ENCODE_BOOL(aCoder, useCardView); + ORK_ENCODE_BOOL(aCoder, autoScrollEnabled); ORK_ENCODE_OBJ(aCoder, footerText); ORK_ENCODE_ENUM(aCoder, cardViewStyle); } @@ -181,6 +182,7 @@ - (void)setFormItems:(NSArray *)formItems { } } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (NSSet *)requestedHealthKitTypesForReading { NSMutableSet *healthTypes = [NSMutableSet set]; @@ -194,6 +196,7 @@ - (void)setFormItems:(NSArray *)formItems { return healthTypes.count ? healthTypes : nil; } +#endif @end @@ -226,6 +229,7 @@ - (instancetype)initWithSectionTitle:(NSString *)sectionTitle { self = [super init]; if (self) { _text = [sectionTitle copy]; + _identifier = [[NSUUID UUID] UUIDString]; } return self; } @@ -250,6 +254,7 @@ - (instancetype)initWithSectionTitle:(nullable NSString *)sectionTitle detailTex self = [super init]; if (self) { _text = [sectionTitle copy]; + _identifier = [[NSUUID UUID] UUIDString]; _detailText = [text copy]; _learnMoreItem = [learnMoreItem copy]; _showsProgress = showsProgress; @@ -289,6 +294,7 @@ - (instancetype)copyWithZone:(NSZone *)zone { item->_learnMoreItem = [_learnMoreItem copy]; item->_showsProgress = _showsProgress; item->_tagText = [_tagText copy]; + item->_visibilityRule = [_visibilityRule copy]; return item; } @@ -305,6 +311,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { ORK_DECODE_OBJ_CLASS(aDecoder, answerFormat, ORKAnswerFormat); ORK_DECODE_OBJ_CLASS(aDecoder, step, ORKFormStep); ORK_DECODE_OBJ_CLASS(aDecoder, tagText, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, visibilityRule, ORKFormItemVisibilityRule); } return self; } @@ -320,7 +327,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { ORK_ENCODE_OBJ(aCoder, answerFormat); ORK_ENCODE_OBJ(aCoder, step); ORK_ENCODE_OBJ(aCoder, tagText); - + ORK_ENCODE_OBJ(aCoder, visibilityRule); } - (BOOL)isEqual:(id)object { @@ -338,12 +345,13 @@ - (BOOL)isEqual:(id)object { && self.showsProgress == castObject.showsProgress && ORKEqualObjects(self.placeholder, castObject.placeholder) && ORKEqualObjects(self.tagText, castObject.tagText) - && ORKEqualObjects(self.answerFormat, castObject.answerFormat)); + && ORKEqualObjects(self.answerFormat, castObject.answerFormat) + && ORKEqualObjects(self.visibilityRule, castObject.visibilityRule)); } - (NSUInteger)hash { // Ignore the step reference - it's not part of the content of this item - return _identifier.hash ^ _text.hash ^ _placeholder.hash ^ _answerFormat.hash ^ (_optional ? 0xf : 0x0) ^ _detailText.hash ^ _learnMoreItem.hash ^ (_showsProgress ? 0xf : 0x0) ^ _tagText.hash; + return _identifier.hash ^ _text.hash ^ _placeholder.hash ^ _answerFormat.hash ^ (_optional ? 0xf : 0x0) ^ _detailText.hash ^ _learnMoreItem.hash ^ (_showsProgress ? 0xf : 0x0) ^ _tagText.hash ^ _visibilityRule.hash; } - (ORKAnswerFormat *)impliedAnswerFormat { diff --git a/ResearchKit/Common/ORKFormStepViewController.m b/ResearchKit/Common/ORKFormStepViewController.m deleted file mode 100644 index 8dc268cbe2..0000000000 --- a/ResearchKit/Common/ORKFormStepViewController.m +++ /dev/null @@ -1,1585 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKFormStepViewController.h" - -#import "ORKCaption1Label.h" -#import "ORKChoiceViewCell_Internal.h" -#import "ORKFormItemCell.h" -#import "ORKFormSectionTitleLabel.h" -#import "ORKStepHeaderView_Internal.h" -#import "ORKTableContainerView.h" -#import "ORKStepContentView.h" -#import "ORKBodyItem.h" -#import "ORKLearnMoreView.h" - -#import "ORKSurveyCardHeaderView.h" -#import "ORKTextChoiceCellGroup.h" -#import "ORKLearnMoreStepViewController.h" -#import "ORKBodyItem.h" - -#import "ORKNavigationContainerView_Internal.h" -#import "ORKStepViewController_Internal.h" -#import "ORKTaskViewController_Internal.h" - -#import "ORKAnswerFormat_Internal.h" -#import "ORKCollectionResult_Private.h" -#import "ORKQuestionResult_Private.h" -#import "ORKFormItem_Internal.h" -#import "ORKFormStep_Internal.h" -#import "ORKResult_Private.h" -#import "ORKStep_Private.h" - -#import "ORKSESSelectionView.h" -#import "ORKHelpers_Internal.h" -#import "ORKSkin.h" - -static const CGFloat TableViewYOffsetStandard = 30.0; -static const NSTimeInterval DelayBeforeAutoScroll = 0.25; - -@interface ORKTableCellItem : NSObject - -- (instancetype)initWithFormItem:(ORKFormItem *)formItem; -- (instancetype)initWithFormItem:(ORKFormItem *)formItem choiceIndex:(NSUInteger)index; - -@property (nonatomic, copy) ORKFormItem *formItem; - -@property (nonatomic, copy) ORKAnswerFormat *answerFormat; - -@property (nonatomic, readonly) CGFloat labelWidth; - -// For choice types only -@property (nonatomic, copy, readonly) ORKTextChoice *choice; - -@end - - -@implementation ORKTableCellItem - -- (instancetype)initWithFormItem:(ORKFormItem *)formItem { - self = [super init]; - if (self) { - self.formItem = formItem; - _answerFormat = [[formItem impliedAnswerFormat] copy]; - } - return self; -} - -- (instancetype)initWithFormItem:(ORKFormItem *)formItem choiceIndex:(NSUInteger)index { - self = [super init]; - if (self) { - self.formItem = formItem; - _answerFormat = [[formItem impliedAnswerFormat] copy]; - - if ([self textChoiceAnswerFormat] != nil) { - _choice = [self.textChoiceAnswerFormat.textChoices[index] copy]; - } - } - return self; -} - -- (ORKTextChoiceAnswerFormat *)textChoiceAnswerFormat { - if ([self.answerFormat isKindOfClass:[ORKTextChoiceAnswerFormat class]]) { - return (ORKTextChoiceAnswerFormat *)self.answerFormat; - } - return nil; -} - -- (CGFloat)labelWidth { - static ORKCaption1Label *sharedLabel; - - if (sharedLabel == nil) { - sharedLabel = [ORKCaption1Label new]; - } - - sharedLabel.text = _formItem.text; - - return [sharedLabel textRectForBounds:CGRectInfinite limitedToNumberOfLines:1].size.width; -} - -@end - - -@interface ORKTableSection : NSObject - -- (instancetype)initWithSectionIndex:(NSUInteger)index; - -@property (nonatomic, assign, readonly) NSUInteger index; - -@property (nonatomic, copy) NSString *title; - -@property (nonatomic, copy, nullable) NSString *detailText; - -@property (nonatomic) BOOL showsProgress; - -@property (nonatomic, nullable) ORKLearnMoreItem *learnMoreItem; - -@property (nonatomic, copy, nullable) NSString *tagText; - -// ORKTableCellItem -@property (nonatomic, copy, readonly) NSArray *items; - -@property (nonatomic, readonly) BOOL hasChoiceRows; - -@property (nonatomic, strong) ORKTextChoiceCellGroup *textChoiceCellGroup; - -- (void)addFormItem:(ORKFormItem *)item; - -- (BOOL)containsFormItem:(ORKFormItem *)formItem; - -@property (nonatomic, readonly) CGFloat maxLabelWidth; - -@end - - -@implementation ORKTableSection - -- (instancetype)initWithSectionIndex:(NSUInteger)index { - self = [super init]; - if (self) { - _items = [NSMutableArray new]; - self.title = nil; - _index = index; - } - return self; -} - -- (void)setTitle:(NSString *)title { - _title = title; -} - -- (void)addFormItem:(ORKFormItem *)item { - if ([[item impliedAnswerFormat] isKindOfClass:[ORKTextChoiceAnswerFormat class]]) { - _hasChoiceRows = YES; - ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = (ORKTextChoiceAnswerFormat *)[item impliedAnswerFormat]; - - _textChoiceCellGroup = [[ORKTextChoiceCellGroup alloc] initWithTextChoiceAnswerFormat:textChoiceAnswerFormat - answer:nil - beginningIndexPath:[NSIndexPath indexPathForRow:0 inSection:_index] - immediateNavigation:NO]; - - [textChoiceAnswerFormat.textChoices enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - ORKTableCellItem *cellItem = [[ORKTableCellItem alloc] initWithFormItem:item choiceIndex:idx]; - [(NSMutableArray *)self.items addObject:cellItem]; - }]; - - } else { - ORKTableCellItem *cellItem = [[ORKTableCellItem alloc] initWithFormItem:item]; - [(NSMutableArray *)self.items addObject:cellItem]; - } -} - -- (BOOL)containsFormItem:(ORKFormItem *)formItem { - for (ORKTableCellItem *cellItem in _items) { - if (cellItem.formItem.identifier == formItem.identifier) { - return YES; - } - } - - return NO; -} - -- (CGFloat)maxLabelWidth { - CGFloat max = 0; - for (ORKTableCellItem *item in self.items) { - if (item.labelWidth > max) { - max = item.labelWidth; - } - } - return max; -} - -@end - -@interface ORKFormSectionHeaderView : UIView - -- (instancetype)initWithTitle:(NSString *)title tableView:(UITableView *)tableView firstSection:(BOOL)firstSection; - -@property (nonatomic, strong) NSLayoutConstraint *leftMarginConstraint; - -@property (nonatomic, weak) UITableView *tableView; - -@end - - -@implementation ORKFormSectionHeaderView { - ORKFormSectionTitleLabel *_label; - BOOL _firstSection; -} - -- (instancetype)initWithTitle:(NSString *)title tableView:(UITableView *)tableView firstSection:(BOOL)firstSection { - self = [super init]; - if (self) { - _tableView = tableView; - _firstSection = firstSection; - self.backgroundColor = [UIColor whiteColor]; - - _label = [ORKFormSectionTitleLabel new]; - _label.text = title; - _label.numberOfLines = 0; - _label.translatesAutoresizingMaskIntoConstraints = NO; - [self addSubview:_label]; - [self setUpConstraints]; - } - return self; -} - -- (void)setUpConstraints { - - const CGFloat LabelFirstBaselineToTop = _firstSection ? 20.0 : 40.0; - const CGFloat LabelLastBaselineToBottom = -10.0; - const CGFloat LabelRightMargin = -4.0; - - NSMutableArray *constraints = [NSMutableArray new]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_label - attribute:NSLayoutAttributeFirstBaseline - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:LabelFirstBaselineToTop]]; - - self.leftMarginConstraint = [NSLayoutConstraint constraintWithItem:_label - attribute:NSLayoutAttributeLeft - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeLeft - multiplier:1.0 - constant:0.0]; - - [constraints addObject:self.leftMarginConstraint]; - - [constraints addObject:[NSLayoutConstraint constraintWithItem:_label - attribute:NSLayoutAttributeLastBaseline - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:LabelLastBaselineToBottom]]; - - [constraints addObject:[NSLayoutConstraint constraintWithItem:_label - attribute:NSLayoutAttributeRight - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeRight - multiplier:1.0 - constant:LabelRightMargin]]; - - [NSLayoutConstraint activateConstraints:constraints]; -} - -- (void)updateConstraints { - [super updateConstraints]; - self.leftMarginConstraint.constant = _tableView.layoutMargins.left; -} - -@end - - -@interface ORKFormStepViewController () - -@property (nonatomic, strong) ORKTableContainerView *tableContainer; -@property (nonatomic, strong) UITableView *tableView; -@property (nonatomic, strong) ORKStepContentView *headerView; - -@property (nonatomic, strong) NSMutableDictionary *savedAnswers; -@property (nonatomic, strong) NSMutableDictionary *savedAnswerDates; -@property (nonatomic, strong) NSMutableDictionary *savedSystemCalendars; -@property (nonatomic, strong) NSMutableDictionary *savedSystemTimeZones; -@property (nonatomic, strong) NSDictionary *originalAnswers; - -@property (nonatomic, strong) NSMutableDictionary *savedDefaults; - -@end - - -@implementation ORKFormStepViewController { - ORKAnswerDefaultSource *_defaultSource; - NSMutableSet *_formItemCells; - NSMutableArray *_sections; - NSMutableSet *_answeredSections; - BOOL _skipped; - BOOL _autoScrollCancelled; - UITableViewCell *_currentFirstResponderCell; - NSArray *_constraints; -} - -- (instancetype)ORKFormStepViewController_initWithResult:(ORKResult *)result { - _defaultSource = [ORKAnswerDefaultSource sourceWithHealthStore:[HKHealthStore new]]; - if (result) { - NSAssert([result isKindOfClass:[ORKStepResult class]], @"Expect a ORKStepResult instance"); - - NSArray *resultsArray = [(ORKStepResult *)result results]; - for (ORKQuestionResult *currentResult in resultsArray) { - id answer = currentResult.answer ? : ORKNullAnswerValue(); - [self setAnswer:answer forIdentifier:currentResult.identifier]; - } - self.originalAnswers = [[NSDictionary alloc] initWithDictionary:self.savedAnswers]; - } - return self; -} - -- (instancetype)initWithStep:(ORKStep *)step { - self = [super initWithStep:step]; - return [self ORKFormStepViewController_initWithResult:nil]; -} - -- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result { - - self = [super initWithStep:step]; - return [self ORKFormStepViewController_initWithResult:result]; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - [self stepDidChange]; - - [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; - [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; -} - -- (void)viewDidLayoutSubviews { - [super viewDidLayoutSubviews]; - [_tableContainer sizeHeaderToFit]; - [_tableContainer resizeFooterToFit]; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [self updateAnsweredSections]; - NSMutableSet *types = [NSMutableSet set]; - for (ORKFormItem *item in [self formItems]) { - ORKAnswerFormat *format = [item answerFormat]; - HKObjectType *objType = [format healthKitObjectTypeForAuthorization]; - if (objType) { - [types addObject:objType]; - } - } - - BOOL refreshDefaultsPending = NO; - if (types.count) { - NSSet *alreadyRequested = [[self taskViewController] requestedHealthTypesForRead]; - if (![types isSubsetOfSet:alreadyRequested]) { - refreshDefaultsPending = YES; - [_defaultSource.healthStore requestAuthorizationToShareTypes:nil readTypes:types completion:^(BOOL success, NSError *error) { - if (!success) { - ORK_Log_Debug("Authorization: %@",error); - } - dispatch_async(dispatch_get_main_queue(), ^{ - [self refreshDefaults]; - }); - }]; - } - } - if (!refreshDefaultsPending) { - [self refreshDefaults]; - } - - // Reset skipped flag - result can now be non-empty - _skipped = NO; - - if (_tableView) { - [_tableView reloadData]; - } -} - -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil); - _autoScrollCancelled = NO; -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - _autoScrollCancelled = YES; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; -} - -- (void)updateAnsweredSections { - _answeredSections = [NSMutableSet new]; - [_sections enumerateObjectsUsingBlock:^(ORKTableSection * _Nonnull section, NSUInteger idx, BOOL * _Nonnull stop) { - for (ORKTableCellItem *cellItem in section.items) { - id answer = _savedAnswers[cellItem.formItem.identifier]; - if (!ORKIsAnswerEmpty(answer)) { - NSNumber *sectionNumber = [NSNumber numberWithUnsignedInteger:idx]; - [_answeredSections addObject:sectionNumber]; - } - } - }]; -} - -- (void)updateDefaults:(NSMutableDictionary *)defaults { - _savedDefaults = defaults; - - for (ORKFormItemCell *cell in [_tableView visibleCells]) { - NSIndexPath *indexPath = [_tableView indexPathForCell:cell]; - - ORKTableSection *section = _sections[indexPath.section]; - ORKTableCellItem *cellItem = [section items][indexPath.row]; - ORKFormItem *formItem = cellItem.formItem; - if ([cell isKindOfClass:[ORKChoiceViewCell class]]) { - id answer = _savedAnswers[formItem.identifier]; - answer = answer ? : _savedDefaults[formItem.identifier]; - - [section.textChoiceCellGroup setAnswer:answer]; - - // Answers need to be saved. - [self setAnswer:answer forIdentifier:formItem.identifier]; - - } else { - cell.defaultAnswer = _savedDefaults[formItem.identifier]; - } - } - - _skipped = NO; - [self updateButtonStates]; - [self notifyDelegateOnResultChange]; -} - -- (void)refreshDefaults { - NSArray *formItems = [self formItems]; - ORKAnswerDefaultSource *source = _defaultSource; - ORKWeakTypeOf(self) weakSelf = self; - dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ - dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); - __block NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; - for (ORKFormItem *formItem in formItems) { - [source fetchDefaultValueForAnswerFormat:formItem.answerFormat handler:^(id defaultValue, NSError *error) { - if (defaultValue != nil) { - defaults[formItem.identifier] = defaultValue; - } else if (error != nil) { - ORK_Log_Error("Error fetching default for %@: %@", formItem, error); - } - dispatch_semaphore_signal(semaphore); - }]; - } - for (__unused ORKFormItem *formItem in formItems) { - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); - } - - // All fetches have completed. - dispatch_async(dispatch_get_main_queue(), ^{ - ORKStrongTypeOf(weakSelf) strongSelf = weakSelf; - [strongSelf updateDefaults:defaults]; - }); - - }); - - -} - -- (void)removeAnswerForIdentifier:(NSString *)identifier { - if (identifier == nil) { - return; - } - [_savedAnswers removeObjectForKey:identifier]; - _savedAnswerDates[identifier] = [NSDate date]; -} - -- (void)setAnswer:(id)answer forIdentifier:(NSString *)identifier { - if (answer == nil || identifier == nil) { - return; - } - if (_savedAnswers == nil) { - _savedAnswers = [NSMutableDictionary new]; - } - if (_savedAnswerDates == nil) { - _savedAnswerDates = [NSMutableDictionary new]; - } - if (_savedSystemCalendars == nil) { - _savedSystemCalendars = [NSMutableDictionary new]; - } - if (_savedSystemTimeZones == nil) { - _savedSystemTimeZones = [NSMutableDictionary new]; - } - _savedAnswers[identifier] = answer; - _savedAnswerDates[identifier] = [NSDate date]; - _savedSystemCalendars[identifier] = [NSCalendar currentCalendar]; - _savedSystemTimeZones[identifier] = [NSTimeZone systemTimeZone]; -} - -// Override to monitor button title change -- (void)setContinueButtonItem:(UIBarButtonItem *)continueButtonItem { - [super setContinueButtonItem:continueButtonItem]; - _navigationFooterView.continueButtonItem = continueButtonItem; - [self updateButtonStates]; -} - -- (void)setSkipButtonItem:(UIBarButtonItem *)skipButtonItem { - [super setSkipButtonItem:skipButtonItem]; - - _navigationFooterView.skipButtonItem = skipButtonItem; - [self updateButtonStates]; -} - -- (void)stepDidChange { - [super stepDidChange]; - - [_tableContainer removeFromSuperview]; - _tableContainer = nil; - - _tableView.delegate = nil; - _tableView.dataSource = nil; - _tableView = nil; - _formItemCells = nil; - _headerView = nil; - _navigationFooterView = nil; - - if (self.isViewLoaded && self.step) { - [self buildSections]; - - _formItemCells = [NSMutableSet new]; - - _tableContainer = [[ORKTableContainerView alloc] initWithStyle:UITableViewStyleGrouped pinNavigationContainer:NO]; - _tableContainer.tableContainerDelegate = self; - [self.view addSubview:_tableContainer]; - _tableContainer.tapOffView = self.view; - - _tableView = _tableContainer.tableView; - _tableView.delegate = self; - _tableView.dataSource = self; - _tableView.clipsToBounds = YES; - _tableView.rowHeight = UITableViewAutomaticDimension; - _tableView.sectionHeaderHeight = UITableViewAutomaticDimension; - _tableView.estimatedRowHeight = ORKGetMetricForWindow(ORKScreenMetricTableCellDefaultHeight, self.view.window); - _tableView.estimatedSectionHeaderHeight = 30.0; - - if ([self formStep].useCardView) { - _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - - if (ORKNeedWideScreenDesign(self.view)) { - [_tableView setBackgroundColor:[UIColor clearColor]]; - [self.taskViewController setNavigationBarColor:ORKColor(ORKBackgroundColorKey)]; - [self.view setBackgroundColor:ORKColor(ORKBackgroundColorKey)]; - } - else { - if (@available(iOS 13.0, *)) { - [_tableView setBackgroundColor:[UIColor systemGroupedBackgroundColor]]; - } else { - [_tableView setBackgroundColor:ORKColor(ORKBackgroundColorKey)]; - } - - [self.taskViewController setNavigationBarColor:[_tableView backgroundColor]]; - [self.view setBackgroundColor:[_tableView backgroundColor]]; - } - } else { - [_tableView setBackgroundColor:[UIColor clearColor]]; - } - _headerView = _tableContainer.stepContentView; - _headerView.stepTopContentImage = self.step.image; - _headerView.titleIconImage = self.step.iconImage; - _headerView.stepTitle = self.step.title; - _headerView.stepText = self.step.text; - _headerView.stepDetailText = self.step.detailText; - _headerView.stepHeaderTextAlignment = self.step.headerTextAlignment; - _headerView.bodyItems = self.step.bodyItems; - _tableContainer.stepTopContentImageContentMode = self.step.imageContentMode; - - _navigationFooterView = _tableContainer.navigationFooterView; - _navigationFooterView.skipButtonItem = self.skipButtonItem; - _navigationFooterView.continueEnabled = [self continueButtonEnabled]; - _navigationFooterView.continueButtonItem = self.continueButtonItem; - _navigationFooterView.optional = self.step.optional; - _navigationFooterView.footnoteLabel.text = [self formStep].footnote; - - // Form steps should always force the navigation controller to be scrollable - // therefore we should always remove the styling. - [_navigationFooterView removeStyling]; - - if (self.readOnlyMode) { - _navigationFooterView.optional = YES; - [_navigationFooterView setNeverHasContinueButton:YES]; - _navigationFooterView.skipEnabled = [self skipButtonEnabled]; - _navigationFooterView.skipButton.accessibilityTraits = UIAccessibilityTraitStaticText; - } - [self setupConstraints]; - [_tableContainer setNeedsLayout]; - } -} - -- (void)setupConstraints { - if (_constraints) { - [NSLayoutConstraint deactivateConstraints:_constraints]; - } - _tableContainer.translatesAutoresizingMaskIntoConstraints = NO; - _constraints = nil; - - - _constraints = @[ - [NSLayoutConstraint constraintWithItem:_tableContainer - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:self.view - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_tableContainer - attribute:NSLayoutAttributeLeft - relatedBy:NSLayoutRelationEqual - toItem:self.view - attribute:NSLayoutAttributeLeft - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_tableContainer - attribute:NSLayoutAttributeRight - relatedBy:NSLayoutRelationEqual - toItem:self.view - attribute:NSLayoutAttributeRight - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_tableContainer - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self.view - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:0.0] - ]; - [NSLayoutConstraint activateConstraints:_constraints]; - -} - -- (void)buildSections { - NSArray *items = [self allFormItems]; - _sections = [NSMutableArray new]; - ORKTableSection *section = nil; - - for (ORKFormItem *item in items) { - BOOL itemRequiresSingleSection = [self doesItemRequireSingleSection:item]; - - if (!item.answerFormat) { - // Add new section - section = [self createSectionWithItem:item]; - [_sections addObject:section]; - - } else if (itemRequiresSingleSection || _sections.count == 0) { - - [self buildSingleSection:item]; - section = [_sections lastObject]; - } else { - if (section) { - [section addFormItem:item]; - } - } - } -} - -- (void)buildSingleSection:(ORKFormItem *)item { - ORKTableSection *section = nil; - - // Section header - if ([item impliedAnswerFormat] == nil) { - // Add new section - section = [self createSectionWithItem:item]; - [_sections addObject:section]; - - // Actual item - } else { - - // Items require individual section - if ([self doesItemRequireSingleSection:item]) { - // Add new section - section = [self createSectionWithItem:item]; - [_sections addObject:section]; - - [section addFormItem:item]; - - } else { - // In case no section available, create new one. - if (section == nil) { - section = [self createSectionWithItem:item]; - [_sections addObject:section]; - } - [section addFormItem:item]; - } - } -} - -- (ORKTableSection *)createSectionWithItem:(ORKFormItem *)item { - ORKTableSection *section = [[ORKTableSection alloc] initWithSectionIndex:_sections.count]; - section.title = item.text; - section.detailText = item.detailText; - section.learnMoreItem = item.learnMoreItem; - section.showsProgress = item.showsProgress; - section.tagText = item.tagText; - - return section; -} - -- (BOOL)doesItemRequireSingleSection:(ORKFormItem *)item { - if (item.impliedAnswerFormat == nil) { - return NO; - } - - ORKAnswerFormat *answerFormat = [item impliedAnswerFormat]; - - NSArray *singleSectionTypes = @[@(ORKQuestionTypeBoolean), - @(ORKQuestionTypeSingleChoice), - @(ORKQuestionTypeMultipleChoice), - @(ORKQuestionTypeLocation), - @(ORKQuestionTypeSES)]; - - BOOL multiCellChoices = ([singleSectionTypes containsObject:@(answerFormat.questionType)] && - NO == [answerFormat isKindOfClass:[ORKValuePickerAnswerFormat class]]); - - BOOL scale = (answerFormat.questionType == ORKQuestionTypeScale); - - // Items require individual section - if (multiCellChoices || scale) { - return YES; - } - - return NO; -} - -- (NSInteger)numberOfAnsweredFormItemsInDictionary:(NSDictionary *)dictionary { - __block NSInteger nonNilCount = 0; - [dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id answer, BOOL *stop) { - if (ORKIsAnswerEmpty(answer) == NO) { - nonNilCount ++; - } - }]; - return nonNilCount; -} - -- (NSInteger)numberOfAnsweredFormItems { - return [self numberOfAnsweredFormItemsInDictionary:self.savedAnswers]; -} - -- (BOOL)allAnsweredFormItemsAreValid { - for (ORKFormItem *item in [self formItems]) { - id answer = _savedAnswers[item.identifier]; - if (ORKIsAnswerEmpty(answer) == NO && ![item.impliedAnswerFormat isAnswerValid:answer]) { - return NO; - } - } - return YES; -} - -- (BOOL)allNonOptionalFormItemsHaveAnswers { - for (ORKFormItem *item in [self formItems]) { - if (!item.optional) { - id answer = _savedAnswers[item.identifier]; - if (ORKIsAnswerEmpty(answer) || ![item.impliedAnswerFormat isAnswerValid:answer]) { - return NO; - } - } - } - return YES; -} - -- (nullable ORKFormItem *)fetchFirstUnansweredNonOptionalFormItem:(NSArray *)formItems { - for (ORKFormItem *item in formItems) { - if (!item.optional) { - id answer = _savedAnswers[item.identifier]; - if (ORKIsAnswerEmpty(answer) || ![item.impliedAnswerFormat isAnswerValid:answer]) { - return item; - } - } - } - - return nil; -} - -- (nullable ORKTableSection *)fetchSectionThatContainsFormItem:(ORKFormItem *)formItem { - for (ORKTableSection *section in _sections) { - if ([section containsFormItem:formItem]) { - return section; - } - } - - return nil; -} - -- (BOOL)continueButtonEnabled { - BOOL enabled = ([self numberOfAnsweredFormItems] > 0 - && [self allAnsweredFormItemsAreValid] - && [self allNonOptionalFormItemsHaveAnswers]); - if (self.isBeingReviewed) { - enabled = enabled && ![self.savedAnswers isEqualToDictionary:self.originalAnswers]; - } - return enabled; -} - -- (BOOL)skipButtonEnabled { - BOOL enabled = self.formStep.optional; - if (self.isBeingReviewed) { - enabled = self.readOnlyMode ? NO : enabled && [self numberOfAnsweredFormItemsInDictionary:self.originalAnswers] > 0; - } - return enabled; -} - -- (void)updateButtonStates { - _navigationFooterView.continueEnabled = [self continueButtonEnabled]; - _navigationFooterView.skipEnabled = [self skipButtonEnabled]; - - if (self.shouldPresentInReview && self.navigationItem.rightBarButtonItem) { - self.navigationItem.rightBarButtonItem.enabled = [self continueButtonEnabled]; - } -} - -- (void)setShouldPresentInReview:(BOOL)shouldPresentInReview { - [super setShouldPresentInReview:shouldPresentInReview]; - [_navigationFooterView setHidden:YES]; -} - -#pragma mark Helpers - -- (ORKFormStep *)formStep { - NSAssert(!self.step || [self.step isKindOfClass:[ORKFormStep class]], nil); - return (ORKFormStep *)self.step; -} - -- (NSArray *)allFormItems { - return [[self formStep] formItems]; -} - -- (NSArray *)formItems { - NSArray *formItems = [self allFormItems]; - NSMutableArray *array = [NSMutableArray arrayWithCapacity:formItems.count]; - for (ORKFormItem *item in formItems) { - if (item.answerFormat != nil) { - [array addObject:item]; - } - } - - return [array copy]; -} - -- (BOOL)showValidityAlertWithMessage:(NSString *)text { - // Ignore if our answer is null - if (_skipped) { - return NO; - } - - return [super showValidityAlertWithMessage:text]; -} - -- (BOOL)hasAnswer { - return (self.savedAnswers != nil); -} - -// Not to use `ImmediateNavigation` when current step already has an answer. -// So user is able to review the answer when it is present. -- (BOOL)isStepImmediateNavigation { - return NO; -} - -- (ORKStepResult *)result { - ORKStepResult *parentResult = [super result]; - - NSArray *items = [self formItems]; - - // "Now" is the end time of the result, which is either actually now, - // or the last time we were in the responder chain. - NSDate *now = parentResult.endDate; - - NSMutableArray *qResults = [NSMutableArray new]; - for (ORKFormItem *item in items) { - - // Skipped forms report a "null" value for every item -- by skipping, the user has explicitly said they don't want - // to report any values from this form. - - id answer = ORKNullAnswerValue(); - NSDate *answerDate = now; - NSCalendar *systemCalendar = [NSCalendar currentCalendar]; - NSTimeZone *systemTimeZone = [NSTimeZone systemTimeZone]; - if (!_skipped) { - answer = _savedAnswers[item.identifier]; - answerDate = _savedAnswerDates[item.identifier] ? : now; - systemCalendar = _savedSystemCalendars[item.identifier]; - NSAssert(answer == nil || answer == ORKNullAnswerValue() || systemCalendar != nil, @"systemCalendar NOT saved"); - systemTimeZone = _savedSystemTimeZones[item.identifier]; - NSAssert(answer == nil || answer == ORKNullAnswerValue() || systemTimeZone != nil, @"systemTimeZone NOT saved"); - } - - ORKQuestionResult *result = [item.answerFormat resultWithIdentifier:item.identifier answer:answer]; - ORKAnswerFormat *impliedAnswerFormat = [item impliedAnswerFormat]; - - if ([impliedAnswerFormat isKindOfClass:[ORKDateAnswerFormat class]]) { - ORKDateQuestionResult *dqr = (ORKDateQuestionResult *)result; - if (dqr.dateAnswer) { - NSCalendar *usedCalendar = [(ORKDateAnswerFormat *)impliedAnswerFormat calendar] ? : systemCalendar; - dqr.calendar = [NSCalendar calendarWithIdentifier:usedCalendar.calendarIdentifier]; - dqr.timeZone = systemTimeZone; - } - } else if ([impliedAnswerFormat isKindOfClass:[ORKNumericAnswerFormat class]]) { - ORKNumericQuestionResult *nqr = (ORKNumericQuestionResult *)result; - if (nqr.unit == nil) { - nqr.unit = [(ORKNumericAnswerFormat *)impliedAnswerFormat unit]; - nqr.displayUnit = [(ORKNumericAnswerFormat *)impliedAnswerFormat displayUnit]; - } - } - - result.startDate = answerDate; - result.endDate = answerDate; - - [qResults addObject:result]; - } - - parentResult.results = [parentResult.results arrayByAddingObjectsFromArray:qResults] ? : qResults; - - return parentResult; -} - -- (void)skipForward { - // This _skipped flag is a hack so that the -result method can return an empty - // result after the skip action, without having to generate the result - // in advance. - _skipped = YES; - [self notifyDelegateOnResultChange]; - - [super skipForward]; -} - -- (void)goBackward { - if (self.isBeingReviewed) { - self.savedAnswers = [[NSMutableDictionary alloc] initWithDictionary:self.originalAnswers]; - } - [super goBackward]; -} - -- (BOOL)didAutoScrollToNextItem:(ORKFormItemCell *)cell { - NSIndexPath *currentIndexPath = [self.tableView indexPathForCell:cell]; - - if (cell.isLastItem) { - return NO; - } else { - NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:currentIndexPath.row + 1 inSection:currentIndexPath.section]; - ORKFormItemCell *nextCell = [self.tableView cellForRowAtIndexPath:nextIndexPath]; - ORKQuestionType type = nextCell.formItem.impliedAnswerFormat.questionType; - - if ([self doesTableCellTypeUseKeyboard:type]) { - [_tableView deselectRowAtIndexPath:currentIndexPath animated:NO]; - - if ([nextCell isKindOfClass:[ORKFormItemCell class]]) { - [nextCell becomeFirstResponder]; - } - - } else { - return NO; - } - } - - return YES; -} - -- (BOOL)shouldAutoScrollToNextSection:(NSIndexPath *)indexPath { - NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:0 inSection:(indexPath.section + 1)]; - ORKFormItemCell *nextCell = [self.tableView cellForRowAtIndexPath:nextIndexPath]; - - if ([nextCell respondsToSelector:@selector(formItem)] && !_autoScrollCancelled) { - ORKQuestionType type = nextCell.formItem.impliedAnswerFormat.questionType; - - if ([self doesTableCellTypeUseKeyboard:type] && [nextCell isKindOfClass:[ORKFormItemCell class]]) { - return YES; - } - } - return NO; -} - -- (void)autoScrollToNextSection:(NSIndexPath *)indexPath { - NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:0 inSection:(indexPath.section + 1)]; - ORKFormItemCell *nextCell = [self.tableView cellForRowAtIndexPath:nextIndexPath]; - [nextCell becomeFirstResponder]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - [_tableView scrollToRowAtIndexPath:nextIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; - }); -} - -- (void)handleAutoScrollForNonKeyboardCell:(ORKFormItemCell *)cell { - NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; - ORKTableSection *section = _sections[indexPath.section]; - NSNumber *sectionIndex = [NSNumber numberWithLong:indexPath.section]; - - if ([cell isKindOfClass:[ORKFormItemCell class]] && [cell.answer class] != [ORKDontKnowAnswer class]) { - if (cell.formItem.answerFormat.impliedAnswerFormat.questionType != ORKQuestionTypeSES) { - return; - } - } else if (![cell isKindOfClass:[ORKFormItemCell class]] && ![self isAnswerStyleSingleChoice:section.textChoiceCellGroup] && ![self exclusiveChoiceSelectedForCellGroup:section.textChoiceCellGroup withCell:cell] ) { - return; - } - - if ((indexPath.section < _sections.count - 1) && [self shouldAutoScrollToNextSection:indexPath] && ![_answeredSections containsObject:sectionIndex]) { - [self autoScrollToNextSection:indexPath]; - } else if ((indexPath.section == (_sections.count - 1)) && ![_answeredSections containsObject:sectionIndex]) { - if (![self allNonOptionalFormItemsHaveAnswers]) { - [self scrollToFirstUnansweredSection]; - } else { - [self.tableView scrollRectToVisible:[self.tableView convertRect:self.tableView.tableFooterView.bounds fromView:self.tableView.tableFooterView] animated:YES]; - } - - } else if (indexPath.section < (_sections.count - 1) && ![_answeredSections containsObject:sectionIndex]) { - NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:0 inSection:(indexPath.section + 1)]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - [_tableView scrollToRowAtIndexPath:nextIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; - }); - } -} - -- (void)scrollToFirstUnansweredSection { - ORKFormItem *formItem = [self fetchFirstUnansweredNonOptionalFormItem:[self formItems]]; - if (formItem) { - ORKTableSection *section = [self fetchSectionThatContainsFormItem:formItem]; - if (section) { - NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:0 inSection:section.index]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - [_tableView scrollToRowAtIndexPath:nextIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; - }); - } - } -} - -- (BOOL)isAnswerStyleSingleChoice:(ORKTextChoiceCellGroup *)cellGroup { - return (cellGroup.answerFormat.style == ORKChoiceAnswerStyleSingleChoice); -} - -- (BOOL)exclusiveChoiceSelectedForCellGroup:(ORKTextChoiceCellGroup *)cellGroup withCell:(ORKFormItemCell *)cell { - ORKChoiceViewCell *choiceViewCell = (ORKChoiceViewCell *)cell; - - if (choiceViewCell) { - return (cellGroup.answer != nil && choiceViewCell.isExclusive); - } else { - return NO; - } -} - -- (BOOL)doesTableCellTypeUseKeyboard:(ORKQuestionType)questionType { - switch (questionType) { - case ORKQuestionTypeDecimal: - case ORKQuestionTypeInteger: - case ORKQuestionTypeText: - return YES; - - default: - return NO; - } -} - -#pragma mark NSNotification methods - -- (void)keyboardWillShow:(NSNotification *)notification { - - if (_currentFirstResponderCell) { - if ([_currentFirstResponderCell isKindOfClass:[ORKChoiceOtherViewCell class]]) { - CGRect keyboardFrame = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; - CGRect convertedKeyboardFrame = [self.view convertRect:keyboardFrame fromView:nil]; - - if (CGRectGetMaxY(_currentFirstResponderCell.frame) >= CGRectGetMinY(convertedKeyboardFrame)) { - - [self.tableView setContentInset:UIEdgeInsetsMake(0, 0, CGRectGetHeight(convertedKeyboardFrame), 0)]; - - NSIndexPath *currentFirstResponderCellIndex = [self.tableView indexPathForCell:_currentFirstResponderCell]; - - if (currentFirstResponderCellIndex) { - [self.tableView scrollToRowAtIndexPath:currentFirstResponderCellIndex atScrollPosition:UITableViewScrollPositionBottom animated:YES]; - } - } - } else { - CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size; - - if ((_currentFirstResponderCell.frame.origin.y + CGRectGetHeight(_currentFirstResponderCell.frame)) >= (CGRectGetHeight(self.view.frame) - keyboardSize.height)) { - _tableView.contentInset = UIEdgeInsetsMake(0, 0, keyboardSize.height + TableViewYOffsetStandard, 0); - } - } - } -} - -- (void)keyboardWillHide:(NSNotification *)notification { - _tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); -} - -#pragma mark UITableViewDataSource - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return _sections.count; -} - -- (NSInteger)numberOfRowsInSection:(NSInteger)section { - ORKTableSection *sectionObject = (ORKTableSection *)_sections[section]; - return sectionObject.items.count; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [self numberOfRowsInSection:section]; -} - -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - NSString *identifier = [NSString stringWithFormat:@"%ld-%ld",(long)indexPath.section, (long)indexPath.row]; - - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; - - if (cell == nil) { - ORKTableSection *section = (ORKTableSection *)_sections[indexPath.section]; - ORKTableCellItem *cellItem = [section items][indexPath.row]; - bool isLastItem = [section items].count == indexPath.row + 1; - bool isFirstItemWithSectionWithoutTitle = indexPath.row == 0 && !section.title; - ORKFormItem *formItem = cellItem.formItem; - id answer = _savedAnswers[formItem.identifier]; - - if (section.textChoiceCellGroup && ([section.textChoiceCellGroup cellAtIndexPath:indexPath withReuseIdentifier:identifier] != nil)) { - [section.textChoiceCellGroup setAnswer:answer]; - section.textChoiceCellGroup.delegate = self; - ORKChoiceViewCell *choiceViewCell = nil; - choiceViewCell = [section.textChoiceCellGroup cellAtIndexPath:indexPath withReuseIdentifier:identifier]; - if ([choiceViewCell isKindOfClass:[ORKChoiceOtherViewCell class]]) { - ORKChoiceOtherViewCell *choiceOtherViewCell = (ORKChoiceOtherViewCell *)choiceViewCell; - choiceOtherViewCell.delegate = self; - } - choiceViewCell.tintColor = ORKViewTintColor(self.view); - choiceViewCell.useCardView = [self formStep].useCardView; - choiceViewCell.cardViewStyle = [self formStep].cardViewStyle; - choiceViewCell.isLastItem = isLastItem; - choiceViewCell.isFirstItemInSectionWithoutTitle = isFirstItemWithSectionWithoutTitle; - [choiceViewCell layoutSubviews]; - cell = choiceViewCell; - - } else { - ORKAnswerFormat *answerFormat = [cellItem.formItem impliedAnswerFormat]; - ORKQuestionType type = answerFormat.questionType; - - Class class = nil; - switch (type) { - case ORKQuestionTypeSingleChoice: - case ORKQuestionTypeMultipleChoice: { - if ([formItem.impliedAnswerFormat isKindOfClass:[ORKImageChoiceAnswerFormat class]]) { - class = [ORKFormItemImageSelectionCell class]; - } else if ([formItem.impliedAnswerFormat isKindOfClass:[ORKValuePickerAnswerFormat class]]) { - class = [ORKFormItemPickerCell class]; - } - break; - } - - case ORKQuestionTypeDateAndTime: - case ORKQuestionTypeDate: - case ORKQuestionTypeTimeOfDay: - case ORKQuestionTypeTimeInterval: - case ORKQuestionTypeMultiplePicker: - case ORKQuestionTypeHeight: - case ORKQuestionTypeWeight: { - class = [ORKFormItemPickerCell class]; - break; - } - - case ORKQuestionTypeDecimal: - case ORKQuestionTypeInteger: { - class = [ORKFormItemNumericCell class]; - break; - } - - case ORKQuestionTypeText: { - if ([formItem.answerFormat isKindOfClass:[ORKConfirmTextAnswerFormat class]]) { - class = [ORKFormItemConfirmTextCell class]; - } else { - ORKTextAnswerFormat *textFormat = (ORKTextAnswerFormat *)answerFormat; - if (!textFormat.multipleLines) { - class = [ORKFormItemTextFieldCell class]; - } else { - class = [ORKFormItemTextCell class]; - } - } - break; - } - - case ORKQuestionTypeScale: { - class = [ORKFormItemScaleCell class]; - break; - } - - case ORKQuestionTypeLocation: { - class = [ORKFormItemLocationCell class]; - break; - } - case ORKQuestionTypeSES: { - class = [ORKFormItemSESCell class]; - break; - } - - default: - NSAssert(NO, @"SHOULD NOT FALL IN HERE %@ %@", @(type), answerFormat); - break; - } - - if (class) { - if ([class isSubclassOfClass:[ORKChoiceViewCell class]]) { - NSAssert(NO, @"SHOULD NOT FALL IN HERE"); - } else { - ORKFormItemCell *formCell = nil; - formCell = [[class alloc] initWithReuseIdentifier:identifier formItem:formItem answer:answer maxLabelWidth:section.maxLabelWidth delegate:self]; - [_formItemCells addObject:formCell]; - [formCell setExpectedLayoutWidth:self.tableView.bounds.size.width]; - formCell.selectionStyle = UITableViewCellSelectionStyleNone; - formCell.defaultAnswer = _savedDefaults[formItem.identifier]; - if (!_savedAnswers) { - _savedAnswers = [NSMutableDictionary new]; - } - formCell.savedAnswers = _savedAnswers; - formCell.useCardView = [self formStep].useCardView; - formCell.cardViewStyle = [self formStep].cardViewStyle; - formCell.isLastItem = isLastItem; - formCell.isFirstItemInSectionWithoutTitle = isFirstItemWithSectionWithoutTitle; - cell = formCell; - } - } else { - NSAssert(NO, @"SHOULD NOT FALL IN HERE"); - } - } - } - else { - [cell setNeedsDisplay]; - } - cell.userInteractionEnabled = !self.readOnlyMode; - - return cell; -} - -- (BOOL)isChoiceSelected:(id)value atIndex:(NSUInteger)index answer:(id)answer { - BOOL isSelected = NO; - if (answer != nil && answer != ORKNullAnswerValue()) { - if ([answer isKindOfClass:[NSArray class]]) { - if (value) { - isSelected = [(NSArray *)answer containsObject:value]; - } else { - isSelected = [(NSArray *)answer containsObject:@(index)]; - } - } else { - if (value) { - isSelected = ([answer isEqual:value]); - } else { - isSelected = (((NSNumber *)answer).integerValue == index); - } - } - } - return isSelected; -} - -#pragma mark UITableViewDelegate - -- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath { - return YES; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:NO]; - - ORKFormItemCell *cell = (ORKFormItemCell *)[tableView cellForRowAtIndexPath:indexPath]; - if ([cell isKindOfClass:[ORKFormItemCell class]]) { - [cell becomeFirstResponder]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - [_tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; - }); - } else { - // Dismiss other textField's keyboard - [tableView endEditing:NO]; - - ORKTableSection *section = _sections[indexPath.section]; - [section.textChoiceCellGroup didSelectCellAtIndexPath:indexPath]; - } -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return UITableViewAutomaticDimension; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - NSString *title = _sections[section].title; - - // Make first section header view zero height when there is no title - return [self formStep].useCardView ? UITableViewAutomaticDimension : (title.length > 0) ? UITableViewAutomaticDimension : ((section == 0) ? 0 : UITableViewAutomaticDimension); -} - -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - NSString *title = _sections[section].title; - NSString *detailText = _sections[section].detailText; - NSString *sectionProgressText = nil; - ORKLearnMoreView *learnMoreView; - NSString *tagText = _sections[section].tagText; - BOOL hasMultipleChoiceFormItem = NO; - - if (_sections[section].showsProgress) { - if ([self.delegate respondsToSelector:@selector(stepViewControllerTotalProgressInfoForStep:currentStep:)]) { - ORKTaskTotalProgress progressInfo = [self.delegate stepViewControllerTotalProgressInfoForStep:self currentStep:self.step]; - if (progressInfo.stepShouldShowTotalProgress) { - sectionProgressText = [NSString localizedStringWithFormat:ORKLocalizedString(@"FORM_ITEM_PROGRESS", nil) ,ORKLocalizedStringFromNumber(@(section + progressInfo.currentStepStartingProgressPosition)), ORKLocalizedStringFromNumber(@(progressInfo.total))]; - } - } - - if (!sectionProgressText) { - // only display progress label if there are more than 1 sections in the form step - if ([_sections count] > 1) { - sectionProgressText = [NSString localizedStringWithFormat:ORKLocalizedString(@"FORM_ITEM_PROGRESS", nil) ,ORKLocalizedStringFromNumber(@(section + 1)), ORKLocalizedStringFromNumber(@([_sections count]))]; - } - } - } - - if (_sections[section].learnMoreItem) { - learnMoreView = [ORKLearnMoreView learnMoreViewWithItem:_sections[section].learnMoreItem]; - learnMoreView.delegate = self; - } - - if (_sections[section].items.count > 0) { - ORKTableCellItem *tableCellItem = (ORKTableCellItem *)_sections[section].items.firstObject; - ORKFormItem *firstFormItem = tableCellItem.formItem; - - if (firstFormItem.impliedAnswerFormat != nil) { - if (firstFormItem.impliedAnswerFormat.questionType == ORKQuestionTypeMultipleChoice) { - hasMultipleChoiceFormItem = YES; - } - } - } - - ORKSurveyCardHeaderView *cardHeaderView = (ORKSurveyCardHeaderView *)[tableView dequeueReusableHeaderFooterViewWithIdentifier:@(section).stringValue]; - - if (cardHeaderView == nil && title) { - cardHeaderView = [[ORKSurveyCardHeaderView alloc] initWithTitle:title - detailText:detailText - learnMoreView:learnMoreView - progressText:sectionProgressText - tagText:tagText - showBorder:([self formStep].cardViewStyle == ORKCardViewStyleBordered) - hasMultipleChoiceItem:hasMultipleChoiceFormItem]; - } - - return cardHeaderView; -} - -- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { - ORKFormStep *formStep = [self formStep]; - if (formStep.footerText != nil && (section == (tableView.numberOfSections - 1))) { - return formStep.footerText; - } - - return nil; -} - -- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - return nil; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - return section == tableView.numberOfSections - 1 ? UITableViewAutomaticDimension : 10; -} - -#pragma mark ORKFormItemCellDelegate - -- (void)formItemCellDidBecomeFirstResponder:(ORKFormItemCell *)cell { - if (_currentFirstResponderCell) { - ORKFormItemTextFieldBasedCell *previousSelectedCell = (ORKFormItemTextFieldBasedCell*)_currentFirstResponderCell; - if (previousSelectedCell != nil && [previousSelectedCell respondsToSelector:@selector(removeEditingHighlight)]) { - [previousSelectedCell removeEditingHighlight]; - } - } - - _currentFirstResponderCell = cell; - NSIndexPath *path = [_tableView indexPathForCell:cell]; - if (path) { - [_tableContainer scrollCellVisible:cell animated:YES]; - } -} - -- (void)formItemCellDidResignFirstResponder:(ORKFormItemCell *)cell { - if (_currentFirstResponderCell == cell) { - _currentFirstResponderCell = nil; - } - - //determines if the table should autoscroll to the next section - NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; - NSNumber *sectionIndex = [NSNumber numberWithLong:indexPath.section]; - if (cell.isLastItem && [self shouldAutoScrollToNextSection:indexPath]) { - [self autoScrollToNextSection:indexPath]; - return; - } else if (cell.isLastItem && indexPath.section == (_sections.count - 1) && ![_answeredSections containsObject:sectionIndex]) { - - if (![self allNonOptionalFormItemsHaveAnswers]) { - [self scrollToFirstUnansweredSection]; - } else { - [self.tableView scrollRectToVisible:[self.tableView convertRect:self.tableView.tableFooterView.bounds fromView:self.tableView.tableFooterView] animated:YES]; - } - } - - NSIndexPath *path = [_tableView indexPathForCell:cell]; - - if (path) { - ORKTableSection *sectionObject = (ORKTableSection *)_sections[path.section]; - if (path.row < sectionObject.items.count - 1) { - NSIndexPath *nextPath = [NSIndexPath indexPathForRow:(path.row + 1) inSection:path.section]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - [_tableView scrollToRowAtIndexPath:nextPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; - }); - } - } - -} - -- (void)formItemCell:(ORKFormItemCell *)cell invalidInputAlertWithMessage:(NSString *)input { - [self showValidityAlertWithMessage:input]; -} - -- (void)formItemCell:(ORKFormItemCell *)cell invalidInputAlertWithTitle:(NSString *)title message:(NSString *)message { - [self showValidityAlertWithTitle:title message:message]; -} - -- (void)formItemCell:(ORKFormItemCell *)cell answerDidChangeTo:(id)answer { - if (answer && cell.formItem.identifier) { - [self setAnswer:answer forIdentifier:cell.formItem.identifier]; - } else if (answer == nil && cell.formItem.identifier) { - [self removeAnswerForIdentifier:cell.formItem.identifier]; - } - - _skipped = NO; - [self updateButtonStates]; - [self notifyDelegateOnResultChange]; - [self handleAutoScrollForNonKeyboardCell:cell]; - [self updateAnsweredSections]; -} - -- (BOOL)formItemCellShouldDismissKeyboard:(ORKFormItemCell *)cell { - if ([self didAutoScrollToNextItem:cell]) { - return NO; - } - return YES; -} - -#pragma mark ORKTableContainerViewDelegate - -- (UITableViewCell *)currentFirstResponderCellForTableContainerView:(ORKTableContainerView *)tableContainerView { - return _currentFirstResponderCell; -} - -#pragma mark UIStateRestoration - -static NSString *const _ORKSavedAnswersRestoreKey = @"savedAnswers"; -static NSString *const _ORKSavedAnswerDatesRestoreKey = @"savedAnswerDates"; -static NSString *const _ORKSavedSystemCalendarsRestoreKey = @"savedSystemCalendars"; -static NSString *const _ORKSavedSystemTimeZonesRestoreKey = @"savedSystemTimeZones"; -static NSString *const _ORKOriginalAnswersRestoreKey = @"originalAnswers"; -static NSString *const _ORKAnsweredSectionsRestoreKey = @"answeredSections"; - -- (void)encodeRestorableStateWithCoder:(NSCoder *)coder { - [super encodeRestorableStateWithCoder:coder]; - - [coder encodeObject:_savedAnswers forKey:_ORKSavedAnswersRestoreKey]; - [coder encodeObject:_savedAnswerDates forKey:_ORKSavedAnswerDatesRestoreKey]; - [coder encodeObject:_savedSystemCalendars forKey:_ORKSavedSystemCalendarsRestoreKey]; - [coder encodeObject:_savedSystemTimeZones forKey:_ORKSavedSystemTimeZonesRestoreKey]; - [coder encodeObject:_originalAnswers forKey:_ORKOriginalAnswersRestoreKey]; - [coder encodeObject:_answeredSections forKey:_ORKAnsweredSectionsRestoreKey]; -} - -- (void)decodeRestorableStateWithCoder:(NSCoder *)coder { - [super decodeRestorableStateWithCoder:coder]; - - NSSet *decodableAnswerTypes = [NSSet setWithObjects:NSMutableDictionary.self, NSString.self, NSNumber.self, NSDate.self, nil]; - _savedAnswers = [coder decodeObjectOfClasses:decodableAnswerTypes forKey:_ORKSavedAnswersRestoreKey]; - _savedAnswerDates = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, NSDate.self]] forKey:_ORKSavedAnswerDatesRestoreKey]; - _savedSystemCalendars = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, NSCalendar.self]] forKey:_ORKSavedSystemCalendarsRestoreKey]; - _savedSystemTimeZones = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, NSTimeZone.self]] forKey:_ORKSavedSystemTimeZonesRestoreKey]; - _originalAnswers = [coder decodeObjectOfClasses:decodableAnswerTypes forKey:_ORKOriginalAnswersRestoreKey]; - _answeredSections = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableSet.self, NSNumber.self]] forKey:_ORKAnsweredSectionsRestoreKey]; -} - -#pragma mark Rotate - -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - for (ORKFormItemCell *cell in _formItemCells) { - [cell setExpectedLayoutWidth:size.width]; - } -} - - -#pragma mark ORKTextChoiceCellGroupDelegate - -- (void)answerChangedForIndexPath:(NSIndexPath *)indexPath { - BOOL immediateNavigation = [self isStepImmediateNavigation]; - ORKTableSection *section = _sections[indexPath.section]; - ORKTableCellItem *cellItem = section.items[indexPath.row]; - id answer = ([cellItem.formItem.answerFormat isKindOfClass:[ORKBooleanAnswerFormat class]]) ? [section.textChoiceCellGroup answerForBoolean] : [section.textChoiceCellGroup answer]; - NSString *formItemIdentifier = cellItem.formItem.identifier; - if (answer && formItemIdentifier) { - [self setAnswer:answer forIdentifier:formItemIdentifier]; - } else if (answer == nil && formItemIdentifier) { - [self removeAnswerForIdentifier:formItemIdentifier]; - } - - _skipped = NO; - [self updateButtonStates]; - [self notifyDelegateOnResultChange]; - - ORKFormItemCell *cell = (ORKFormItemCell *)[_tableView cellForRowAtIndexPath:indexPath]; - if (![cell isKindOfClass:[ORKChoiceOtherViewCell class]]) { - [self handleAutoScrollForNonKeyboardCell:cell]; - } - [self updateAnsweredSections]; - - if (immediateNavigation) { - // Proceed as continueButton tapped - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - ORKSuppressPerformSelectorWarning( - [self.continueButtonItem.target performSelector:self.continueButtonItem.action withObject:self.continueButtonItem];); - }); - } -} - -- (void)tableViewCellHeightUpdated { - [_tableView reloadData]; -} - -#pragma mark - ORKChoiceOtherViewCellDelegate - -- (void)textChoiceOtherCellDidBecomeFirstResponder:(ORKChoiceOtherViewCell *)choiceOtherViewCell { - _currentFirstResponderCell = choiceOtherViewCell; - NSIndexPath *path = [_tableView indexPathForCell:choiceOtherViewCell]; - if (path) { - [_tableContainer scrollCellVisible:choiceOtherViewCell animated:YES]; - } -} - -- (void)textChoiceOtherCellDidResignFirstResponder:(ORKChoiceOtherViewCell *)choiceOtherViewCell { - if (_currentFirstResponderCell == choiceOtherViewCell) { - _currentFirstResponderCell = nil; - } - NSIndexPath *indexPath = [_tableView indexPathForCell:choiceOtherViewCell]; - ORKTableSection *section = _sections[indexPath.section]; - [section.textChoiceCellGroup textViewDidResignResponderForCellAtIndexPath:indexPath]; -} - -#pragma mark - ORKlearnMoreStepViewControllerDelegate - -- (void)learnMoreButtonPressedWithStep:(ORKLearnMoreInstructionStep *)learnMoreStep { - [self.taskViewController learnMoreButtonPressedWithStep:learnMoreStep fromStepViewController:self]; -} - -@end diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStep.h b/ResearchKit/Common/ORKFrontFacingCameraStep.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStep.h rename to ResearchKit/Common/ORKFrontFacingCameraStep.h index 771a30941d..4f138b7908 100644 --- a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStep.h +++ b/ResearchKit/Common/ORKFrontFacingCameraStep.h @@ -33,6 +33,11 @@ NS_ASSUME_NONNULL_BEGIN +/** + A step that captures video through the device's + front facing camera. + */ + ORK_CLASS_AVAILABLE @interface ORKFrontFacingCameraStep : ORKActiveStep diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStep.m b/ResearchKit/Common/ORKFrontFacingCameraStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStep.m rename to ResearchKit/Common/ORKFrontFacingCameraStep.m index 214f56b063..d3eafac3e9 100644 --- a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStep.m +++ b/ResearchKit/Common/ORKFrontFacingCameraStep.m @@ -29,7 +29,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKFrontFacingCameraStep.h" -#import "ORKFrontFacingCameraStepViewController.h" #import "ORKHelpers_Internal.h" static const NSTimeInterval MIN_RECORDING_DURATION = 10.0; @@ -37,11 +36,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKFrontFacingCameraStep -+ (Class)stepViewControllerClass -{ - return [ORKFrontFacingCameraStepViewController class]; -} - + (BOOL)supportsSecureCoding { return YES; diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepResult.h b/ResearchKit/Common/ORKFrontFacingCameraStepResult.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStepResult.h rename to ResearchKit/Common/ORKFrontFacingCameraStepResult.h index 1653cc826b..cf26bc904e 100644 --- a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepResult.h +++ b/ResearchKit/Common/ORKFrontFacingCameraStepResult.h @@ -33,6 +33,10 @@ NS_ASSUME_NONNULL_BEGIN +/** + The result object that the front facing camera step generates. + */ + ORK_CLASS_AVAILABLE @interface ORKFrontFacingCameraStepResult : ORKFileResult diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepResult.m b/ResearchKit/Common/ORKFrontFacingCameraStepResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStepResult.m rename to ResearchKit/Common/ORKFrontFacingCameraStepResult.m diff --git a/ResearchKit/Common/ORKHTMLPDFWriter.h b/ResearchKit/Common/ORKHTMLPDFWriter.h index 0a417d084f..bcb80faaa8 100644 --- a/ResearchKit/Common/ORKHTMLPDFWriter.h +++ b/ResearchKit/Common/ORKHTMLPDFWriter.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import @class ORKHTMLPDFPageRenderer; diff --git a/ResearchKit/Common/ORKHealthAnswerFormat.h b/ResearchKit/Common/ORKHealthAnswerFormat.h index e2afa235fd..3b5cdee54f 100644 --- a/ResearchKit/Common/ORKHealthAnswerFormat.h +++ b/ResearchKit/Common/ORKHealthAnswerFormat.h @@ -29,17 +29,28 @@ */ -@import HealthKit; #import +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import +#endif + NS_ASSUME_NONNULL_BEGIN +/** + An enumeration of biological sex options. + */ + typedef NSString *ORKBiologicalSexIdentifier NS_STRING_ENUM; ORK_EXTERN ORKBiologicalSexIdentifier const ORKBiologicalSexIdentifierFemale; ORK_EXTERN ORKBiologicalSexIdentifier const ORKBiologicalSexIdentifierMale; ORK_EXTERN ORKBiologicalSexIdentifier const ORKBiologicalSexIdentifierOther; +/** + An enumeration of blood type options. + */ + typedef NSString *ORKBloodTypeIdentifier NS_STRING_ENUM; ORK_EXTERN ORKBloodTypeIdentifier const ORKBloodTypeIdentifierAPositive; @@ -62,6 +73,8 @@ ORK_EXTERN ORKBloodTypeIdentifier const ORKBloodTypeIdentifierONegative; You can use the HealthKit characteristic answer format to let users autofill information, such as their blood type or date of birth. */ + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION ORK_CLASS_AVAILABLE @interface ORKHealthKitCharacteristicTypeAnswerFormat : ORKAnswerFormat @@ -213,6 +226,6 @@ included in the question result generated by form items or question steps - (NSString *)localizedUnitString; @end - +#endif NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKHealthAnswerFormat.m b/ResearchKit/Common/ORKHealthAnswerFormat.m index 3e9a84a877..e75df79e7d 100644 --- a/ResearchKit/Common/ORKHealthAnswerFormat.m +++ b/ResearchKit/Common/ORKHealthAnswerFormat.m @@ -38,7 +38,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKQuestionResult_Private.h" #import "ORKResult.h" - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION #pragma mark - ORKHealthAnswerFormat ORKBiologicalSexIdentifier const ORKBiologicalSexIdentifierFemale = @"HKBiologicalSexFemale"; @@ -420,3 +420,4 @@ - (NSString *)localizedUnitString { } @end +#endif diff --git a/ResearchKit/Common/ORKHealthCondition.h b/ResearchKit/Common/ORKHealthCondition.h new file mode 100644 index 0000000000..be33dd111e --- /dev/null +++ b/ResearchKit/Common/ORKHealthCondition.h @@ -0,0 +1,70 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +#import + +@class ORKTaskResult; + +NS_ASSUME_NONNULL_BEGIN + +/** + A base class that represents a single health condition displayed + by the family history step. + */ + +ORK_CLASS_AVAILABLE +@interface ORKHealthCondition : NSObject + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +/** + Creates a new health condition with the specified identifier. + + This method is the primary designated initializer. + + @param identifier The unique identifier of the health condition. + @param name The name displayed to the participant for selection. + @param value The value stored to the result if the health condition is selected. + */ + +- (instancetype)initWithIdentifier:(NSString *)identifier + displayName:(NSString *)name + value:(NSObject *)value NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, readonly, copy) NSString *identifier; +@property (nonatomic, readonly, copy) NSString *displayName; +@property (nonatomic, readonly, copy) NSObject *value; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKHealthCondition.m b/ResearchKit/Common/ORKHealthCondition.m new file mode 100644 index 0000000000..ce9196d0c1 --- /dev/null +++ b/ResearchKit/Common/ORKHealthCondition.m @@ -0,0 +1,98 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKHealthCondition.h" + +#import "ORKAnswerFormat_Internal.h" +#import "ORKCollectionResult.h" +#import "ORKHelpers_Internal.h" + + +@implementation ORKHealthCondition + +- (instancetype)initWithIdentifier:(NSString *)identifier + displayName:(NSString *)name + value:(NSObject *)value { + self = [super init]; + + if (self) { + _identifier = [identifier copy]; + _displayName = [name copy]; + _value = [value copy]; + } + + return self; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + ORK_ENCODE_OBJ(aCoder, identifier); + ORK_ENCODE_OBJ(aCoder, displayName); + ORK_ENCODE_OBJ(aCoder, value); +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self) { + ORK_DECODE_OBJ_CLASS(aDecoder, identifier, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, displayName, NSString); + ORK_DECODE_OBJ_CLASSES(aDecoder, value, ORKAllowableValueClasses()); + } + return self; +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone { + ORKHealthCondition *healthCondition = [[[self class] allocWithZone:zone] initWithIdentifier:[_identifier copy] + displayName:[_displayName copy] + value:[_value copy]]; + return healthCondition; +} + +- (BOOL)isEqual:(id)object { + if ([self class] != [object class]) { + return NO; + } + + __typeof(self) castObject = object; + return (ORKEqualObjects(self.identifier, castObject.identifier) + && ORKEqualObjects(self.displayName, castObject.displayName) + && ORKEqualObjects(self.value, castObject.value)); +} + +- (NSUInteger)hash { + return super.hash ^ self.identifier.hash ^ self.displayName.hash ^ self.value.hash; +} + +@end diff --git a/ResearchKit/Common/ORKHealthKitPermissionType.h b/ResearchKit/Common/ORKHealthKitPermissionType.h index 603ed92105..cd55a99a89 100644 --- a/ResearchKit/Common/ORKHealthKitPermissionType.h +++ b/ResearchKit/Common/ORKHealthKitPermissionType.h @@ -35,6 +35,10 @@ NS_ASSUME_NONNULL_BEGIN @class HKSampleType, HKObjectType; +/** + A permission type object that requests access for HealthKit data. + */ + ORK_CLASS_AVAILABLE @interface ORKHealthKitPermissionType : ORKPermissionType diff --git a/ResearchKit/Common/ORKHealthKitPermissionType.m b/ResearchKit/Common/ORKHealthKitPermissionType.m index 7fc36d39f4..a213dbc490 100644 --- a/ResearchKit/Common/ORKHealthKitPermissionType.m +++ b/ResearchKit/Common/ORKHealthKitPermissionType.m @@ -28,16 +28,19 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "ORKRequestPermissionButton.h" #import "ORKHealthKitPermissionType.h" #import "ORKHelpers_Internal.h" -#import "ORKRequestPermissionView.h" + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION #import +#endif static NSString *const Symbol = @"heart.fill"; static uint32_t const IconTintColor = 0xFF5E5E; -@implementation ORKHealthKitPermissionType +@implementation ORKHealthKitPermissionType { + ORKRequestPermissionsState _permissionState; +} + (instancetype)new { ORKThrowMethodUnavailableException(); @@ -53,79 +56,88 @@ - (instancetype)initWithSampleTypesToWrite:(NSSet *)sampleTypesT if (self) { self.sampleTypesToWrite = sampleTypesToWrite; self.objectTypesToRead = objectTypesToRead; - [self setupCardView]; [self checkHealthKitAuthorizationStatus]; } return self; } -- (void)setupCardView { - UIImage *image; - - if (@available(iOS 13.0, *)) { - image = [UIImage systemImageNamed:Symbol]; - } - - self.cardView = [[ORKRequestPermissionView alloc] initWithIconImage:image - title:ORKLocalizedString(@"REQUEST_HEALTH_DATA_STEP_VIEW_TITLE", nil) - detailText:ORKLocalizedString(@"REQUEST_HEALTH_DATA_STEP_VIEW_DESCRIPTION", nil)]; +- (NSString *)localizedTitle { + return ORKLocalizedString(@"REQUEST_HEALTH_DATA_STEP_VIEW_TITLE", nil); +} + +- (NSString *)localizedDetailText { + return ORKLocalizedString(@"REQUEST_HEALTH_DATA_STEP_VIEW_DESCRIPTION", nil); +} + +- (UIImage * _Nullable)image { + return [UIImage systemImageNamed:Symbol]; +} - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; - [self.cardView.requestPermissionButton addTarget:self action:@selector(requestPermissionButtonPressed) forControlEvents:UIControlEventTouchUpInside]; - [self.cardView updateIconTintColor:ORKRGB(IconTintColor)]; +- (UIColor *)iconTintColor { + return ORKRGB(IconTintColor); +} + +- (ORKRequestPermissionsState) permissionState { + return _permissionState; } - (void)checkHealthKitAuthorizationStatus { +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION if (![HKHealthStore isHealthDataAvailable]) { - [self setState:ORKRequestPermissionsButtonStateNotSupported canContinue:YES]; + _permissionState = ORKRequestPermissionsStateNotSupported; + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); + } return; } + + [[HKHealthStore new] getRequestStatusForAuthorizationToShareTypes:_sampleTypesToWrite readTypes:_objectTypesToRead completion:^(HKAuthorizationRequestStatus requestStatus, NSError * _Nullable error) { + dispatch_async(dispatch_get_main_queue(), ^{ + if (error) { + _permissionState = ORKRequestPermissionsStateError; + } else switch (requestStatus) { + case HKAuthorizationStatusSharingAuthorized: + _permissionState = ORKRequestPermissionsStateConnected; + break; + + case HKAuthorizationRequestStatusShouldRequest: + case HKAuthorizationRequestStatusUnknown: + _permissionState = ORKRequestPermissionsStateDefault; + break; + } + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); + } + + }); + }]; +#endif // ORK_FEATURE_HEALTHKIT_AUTHORIZATION - if (@available(iOS 12.0, *)) { - [[HKHealthStore new] getRequestStatusForAuthorizationToShareTypes:_sampleTypesToWrite readTypes:_objectTypesToRead completion:^(HKAuthorizationRequestStatus requestStatus, NSError * _Nullable error) { - dispatch_async(dispatch_get_main_queue(), ^{ - - if (error) { - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; - return; - } - - switch (requestStatus) { - - case HKAuthorizationStatusSharingAuthorized: - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; - break; - - case HKAuthorizationRequestStatusShouldRequest: - case HKAuthorizationRequestStatusUnknown: - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; - break; - } - }); - }]; - } else { - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; - } } -- (void)requestPermissionButtonPressed { +- (BOOL)canContinue { + BOOL result = self.permissionState == ORKRequestPermissionsStateConnected + || self.permissionState == ORKRequestPermissionsStateNotSupported + || self.permissionState == ORKRequestPermissionsStateError; + return result; +} + +- (void)requestPermission { +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION [[HKHealthStore new] requestAuthorizationToShareTypes:_sampleTypesToWrite readTypes:_objectTypesToRead completion:^(BOOL success, NSError * _Nullable error) { dispatch_async(dispatch_get_main_queue(), ^{ - if (error) { - [self setState:ORKRequestPermissionsButtonStateError canContinue:YES]; - return; + _permissionState = ORKRequestPermissionsStateError; + } else { + _permissionState = ORKRequestPermissionsStateConnected; + } + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); } - - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; }); }]; -} - -- (void)setState:(ORKRequestPermissionsButtonState)state canContinue:(BOOL)canContinue { - [self.cardView setEnableContinueButton:canContinue]; - [self.cardView.requestPermissionButton setState:state]; +#endif // ORK_FEATURE_HEALTHKIT_AUTHORIZATION } - (BOOL)isEqual:(id)object { diff --git a/ResearchKit/Common/ORKHealthSampleQueryOperation.h b/ResearchKit/Common/ORKHealthSampleQueryOperation.h index b70c31c4c6..a086afd385 100644 --- a/ResearchKit/Common/ORKHealthSampleQueryOperation.h +++ b/ResearchKit/Common/ORKHealthSampleQueryOperation.h @@ -31,8 +31,9 @@ #import #import "ORKOperation.h" +#import "ORKDefines.h" - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @class ORKDataCollectionManager; @class ORKCollector; @protocol ORKHealthCollectable; @@ -47,3 +48,4 @@ - (instancetype)initWithCollector:(ORKCollector *)collector mananger:(ORKDataCollectionManager *)manager; @end +#endif diff --git a/ResearchKit/Common/ORKHealthSampleQueryOperation.m b/ResearchKit/Common/ORKHealthSampleQueryOperation.m index 09535efacb..5c0d453738 100644 --- a/ResearchKit/Common/ORKHealthSampleQueryOperation.m +++ b/ResearchKit/Common/ORKHealthSampleQueryOperation.m @@ -35,7 +35,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKCollector_Internal.h" #import "ORKDataCollectionManager_Internal.h" - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION static NSUInteger const QueryLimitSize = 1000; @implementation ORKHealthSampleQueryOperation { @@ -245,3 +245,4 @@ - (void)handleResults:(NSArray *)results } @end +#endif diff --git a/ResearchKit/Common/ORKHelpers.m b/ResearchKit/Common/ORKHelpers.m index 55de5998b0..1fda3e8cb9 100644 --- a/ResearchKit/Common/ORKHelpers.m +++ b/ResearchKit/Common/ORKHelpers.m @@ -40,7 +40,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE BOOL ORKLoggingEnabled = YES; -NSURL *ORKCreateRandomBaseURL() { +NSURL *ORKCreateRandomBaseURL(void) { return [NSURL URLWithString:[NSString stringWithFormat:@"http://researchkit.%@/", [NSUUID UUID].UUIDString]]; } @@ -231,7 +231,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { } #endif -NSDateFormatter *ORKResultDateTimeFormatter() { +NSDateFormatter *ORKResultDateTimeFormatter(void) { static NSDateFormatter *dateTimeformatter = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -242,7 +242,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return dateTimeformatter; } -NSDateFormatter *ORKResultTimeFormatter() { +NSDateFormatter *ORKResultTimeFormatter(void) { static NSDateFormatter *timeformatter = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -253,7 +253,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return timeformatter; } -NSDateFormatter *ORKResultDateFormatter() { +NSDateFormatter *ORKResultDateFormatter(void) { static NSDateFormatter *dateformatter = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -264,7 +264,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return dateformatter; } -NSDateFormatter *ORKTimeOfDayLabelFormatter() { +NSDateFormatter *ORKTimeOfDayLabelFormatter(void) { static NSDateFormatter *timeformatter = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -276,7 +276,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return timeformatter; } -NSBundle *ORKBundle() { +NSBundle *ORKBundle(void) { static NSBundle *bundle; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -285,7 +285,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return bundle; } -NSBundle *ORKDefaultLocaleBundle() { +NSBundle *ORKDefaultLocaleBundle(void) { static NSBundle *bundle; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -295,7 +295,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return bundle; } -NSDateComponentsFormatter *ORKTimeIntervalLabelFormatter() { +NSDateComponentsFormatter *ORKTimeIntervalLabelFormatter(void) { static NSDateComponentsFormatter *durationFormatter = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -308,7 +308,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return durationFormatter; } -NSDateComponentsFormatter *ORKDurationStringFormatter() { +NSDateComponentsFormatter *ORKDurationStringFormatter(void) { static NSDateComponentsFormatter *durationFormatter = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -321,7 +321,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return durationFormatter; } -NSCalendar *ORKTimeOfDayReferenceCalendar() { +NSCalendar *ORKTimeOfDayReferenceCalendar(void) { static NSCalendar *calendar; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -366,7 +366,7 @@ void ORKEnableAutoLayoutForViews(NSArray *views) { return [ORKTimeOfDayReferenceCalendar() dateFromComponents:dateComponents]; } -BOOL ORKCurrentLocalePresentsFamilyNameFirst() { +BOOL ORKCurrentLocalePresentsFamilyNameFirst(void) { NSString *language = [[NSLocale preferredLanguages].firstObject substringToIndex:2]; static dispatch_once_t onceToken; static NSArray *familyNameFirstLanguages = nil; @@ -472,7 +472,7 @@ BOOL ORKCurrentLocalePresentsFamilyNameFirst() { } } -static NSURL *ORKHomeDirectoryURL() { +static NSURL *ORKHomeDirectoryURL(void) { static NSURL *homeDirectoryURL = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -552,7 +552,7 @@ void ORKAdjustPageViewControllerNavigationDirectionForRTL(UIPageViewControllerNa return [@"" stringByPaddingToLength:numberOfPaddingSpaces withString:@" " startingAtIndex:0]; } -NSNumberFormatter *ORKDecimalNumberFormatter() { +NSNumberFormatter *ORKDecimalNumberFormatter(void) { NSNumberFormatter *numberFormatter = [NSNumberFormatter new]; numberFormatter.numberStyle = NSNumberFormatterDecimalStyle; numberFormatter.maximumFractionDigits = NSDecimalNoScale; @@ -560,6 +560,3 @@ void ORKAdjustPageViewControllerNavigationDirectionForRTL(UIPageViewControllerNa return numberFormatter; } -NSString* ORKSwiftLocalizedString(NSString *key, NSString *comment) { - return ORKLocalizedString(key, comment); -} diff --git a/ResearchKit/Common/ORKHelpers_Internal.h b/ResearchKit/Common/ORKHelpers_Internal.h index 357b47a709..40ce9fed07 100644 --- a/ResearchKit/Common/ORKHelpers_Internal.h +++ b/ResearchKit/Common/ORKHelpers_Internal.h @@ -30,14 +30,19 @@ */ -@import UIKit; +#import +#if TARGET_OS_IOS #import #import #import +#endif + + #import #import + NS_ASSUME_NONNULL_BEGIN ORK_EXTERN BOOL ORKLoggingEnabled; @@ -206,6 +211,7 @@ UIFontDescriptor *ORKFontDescriptorForLightStylisticAlternative(UIFontDescriptor CGFloat ORKFloorToViewScale(CGFloat value, UIView *view); #endif + ORK_INLINE bool ORKEqualObjects(id o1, id o2) { return (o1 == o2) || (o1 && o2 && [o1 isEqual:o2]); @@ -273,6 +279,7 @@ ORKCGFloatNearlyEqualToFloat(CGFloat f1, CGFloat f2) { #define ORKThrowMethodUnavailableException() @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"method unavailable" userInfo:nil]; #define ORKThrowInvalidArgumentExceptionIfNil(argument) if (!argument) { @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@#argument" cannot be nil." userInfo:nil]; } +#define ORKThrowInvalidArgumentExceptionIfNotEqual(argument1, argument2) if (![argument1 isEqual:argument2]) { @throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"text argument(%@) and value argument(%@) are not equal",argument1, argument2] userInfo:nil]; } void ORKValidateArrayForObjectsOfClass(NSArray *array, Class expectedObjectClass, NSString *exceptionReason); @@ -365,6 +372,13 @@ ORK_INLINE double ORKPoundsToKilograms(double pounds) { return ORKPoundsAndOuncesToKilograms(pounds, 0); } +ORK_INLINE double ORKForceDoubleToLimits(double value) { + if (value == NAN || value == INFINITY) { + return DBL_MAX; + } + return fmin(fmax(value, -DBL_MAX), DBL_MAX); +} + ORK_INLINE UIColor *ORKOpaqueColorWithReducedAlphaFromBaseColor(UIColor *baseColor, NSUInteger colorIndex, NSUInteger totalColors) { UIColor *color = baseColor; if (totalColors > 1) { @@ -389,11 +403,8 @@ ORK_EXTERN NSBundle *ORKBundle(void) ORK_AVAILABLE_DECL; ORK_EXTERN NSBundle *ORKDefaultLocaleBundle(void); ORK_INLINE NSString *ORKLocalizedHiddenString(NSString *key) { - // try to find on hidden table - NSString *value = [ORKBundle() localizedStringForKey:key value:key table:@"No-Localization"]; + NSString *value = [ORKBundle() localizedStringForKey:key value:key table:@"ResearchKit"]; if ([value isEqualToString:key]) { - value = [ORKBundle() localizedStringForKey:key value:key table:@"ResearchKit"]; - } if ([value isEqualToString:key]) { // If it fails try to find on default table value = [ORKDefaultLocaleBundle() localizedStringForKey:key value:key table:@"ResearchKit"]; } @@ -409,6 +420,4 @@ ORKLocalizedHiddenString(key) #define ORKLocalizedStringFromNumber(number) \ [NSNumberFormatter localizedStringFromNumber:number numberStyle:NSNumberFormatterNoStyle] -NSString* ORKSwiftLocalizedString(NSString *key, NSString *comment); - NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKHelpers_Private.h b/ResearchKit/Common/ORKHelpers_Private.h index f0f4e19aa4..c021bfd702 100644 --- a/ResearchKit/Common/ORKHelpers_Private.h +++ b/ResearchKit/Common/ORKHelpers_Private.h @@ -29,9 +29,11 @@ */ -@import Foundation; - +#import +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKImageCaptureStep.h b/ResearchKit/Common/ORKImageCaptureStep.h index afbbc236f8..186708bfa9 100644 --- a/ResearchKit/Common/ORKImageCaptureStep.h +++ b/ResearchKit/Common/ORKImageCaptureStep.h @@ -29,15 +29,16 @@ */ -@import UIKit; +#import #import NS_ASSUME_NONNULL_BEGIN /** - The `ORKImageCaptureStep` class represents a step that captures an image through the device - camera. A template image can optionally be laid over the camera preview to assist in properly + A step that captures an image through the device camera. + + You can optionally place a template image over the camera preview to assist in properly capturing the image. To use the image capture step, optionally set the `templateImage` and `templateImageInsets` diff --git a/ResearchKit/Common/ORKImageCaptureStep.m b/ResearchKit/Common/ORKImageCaptureStep.m index 448652c0bf..58ca7dbc0c 100644 --- a/ResearchKit/Common/ORKImageCaptureStep.m +++ b/ResearchKit/Common/ORKImageCaptureStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKImageCaptureStep.h" -#import "ORKImageCaptureStepViewController.h" - #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -40,10 +38,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKImageCaptureStep -+ (Class)stepViewControllerClass { - return [ORKImageCaptureStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/Common/ORKInstructionStep.h b/ResearchKit/Common/ORKInstructionStep.h index 5ca149beab..056a26bbef 100644 --- a/ResearchKit/Common/ORKInstructionStep.h +++ b/ResearchKit/Common/ORKInstructionStep.h @@ -29,9 +29,13 @@ */ -@import UIKit; +#import + + +#if TARGET_OS_IOS #import +#endif NS_ASSUME_NONNULL_BEGIN @@ -56,6 +60,9 @@ ORK_CLASS_AVAILABLE @property (nonatomic) BOOL centerImageVertically; +@property(nonatomic) NSInteger type; + + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKInstructionStep.m b/ResearchKit/Common/ORKInstructionStep.m index 06058baa95..51b5686bc9 100644 --- a/ResearchKit/Common/ORKInstructionStep.m +++ b/ResearchKit/Common/ORKInstructionStep.m @@ -30,9 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKInstructionStep.h" -#if TARGET_OS_IOS -#import "ORKInstructionStepViewController.h" -#endif #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -40,12 +37,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKInstructionStep -#if TARGET_OS_IOS -+ (Class)stepViewControllerClass { - return [ORKInstructionStepViewController class]; -} -#endif - - (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { diff --git a/ResearchKit/Common/ORKInstructionStepView.h b/ResearchKit/Common/ORKInstructionStepView.h deleted file mode 100644 index 08acd1e830..0000000000 --- a/ResearchKit/Common/ORKInstructionStepView.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -#import "ORKVerticalContainerView.h" - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKInstructionStep; - -@interface ORKInstructionStepView : ORKVerticalContainerView - -@property (nonatomic, strong, nullable) ORKInstructionStep *instructionStep; - -@property (nonatomic, strong, nullable) UIImageView *instructionImageView; - -@property (nonatomic, strong, nullable) UIImageView *auxiliaryInstructionImageView; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKInstructionStepView.m b/ResearchKit/Common/ORKInstructionStepView.m deleted file mode 100644 index e8813736ba..0000000000 --- a/ResearchKit/Common/ORKInstructionStepView.m +++ /dev/null @@ -1,196 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKInstructionStepView.h" - -#import "ORKStepHeaderView_Internal.h" -#import "ORKTintedImageView.h" -#import "ORKVerticalContainerView_Internal.h" - -#import "ORKNavigationContainerView_Internal.h" - -#import "ORKInstructionStep.h" -#import "ORKCompletionStep.h" -#import "ORKStep_Private.h" - -#import "ORKHelpers_Internal.h" -#import "ORKSkin.h" - - -@implementation ORKInstructionStepView { - ORKTintedImageView *_auxiliaryInstructionImageView; - ORKTintedImageView *_instructionImageView; - UIView *_imageContainerView; - BOOL _isCompletionStep; - NSLayoutConstraint *_imageContainerHeightConstraint; -} - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - _instructionImageView = [ORKTintedImageView new]; - _instructionImageView.translatesAutoresizingMaskIntoConstraints = NO; - _instructionImageView.contentMode = UIViewContentModeScaleAspectFit; - - _auxiliaryInstructionImageView = [ORKTintedImageView new]; - _auxiliaryInstructionImageView.translatesAutoresizingMaskIntoConstraints = NO; - _auxiliaryInstructionImageView.contentMode = UIViewContentModeScaleAspectFit; - _auxiliaryInstructionImageView.tintColor = ORKColor(ORKAuxiliaryImageTintColorKey); - - _imageContainerView = [[UIView alloc] initWithFrame:frame]; - _imageContainerView.translatesAutoresizingMaskIntoConstraints = NO; - [_imageContainerView addSubview:_auxiliaryInstructionImageView]; - [_imageContainerView addSubview:_instructionImageView]; - - self.stepView = _imageContainerView; - } - return self; -} - -- (void)setInstructionStep:(ORKInstructionStep *)instructionStep { - _instructionStep = instructionStep; - UIImage *image = _instructionStep.image; - UIImage *auxiliaryImage = _instructionStep.auxiliaryImage; - BOOL hasImage = (image != nil); - BOOL hasFootnote = _instructionStep.footnote.length > 0; - - _isCompletionStep = [_instructionStep isKindOfClass:[ORKCompletionStep class]]; - - self.verticalCenteringEnabled = NO; - self.continueHugsContent = !hasImage && !hasFootnote; - self.stepViewFillsAvailableSpace = ((hasImage || hasFootnote) && !_isCompletionStep); - - _instructionImageView.image = image; - _instructionImageView.shouldApplyTint = instructionStep.shouldTintImages; - _auxiliaryInstructionImageView.image = auxiliaryImage; - _auxiliaryInstructionImageView.shouldApplyTint = instructionStep.shouldTintImages; - - CGSize imageSize = image.size; - if (imageSize.width > 0 && imageSize.height > 0) { - [NSLayoutConstraint deactivateConstraints:[_imageContainerView constraints]]; - NSMutableArray *constraints = [NSMutableArray new]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_imageContainerView - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationLessThanOrEqual - toItem:_imageContainerView - attribute:NSLayoutAttributeWidth - multiplier:imageSize.height / imageSize.width - constant:0.0]]; - - _imageContainerHeightConstraint = [NSLayoutConstraint constraintWithItem:_imageContainerView - attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationLessThanOrEqual - toItem:nil - attribute:NSLayoutAttributeNotAnAttribute - multiplier:1.0 - constant:300.0]; - - [constraints addObject:_imageContainerHeightConstraint]; - - NSDictionary *views = NSDictionaryOfVariableBindings(_instructionImageView, _auxiliaryInstructionImageView); - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_instructionImageView]|" - options:0 - metrics:nil - views:views]]; - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_instructionImageView]|" - options:0 - metrics:nil - views:views]]; - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[_auxiliaryInstructionImageView]|" - options:0 - metrics:nil - views:views]]; - [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_auxiliaryInstructionImageView]|" - options:0 - metrics:nil - views:views]]; - - [NSLayoutConstraint activateConstraints:constraints]; - - _instructionImageView.isAccessibilityElement = YES; - _instructionImageView.accessibilityLabel = [NSString stringWithFormat:ORKLocalizedString(@"AX_IMAGE_ILLUSTRATION", nil), _instructionStep.title]; - } else { - _instructionImageView.isAccessibilityElement = NO; - } - - self.headerView.iconImageView.image = _instructionStep.iconImage; - - NSMutableAttributedString *attributedInstruction = [[NSMutableAttributedString alloc] init]; - NSAttributedString *attributedDetail = _instructionStep.attributedDetailText; - NSString *detail = _instructionStep.detailText; - NSString *text = _instructionStep.text; - attributedDetail = attributedDetail.length ? attributedDetail : nil; - detail = detail.length ? detail : nil; - text = text.length ? text : nil; - - if (attributedDetail && text) { - [attributedInstruction appendAttributedString:[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n", text] attributes:nil]]; - - NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; - [style setParagraphSpacingBefore:self.headerView.instructionLabel.font.lineHeight * 0.5]; - [style setAlignment:NSTextAlignmentNatural]; - - [attributedInstruction appendAttributedString:attributedDetail]; - - } else if (detail && text) { - [attributedInstruction appendAttributedString:[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n", text] attributes:nil]]; - - NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; - [style setParagraphSpacingBefore:self.headerView.instructionLabel.font.lineHeight * 0.5]; - [style setAlignment:NSTextAlignmentNatural]; - - NSAttributedString *attString = [[NSMutableAttributedString alloc] initWithString:detail - attributes:@{NSParagraphStyleAttributeName: style}]; - [attributedInstruction appendAttributedString:attString]; - - } else if (attributedDetail || detail || text) { - if (attributedDetail) { - [attributedInstruction appendAttributedString:attributedDetail]; - } else { - [attributedInstruction appendAttributedString:[[NSAttributedString alloc] initWithString:detail ? : text attributes:nil]]; - } - } - - self.headerView.instructionLabel.attributedText = attributedInstruction; - - [self tintColorDidChange]; - - [self setNeedsUpdateConstraints]; -} - -- (void)updateConstraintConstantsForWindow:(UIWindow *)window { - [super updateConstraintConstantsForWindow:window]; - - const CGFloat IllustrationHeight = ORKGetMetricForWindow(ORKScreenMetricInstructionImageHeight, window); - _imageContainerHeightConstraint.constant = (_instructionImageView.image ? IllustrationHeight : 0); -} - -@end diff --git a/ResearchKit/Common/ORKKeychainWrapper.h b/ResearchKit/Common/ORKKeychainWrapper.h index 71192e9d49..c4412c6254 100644 --- a/ResearchKit/Common/ORKKeychainWrapper.h +++ b/ResearchKit/Common/ORKKeychainWrapper.h @@ -29,15 +29,14 @@ */ -@import Foundation; +#import #import NS_ASSUME_NONNULL_BEGIN /** - The `ORKKeychainWrapper` class is an abstraction layer for the iOS keychain - communication. + An abstraction layer for iOS keychain communication. */ ORK_CLASS_AVAILABLE @interface ORKKeychainWrapper : NSObject @@ -66,7 +65,7 @@ ORK_CLASS_AVAILABLE @return An object or `nil` if key is not valid. */ -+ (nullable id)objectOfClass:(Class)objectClass forKey:(NSString *)key error:(NSError * __autoreleasing _Nullable *)errorOut; ++ (nullable id)objectForKey:(nonnull NSString *)key error:(NSError * __autoreleasing _Nullable *)error; /** Removes the object in the keychain for the provided key. diff --git a/ResearchKit/Common/ORKKeychainWrapper.m b/ResearchKit/Common/ORKKeychainWrapper.m index 8fa66caa4b..f13f74ea25 100644 --- a/ResearchKit/Common/ORKKeychainWrapper.m +++ b/ResearchKit/Common/ORKKeychainWrapper.m @@ -35,7 +35,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ResearchKit/ResearchKit-Swift.h" -static NSString *ORKKeychainWrapperDefaultService() { +static NSString *ORKKeychainWrapperDefaultService(void) { static NSString *defaultService; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -61,14 +61,14 @@ + (BOOL)setObject:(id)object error:errorOut]; } -+ (id)objectOfClass:(Class)objectClass forKey:(NSString *)key - error:(NSError **)errorOut { - NSData *data = [self dataForKey:key - service:ORKKeychainWrapperDefaultService() - accessGroup:nil - error:errorOut]; - - return data ? [NSKeyedUnarchiver unarchivedObjectOfClass:objectClass fromData:data error:errorOut] : nil; ++ (id)objectForKey:(NSString *)key + error:(NSError **)errorOut { + NSData *data = [self dataForKey:key + service:ORKKeychainWrapperDefaultService() + accessGroup:nil + error:errorOut]; + NSSet *expectedClasses = [NSSet setWithObjects:[NSMutableDictionary class], [NSData class], [NSString class], [NSNumber class], nil]; + return data ? [NSKeyedUnarchiver unarchivedObjectOfClasses:expectedClasses fromData:data error:NULL] : nil; } + (BOOL)removeObjectForKey:(NSString *)key diff --git a/ResearchKit/Common/ORKLearnMoreInstructionStep.h b/ResearchKit/Common/ORKLearnMoreInstructionStep.h index c001657062..f94442a810 100644 --- a/ResearchKit/Common/ORKLearnMoreInstructionStep.h +++ b/ResearchKit/Common/ORKLearnMoreInstructionStep.h @@ -33,6 +33,11 @@ NS_ASSUME_NONNULL_BEGIN +/** + A step that a Learn More Item object uses to display + additional information with a question. + */ + ORK_CLASS_AVAILABLE @interface ORKLearnMoreInstructionStep : ORKInstructionStep diff --git a/ResearchKit/Common/ORKLearnMoreInstructionStep.m b/ResearchKit/Common/ORKLearnMoreInstructionStep.m index 04d038838f..066b428b86 100644 --- a/ResearchKit/Common/ORKLearnMoreInstructionStep.m +++ b/ResearchKit/Common/ORKLearnMoreInstructionStep.m @@ -30,14 +30,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKLearnMoreInstructionStep.h" -#import "ORKLearnMoreStepViewController.h" @implementation ORKLearnMoreInstructionStep -+ (Class)stepViewControllerClass { - return [ORKLearnMoreStepViewController class]; -} - + (BOOL)supportsSecureCoding { return YES; } diff --git a/ResearchKit/Common/ORKLearnMoreItem.h b/ResearchKit/Common/ORKLearnMoreItem.h index 1d5f347b25..36fef820c1 100644 --- a/ResearchKit/Common/ORKLearnMoreItem.h +++ b/ResearchKit/Common/ORKLearnMoreItem.h @@ -37,6 +37,11 @@ NS_ASSUME_NONNULL_BEGIN @class ORKLearnMoreView; @protocol ORKLearnMoreViewDelegate; +/** + An object that allows additional information to be + presented with a question. + */ + ORK_CLASS_AVAILABLE @interface ORKLearnMoreItem : NSObject diff --git a/ResearchKit/Common/ORKLocationPermissionType.h b/ResearchKit/Common/ORKLocationPermissionType.h index ec9d6b96ea..42cdd6c1f3 100644 --- a/ResearchKit/Common/ORKLocationPermissionType.h +++ b/ResearchKit/Common/ORKLocationPermissionType.h @@ -33,9 +33,15 @@ NS_ASSUME_NONNULL_BEGIN +/** + A permission type object that requests access for location data. + */ + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION ORK_CLASS_AVAILABLE @interface ORKLocationPermissionType : ORKPermissionType @end +#endif NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKLocationPermissionType.m b/ResearchKit/Common/ORKLocationPermissionType.m index cde739f36c..c6cd467863 100644 --- a/ResearchKit/Common/ORKLocationPermissionType.m +++ b/ResearchKit/Common/ORKLocationPermissionType.m @@ -29,11 +29,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKLocationPermissionType.h" -#import "ORKRequestPermissionView.h" #import "ORKHelpers_Internal.h" -#import "ORKRequestPermissionButton.h" -@import CoreLocation; +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +#import +#import static NSString *const Symbol = @"location.circle"; static const uint32_t IconLightTintColor = 0x50C878; @@ -49,15 +49,6 @@ + (instancetype)new { return [[ORKLocationPermissionType alloc] init]; } -- (instancetype)init -{ - self = [super init]; - if (self) { - [self setupCardView]; - } - return self; -} - - (CLLocationManager *)locationManager { if (!_locationManager) { _locationManager = [[CLLocationManager alloc] init]; @@ -66,60 +57,56 @@ - (CLLocationManager *)locationManager { return _locationManager; } -- (void)setupCardView { - - UIImage *image; - if (@available(iOS 13, *)) { - image = [UIImage systemImageNamed:Symbol]; - } - - self.cardView = [[ORKRequestPermissionView alloc] - initWithIconImage:image - title:ORKLocalizedString(@"REQUEST_LOCATION_DATA_STEP_VIEW_TITLE", nil) - detailText:ORKLocalizedString(@"REQUEST_LOCATION_DATA_STEP_VIEW_DESCRIPTION", nil)]; +- (NSString *)localizedTitle { + return ORKLocalizedString(@"REQUEST_LOCATION_DATA_STEP_VIEW_TITLE", nil); +} - [self.cardView.requestPermissionButton addTarget:self action:@selector(requestPermissionButtonPressed) forControlEvents:UIControlEventTouchUpInside]; - - // Set the tint color for the icon - if (@available(iOS 13, *)) { - UIColor *dynamicTint = [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { - return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); - }]; - [self.cardView updateIconTintColor:dynamicTint]; - } else { - [self.cardView updateIconTintColor:ORKRGB(IconLightTintColor)]; - } - - [self checkLocationAuthStatus]; +- (NSString *)localizedDetailText { + return ORKLocalizedString(@"REQUEST_LOCATION_DATA_STEP_VIEW_DESCRIPTION", nil); } --(void)checkLocationAuthStatus { +- (UIImage * _Nullable)image { + return [UIImage systemImageNamed:Symbol]; +} + +- (UIColor *)iconTintColor { + return [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { + return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); + }]; +} + +- (ORKRequestPermissionsState)permissionState { switch (CLLocationManager.authorizationStatus) { case kCLAuthorizationStatusNotDetermined: - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; - break; + return ORKRequestPermissionsStateDefault; case kCLAuthorizationStatusAuthorizedAlways: case kCLAuthorizationStatusAuthorizedWhenInUse: case kCLAuthorizationStatusRestricted: case kCLAuthorizationStatusDenied: - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; - break; + return ORKRequestPermissionsStateConnected; } } +- (BOOL)canContinue { + return self.permissionState == ORKRequestPermissionsStateConnected; +} + - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { - [self checkLocationAuthStatus]; + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); + } } // Request for always permission. -- (void)requestPermissionButtonPressed { +- (void)requestPermission { [self.locationManager requestAlwaysAuthorization]; -} - -- (void)setState:(ORKRequestPermissionsButtonState)state canContinue:(BOOL)canContinue { - [self.cardView setEnableContinueButton:canContinue]; - [self.cardView.requestPermissionButton setState:state]; + + BOOL requestWasDelivered = [self.locationManager ork_requestAlwaysAuthorization]; + + // if the auth request was not delivered, that means ResearchKit was built with CoreLocation requests disabled + // Presenting the location permission step in this case is probably programmer error + NSAssert(requestWasDelivered, @"Tried to invoke -[CLLocationManager requestAlwaysAuthorization] but ResearchKit was compiled with CoreLocation authorization requests disabled. This is a programmer error. Check build settings for ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION"); } - (BOOL)isEqual:(id)object { @@ -130,3 +117,4 @@ - (BOOL)isEqual:(id)object { } @end +#endif diff --git a/ResearchKit/Common/ORKMotionActivityPermissionType.h b/ResearchKit/Common/ORKMotionActivityPermissionType.h index fa6e8a1052..1a4792c2d1 100644 --- a/ResearchKit/Common/ORKMotionActivityPermissionType.h +++ b/ResearchKit/Common/ORKMotionActivityPermissionType.h @@ -30,9 +30,12 @@ #import #import - NS_ASSUME_NONNULL_BEGIN +/** + A permission type object that requests access for motion activity. + */ + ORK_CLASS_AVAILABLE @interface ORKMotionActivityPermissionType : ORKPermissionType diff --git a/ResearchKit/Common/ORKMotionActivityPermissionType.m b/ResearchKit/Common/ORKMotionActivityPermissionType.m index 3d8607da40..dbada52090 100644 --- a/ResearchKit/Common/ORKMotionActivityPermissionType.m +++ b/ResearchKit/Common/ORKMotionActivityPermissionType.m @@ -29,8 +29,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKMotionActivityPermissionType.h" -#import "ORKRequestPermissionView.h" -#import "ORKRequestPermissionButton.h" #import "ORKHelpers_Internal.h" @import CoreMotion; @@ -41,23 +39,29 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @interface ORKMotionActivityPermissionType() @property (nonatomic) CMMotionActivityManager *activityManager; +@property (nonatomic, readonly, assign) ORKRequestPermissionsState permissionState; +@property (nonatomic, readonly, assign) BOOL canContinue; @end -@implementation ORKMotionActivityPermissionType +@implementation ORKMotionActivityPermissionType { + __weak NSTimer *_checkStatusTimer; +} + (instancetype)new { return [[ORKMotionActivityPermissionType alloc] init]; } -- (instancetype)init -{ +- (instancetype)init { self = [super init]; if (self) { - [self setupCardView]; } return self; } +- (void)cleanUp { + [self _invalidateCheckStatusTimer]; +} + - (CMMotionActivityManager *)activityManager { if (!_activityManager) { _activityManager = [[CMMotionActivityManager alloc] init]; @@ -65,60 +69,74 @@ - (CMMotionActivityManager *)activityManager { return _activityManager; } -- (void)setupCardView { +- (NSString *)localizedTitle { + return ORKLocalizedString(@"REQUEST_MOTION_ACTIVITY_STEP_VIEW_TITLE", nil); +} - UIImage *image; - if (@available(iOS 13, *)) { - image = [UIImage systemImageNamed:Symbol]; - } +- (NSString *)localizedDetailText { + return ORKLocalizedString(@"REQUEST_MOTION_ACTIVITY_STEP_VIEW_DESCRIPTION", nil); +} - self.cardView = [[ORKRequestPermissionView alloc] - initWithIconImage:image - title:ORKLocalizedString(@"REQUEST_MOTION_ACTIVITY_STEP_VIEW_TITLE", nil) - detailText:ORKLocalizedString(@"REQUEST_MOTION_ACTIVITY_STEP_VIEW_DESCRIPTION", nil)]; - - [self.cardView.requestPermissionButton addTarget:self action:@selector(requestPermissionButtonPressed) forControlEvents:UIControlEventTouchUpInside]; - - // Set the tint color for the icon - if (@available(iOS 13, *)) { - UIColor *dynamicTint = [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { - return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); - }]; - [self.cardView updateIconTintColor:dynamicTint]; - } else { - [self.cardView updateIconTintColor:ORKRGB(IconLightTintColor)]; - } +- (UIImage * _Nullable)image { + return [UIImage systemImageNamed:Symbol]; +} - [self checkMotionAuthStatus]; +- (UIColor *)iconTintColor { + return [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { + return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); + }]; } --(void)checkMotionAuthStatus { +- (ORKRequestPermissionsState)permissionState { switch (CMMotionActivityManager.authorizationStatus) { case CMAuthorizationStatusNotDetermined: - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; - break; + return ORKRequestPermissionsStateDefault; case CMAuthorizationStatusDenied: case CMAuthorizationStatusAuthorized: case CMAuthorizationStatusRestricted: - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; - break; + return ORKRequestPermissionsStateConnected; } } +- (BOOL)canContinue { + return self.permissionState == ORKRequestPermissionsStateConnected; +} + // There is no explicit API for requesting device motion permission. // It is requested automatically when you try read data for the first time. // This method tries to read data in order to trigger the permission dialogue. -- (void)requestPermissionButtonPressed { +- (void)requestPermission { [self.activityManager startActivityUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMMotionActivity * _Nullable activity) {}]; [self.activityManager stopActivityUpdates]; - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; + + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); + } + + if (!_checkStatusTimer) { + __weak typeof(self) weakSelf = self; + _checkStatusTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 + target:weakSelf + selector:@selector(_checkPermissionStatus) + userInfo:nil + repeats:YES]; + } } -- (void)setState:(ORKRequestPermissionsButtonState)state canContinue:(BOOL)canContinue { - [self.cardView setEnableContinueButton:canContinue]; - [self.cardView.requestPermissionButton setState:state]; +- (void)_checkPermissionStatus { + if ([self permissionState] == ORKRequestPermissionsStateConnected && self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); + [self _invalidateCheckStatusTimer]; + } +} + +- (void)_invalidateCheckStatusTimer { + if (_checkStatusTimer) { + [_checkStatusTimer invalidate]; + _checkStatusTimer = nil; + } } - (BOOL)isEqual:(id)object { diff --git a/ResearchKit/Common/ORKNavigableOrderedTask.h b/ResearchKit/Common/ORKNavigableOrderedTask.h index bff33ab9cf..bec033d834 100644 --- a/ResearchKit/Common/ORKNavigableOrderedTask.h +++ b/ResearchKit/Common/ORKNavigableOrderedTask.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import @@ -40,8 +40,7 @@ NS_ASSUME_NONNULL_BEGIN @class ORKStepModifier; /** - The `ORKNavigableOrderedTask` class adds conditional step navigation to the behavior inherited from - the `ORKOrderedTask` class. + A collection of steps that are presented with possible conditional step navigation behavior. For implementing conditional task navigation, you must instantiate concrete subclasses of `ORKStepNavigationRule` and `ORKSkipStepNavigationRule` and attach them to trigger steps by using diff --git a/ResearchKit/Common/ORKNotificationPermissionType.h b/ResearchKit/Common/ORKNotificationPermissionType.h index 5280e7fa10..6402b97d15 100644 --- a/ResearchKit/Common/ORKNotificationPermissionType.h +++ b/ResearchKit/Common/ORKNotificationPermissionType.h @@ -33,6 +33,10 @@ NS_ASSUME_NONNULL_BEGIN +/** + A permission type object that requests permission to send user notifications. + */ + ORK_CLASS_AVAILABLE @interface ORKNotificationPermissionType : ORKPermissionType diff --git a/ResearchKit/Common/ORKNotificationPermissionType.m b/ResearchKit/Common/ORKNotificationPermissionType.m index 72c8d9c5b3..8e8fe3783e 100644 --- a/ResearchKit/Common/ORKNotificationPermissionType.m +++ b/ResearchKit/Common/ORKNotificationPermissionType.m @@ -31,21 +31,15 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import #import "ORKNotificationPermissionType.h" -#import "ORKRequestPermissionButton.h" -#import "ORKRequestPermissionView.h" #import "ORKHelpers_Internal.h" static NSString *const Symbol = @"app.badge"; static const uint32_t IconLightTintColor = 0xFBD00B; static const uint32_t IconDarkTintColor = 0xFFD005; -@interface ORKNotificationPermissionType () - -@property UNAuthorizationOptions options; - -@end - -@implementation ORKNotificationPermissionType +@implementation ORKNotificationPermissionType { + ORKRequestPermissionsState _permissionState; +} + (instancetype)new { ORKThrowMethodUnavailableException(); @@ -59,76 +53,80 @@ - (instancetype)initWithAuthorizationOptions:(UNAuthorizationOptions)options { NSAssert(options != 0, @"Authorization options must not be empty!"); self = [super init]; if (self) { - self.options = options; - [self setupCardView]; + _options = options; + _permissionState = ORKRequestPermissionsStateDefault; + [self getInitialStatus]; } return self; } -- (void)setupCardView { - UIImage *image; +- (NSString *)localizedTitle { + return ORKLocalizedString(@"REQUEST_NOTIFICATIONS_STEP_VIEW_TITLE", nil); +} - if (@available(iOS 13.0, *)) { - image = [UIImage systemImageNamed:Symbol]; - } +- (NSString *)localizedDetailText { + return ORKLocalizedString(@"REQUEST_NOTIFICATIONS_STEP_VIEW_DESCRIPTION", nil); +} - self.cardView = [[ORKRequestPermissionView alloc] initWithIconImage:image - title:ORKLocalizedString(@"REQUEST_NOTIFICATIONS_STEP_VIEW_TITLE", nil) - detailText:ORKLocalizedString(@"REQUEST_NOTIFICATIONS_STEP_VIEW_DESCRIPTION", nil)]; +- (UIImage * _Nullable)image { + return [UIImage systemImageNamed:Symbol]; +} - [self.cardView.requestPermissionButton addTarget:self action:@selector(requestPermissionButtonPressed) forControlEvents:UIControlEventTouchUpInside]; +- (UIColor *)iconTintColor { + return [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { + return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); + }]; +} - // Set the tint color for the icon - if (@available(iOS 13, *)) { - UIColor *dynamicTint = [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { - return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); - }]; - [self.cardView updateIconTintColor:dynamicTint]; - } else { - [self.cardView updateIconTintColor:ORKRGB(IconLightTintColor)]; - } +- (ORKRequestPermissionsState)permissionState { + return _permissionState; +} - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; +- (BOOL)canContinue { + return self.permissionState == ORKRequestPermissionsStateConnected || self.permissionState == ORKRequestPermissionsStateError; +} +- (void)getInitialStatus { [[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { dispatch_async(dispatch_get_main_queue(), ^{ switch (settings.authorizationStatus) { - case UNAuthorizationStatusNotDetermined: - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; + _permissionState = ORKRequestPermissionsStateDefault; break; case UNAuthorizationStatusEphemeral: case UNAuthorizationStatusAuthorized: case UNAuthorizationStatusProvisional: case UNAuthorizationStatusDenied: - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; + _permissionState = ORKRequestPermissionsStateConnected; break; } + + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); + } }); }]; } -- (void)requestPermissionButtonPressed { +- (void)requestPermission { [[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions: self.options completionHandler:^(BOOL granted, NSError * _Nullable error) { dispatch_async(dispatch_get_main_queue(), ^{ if (error) { - [self setState:ORKRequestPermissionsButtonStateError canContinue:YES]; - return; + _permissionState = ORKRequestPermissionsStateError; + } else { + _permissionState = ORKRequestPermissionsStateConnected; + } + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); } - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; }); }]; } -- (void)setState:(ORKRequestPermissionsButtonState)state canContinue:(BOOL)canContinue { - [self.cardView setEnableContinueButton:canContinue]; - [self.cardView.requestPermissionButton setState:state]; -} - - (BOOL)isEqual:(id)object { if ([self class] != [object class]) { return NO; diff --git a/ResearchKit/Common/ORKOrderedTask.h b/ResearchKit/Common/ORKOrderedTask.h index 43803e3c11..016f7bc8a6 100644 --- a/ResearchKit/Common/ORKOrderedTask.h +++ b/ResearchKit/Common/ORKOrderedTask.h @@ -29,16 +29,18 @@ */ -@import UIKit; +#import + +#if TARGET_OS_IOS #import +#endif NS_ASSUME_NONNULL_BEGIN /** - The `ORKOrderedTask` class implements all the methods in the `ORKTask` protocol and represents a - task that assumes a fixed order for its steps. + A collection of steps that is presented in a fixed order. In the ResearchKit framework, any simple sequential task, such as a survey or an active task, can be represented as an ordered task. diff --git a/ResearchKit/Common/ORKOrderedTask.m b/ResearchKit/Common/ORKOrderedTask.m index 851b9e1797..727346bed6 100644 --- a/ResearchKit/Common/ORKOrderedTask.m +++ b/ResearchKit/Common/ORKOrderedTask.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKOrderedTask.h" -#import "ORKQuestionStep.h" #import "ORKAnswerFormat.h" #import "ORKInstructionStep.h" #import "ORKCompletionStep.h" @@ -38,8 +37,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKSkin.h" #if TARGET_OS_IOS +#import "ORKQuestionStep.h" #import "ORKFormStep.h" -#import "ORKFormStepViewController.h" #import "ORKFormItem_Internal.h" #import "ORKActiveStep_Internal.h" #import "ORKEarlyTerminationConfiguration.h" diff --git a/ResearchKit/Common/ORKPDFViewerStep.m b/ResearchKit/Common/ORKPDFViewerStep.m index 364ea3ce73..e6f2318db3 100644 --- a/ResearchKit/Common/ORKPDFViewerStep.m +++ b/ResearchKit/Common/ORKPDFViewerStep.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKPDFViewerStep.h" -#import "ORKPDFViewerStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKPDFViewerStep { @@ -60,12 +59,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier pdfURL:(nullable NSURL return self; } -#pragma mark - view controller instantiation - -+ (Class)stepViewControllerClass { - return [ORKPDFViewerStepViewController class]; -} - #pragma mark - NSCopying - (instancetype)copyWithZone:(NSZone *)zone { diff --git a/ResearchKit/Common/ORKPageStep.h b/ResearchKit/Common/ORKPageStep.h index 004a8337fc..f8ff19d4af 100644 --- a/ResearchKit/Common/ORKPageStep.h +++ b/ResearchKit/Common/ORKPageStep.h @@ -28,15 +28,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#if TARGET_OS_IOS #import #import +#endif NS_ASSUME_NONNULL_BEGIN /** - The `ORKPageStep` class is a concrete subclass of `ORKStep`, used for presenting a subgrouping of - `ORKStepViewController` views using a `UIPageViewController`. + A class used for presenting a subgrouping of + step view controller views using a page view controller. To use `ORKPageStep`, instantiate the object, fill in its properties, and include it in a task. Next, create a task view controller for the task and present it. diff --git a/ResearchKit/Common/ORKPageStep.m b/ResearchKit/Common/ORKPageStep.m index 0b4e92dda8..5701945beb 100644 --- a/ResearchKit/Common/ORKPageStep.m +++ b/ResearchKit/Common/ORKPageStep.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKPageStep_Private.h" #import "ORKHelpers_Internal.h" -#import "ORKPageStepViewController.h" #import "ORKResult.h" @@ -65,12 +64,6 @@ - (void)ork_initializePageTask:(ORKOrderedTask *)task { return self.pageTask.steps; } -#pragma mark - view controller instantiation - -+ (Class)stepViewControllerClass { - return [ORKPageStepViewController class]; -} - #pragma mark - permissions - (ORKPermissionMask)requestedPermissions { @@ -80,12 +73,14 @@ - (ORKPermissionMask)requestedPermissions { return ORKPermissionNone; } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (NSSet *)requestedHealthKitTypesForReading { if ([self.pageTask respondsToSelector:@selector(requestedHealthKitTypesForReading)]) { return [self.pageTask requestedHealthKitTypesForReading]; } return nil; } +#endif #pragma mark - NSCopying diff --git a/ResearchKit/Common/ORKPasscodeResult.h b/ResearchKit/Common/ORKPasscodeResult.h index 7c06c8c4ab..4f72a60484 100644 --- a/ResearchKit/Common/ORKPasscodeResult.h +++ b/ResearchKit/Common/ORKPasscodeResult.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /** - The `ORKPasscodeResult` class records the results of a passcode step. + A result object of the passcode step. The passcode result object contains a boolean indicating whether the passcode was saved or not. */ diff --git a/ResearchKit/Common/ORKPasscodeStep.h b/ResearchKit/Common/ORKPasscodeStep.h index 2b0ced58f5..4ade5952f2 100644 --- a/ResearchKit/Common/ORKPasscodeStep.h +++ b/ResearchKit/Common/ORKPasscodeStep.h @@ -29,14 +29,14 @@ */ -@import Foundation; +#import #import NS_ASSUME_NONNULL_BEGIN /** - An enumeration of values used in `ORKPasscodeStepViewController` to indicate the type of flow used + An enumeration of values used in passcode view controller to indicate the type of flow used by the view controller. */ typedef NS_ENUM(NSUInteger, ORKPasscodeFlow) { diff --git a/ResearchKit/Common/ORKPasscodeStep.m b/ResearchKit/Common/ORKPasscodeStep.m index 0db6269bf0..0e55054f63 100644 --- a/ResearchKit/Common/ORKPasscodeStep.m +++ b/ResearchKit/Common/ORKPasscodeStep.m @@ -31,17 +31,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKPasscodeStep.h" -#import "ORKPasscodeStepViewController.h" - #import "ORKHelpers_Internal.h" @implementation ORKPasscodeStep -+ (Class)stepViewControllerClass { - return [ORKPasscodeStepViewController class]; -} - + (instancetype)passcodeStepWithIdentifier:(NSString *)identifier passcodeFlow:(ORKPasscodeFlow)passcodeFlow { diff --git a/ResearchKit/Common/ORKPermissionType.h b/ResearchKit/Common/ORKPermissionType.h index 456a2bfc14..aa0c146014 100644 --- a/ResearchKit/Common/ORKPermissionType.h +++ b/ResearchKit/Common/ORKPermissionType.h @@ -28,7 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import +#import #import @@ -39,16 +40,36 @@ NS_ASSUME_NONNULL_BEGIN @class ORKSensorPermissionType; @class ORKMotionActivityPermissionType; @class ORKLocationPermissionType; -@class ORKRequestPermissionView; @class HKSampleType, HKObjectType; +typedef NS_ENUM(NSInteger, ORKRequestPermissionsState) { + ORKRequestPermissionsStateDefault = 0, + ORKRequestPermissionsStateConnected, + ORKRequestPermissionsStateNotSupported, + ORKRequestPermissionsStateError, +}; + typedef NS_OPTIONS(NSUInteger, UNAuthorizationOptions); typedef NSString * SRSensor NS_TYPED_ENUM API_AVAILABLE(ios(14.0)); +/** + An abstract class that all permission types subclass from. + */ + ORK_CLASS_AVAILABLE @interface ORKPermissionType : NSObject -@property (nonatomic) ORKRequestPermissionView *cardView; +@property (nonatomic, copy) void (^permissionsStatusUpdateCallback)(void); + +@property (nonatomic, copy, readonly) NSString *localizedTitle; +@property (nonatomic, copy, readonly) NSString *localizedDetailText; +@property (nonatomic, strong, readonly) UIImage * _Nullable image; +@property (nonatomic, copy, readonly) UIColor *iconTintColor; +@property (nonatomic, assign, readonly) ORKRequestPermissionsState permissionState; +@property (nonatomic, assign, readonly) BOOL canContinue; + +- (void)requestPermission; +- (void)cleanUp; + (ORKHealthKitPermissionType *)healthKitPermissionTypeWithSampleTypesToWrite:(nullable NSSet *)sampleTypesToWrite objectTypesToRead:(nullable NSSet *)objectTypesToRead; @@ -59,7 +80,9 @@ ORK_CLASS_AVAILABLE + (ORKMotionActivityPermissionType *) deviceMotionPermissionType; +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + (ORKLocationPermissionType *) locationPermissionType; +#endif @end diff --git a/ResearchKit/Common/ORKPermissionType.m b/ResearchKit/Common/ORKPermissionType.m index fcafd5441b..5d99e4eeed 100644 --- a/ResearchKit/Common/ORKPermissionType.m +++ b/ResearchKit/Common/ORKPermissionType.m @@ -38,6 +38,38 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKPermissionType +- (NSString *)localizedTitle { + ORKThrowMethodUnavailableException(); +} + +- (NSString *)localizedDetailText { + ORKThrowMethodUnavailableException(); +} + +- (UIImage * _Nullable)image { + ORKThrowMethodUnavailableException(); +} + +- (UIColor *)iconTintColor { + ORKThrowMethodUnavailableException(); +} + +- (ORKRequestPermissionsState)permissionState { + ORKThrowMethodUnavailableException(); +} + +- (BOOL)canContinue { + ORKThrowMethodUnavailableException(); +} + +- (void)requestPermission { + ORKThrowMethodUnavailableException(); +} + +- (void)cleanUp { + // left empty for optional subclass override +} + + (ORKHealthKitPermissionType *)healthKitPermissionTypeWithSampleTypesToWrite:(NSSet *)sampleTypesToWrite objectTypesToRead:(NSSet *)objectTypesToRead { return [[ORKHealthKitPermissionType alloc] initWithSampleTypesToWrite:sampleTypesToWrite objectTypesToRead:objectTypesToRead]; @@ -55,8 +87,11 @@ + (ORKMotionActivityPermissionType *)deviceMotionPermissionType { return [[ORKMotionActivityPermissionType alloc] init]; } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + (ORKLocationPermissionType *) locationPermissionType { return [[ORKLocationPermissionType alloc] init]; } +#endif @end + diff --git a/ResearchKit/Common/ORKPredicateFormItemVisibilityRule.h b/ResearchKit/Common/ORKPredicateFormItemVisibilityRule.h new file mode 100644 index 0000000000..a0885cae0d --- /dev/null +++ b/ResearchKit/Common/ORKPredicateFormItemVisibilityRule.h @@ -0,0 +1,53 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + A visibility rule you add to form items to + conditionally present a question. + */ + +ORK_CLASS_AVAILABLE +@interface ORKPredicateFormItemVisibilityRule : ORKFormItemVisibilityRule + +- (instancetype)init NS_UNAVAILABLE; + +- (instancetype)initWithPredicate:(NSPredicate *)predicate NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, copy, readonly) NSPredicate *predicate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKPredicateFormItemVisibilityRule.m b/ResearchKit/Common/ORKPredicateFormItemVisibilityRule.m new file mode 100644 index 0000000000..86dfdf465f --- /dev/null +++ b/ResearchKit/Common/ORKPredicateFormItemVisibilityRule.m @@ -0,0 +1,130 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import +#import + +#import "ORKHelpers_Internal.h" + +NS_ASSUME_NONNULL_BEGIN + +@implementation ORKPredicateFormItemVisibilityRule + +- (instancetype)init { + ORKThrowMethodUnavailableException(); +} + +- (nullable instancetype)initWithPredicateFormat:(NSString *)predicateFormat { + NSPredicate *predicate; + @try { + predicate = [NSPredicate predicateWithFormat:predicateFormat]; + } @catch (NSException *exception) { + ORK_Log_Fault("ORKPredicateFormItemVisibilityRule: Error creating predicate from predicateFormat string: '%{public}@' (error: %{public}@)", predicateFormat, [exception debugDescription]); + predicate = nil; + } + if (predicate != nil) { + self = [self initWithPredicate:predicate]; + _predicateFormat = [predicateFormat copy]; + } + return self; +} + +- (instancetype)initWithPredicate:(NSPredicate *)predicate { + self = [super init]; + if (self != nil) { + _predicate = [predicate copy]; + } + return self; +} + +#pragma mark NSSecureCoding + ++ (BOOL)supportsSecureCoding { + return YES; +} + +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + // [predicate allowEvaluation] is needed because Foundation doesn’t want any old predicate decoded and then end up providing a vector for user data to execute arbitrary code. + if (self && (aDecoder.requiresSecureCoding == YES)) { + ORK_DECODE_OBJ_CLASS(aDecoder, predicate, NSPredicate); + ORK_DECODE_OBJ_CLASS(aDecoder, predicateFormat, NSString); + [self.predicate allowEvaluation]; + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [super encodeWithCoder:aCoder]; + ORK_ENCODE_OBJ(aCoder, predicate); + ORK_ENCODE_OBJ(aCoder, predicateFormat); +} + +#pragma mark NSCopying + +- (instancetype)copyWithZone:(nullable NSZone *)zone { + __typeof(self) rule = [[[self class] allocWithZone:zone] initWithPredicate:_predicate]; + rule->_predicateFormat = [_predicateFormat copy]; + return rule; +} + +- (BOOL)isEqual:(id)object { + BOOL isParentSame = [super isEqual:object]; + __typeof(self) castObject = object; + BOOL result = isParentSame + && ORKEqualObjects(_predicate, castObject->_predicate) + && ORKEqualObjects(_predicateFormat, castObject->_predicateFormat); + + return result; +} + +- (NSUInteger)hash { + NSUInteger hash = _predicate.hash ^ _predicateFormat.hash; + return hash; +} + +- (BOOL)formItemVisibilityForTaskResult:(nullable ORKTaskResult *)taskResult { + + // Our ORKPredicates expect evaluateWithObject to be called with an array of taskResults. + // if taskResult is nil, we have to pass an empty array + NSArray *evaluationObject = (taskResult != nil) ? @[taskResult] : @[]; + NSString *taskResultIdentifier = taskResult.identifier ?: @""; + + BOOL result = [self.predicate evaluateWithObject:evaluationObject substitutionVariables: @{ + ORKResultPredicateTaskIdentifierVariableName: taskResultIdentifier + }]; + return result; +} + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKPredicateFormItemVisibilityRule_Private.h b/ResearchKit/Common/ORKPredicateFormItemVisibilityRule_Private.h new file mode 100644 index 0000000000..a0a90884c2 --- /dev/null +++ b/ResearchKit/Common/ORKPredicateFormItemVisibilityRule_Private.h @@ -0,0 +1,48 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKPredicateFormItemVisibilityRule () + +/** + To support deserialization, where deserialization of NSPredicates isn't supported, this class extension allows initializing + an `ORKPredicateFormItemVisibilityRule` with a predicateFormat `NSString` instead of an `NSPredicate` + and retains the original predicateFormat for serialization. +*/ +- (nullable instancetype)initWithPredicateFormat:(NSString *)predicateFormat; + +@property (nonatomic, nullable, copy, readonly) NSString *predicateFormat; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKQuestionResult.h b/ResearchKit/Common/ORKQuestionResult.h index 4826b4fa0e..b9c84c21e4 100644 --- a/ResearchKit/Common/ORKQuestionResult.h +++ b/ResearchKit/Common/ORKQuestionResult.h @@ -28,13 +28,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if TARGET_OS_IOS #import +#endif -@import CoreLocation; -@import Contacts; + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +#import +#endif + +#import NS_ASSUME_NONNULL_BEGIN +@class CLCircularRegion; @class ORKQuestionStep; @class ORKFormItem; @class ORKFormStep; @@ -42,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN /** - The `ORKQuestionResult` class is the base class for leaf results from an item that uses an answer format (`ORKAnswerFormat`). + A base class for leaf results from an item that uses an answer format. A question result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize it for transmission to a server, @@ -72,7 +79,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKBooleanQuestionResult` class represents the answer to a Yes/No question. + A result object from a boolean answer format. A Boolean question result is produced by the task view controller when it presents a question or form item with a Boolean answer format (that is, `ORKBooleanAnswerFormat`). @@ -91,8 +98,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKChoiceQuestionResult` class represents the single or multiple choice - answers from a choice-based answer format. + A result object from a multiple or single choice-based answer format. For example, an `ORKTextChoiceAnswerFormat` or an `ORKImageChoiceAnswerFormat` format produces an `ORKChoiceQuestionResult` object. @@ -116,7 +122,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKDateQuestionResult` class represents the result of a question or form item that asks for a date (`ORKDateAnswerFormat`). + A result object from a date answer format. The calendar and time zone are recorded in addition to the answer itself, to give the answer context. Usually, this data corresponds to the current calendar @@ -147,8 +153,9 @@ ORK_CLASS_AVAILABLE @end +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION /** - The `ORKLocation` class represents the location addess obtained from a locaton question. + The `ORKLocation` class represents the location addess obtained from a location question. */ ORK_CLASS_AVAILABLE @interface ORKLocation : NSObject @@ -177,10 +184,10 @@ ORK_CLASS_AVAILABLE @property (nonatomic, copy, readonly, nullable) CNPostalAddress *postalAddress; @end - +#endif /** - The `ORKLocationQuestionResult` class represents the result of a question or form item that asks for a location (`ORKLocationAnswerFormat`). + A result object from a location answer format. A Location question result is produced by the task view controller when it presents a question or form item with a Location answer format (that is, `ORKLocationAnswerFormat`). @@ -189,6 +196,7 @@ ORK_CLASS_AVAILABLE completes, it may be appropriate to serialize it for transmission to a server, or to immediately perform analysis on it. */ +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION ORK_CLASS_AVAILABLE @interface ORKLocationQuestionResult : ORKQuestionResult @@ -198,11 +206,10 @@ ORK_CLASS_AVAILABLE @property (nonatomic, copy, nullable) ORKLocation *locationAnswer; @end - +#endif /** - The `ORKMultipleComponentQuestionResult` class represents the choice - answers from a multiple-component picker-style choice-based answer format. + A result object from a multiple-component picker-style choice-based answer format. For example, an `ORKMultipleValuePickerAnswerFormat` produces an `ORKMultipleComponentQuestionResult` object. @@ -230,7 +237,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKNumericQuestionResult` class represents a question or form item that uses an answer format that produces a numeric answer. + A result object from a numeric answer format. Examples of this type of answer format include `ORKScaleAnswerFormat` and `ORKNumericAnswerFormat`. @@ -259,8 +266,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKScaleQuestionResult` class represents the answer to a continuous or - discrete-value scale answer format. + A result object from a continuous or discrete-value scale answer format. A scale question result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize it for transmission to a server, @@ -280,8 +286,7 @@ ORK_CLASS_AVAILABLE @end /** - The `ORKTextQuestionResult` class represents the answer to a question or - form item that uses an `ORKTextAnswerFormat` format. + A result object from a question or form item that uses an text answer format. A text question result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize it for transmission to a server @@ -301,8 +306,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKTimeIntervalQuestionResult` class represents the result of a question - that uses the `ORKTimeIntervalAnswerFormat` format. + A result object from a question that uses the time interval answer format. A time interval question result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize it for transmission to a server, @@ -322,7 +326,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKTimeOfDayQuestionResult` class represents the result of a question that uses the `ORKTimeOfDayAnswerFormat` format. + A result object from a question that uses the time of day answer format. */ ORK_CLASS_AVAILABLE @interface ORKTimeOfDayQuestionResult : ORKQuestionResult @@ -337,7 +341,7 @@ ORK_CLASS_AVAILABLE @end /** - The `ORKSESQuestionResult` class represents the result of socio-economic ladder answer format. + A result object from the socio-economic ladder answer format. */ ORK_CLASS_AVAILABLE @interface ORKSESQuestionResult : ORKQuestionResult diff --git a/ResearchKit/Common/ORKQuestionResult.m b/ResearchKit/Common/ORKQuestionResult.m index 07782b523b..fffdc7b06e 100644 --- a/ResearchKit/Common/ORKQuestionResult.m +++ b/ResearchKit/Common/ORKQuestionResult.m @@ -30,15 +30,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKQuestionResult_Private.h" - #import "ORKResult_Private.h" -#import "ORKAnswerFormat_Internal.h" -#import "ORKFormStep.h" -#import "ORKQuestionStep.h" +#if TARGET_OS_IOS +#import "ORKQuestionStep.h" #import "ORKHelpers_Internal.h" - +#import "ORKAnswerFormat_Internal.h" +#endif @implementation ORKQuestionResult { @protected @@ -94,7 +93,6 @@ - (instancetype)copyWithZone:(NSZone *)zone { if (answer == ORKNullAnswerValue()) { answer = nil; } - NSParameterAssert(!answer || [answer isKindOfClass:[[self class] answerClass]] || [answer isKindOfClass:[ORKNoAnswer class]]); return answer; } @@ -203,6 +201,7 @@ - (void)setAnswer:(NSObject *)answer { [super setAnswer:answer]; } + - (void)setBooleanAnswer:(NSNumber *)booleanAnswer { self.answer = booleanAnswer; } @@ -274,7 +273,6 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { // Backwards compatibility, do not change the key ORK_DECODE_OBJ_CLASSES_FOR_KEY(aDecoder, typedAnswerOrNoAnswer, [[self class] answerClassesIncludingNoAnswer], dateAnswer); } - if (_typedAnswerOrNoAnswer != nil && ![_typedAnswerOrNoAnswer isKindOfClass:[NSDate class]] && ![_typedAnswerOrNoAnswer isKindOfClass:[ORKNoAnswer class]]) { ORK_Log_Fault("ORKDateQuestionResult: Discarding answer of wrong class: %{public}@ (%@, identifier: %{public}@)", [_typedAnswerOrNoAnswer class], _typedAnswerOrNoAnswer, self.identifier); _typedAnswerOrNoAnswer = nil; @@ -328,7 +326,7 @@ - (NSDate *)dateAnswer { @end - +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION #pragma mark - ORKLocationQuestionResult @implementation ORKLocation @@ -471,6 +469,7 @@ - (ORKLocation *)locationAnswer { @end +#endif #pragma mark - ORKSESQuestionResult @@ -558,6 +557,7 @@ + (Class)answerClass { return classes; } + - (void)setComponentsAnswer:(NSArray *> *)componentsAnswer { self.answer = componentsAnswer; } diff --git a/ResearchKit/Common/ORKQuestionResult_Private.h b/ResearchKit/Common/ORKQuestionResult_Private.h index be8b7cedf6..c5bfbc78a2 100644 --- a/ResearchKit/Common/ORKQuestionResult_Private.h +++ b/ResearchKit/Common/ORKQuestionResult_Private.h @@ -28,9 +28,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + + +#if TARGET_OS_IOS #import +#endif -@import MapKit; +#import NS_ASSUME_NONNULL_BEGIN @@ -45,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN @end - +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @interface ORKLocation () - (instancetype)initWithCoordinate:(CLLocationCoordinate2D)coordinate @@ -56,5 +60,5 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithPlacemark:(CLPlacemark *)placemark userInput:(NSString *)userInput; @end - +#endif NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKRecorder.h b/ResearchKit/Common/ORKRecorder.h similarity index 78% rename from ResearchKit/ActiveTasks/ORKRecorder.h rename to ResearchKit/Common/ORKRecorder.h index 74b6ec0ffc..c57b2b2101 100644 --- a/ResearchKit/ActiveTasks/ORKRecorder.h +++ b/ResearchKit/Common/ORKRecorder.h @@ -30,11 +30,13 @@ */ -@import UIKit; -@import HealthKit; +#import #import #import +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import +#endif NS_ASSUME_NONNULL_BEGIN @@ -43,8 +45,7 @@ NS_ASSUME_NONNULL_BEGIN @class ORKStep; /** - The `ORKRecorderConfiguration` class is the abstract base class for recorder configurations - that can be attached to an active step (`ORKActiveStep`). + A base class for recorder configuration objects that can be attached to an active step. Recorder configurations provide an easy way to collect CoreMotion or other sensor data into a serialized format during the duration of an active step. @@ -106,14 +107,14 @@ ORK_CLASS_AVAILABLE If your recorder requires or would benefit from read access to HealthKit at runtime during the task, return the appropriate set of `HKSampleType` objects. */ +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (nullable NSSet *)requestedHealthKitTypesForReading; - +#endif @end /** - The `ORKAccelerometerRecorderConfiguration` subclass configures - the collection of accelerometer data during an active step. + A configuration object that collects accelerometer data during an active step. Accelerometer data is serialized to JSON and returned as an `ORKFileResult` object. For details on the format, see `CMAccelerometerData+ORKJSONDictionary`. @@ -155,8 +156,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKAudioRecorderConfiguration` class represents a configuration that records - audio data during an active step. + A configuration that records audio data during an active step. An `ORKAudioRecorderConfiguration` generates an `ORKAudioRecorder` object. @@ -205,8 +205,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKDeviceMotionRecorderConfiguration` class represents a configuration - that records device motion data during an active step. + A configuration object that records device motion data during an active step. Device motion data is the processed motion data provided by CoreMotion and obtained from a `CMMotionManager` object. The data can include measures of the overall device orientation @@ -252,8 +251,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKPedometerRecorderConfiguration` class represents a configuration - that records pedometer data during an active step. + A configuration object that records pedometer data during an active step. Pedometer data consists of information about the processed steps provided by CoreMotion, obtained from a `CMPedometer` object. The pedometer object essentially reports the total number of steps taken since the @@ -297,8 +295,7 @@ ORK_CLASS_AVAILABLE /** - The `ORKLocationRecorderConfiguration` class represents a configuration - that records location data during an active step. + A configuration object that records location data during an active step. The location data reported is the location provided by CoreLocation. @@ -315,6 +312,8 @@ ORK_CLASS_AVAILABLE No additional parameters besides the identifier are required. */ + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION ORK_CLASS_AVAILABLE @interface ORKLocationRecorderConfiguration : ORKRecorderConfiguration @@ -339,104 +338,10 @@ ORK_CLASS_AVAILABLE - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; @end - - -/** - The `ORKHealthQuantityTypeRecorderConfiguration` class represents a configuration - that records data from a HealthKit quantity type during an active step. - - Before you can use this configuration, you must use Xcode to enable the appropriate HealthKit entitlement - for your app. - - HealthKit quantity type data is serialized to JSON and returned as an `ORKFileResult` object. - For details on the format, see `HKSample+ORKJSONDictionary`. - - To use a recorder, include its configuration in the `recorderConfigurations` property - of an `ORKActiveStep` object, include that step in a task, and present it with - a task view controller. - */ -ORK_CLASS_AVAILABLE -@interface ORKHealthQuantityTypeRecorderConfiguration : ORKRecorderConfiguration - -/** - Returns an initialized health quantity type recorder configuration using the specified quantity type and unit designation. - - This method is the designated initializer. - - @param identifier The unique identifier of the recorder configuration. - @param quantityType The quantity type that should be collected during the active task. - @param unit The unit for the data that should be collected and serialized. - - @return An initialized health quantity type recorder configuration. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier healthQuantityType:(HKQuantityType *)quantityType unit:(HKUnit *)unit NS_DESIGNATED_INITIALIZER; - -/** - Returns a new health quantity type recorder configuration initialized from data in the given unarchiver. - - @param aDecoder Coder from which to initialize the health quantity type recorder configuration. - - @return A new health quantity type recorder configuration. - */ -- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; - -/** - The quantity type to be collected from HealthKit. (read-only) - */ -@property (nonatomic, readonly, copy) HKQuantityType *quantityType; - -/** - The unit in which to serialize the data from HealthKit. (read-only) - */ -@property (nonatomic, readonly, copy) HKUnit *unit; - -@end - -ORK_CLASS_AVAILABLE -#if defined(__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0 -API_AVAILABLE(ios(12.0)) -@interface ORKHealthClinicalTypeRecorderConfiguration : ORKRecorderConfiguration - -/** - Returns an initialized health clinical type recorder configuration using the specified clinical type. - - This method is the designated initializer. - - @param identifier The unique identifier of the recorder configuration. - @param healthClinicalType The HKClinicalType that should be collected during the active task. - @param healthFHIRResourceType The HKFHIRResourceType that should be used as predicate while querying for the healthClinicalType. Providing a HKFHIRResourceType that does not correspond to a HKClinicalType will NOT generate any result. - - @return An initialized health clinical type recorder configuration. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier - healthClinicalType:(HKClinicalType *)healthClinicalType - healthFHIRResourceType:(nullable HKFHIRResourceType)healthFHIRResourceType NS_DESIGNATED_INITIALIZER API_AVAILABLE(ios(12.0)); - -/** - Returns a new health clinical type recorder configuration initialized from data in the given unarchiver. - - @param aDecoder Coder from which to initialize the health clinical type recorder configuration. - - @return A new health clinical type recorder configuration. - */ -- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; - -/** - The HKClinicalType to be collected from HealthKit. (read-only) - */ -@property (nonatomic, readonly, copy) HKClinicalType *healthClinicalType; - -/** - The HKFHIRResourceType to used as predicate for HKQuery. (read-only) - */ -@property (nonatomic, readonly, copy) HKFHIRResourceType healthFHIRResourceType; - -@end -#endif +#endif /** - The `ORKStreamingAudioRecorderConfiguration` class represents a configuration that records streaming - audio data during an active step. + A configuration object that records streaming audio data during an active step. An `ORKStreamingAudioRecorderConfiguration` generates an `ORKStreamingAudioRecorder` object. @@ -502,7 +407,7 @@ need to implement it. /** - A recorder is the runtime companion to an `ORKRecorderConfiguration` object, and is + A recorder is the runtime companion to a recorder configuration object, and is usually generated by one. During active tasks, it is often useful to collect one or more pieces of data diff --git a/ResearchKit/ActiveTasks/ORKRecorder.m b/ResearchKit/Common/ORKRecorder.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKRecorder.m rename to ResearchKit/Common/ORKRecorder.m index bfc0d2a78d..def1d0eddc 100644 --- a/ResearchKit/ActiveTasks/ORKRecorder.m +++ b/ResearchKit/Common/ORKRecorder.m @@ -89,9 +89,12 @@ - (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)output return nil; } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (NSSet *)requestedHealthKitTypesForReading { return nil; } +#endif + - (ORKPermissionMask)requestedPermissionMask { return ORKPermissionNone; } diff --git a/ResearchKit/ActiveTasks/ORKRecorder_Internal.h b/ResearchKit/Common/ORKRecorder_Internal.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKRecorder_Internal.h rename to ResearchKit/Common/ORKRecorder_Internal.h diff --git a/ResearchKit/ActiveTasks/ORKRecorder_Private.h b/ResearchKit/Common/ORKRecorder_Private.h similarity index 83% rename from ResearchKit/ActiveTasks/ORKRecorder_Private.h rename to ResearchKit/Common/ORKRecorder_Private.h index 8b3af416d2..e2d7cf1e33 100644 --- a/ResearchKit/ActiveTasks/ORKRecorder_Private.h +++ b/ResearchKit/Common/ORKRecorder_Private.h @@ -37,38 +37,6 @@ NS_ASSUME_NONNULL_BEGIN @class ORKStep; -/** - The `ORKTouchRecorderConfiguration` is a recorder configuration class for - generating an `ORKTouchRecorder`. - - It is currently considered private, and is not used in any of the active tasks. - */ -ORK_CLASS_AVAILABLE -@interface ORKTouchRecorderConfiguration : ORKRecorderConfiguration - -/** - Returns an initialized touch recorder configuration. - - This method is the designated initializer. - - @param identifier The unique identifier of the recorder configuration. - - @return An initialized touch recorder configuration. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER; - -/** - Returns a new touch recorder configuration initialized from data in the given unarchiver. - - @param aDecoder Coder from which to initialize the touch recorder configuration. - - @return A new touch recorder configuration. - */ -- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; - -@end - - @interface ORKRecorder () /** @@ -156,6 +124,8 @@ ORK_CLASS_AVAILABLE - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; +@property (nonatomic, assign) BOOL bypassAudioEngineStart; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKRelatedPerson.h b/ResearchKit/Common/ORKRelatedPerson.h new file mode 100644 index 0000000000..0fa20dfd7d --- /dev/null +++ b/ResearchKit/Common/ORKRelatedPerson.h @@ -0,0 +1,87 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +#import +#import +#import + + +@class ORKTaskResult; + + +NS_ASSUME_NONNULL_BEGIN + +/** + An object that represents a relative added during + a family health history survey. + */ + +ORK_CLASS_AVAILABLE +@interface ORKRelatedPerson : NSObject + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +/** + Creates a new related person with the specified identifier. + + This method is the primary designated initializer. + + @param identifier The unique identifier of the related person. + @param groupIdentifier The identifier of the relative group to which the person belongs. + @param identifierForCellTitle The identifier of the result value to be used for the relative's cell title. + @param result The task result generated for the relative's health history survey. + */ + +- (instancetype)initWithIdentifier:(NSString *)identifier + groupIdentifier:(NSString *)groupIdentifier + identifierForCellTitle:(NSString *)identifierForCellTitle + taskResult:(ORKTaskResult *)result NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, readonly, copy) NSString *identifier; +@property (nonatomic, readonly, copy) NSString *groupIdentifier; +@property (nonatomic, readonly, copy) NSString *identifierForCellTitle; +@property (nonatomic, copy) ORKTaskResult *taskResult; + +- (nullable NSString *)getTitleValueWithIdentifier:(NSString *)identifier; + +- (NSArray *)getDetailListValuesWithIdentifiers:(NSArray *)identifiers + displayInfoKeyAndValues:(NSDictionary *> *)displayInfoKeyAndValues; + +- (NSArray *)getConditionsListWithStepIdentifier:(NSString *)stepIdentifier + formItemIdentifier:(NSString *)formItemIdentifier + conditionsKeyValues:(NSDictionary *)conditionsKeyValues; + + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKRelatedPerson.m b/ResearchKit/Common/ORKRelatedPerson.m new file mode 100644 index 0000000000..31d92fd3b6 --- /dev/null +++ b/ResearchKit/Common/ORKRelatedPerson.m @@ -0,0 +1,190 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKRelatedPerson.h" + +#import +#import +#import +#import +#import +#import +#import +#import + + + +@implementation ORKRelatedPerson { +} + +- (instancetype)initWithIdentifier:(NSString *)identifier + groupIdentifier:(NSString *)groupIdentifier + identifierForCellTitle:(NSString *)identifierForCellTitle + taskResult:(ORKTaskResult *)result { + self = [super init]; + + if (self) { + _identifier = [identifier copy]; + _groupIdentifier = [groupIdentifier copy]; + _identifierForCellTitle = [identifierForCellTitle copy]; + _taskResult = [result copy]; + } + return self; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + ORK_ENCODE_OBJ(aCoder, identifier); + ORK_ENCODE_OBJ(aCoder, groupIdentifier); + ORK_ENCODE_OBJ(aCoder, identifierForCellTitle); + ORK_ENCODE_OBJ(aCoder, taskResult); +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self) { + ORK_DECODE_OBJ_CLASS(aDecoder, identifier, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, groupIdentifier, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, identifierForCellTitle, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, taskResult, ORKTaskResult); + } + return self; +} + +- (instancetype)copyWithZone:(nullable NSZone *)zone { + ORKRelatedPerson *relatedPerson = [[[self class] allocWithZone:zone] initWithIdentifier:[_identifier copy] + groupIdentifier:[_groupIdentifier copy] + identifierForCellTitle: [_identifierForCellTitle copy] + taskResult:[_taskResult copy]]; + return relatedPerson; +} + +- (BOOL)isEqual:(id)object { + if ([self class] != [object class]) { + return NO; + } + + __typeof(self) castObject = object; + return (ORKEqualObjects(self.identifier, castObject.identifier) + && ORKEqualObjects(self.groupIdentifier, castObject.groupIdentifier) + && ORKEqualObjects(self.identifierForCellTitle, castObject.identifierForCellTitle) + && ORKEqualObjects(self.taskResult, castObject.taskResult)); +} + +- (nullable NSString *)getTitleValueWithIdentifier:(NSString *)identifier { + return [self getResultValueWithIdentifier:identifier]; +} + +- (NSArray *)getDetailListValuesWithIdentifiers:(NSArray *)identifiers + displayInfoKeyAndValues:(nonnull NSDictionary *> *)displayInfoKeyAndValues { + NSMutableArray *detailListValues = [NSMutableArray new]; + + for (NSString *identifier in identifiers) { + NSString *result = [self getResultValueWithIdentifier:identifier]; + + if ([result isKindOfClass:[ORKDontKnowAnswer class]]) { + continue; + } + + NSString *value = ![result isKindOfClass:[NSString class]] ? [NSString stringWithFormat:@"%i", result.intValue] : result; + if (value && ![value isEqual:@"0"]) { + NSString *displayText = displayInfoKeyAndValues[identifier][value]; + if (![self shouldSkipListValue:displayText] && ![self shouldSkipListValue:value]) { + [detailListValues addObject: displayText != nil ? displayText : value]; + } + } + } + + return [detailListValues copy]; +} + +- (NSArray *)getConditionsListWithStepIdentifier:(NSString *)stepIdentifier + formItemIdentifier:(NSString *)formItemIdentifier + conditionsKeyValues:(nonnull NSDictionary *)conditionsKeyValues { + ORKStepResult *stepResult = (ORKStepResult *)[self.taskResult resultForIdentifier:stepIdentifier]; + + ORKChoiceQuestionResult *choiceQuestionResult = (ORKChoiceQuestionResult *)[stepResult resultForIdentifier:formItemIdentifier]; + NSArray *conditionsList = (NSArray *)choiceQuestionResult.choiceAnswers; + + NSMutableArray *conditionListDisplayValues = [NSMutableArray new]; + + BOOL didSkipValue = NO; + for (NSString *condition in conditionsList) { + NSString *value = [conditionsKeyValues valueForKey:condition]; + + if ([self shouldSkipListValue:value]) { + didSkipValue = YES; + } else { + NSString *displayString = [[value lowercaseString] isEqual:@"none of the above"] ? ORKLocalizedString(@"FAMILY_HISTORY_NONE_SELECTED", @"") : value; + [conditionListDisplayValues addObject:displayString]; + } + } + + if (didSkipValue && conditionListDisplayValues.count == 0) { + [conditionListDisplayValues addObject:@""]; + } + + return [conditionListDisplayValues copy]; +} + +- (nullable NSString *)getResultValueWithIdentifier:(NSString *)identifier { + + for (ORKStepResult *result in _taskResult.results) { + ORKQuestionResult *questionResult = (ORKQuestionResult *)[result resultForIdentifier:identifier]; + + if (questionResult) { + if ([questionResult isKindOfClass:[ORKChoiceQuestionResult class]]) { + ORKChoiceQuestionResult *choiceQuestionResult = (ORKChoiceQuestionResult *)questionResult; + return (NSString *)choiceQuestionResult.choiceAnswers.firstObject; + } else { + NSString *answer = (NSString *)questionResult.answer; + + + return answer; + } + } else { + break; + } + } + + return nil; +} + +- (BOOL)shouldSkipListValue:(NSString *)value { + return ([[value lowercaseString] isEqual:@"i don't know"] || [[value lowercaseString] isEqual:@"i don’t know"] || [[value lowercaseString] isEqual:@"i prefer not to answer"]); +} + + +@end diff --git a/ResearchKit/Common/ORKRelativeGroup.h b/ResearchKit/Common/ORKRelativeGroup.h new file mode 100644 index 0000000000..3aa9889cc4 --- /dev/null +++ b/ResearchKit/Common/ORKRelativeGroup.h @@ -0,0 +1,89 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +#import + + +@class ORKTaskResult; +@class ORKFormStep; + +NS_ASSUME_NONNULL_BEGIN + +/** + An object to represent a relative type displayed + during a family health history survey. + + Example relative groups could be parents, children, or siblings. + */ + +ORK_CLASS_AVAILABLE +@interface ORKRelativeGroup : NSObject + ++ (instancetype)new NS_UNAVAILABLE; +- (instancetype)init NS_UNAVAILABLE; + +/** + Creates a new relative group with the specified identifier. + + This method is the primary designated initializer. + + @param identifier The unique identifier of the relative group. + @param name The name of the relative group. This should be the singular representation. + @param title The table section title for the relative group. + @param detailText The detail text displayed in the table section header for the relative group. + @param identifierForCellTitle The identifier of the result value to be used for the relative's cell title. + @param maxAllowed The maximum amount of relatives that are allowed to be added by the participant. + @param formSteps The form steps that will precede the health conditions step during the survey. + @param detailTextIdentifiers The identifiers of each result value that will be displayed in the relative's card view. + */ + +- (instancetype)initWithIdentifier:(NSString *)identifier + name:(NSString *)name + sectionTitle:(NSString *)title + sectionDetailText:(NSString *)detailText + identifierForCellTitle:(NSString *)identifierForCellTitle + maxAllowed:(NSUInteger)maxAllowed + formSteps:(NSArray *)formSteps + detailTextIdentifiers:(NSArray *)detailTextIdentifiers NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, readonly, copy) NSString *identifier; +@property (nonatomic, readonly, copy) NSString *name; +@property (nonatomic, readonly, copy) NSString *sectionTitle; +@property (nonatomic, readonly, copy) NSString *sectionDetailText; +@property (nonatomic, readonly, copy) NSString *identifierForCellTitle; +@property (nonatomic, readonly) NSUInteger maxAllowed; +@property (nonatomic, readonly, copy) NSArray *formSteps; +@property (nonatomic, readonly, copy) NSArray *detailTextIdentifiers; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKRelativeGroup.m b/ResearchKit/Common/ORKRelativeGroup.m new file mode 100644 index 0000000000..6cb43cb644 --- /dev/null +++ b/ResearchKit/Common/ORKRelativeGroup.m @@ -0,0 +1,129 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKRelativeGroup.h" + +#import "ORKAnswerFormat_Private.h" +#import "ORKCollectionResult.h" +#import "ORKFormStep.h" +#import "ORKHelpers_Internal.h" + + +@implementation ORKRelativeGroup + +- (instancetype)initWithIdentifier:(NSString *)identifier + name:(NSString *)name + sectionTitle:(NSString *)title + sectionDetailText:(NSString *)detailText + identifierForCellTitle:(NSString *)identifierForCellTitle + maxAllowed:(NSUInteger)maxAllowed + formSteps:(NSArray *)formSteps + detailTextIdentifiers:(NSArray *)detailTextIdentifiers { + self = [super init]; + + if (self) { + _identifier = identifier; + _name = name; + _sectionTitle = title; + _sectionDetailText = detailText; + _identifierForCellTitle = identifierForCellTitle; + _maxAllowed = maxAllowed; + _formSteps = formSteps; + _detailTextIdentifiers = detailTextIdentifiers; + } + + return self; +} + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + ORK_ENCODE_OBJ(aCoder, identifier); + ORK_ENCODE_OBJ(aCoder, name); + ORK_ENCODE_OBJ(aCoder, sectionTitle); + ORK_ENCODE_OBJ(aCoder, sectionDetailText); + ORK_ENCODE_OBJ(aCoder, identifierForCellTitle); + ORK_ENCODE_INTEGER(aCoder, maxAllowed); + ORK_ENCODE_OBJ(aCoder, formSteps); + ORK_ENCODE_OBJ(aCoder, detailTextIdentifiers); +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wobjc-designated-initializers" +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super init]; + if (self) { + ORK_DECODE_OBJ_CLASS(aDecoder, identifier, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, name, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, sectionTitle, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, sectionDetailText, NSString); + ORK_DECODE_OBJ_CLASS(aDecoder, identifierForCellTitle, NSString); + ORK_DECODE_INTEGER(aDecoder, maxAllowed); + ORK_DECODE_OBJ_ARRAY(aDecoder, formSteps, ORKFormStep); + ORK_DECODE_OBJ_ARRAY(aDecoder, detailTextIdentifiers, NSString); + } + return self; +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone { + ORKRelativeGroup *relativeGroup = [[[self class] allocWithZone:zone] initWithIdentifier:[_identifier copy] + name:[_name copy] + sectionTitle:[_sectionTitle copy] + sectionDetailText:[_sectionDetailText copy] + identifierForCellTitle:[_identifierForCellTitle copy] + maxAllowed:_maxAllowed + formSteps:[_formSteps copy] + detailTextIdentifiers:[_detailTextIdentifiers copy]]; + return relativeGroup; +} + +- (BOOL)isEqual:(id)object { + if ([self class] != [object class]) { + return NO; + } + + __typeof(self) castObject = object; + return (ORKEqualObjects(self.identifier, castObject.identifier) + && ORKEqualObjects(self.name, castObject.name) + && ORKEqualObjects(self.sectionTitle, castObject.sectionTitle) + && ORKEqualObjects(self.sectionDetailText, castObject.sectionDetailText) + && ORKEqualObjects(self.identifierForCellTitle, castObject.identifierForCellTitle) + && ORKEqualObjects(self.formSteps, castObject.formSteps) + && ORKEqualObjects(self.detailTextIdentifiers, castObject.detailTextIdentifiers) + && self.maxAllowed == castObject.maxAllowed); +} + +- (NSUInteger)hash { + return super.hash ^ _identifier.hash ^ _name.hash ^ _sectionTitle.hash ^ _sectionDetailText.hash ^ _identifierForCellTitle.hash ^ _formSteps.hash ^ _detailTextIdentifiers.hash; +} + +@end diff --git a/ResearchKit/Common/ORKRequestPermissionsStep.h b/ResearchKit/Common/ORKRequestPermissionsStep.h index 439528c325..1a2646bd86 100644 --- a/ResearchKit/Common/ORKRequestPermissionsStep.h +++ b/ResearchKit/Common/ORKRequestPermissionsStep.h @@ -34,6 +34,11 @@ NS_ASSUME_NONNULL_BEGIN @class ORKPermissionType; +/** + A step that presents a configured list of permissions necessary + for the app using it. + */ + ORK_CLASS_AVAILABLE @interface ORKRequestPermissionsStep : ORKStep - (instancetype)initWithIdentifier:(NSString *)identifier diff --git a/ResearchKit/Common/ORKRequestPermissionsStep.m b/ResearchKit/Common/ORKRequestPermissionsStep.m index 13856070e4..cd23bd14be 100644 --- a/ResearchKit/Common/ORKRequestPermissionsStep.m +++ b/ResearchKit/Common/ORKRequestPermissionsStep.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKRequestPermissionsStep.h" #import "ORKPermissionType.h" -#import "ORKRequestPermissionsStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKRequestPermissionsStep @@ -43,10 +42,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier permissionTypes:(nonnu return self; } -+ (Class)stepViewControllerClass { - return [ORKRequestPermissionsStepViewController class]; -} - - (void)validateParameters { [super validateParameters]; } @@ -89,3 +84,4 @@ - (instancetype)copyWithZone:(NSZone *)zone { } @end + diff --git a/ResearchKit/Common/ORKRequestPermissionsStepViewController.m b/ResearchKit/Common/ORKRequestPermissionsStepViewController.m deleted file mode 100644 index 8b9b0553ee..0000000000 --- a/ResearchKit/Common/ORKRequestPermissionsStepViewController.m +++ /dev/null @@ -1,180 +0,0 @@ -/* - Copyright (c) 2020, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import "ORKRequestPermissionsStepViewController.h" -#import "ORKRequestPermissionsStep.h" -#import "ORKRequestPermissionView.h" -#import "ORKPermissionType.h" - -#import "ORKNavigationContainerView_Internal.h" -#import "ORKStepHeaderView_Internal.h" -#import "ORKStepViewController_Internal.h" -#import "ORKTaskViewController_Internal.h" -#import "ORKStepContainerView_Private.h" -#import "ORKStepView_Private.h" -#import "ORKRequestPermissionsStepContainerView.h" - -#import "ORKResult_Private.h" -#import "ORKCollectionResult_Private.h" -#import "ORKStep.h" - -#import "ORKHelpers_Internal.h" -#import "ORKSkin.h" - - -@implementation ORKRequestPermissionsStepViewController { - NSMutableArray *_constraints; - ORKRequestPermissionsStepContainerView *_requestPermissionsStepContainerView; -} - -- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result { - self = [super initWithStep:step result:result]; - - return self; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - if (_requestPermissionsStepContainerView) { - [_requestPermissionsStepContainerView layoutSubviews]; - } - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(cardViewStatusDidChange:) - name:ORKRequestPermissionsNotificationCardViewStatusChanged - object:nil]; - - [self checkCardViewsStatus]; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self name:ORKRequestPermissionsNotificationCardViewStatusChanged object:nil]; -} - -- (ORKStepResult *)result { - ORKStepResult *parentResult = [super result]; - - return parentResult; -} - -- (void)setContinueButtonItem:(UIBarButtonItem *)continueButtonItem { - [super setContinueButtonItem:continueButtonItem]; - _navigationFooterView.continueButtonItem = continueButtonItem; -} - -- (void)setSkipButtonItem:(UIBarButtonItem *)skipButtonItem { - [super setSkipButtonItem:skipButtonItem]; - _navigationFooterView.skipButtonItem = skipButtonItem; -} - -- (void)stepDidChange { - [super stepDidChange]; - - [_requestPermissionsStepContainerView removeFromSuperview]; - - NSMutableArray *cardViews = [self fetchCardViews]; - - _requestPermissionsStepContainerView = [[ORKRequestPermissionsStepContainerView alloc] initWithCardViews:cardViews]; - [_requestPermissionsStepContainerView placeNavigationContainerInsideScrollView]; - _requestPermissionsStepContainerView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; - _requestPermissionsStepContainerView.frame = self.view.bounds; - _requestPermissionsStepContainerView.stepTitle = self.step.title; - _requestPermissionsStepContainerView.stepText = self.step.text; - _requestPermissionsStepContainerView.stepDetailText = self.step.detailText; - _requestPermissionsStepContainerView.stepHeaderTextAlignment = self.step.headerTextAlignment; - _requestPermissionsStepContainerView.stepTopContentImage = self.step.image; - _requestPermissionsStepContainerView.stepTopContentImageContentMode = self.step.imageContentMode; - _requestPermissionsStepContainerView.bodyItems = self.step.bodyItems; - [self setupNavigationFooterView]; - - [self.view addSubview:_requestPermissionsStepContainerView]; - [self setupConstraints]; -} - -- (void)setupNavigationFooterView { - if (!_navigationFooterView && _requestPermissionsStepContainerView) { - _navigationFooterView = _requestPermissionsStepContainerView.navigationFooterView; - } - _navigationFooterView.skipButtonItem = self.skipButtonItem; - _navigationFooterView.continueButtonItem = self.continueButtonItem; - - _navigationFooterView.optional = NO; - [_navigationFooterView updateContinueAndSkipEnabled]; -} - -- (void)setupConstraints { - if (_constraints) { - [NSLayoutConstraint deactivateConstraints:_constraints]; - } - - _constraints = [NSMutableArray new]; - - [_constraints addObject:[_requestPermissionsStepContainerView.topAnchor constraintEqualToAnchor:self.view.topAnchor]]; - [_constraints addObject:[_requestPermissionsStepContainerView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor]]; - [_constraints addObject:[_requestPermissionsStepContainerView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor]]; - [_constraints addObject:[_requestPermissionsStepContainerView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]]; - - [NSLayoutConstraint activateConstraints:_constraints]; -} - -- (void)cardViewStatusDidChange:(NSNotification *)notification { - [self checkCardViewsStatus]; -} - -- (void)checkCardViewsStatus { - NSMutableArray *cardViews = [self fetchCardViews]; - - for (ORKRequestPermissionView *cardView in cardViews) { - if (!cardView.enableContinueButton) { - _navigationFooterView.continueEnabled = NO; - return; - } - } - - _navigationFooterView.continueEnabled = YES; -} - -- (ORKRequestPermissionsStep *)requestPermissionsStep { - return (ORKRequestPermissionsStep *)self.step; -} - -- (NSMutableArray *)fetchCardViews { - ORKRequestPermissionsStep *requestPermissionStep = [self requestPermissionsStep]; - NSMutableArray *cardViews = [NSMutableArray new]; - - for (ORKPermissionType *permissionType in requestPermissionStep.permissionTypes) { - [cardViews addObject:permissionType.cardView]; - } - - return cardViews; -} - -@end diff --git a/ResearchKit/Common/ORKResult.h b/ResearchKit/Common/ORKResult.h index ad8c217024..da7ffc0c10 100644 --- a/ResearchKit/Common/ORKResult.h +++ b/ResearchKit/Common/ORKResult.h @@ -28,15 +28,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN /** - The `ORKResult` class defines the attributes of a result from one step or a group - of steps. When you use the ResearchKit framework APIs, you typically get a result from the `result` property + A class that defines the attributes of a result from one step or a group + of steps. + + When you use the ResearchKit framework APIs, you typically get a result from the `result` property of either `ORKTaskViewController` or `ORKStepViewController`. Certain types of results can contain other results, which together express a hierarchy; examples of these types of results are `ORKCollectionResult` subclasses, such as `ORKStepResult` and `ORKTaskResult`. diff --git a/ResearchKit/Common/ORKResultPredicate.h b/ResearchKit/Common/ORKResultPredicate.h index ee9e968bc6..04f868861a 100644 --- a/ResearchKit/Common/ORKResultPredicate.h +++ b/ResearchKit/Common/ORKResultPredicate.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import @@ -41,7 +41,7 @@ ORK_EXTERN NSString *const ORKResultPredicateTaskIdentifierVariableName ORK_AVAI #define ORKIgnoreTimeIntervalValue (ORKIgnoreDoubleValue) /** - The `ORKResultSelector` class unequivocally identifies a result within a set of task results. + A class that identifies a result within a set of task results. You must use an instance of this object to specify the question result you are interested in when building a result predicate. See `ORKResultPredicate` for more information. @@ -172,8 +172,8 @@ ORK_CLASS_AVAILABLE /** - The `ORKResultPredicate` class provides convenience class methods to build predicates for most of - the `ORKQuestionResult` subtypes. + A class that provides convenience class methods to build predicates for most of + the question-result subtypes. You use result predicates to create `ORKPredicateStepNavigationRule` objects. The result predicates are used to match specific ORKQuestionResult instances (created in response to the participant's @@ -221,6 +221,18 @@ ORK_CLASS_AVAILABLE */ + (NSPredicate *)predicateForNilQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector; +/** + Returns a predicate matching a result whose answer's class equals `[ORKDontKnow class]`. + A result is a `[ORKDontKnow class]` if the don't know button was selected for the question that + generated that result. + + @param resultSelector The result selector object which specifies the question result you are + interested in. + + @return A result predicate. + */ ++ (NSPredicate *)predicateForDontKnowResultWithResultSelector:(ORKResultSelector *)resultSelector; + /** Returns a predicate matching a result of type `ORKScaleQuestionResult` whose answer is the specified integer value. @@ -528,6 +540,7 @@ within the specified `NSTimeInterval` values. refer to the contained `ORKConsentSignatureResult` corresponding to the signature collected by the consent review step. + @param didConsent Boolean to indicate if the user consented. @return A result predicate. */ + (NSPredicate *)predicateForConsentWithResultSelector:(ORKResultSelector *)resultSelector diff --git a/ResearchKit/Common/ORKResultPredicate.m b/ResearchKit/Common/ORKResultPredicate.m index ece90165f6..4aed072f32 100644 --- a/ResearchKit/Common/ORKResultPredicate.m +++ b/ResearchKit/Common/ORKResultPredicate.m @@ -250,6 +250,12 @@ + (NSPredicate *)predicateForNilQuestionResultWithResultSelector:(ORKResultSelec subPredicateFormatArgumentArray:@[ ]]; } ++ (NSPredicate *)predicateForDontKnowResultWithResultSelector:(ORKResultSelector *)resultSelector { + return [self predicateMatchingResultSelector:resultSelector + subPredicateFormatArray:@[ @"answer isKindOfClass: %@" ] + subPredicateFormatArgumentArray:@[ [ORKDontKnowAnswer class] ]]; +} + + (NSPredicate *)predicateForScaleQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector expectedAnswer:(NSInteger)expectedAnswer { return [self predicateForNumericQuestionResultWithResultSelector:resultSelector diff --git a/ResearchKit/Common/ORKResult_Private.h b/ResearchKit/Common/ORKResult_Private.h index 1c62fade2f..9f41be217d 100644 --- a/ResearchKit/Common/ORKResult_Private.h +++ b/ResearchKit/Common/ORKResult_Private.h @@ -28,7 +28,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKReviewStep.h b/ResearchKit/Common/ORKReviewStep.h index 2cea4a6030..d7322370a5 100644 --- a/ResearchKit/Common/ORKReviewStep.h +++ b/ResearchKit/Common/ORKReviewStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/Common/ORKReviewStep.m b/ResearchKit/Common/ORKReviewStep.m index 907e74be86..b8b1428091 100644 --- a/ResearchKit/Common/ORKReviewStep.m +++ b/ResearchKit/Common/ORKReviewStep.m @@ -32,8 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKReviewStep.h" #import "ORKReviewStep_Internal.h" -#import "ORKReviewStepViewController.h" - #import "ORKResult.h" #import "ORKCollectionResult_Private.h" @@ -48,8 +46,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier if (self) { if (steps) { _steps = [steps copy]; - } else { - _steps = @[]; } _resultSource = resultSource; _excludeInstructionSteps = NO; @@ -67,10 +63,6 @@ + (instancetype)embeddedReviewStepWithIdentifier:(NSString *)identifier { return [[ORKReviewStep alloc] initWithIdentifier:identifier steps:nil resultSource:nil]; } -+ (Class)stepViewControllerClass { - return [ORKReviewStepViewController class]; -} - + (BOOL)supportsSecureCoding { return YES; } diff --git a/ResearchKit/ActiveTasks/ORKSecondaryTaskStep.h b/ResearchKit/Common/ORKSecondaryTaskStep.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKSecondaryTaskStep.h rename to ResearchKit/Common/ORKSecondaryTaskStep.h diff --git a/ResearchKit/ActiveTasks/ORKSecondaryTaskStep.m b/ResearchKit/Common/ORKSecondaryTaskStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKSecondaryTaskStep.m rename to ResearchKit/Common/ORKSecondaryTaskStep.m index 72b2db31dd..3c93470a3a 100644 --- a/ResearchKit/ActiveTasks/ORKSecondaryTaskStep.m +++ b/ResearchKit/Common/ORKSecondaryTaskStep.m @@ -29,16 +29,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKSecondaryTaskStep.h" -#import "ORKSecondaryTaskStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKSecondaryTaskStep - -+ (Class)stepViewControllerClass { - return [ORKSecondaryTaskStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; diff --git a/ResearchKit/Common/ORKSensorPermissionType.h b/ResearchKit/Common/ORKSensorPermissionType.h index 61850f5338..21d7308fc2 100644 --- a/ResearchKit/Common/ORKSensorPermissionType.h +++ b/ResearchKit/Common/ORKSensorPermissionType.h @@ -33,6 +33,10 @@ NS_ASSUME_NONNULL_BEGIN +/** + A permission type object that requests access for sensor data. + */ + API_AVAILABLE(ios(14.0)) ORK_CLASS_AVAILABLE @interface ORKSensorPermissionType : ORKPermissionType diff --git a/ResearchKit/Common/ORKSensorPermissionType.m b/ResearchKit/Common/ORKSensorPermissionType.m index 7016ae694c..f8b82048f4 100644 --- a/ResearchKit/Common/ORKSensorPermissionType.m +++ b/ResearchKit/Common/ORKSensorPermissionType.m @@ -31,9 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import #import "ORKSensorPermissionType.h" -#import "ORKRequestPermissionView.h" #import "ORKHelpers_Internal.h" -#import "ORKRequestPermissionButton.h" static NSString *const Symbol = @"gauge"; static const uint32_t IconLightTintColor = 0xA278FE; @@ -68,39 +66,38 @@ - (instancetype)initWithSensors:(nonnull NSSet *)sensors { [readers addObject:reader]; } _readers = [readers copy]; - [self setupCardView]; } return self; } -- (void)setupCardView { - UIImage *image; - if (@available(iOS 13, *)) { - image = [UIImage systemImageNamed:Symbol]; - } +- (NSString *)localizedTitle { + return ORKLocalizedString(@"REQUEST_SENSOR_STEP_VIEW_TITLE", nil); +} - self.cardView = [[ORKRequestPermissionView alloc] initWithIconImage:image - title:ORKLocalizedString(@"REQUEST_SENSOR_STEP_VIEW_TITLE", nil) - detailText:ORKLocalizedString(@"REQUEST_SENSOR_STEP_VIEW_DESCRIPTION", nil)]; +- (NSString *)localizedDetailText { + return ORKLocalizedString(@"REQUEST_SENSOR_STEP_VIEW_DESCRIPTION", nil); +} - [self.cardView.requestPermissionButton addTarget:self action:@selector(requestPermissionButtonPressed) forControlEvents:UIControlEventTouchUpInside]; +- (UIImage * _Nullable)image { + return [UIImage systemImageNamed:Symbol]; +} - // Set the tint color for the icon - if (@available(iOS 13, *)) { - UIColor *dynamicTint = [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { - return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); - }]; - [self.cardView updateIconTintColor:dynamicTint]; - } else { - [self.cardView updateIconTintColor:ORKRGB(IconLightTintColor)]; - } +- (UIColor *)iconTintColor { + return [[UIColor alloc] initWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traitCollection) { + return traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? ORKRGB(IconDarkTintColor) : ORKRGB(IconLightTintColor); + }]; +} +- (ORKRequestPermissionsState)permissionState { if ([self hasRequestedAllSensors]) { - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; - } else { - [self setState:ORKRequestPermissionsButtonStateDefault canContinue:NO]; + return ORKRequestPermissionsStateConnected; } + return ORKRequestPermissionsStateDefault; +} + +- (BOOL)canContinue { + return self.permissionState == ORKRequestPermissionsStateConnected; } - (BOOL)hasRequestedAllSensors { @@ -112,25 +109,20 @@ - (BOOL)hasRequestedAllSensors { return YES; } -- (void)requestPermissionButtonPressed { +- (void)requestPermission { [SRSensorReader requestAuthorizationForSensors:self.sensors completion:^(NSError * _Nullable error) { dispatch_async(dispatch_get_main_queue(), ^{ if (error) { ORK_Log_Error("Error requesting sensor permissions: %@", error); - [self setState:ORKRequestPermissionsButtonStateError canContinue:YES]; - return; } - [self setState:ORKRequestPermissionsButtonStateConnected canContinue:YES]; + if (self.permissionsStatusUpdateCallback != nil) { + self.permissionsStatusUpdateCallback(); + } }); }]; } -- (void)setState:(ORKRequestPermissionsButtonState)state canContinue:(BOOL)canContinue { - [self.cardView setEnableContinueButton:canContinue]; - [self.cardView.requestPermissionButton setState:state]; -} - - (BOOL)isEqual:(id)object { if ([self class] != [object class]) { return NO; diff --git a/ResearchKit/Common/ORKSignatureResult.h b/ResearchKit/Common/ORKSignatureResult.h index bb2d152272..2653aebae7 100644 --- a/ResearchKit/Common/ORKSignatureResult.h +++ b/ResearchKit/Common/ORKSignatureResult.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /** - The `ORKSignatureResult` class represents the result of a signature step (`ORKSignatureStep`). + A result object of the signature step. A signature result is produced by the task view controller when it presents a signature step. diff --git a/ResearchKit/Common/ORKSignatureStep.h b/ResearchKit/Common/ORKSignatureStep.h index 37c95d2922..9c6944f772 100644 --- a/ResearchKit/Common/ORKSignatureStep.h +++ b/ResearchKit/Common/ORKSignatureStep.h @@ -30,7 +30,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/Common/ORKSignatureStep.m b/ResearchKit/Common/ORKSignatureStep.m index 9085750c30..248a3abdbc 100644 --- a/ResearchKit/Common/ORKSignatureStep.m +++ b/ResearchKit/Common/ORKSignatureStep.m @@ -32,8 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSignatureStep.h" -#import "ORKSignatureStepViewController.h" - #import "ORKHelpers_Internal.h" @@ -49,10 +47,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { return self; } -+ (Class)stepViewControllerClass { - return [ORKSignatureStepViewController class]; -} - + (BOOL)supportsSecureCoding { return YES; } diff --git a/ResearchKit/Common/ORKSkin.h b/ResearchKit/Common/ORKSkin.h index 26e9c4e286..b16c46fbee 100644 --- a/ResearchKit/Common/ORKSkin.h +++ b/ResearchKit/Common/ORKSkin.h @@ -29,9 +29,11 @@ */ -@import UIKit; - +#import +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN @@ -59,24 +61,6 @@ ORK_EXTERN NSString *const ORKCaptionTextColorKey; /// Color used for a "blue" highlight ORK_EXTERN NSString *const ORKBlueHighlightColorKey; -/// Default color used for legend, title and text on ORKPieChartView -ORK_EXTERN NSString *const ORKChartDefaultTextColorKey; - -/// Default color used for axes of ORKGraphChartView -ORK_EXTERN NSString *const ORKGraphAxisColorKey; - -/// Default color used for titles on axes of ORKGraphChartView -ORK_EXTERN NSString *const ORKGraphAxisTitleColorKey; - -/// Default color used for scrubber line of ORKGraphChartView -ORK_EXTERN NSString *const ORKGraphScrubberLineColorKey; - -/// Default color used for scrubber thumb of ORKGraphChartView -ORK_EXTERN NSString *const ORKGraphScrubberThumbColorKey; - -/// Default color used for reference line of ORKGraphChartView -ORK_EXTERN NSString *const ORKGraphReferenceLineColorKey; - /// Default color used for auxiliary image tint of ORKInstructionStepView ORK_EXTERN NSString *const ORKAuxiliaryImageTintColorKey; @@ -110,12 +94,24 @@ ORK_EXTERN NSString *const ORKResetDoneButtonKey; /// Return the color for a specified ORK...ColorKey UIColor *ORKColor(NSString *colorKey); +/// Return minimum height for form step header view +ORK_EXTERN CGFloat ORKFormStepMinimumHeaderHeight; + +/// Return minimum height for large text form step header view +ORK_EXTERN CGFloat ORKFormStepLargeTextMinimumHeaderHeight; + +/// Return step container title to body topPadding standard +ORK_EXTERN CGFloat ORKStepContainerTitleToBodyTopPaddingStandard; + /// Return minimum height for question step header view ORK_EXTERN CGFloat ORKQuestionStepMinimumHeaderHeight; /// Default CGFloat used for rounded corner radii for card view ORK_EXTERN CGFloat ORKCardDefaultCornerRadii; +/// Default CGFloat used for rounded corner radii for image choice button image view +ORK_EXTERN CGFloat ORKImageChoiceButtonCornerRadii; + /// Default CGFloat used for border width for card view ORK_EXTERN CGFloat ORKCardDefaultBorderWidth; @@ -166,6 +162,9 @@ void ORKColorSetColorForKey(NSString *key, UIColor *color); + (UIColor *)ork_darkGrayColor; + (UIColor *)ork_borderGrayColor; ++ (UIColor *)ork_splGrayColor; ++ (UIColor *)ork_ringViewStrokeColor; + @end extern const CGFloat ORKScreenMetricMaxDimension; diff --git a/ResearchKit/Common/ORKSkin.m b/ResearchKit/Common/ORKSkin.m index f26d617925..2856f91195 100644 --- a/ResearchKit/Common/ORKSkin.m +++ b/ResearchKit/Common/ORKSkin.m @@ -29,7 +29,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ -#import "ORKSkin.h" +#import "ORKSkin_Private.h" #import "ORKHelpers_Internal.h" @@ -42,12 +42,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE NSString *const ORKDarkTintColorKey = @"ORKDarkTintColorKey"; NSString *const ORKCaptionTextColorKey = @"ORKCaptionTextColorKey"; NSString *const ORKBlueHighlightColorKey = @"ORKBlueHighlightColorKey"; -NSString *const ORKChartDefaultTextColorKey = @"ORKChartDefaultTextColorKey"; -NSString *const ORKGraphAxisColorKey = @"ORKGraphAxisColorKey"; -NSString *const ORKGraphAxisTitleColorKey = @"ORKGraphAxisTitleColorKey"; -NSString *const ORKGraphReferenceLineColorKey = @"ORKGraphReferenceLineColorKey"; -NSString *const ORKGraphScrubberLineColorKey = @"ORKGraphScrubberLineColorKey"; -NSString *const ORKGraphScrubberThumbColorKey = @"ORKGraphScrubberThumbColorKey"; NSString *const ORKAuxiliaryImageTintColorKey = @"ORKAuxiliaryImageTintColorKey"; NSString *const ORKNavigationContainerColorKey = @"ORKNavigationContainerColorKey"; NSString *const ORKNavigationContainerShadowColorKey = @"ORKNavigationContainerShadowColorKey"; @@ -58,8 +52,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE NSString *const ORKStepTopContentImageChangedKey = @"ORKStepTopContentImageChanged"; NSString *const ORKDoneButtonPressedKey = @"ORKDoneButtonPressed"; NSString *const ORKResetDoneButtonKey = @"ORKResetDoneButton"; + +CGFloat ORKFormStepLargeTextMinimumHeaderHeight = 80.0; +CGFloat ORKFormStepMinimumHeaderHeight = 50.0; CGFloat ORKQuestionStepMinimumHeaderHeight = 29.75; CGFloat ORKCardDefaultCornerRadii = 10.0; +CGFloat ORKImageChoiceButtonCornerRadii = 5.0; CGFloat ORKCardDefaultBorderWidth = 0.0; CGFloat ORKCardDefaultFontSize = 25.0; CGFloat ORKSurveyItemMargin = 16.0; @@ -126,42 +124,51 @@ + (UIColor *)m { \ #undef ORKCachedColorMethod ++ (UIColor *)ork_splGrayColor { +#if TARGET_OS_IOS + return [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traits) { + return traits.userInterfaceStyle == UIUserInterfaceStyleDark ? UIColor.systemGray5Color : UIColor.systemGray6Color; + }]; +#else + return UIColor.grayColor; +#endif +} + ++ (UIColor *)ork_ringViewStrokeColor { +#if TARGET_OS_IOS + return [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traits) { + return traits.userInterfaceStyle == UIUserInterfaceStyleDark ? UIColor.systemGray5Color : UIColor.systemGray6Color; + }]; +#else + return UIColor.grayColor; +#endif +} + @end -static NSMutableDictionary *colors() { +static NSMutableDictionary *colors(void) { static NSMutableDictionary *colors = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - UIColor *backgroundColor = [UIColor colorWithRed:239.0 / 255.0 green:239.0 / 255.0 blue:244.0 / 255.0 alpha:1.0]; - UIColor *fillColor = ORKRGB(0xD7D7D7); -#if TARGET_OS_IOS - if (@available(iOS 13.0, *)) { - backgroundColor = [UIColor secondarySystemBackgroundColor]; - fillColor = UIColor.quaternarySystemFillColor; - } -#endif - colors = [@{ ORKSignatureColorKey: ORKRGB(0x000000), - ORKBackgroundColorKey: backgroundColor, +#if TARGET_OS_IOS + ORKBackgroundColorKey: [UIColor secondarySystemBackgroundColor], +#endif ORKConsentBackgroundColorKey: ORKRGB(0xffffff), ORKToolBarTintColorKey: ORKRGB(0xffffff), ORKLightTintColorKey: ORKRGB(0xeeeeee), ORKDarkTintColorKey: ORKRGB(0x888888), ORKCaptionTextColorKey: ORKRGB(0xcccccc), ORKBlueHighlightColorKey: [UIColor colorWithRed:0.0 green:122.0 / 255.0 blue:1.0 alpha:1.0], - ORKChartDefaultTextColorKey: [UIColor lightGrayColor], - ORKGraphAxisColorKey: [UIColor colorWithRed:217.0 / 255.0 green:217.0 / 255.0 blue:217.0 / 255.0 alpha:1.0], - ORKGraphAxisTitleColorKey: [UIColor colorWithRed:142.0 / 255.0 green:142.0 / 255.0 blue:147.0 / 255.0 alpha:1.0], - ORKGraphReferenceLineColorKey: [UIColor colorWithRed:225.0 / 255.0 green:225.0 / 255.0 blue:229.0 / 255.0 alpha:1.0], - ORKGraphScrubberLineColorKey: [UIColor grayColor], - ORKGraphScrubberThumbColorKey: [UIColor colorWithWhite:1.0 alpha:1.0], ORKAuxiliaryImageTintColorKey: [UIColor colorWithRed:228.0 / 255.0 green:233.0 / 255.0 blue:235.0 / 255.0 alpha:1.0], ORKNavigationContainerColorKey: [UIColor colorWithRed:249.0 / 255.0 green:249.0 / 255.0 blue:251.0 / 255.0 alpha:0.0], ORKNavigationContainerShadowColorKey: [UIColor blackColor], ORKProgressLabelColorKey: [UIColor colorWithRed:142.0/255.0 green:142.0/255.0 blue:142.0/255.0 alpha:1.0], ORKiPadBackgroundViewColorKey: [UIColor colorWithRed:249.0 / 255.0 green:249.0 / 255.0 blue:251.0 / 255.0 alpha:1.0], - ORKTopContentImageViewBackgroundColorKey: fillColor, +#if TARGET_OS_IOS + ORKTopContentImageViewBackgroundColorKey: UIColor.quaternarySystemFillColor, +#endif ORKBulletItemTextColorKey: [UIColor colorWithRed:0.56 green:0.56 blue:0.58 alpha:1.0] } mutableCopy]; }); @@ -191,7 +198,9 @@ void ORKColorSetColorForKey(NSString *key, UIColor *color) { static ORKScreenType ORKGetVerticalScreenTypeForBounds(CGRect bounds) { ORKScreenType screenType = ORKScreenTypeiPhone6; CGFloat maximumDimension = MAX(bounds.size.width, bounds.size.height); - if (maximumDimension < ORKiPhone5ScreenSize.height + 1) { + if (maximumDimension < ORKiPhone4ScreenSize.height + 1) { + screenType = ORKScreenTypeiPhone4; + } else if (maximumDimension < ORKiPhone5ScreenSize.height + 1) { screenType = ORKScreenTypeiPhone5; } else if (maximumDimension < ORKiPhone6ScreenSize.height + 1) { screenType = ORKScreenTypeiPhone6; @@ -214,7 +223,9 @@ static ORKScreenType ORKGetVerticalScreenTypeForBounds(CGRect bounds) { static ORKScreenType ORKGetHorizontalScreenTypeForBounds(CGRect bounds) { ORKScreenType screenType = ORKScreenTypeiPhone6; CGFloat minimumDimension = MIN(bounds.size.width, bounds.size.height); - if (minimumDimension < ORKiPhone5ScreenSize.width + 1) { + if (minimumDimension < ORKiPhone4ScreenSize.width + 1) { + screenType = ORKScreenTypeiPhone4; + } else if (minimumDimension < ORKiPhone5ScreenSize.width + 1) { screenType = ORKScreenTypeiPhone5; } else if (minimumDimension < ORKiPhone6ScreenSize.width + 1) { screenType = ORKScreenTypeiPhone6; @@ -241,14 +252,7 @@ static ORKScreenType ORKGetHorizontalScreenTypeForBounds(CGRect bounds) { // Use this method instead of UIApplication's keyWindow or UIApplication's delegate's window // because we may need the window before the keyWindow is set (e.g., if a view controller // loads programmatically on the app delegate to be assigned as the root view controller) - - for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) { - if ([scene.delegate conformsToProtocol:@protocol(UIWindowSceneDelegate)]) { - window = [(id)scene.delegate window]; - break; - } - } - + window = [UIApplication sharedApplication].windows.firstObject; } return window; } @@ -335,6 +339,7 @@ CGFloat ORKGetMetricForWindow(ORKScreenMetric metric, UIWindow *window) { static CGFloat ORKStandardLeftTableViewCellMarginForWindow(UIWindow *window) { CGFloat margin = 0; switch (ORKGetHorizontalScreenTypeForWindow(window)) { + case ORKScreenTypeiPhone4: case ORKScreenTypeiPhone5: case ORKScreenTypeiPhone6: margin = ORKLayoutMarginWidthRegularBezel; @@ -368,6 +373,7 @@ static CGFloat ORKStandardHorizontalMarginForWindow(UIWindow *window) { window = ORKDefaultWindowIfWindowIsNil(window); // need a proper window to use bounds CGFloat margin = 0; switch (ORKGetHorizontalScreenTypeForWindow(window)) { + case ORKScreenTypeiPhone4: case ORKScreenTypeiPhone5: case ORKScreenTypeiPhone6: case ORKScreenTypeiPhoneX: @@ -449,7 +455,7 @@ void ORKUpdateScrollViewBottomInset(UIScrollView *scrollView, CGFloat bottomInse insets = scrollView.verticalScrollIndicatorInsets; insets.bottom = bottomInset; - scrollView.scrollIndicatorInsets = insets; + scrollView.verticalScrollIndicatorInsets = insets; scrollView.contentOffset = savedOffset; } @@ -542,7 +548,6 @@ CGFloat ORKStepContainerFirstItemTopPaddingForWindow(UIWindow *window) { return ceil((ORKStepContainerFirstItemTopPaddingPercentage / 100.0) * windowSize.height); } -//FIXME: Consolidate title/Icon to Body/Bullet methods into one. remove copy paste. CGFloat ORKStepContainerTitleToBodyTopPaddingForWindow(UIWindow *window) { CGFloat padding = 0; @@ -592,4 +597,13 @@ UIFontTextStyle ORKTitleLabelFontTextStyleForWindow(UIWindow *window) { } } +UIFont *ORKDefaultFontForStyle(UIFontTextStyle style, CGFloat sizeAdjustment) { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; + return [UIFont systemFontOfSize:[[descriptor objectForKey:UIFontDescriptorSizeAttribute] doubleValue] + sizeAdjustment]; +} + +CGFloat ORKDefaultFontSizeForStyle(UIFontTextStyle style, CGFloat sizeAdjustment) { + return ORKDefaultFontForStyle(style, sizeAdjustment).pointSize; +} + #endif diff --git a/ResearchKit/Common/ORKSkin_Private.h b/ResearchKit/Common/ORKSkin_Private.h new file mode 100644 index 0000000000..9717032d36 --- /dev/null +++ b/ResearchKit/Common/ORKSkin_Private.h @@ -0,0 +1,44 @@ +// +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +#if TARGET_OS_IOS +#import +#endif + + +#if TARGET_OS_IOS + +UIFont *ORKDefaultFontForStyle(UIFontTextStyle style, CGFloat sizeAdjustment); +CGFloat ORKDefaultFontSizeForStyle(UIFontTextStyle style, CGFloat sizeAdjustment); + +#endif diff --git a/ResearchKit/Common/ORKStep.h b/ResearchKit/Common/ORKStep.h index 2cf1d117ee..a6b53b65b0 100644 --- a/ResearchKit/Common/ORKStep.h +++ b/ResearchKit/Common/ORKStep.h @@ -28,14 +28,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#if TARGET_OS_IOS #import +#endif -@import Foundation; -@import UIKit; +#import +#import @class HKObjectType; @class ORKResult; -@class ORKStepViewController; @protocol ORKTask; NS_ASSUME_NONNULL_BEGIN @@ -46,33 +48,32 @@ ORK_EXTERN NSString *const ORKNullStepIdentifier ORK_AVAILABLE_DECL; @class ORKEarlyTerminationConfiguration; /** - `ORKStep` is the base class for the steps that can compose a task for presentation - in an `ORKTaskViewController` object. Each `ORKStep` object represents one logical piece of data + The base object for composing a task. + + ``ORKStep`` is the base class for the steps that can compose a task for presentation + in an ORKTaskViewController object. Each ``ORKStep`` object represents one logical piece of data entry or activity in a larger task. - A step can be a question, an active test, or a simple instruction. An `ORKStep` - subclass is usually paired with an `ORKStepViewController` subclass that displays the step. + A step can be a question, an active test, or a simple instruction. Pair an ``ORKStep`` + subclass with an ORKStepViewController subclass to display the step. - To use a step, instantiate an `ORKStep` object and populate its properties. Add the step to a task, - such as an `ORKOrderedTask` object, and then present the task using a task view controller (an - `ORKTaskViewController` object). + To use a step, instantiate an ``ORKStep`` object and populate its properties. Add the step to a task, + such as an ``ORKOrderedTask`` object, then present the task using ORKTaskViewController. - To implement a new type of step, subclass `ORKStep` and add your additional - properties. Separately, subclass `ORKStepViewController` and implement - your user interface. Note that if your step is timed or requires sensor data collection, - you should consider subclassing `ORKActiveStep` and `ORKActiveStepViewController` - instead. + To implement a new type of step, subclass ``ORKStep`` and add your additional + properties.Then subclass ORKStepViewController and implement + your user interface. If your step is timed, or requires sensor data collection, + subclass ``ORKActiveStep`` and ORKActiveStepViewController. */ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) - @interface ORKStep : NSObject + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; /** - Returns a new step initialized with the specified identifier. + Creates a new step with the specified identifier. This method is the primary designated initializer. @@ -83,18 +84,18 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) - (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER; /** - Returns a new step initialized from data in the given unarchiver. + Creates a new step from data in the provided unarchiver. - @param aDecoder Coder from which to initialize the step. + @param aDecoder The coder that initializes the step. @return A new step. */ - (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; /** - Returns a copy of this step initialized with the specified identifier. + Creates a copy of this step with the specified identifier. - @param identifier The unique identifier for the new step to be returned. + @param identifier The unique identifier for the copied step. @return A new step. */ @@ -103,10 +104,7 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) /** A short string that uniquely identifies the step within the task. - The identifier is reproduced in the results of a step. In fact, the only way to link a result - (an `ORKStepResult` object) to the step that generated it is to look at the value of - `identifier`. To accurately identify step results, you need to ensure that step identifiers - are unique within each task. + The identifier becomes part of the results of a step. Use it to link an ``ORKStepResult`` to the step that generated it. To accurately identify step results, ensure that step identifiers are unique within each task. In some cases, it can be useful to link the step identifier to a unique identifier in a database; in other cases, it can make sense to make the identifier human @@ -115,22 +113,20 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) @property (nonatomic, copy, readonly) NSString *identifier; /** - A Boolean value indicating whether a task can be restored to the step - during state restoration. (read-only) + A Boolean value that indicates whether a task can be restored to the step + during state restoration. - By default, the value of this property is `YES`, but subclasses of `ORKStep` might use `NO`. + By default, the value of this read-only property is `YES`, but subclasses of `ORKStep` can use `NO`. - If a task cannot be restored to the step, the task is typically restored to the - last restorable step in the task, or to the first step, if - no restorable steps are available. + If a task can't be restored to the step, it's typically restored to the + last restorable step in the task, or to the first step if no restorable steps are available. */ @property (nonatomic, readonly, getter=isRestorable) BOOL restorable; /** - A Boolean value indicating whether the user can skip the step - without providing an answer. + A Boolean value that indicates whether the user can skip the step without providing an answer. - The default value of this property is `YES`. When the value is `NO`, the Skip button does not + The default value of this property is `YES`. When the value is `NO`, the Skip button doesn't appear on this step. This property may not be meaningful for all steps; for example, an active step @@ -146,9 +142,9 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) /** Additional text to display for the step in a localized string. - The additional text is displayed in a smaller font below `title`. If you need to display a + The additional text is displayed in a smaller font below ``title``. If you need to display a long question, it can work well to keep the title short and put the additional content in - the `text` property. + the ``text`` property. */ @property (nonatomic, copy, nullable) NSString *text; @@ -156,12 +152,12 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) /** Additional detailed explanation for the instruction. - The detail text is displayed below the content of the `text` property. + The detail text is displayed below the content of the ``text`` property. */ @property (nonatomic, copy, nullable) NSString *detailText; /** - An 'NSTextAlignment' that controls the text alignment for step title, text and detailText. + A property that controls the text alignment the step's textual elements. */ @property (nonatomic) NSTextAlignment headerTextAlignment; @@ -177,22 +173,31 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0)) @property (nonatomic, copy, nullable) NSString *footnote; /** - Optional icon image to show above the title and text. + An optional icon image to show above the title and text. */ @property (nonatomic, copy, nullable) UIImage *iconImage; /** -Whether to show progress for this step when it is presented. The default is YES. + A property that gates automatic tint color image changes based on appearance changes. + + The default value for this property is NO. + */ +@property (nonatomic) BOOL shouldAutomaticallyAdjustImageTintColor; + +/** + A property that determines whether to show progress for this step when presented. + + The default is YES. */ @property (nonatomic, assign) BOOL showsProgress; /** - Whether to use extended outer padding for views + A property that determines whether to use extended outer padding for views. */ @property (nonatomic, assign) BOOL useExtendedPadding; /** - Configuration for supporting early termination from a step + A configuration for supporting early termination from a step. */ @property (nonatomic, copy, nullable) ORKEarlyTerminationConfiguration *earlyTerminationConfiguration; @@ -207,9 +212,9 @@ Whether to show progress for this step when it is presented. The default is YES. @property (nonatomic, weak, nullable) id task; /** - The set of access permissions required for the step. (read-only) + The set of access permissions required for the step. - The permission mask is used by the task view controller to determine the types of + This is a ready-only property. The task view controller uses the permission mask to determine the types of access to request from users when they complete the initial instruction steps in a task. If your step requires access to APIs that limit access, include the permissions you require in this mask. @@ -220,9 +225,9 @@ Whether to show progress for this step when it is presented. The default is YES. @property (nonatomic, readonly) ORKPermissionMask requestedPermissions; /** - The set of HealthKit types the step requests for reading. (read-only) + The set of HealthKit types the step requests for reading. - The task view controller uses this set of types when constructing a list of + This is a read-only property. The task view controller uses this set of types when constructing a list of all the HealthKit types required by all the steps in a task, so that it can present the HealthKit access dialog just once during that task. @@ -235,7 +240,7 @@ Whether to show progress for this step when it is presented. The default is YES. Checks the parameters of the step and throws exceptions on invalid parameters. This method is called when there is a need to validate the step's parameters, which is typically - the case when adding a step to an `ORKStepViewController` object, and when presenting the + the case when adding a step to an ORKStepViewController object, and when presenting the step view controller. Subclasses should override this method to provide validation of their additional @@ -255,17 +260,17 @@ API_AVAILABLE(ios(11)) @interface ORKStep () /** - Array of `ORKBodyItem` type items to display textual info. + An array of body items to display textual information. */ @property (nonatomic, nullable) NSArray *bodyItems API_AVAILABLE(ios(11)) API_UNAVAILABLE(watchos); /** - An 'NSTextAlignment' that controls the text alignment for text bodyItems. + An property that controls the text alignment for text body items. */ @property (nonatomic) NSTextAlignment bodyItemTextAlignment API_AVAILABLE(ios(11)) API_UNAVAILABLE(watchos); /** - A `Boolen` value indicating if the body items of the step should build in. + A Boolean value indicating if the body items of the step should build in. Default value is NO resulting in all body items being displayed. Set to YES to only show the first item and subsequent items will build in on continue. @@ -283,51 +288,29 @@ API_AVAILABLE(ios(11)) /** - An image that provides visual context for the instruction that will allow for showing - a two-part composite image where the `image` is tinted and the `auxiliaryImage` is - shown with light grey. + An image that provides visual context for the instruction that allows for showing + a two-part composite. + + The image is tinted and ``auxiliaryImage`` appears with light grey. - The image is displayed with the same frame as the `image` so both the `auxiliaryImage` - and `image` should have transparently to allow for overlay. + The image displays with the same frame as ``image``, so it and ``auxiliaryImage`` + should have transparency to allow for overlay. */ @property (nonatomic, copy, nullable) UIImage *auxiliaryImage API_AVAILABLE(ios(11)) API_UNAVAILABLE(watchos); /** - A `UIViewContentMode` used to position image inside a `UIImageView` used by the step. + A view controller that positions an image inside an image view that the step uses. - Depending on the subclass of the step, the `ORKStepView` uses specific 'UIImageView', and the - imageContentMode property sets the content mode of used image view. + Depending on the subclass of the step, ORKStepView uses a specific UIImageView, and + ``imageContentMode`` sets the content mode of used image view. */ @property (nonatomic) UIViewContentMode imageContentMode API_AVAILABLE(ios(11)) API_UNAVAILABLE(watchos); -/** - Returns the class that the task view controller should instantiate to display - this step. - */ - -- (Class)stepViewControllerClass API_AVAILABLE(ios(11)) API_UNAVAILABLE(watchos); - -/** - Instantiates a step view controller for this class. - - This method is called when a step is about to be presented. The default implementation returns - a view controller that is appropriate to this step by allocating an instance of `ORKStepViewController` - using the `-stepViewControllerClass` method and initializing that instance by calling `initWithIdentifier:result:` - on the provided `ORKStepViewController` class instance. - - Override this method if you need to customize the behavior before presenting the step or if - the view controller is presented using a nib or storyboard. - - @param result The result associated with this step - - @return A newly initialized step view controller. - */ -- (ORKStepViewController *)instantiateStepViewControllerWithResult:(ORKResult *)result API_AVAILABLE(ios(11)) API_UNAVAILABLE(watchos); - @end #endif + NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKStep.m b/ResearchKit/Common/ORKStep.m index 8141ff9501..86d18cc417 100644 --- a/ResearchKit/Common/ORKStep.m +++ b/ResearchKit/Common/ORKStep.m @@ -28,7 +28,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #import "ORKHelpers_Internal.h" #import "ORKOrderedTask.h" #import "ORKStep.h" @@ -36,8 +35,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #if TARGET_OS_IOS #import "ORKBodyItem.h" -#import "ORKStepViewController.h" -#import "ORKStepViewController_Internal.h" #import "ORKEarlyTerminationConfiguration.h" #endif @@ -108,7 +105,6 @@ - (instancetype)copyWithZone:(NSZone *)zone { step.shouldTintImages = _shouldTintImages; step.useSurveyMode = _useSurveyMode; step.useExtendedPadding = _useExtendedPadding; - #if TARGET_OS_IOS step.bodyItemTextAlignment = _bodyItemTextAlignment; step.buildInBodyItems = _buildInBodyItems; @@ -118,8 +114,8 @@ - (instancetype)copyWithZone:(NSZone *)zone { step.iconImage = self.iconImage; step.bodyItems = [_bodyItems copy]; step.earlyTerminationConfiguration = self.earlyTerminationConfiguration; + step.shouldAutomaticallyAdjustImageTintColor = _shouldAutomaticallyAdjustImageTintColor; #endif - return step; } @@ -152,6 +148,7 @@ - (BOOL)isEqual:(id)object && ORKEqualObjects(self.iconImage, castObject.iconImage) && ORKEqualObjects(self.bodyItems, castObject.bodyItems) && ORKEqualObjects(self.earlyTerminationConfiguration, castObject.earlyTerminationConfiguration) + && _shouldAutomaticallyAdjustImageTintColor == castObject->_shouldAutomaticallyAdjustImageTintColor #endif ); } @@ -160,7 +157,7 @@ - (NSUInteger)hash { // Ignore the task reference - it's not part of the content of the step. return _identifier.hash ^ _title.hash ^ _text.hash ^ self.detailText.hash ^_headerTextAlignment ^ self.footnote.hash ^ (_optional ? 0xf : 0x0) ^ (_showsProgress ? 0xf : 0x0) ^ (_useExtendedPadding ? 0xf : 0x0) #if TARGET_OS_IOS - ^ _bodyItemTextAlignment ^ (_buildInBodyItems ? 0xf : 0x0) ^ _imageContentMode ^ _bodyItems.hash ^_earlyTerminationConfiguration.hash + ^ _bodyItemTextAlignment ^ (_buildInBodyItems ? 0xf : 0x0) ^ _imageContentMode ^ _bodyItems.hash ^_earlyTerminationConfiguration.hash ^ (_shouldAutomaticallyAdjustImageTintColor ? 0xf : 0x0) #endif ; } @@ -195,6 +192,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { ORK_DECODE_OBJ_ARRAY(aDecoder, bodyItems, ORKBodyItem); ORK_DECODE_BOOL(aDecoder, buildInBodyItems); ORK_DECODE_OBJ_CLASS(aDecoder, earlyTerminationConfiguration, ORKEarlyTerminationConfiguration); + ORK_DECODE_BOOL(aDecoder, shouldAutomaticallyAdjustImageTintColor); #endif } return self; @@ -221,6 +219,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { ORK_ENCODE_OBJ(aCoder, bodyItems); ORK_ENCODE_BOOL(aCoder, buildInBodyItems); ORK_ENCODE_OBJ(aCoder, earlyTerminationConfiguration); + ORK_ENCODE_BOOL(aCoder, shouldAutomaticallyAdjustImageTintColor); #endif if ([_task isKindOfClass:[ORKOrderedTask class]]) { ORK_ENCODE_OBJ(aCoder, task); @@ -230,26 +229,6 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { #if TARGET_OS_IOS #pragma mark - iOS -+ (Class)stepViewControllerClass { - return [ORKStepViewController class]; -} - -- (Class)stepViewControllerClass { - return [[self class] stepViewControllerClass]; -} - -- (ORKStepViewController *)instantiateStepViewControllerWithResult:(ORKResult *)result { - Class stepViewControllerClass = [self stepViewControllerClass]; - - ORKStepViewController *stepViewController = [[stepViewControllerClass alloc] initWithStep:self result:result]; - - // Set the restoration info using the given class - stepViewController.restorationIdentifier = self.identifier; - stepViewController.restorationClass = stepViewControllerClass; - - return stepViewController; -} - - (void)setAuxiliaryImage:(UIImage *)auxiliaryImage { _auxiliaryImage = auxiliaryImage; if (auxiliaryImage) { diff --git a/ResearchKit/Common/ORKStepNavigationRule.h b/ResearchKit/Common/ORKStepNavigationRule.h index aee0e6c57a..41e2d62a0d 100644 --- a/ResearchKit/Common/ORKStepNavigationRule.h +++ b/ResearchKit/Common/ORKStepNavigationRule.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import @@ -48,7 +48,7 @@ ORK_EXTERN NSString *const ORKNullStepIdentifier ORK_AVAILABLE_DECL; @class ORKResultPredicate; /** - The `ORKStepNavigationRule` class is the abstract base class for concrete step navigation rules. + An abstract base class for concrete step navigation rules. Step navigation rules can be used within an `ORKNavigableOrderedTask` object. You assign step navigation rules to be triggered by the task steps. Each step can have one rule at most. @@ -84,9 +84,11 @@ ORK_CLASS_AVAILABLE /** - The `ORKPredicateStepNavigationRule` can be used to match any answer combination in the results of - the ongoing task (or in those of previously completed tasks) and jump accordingly. You must provide - one or more result predicates (each predicate can match one or more step results within the task). + A rule that matches any answer combination within the results of an ongoing task and jumps accordingly. + + This rule also applies to completed tasks. + + You must provide one or more result predicates (each predicate can match one or more step results within the task). Predicate step navigation rules contain an arbitrary number of result predicates with a corresponding number of destination step identifiers, plus an optional default step identifier that @@ -201,8 +203,8 @@ ORK_CLASS_AVAILABLE /** - The `ORKDirectStepNavigationRule` class can be used to unconditionally jump to a destination step - specified by its identifier or to finish the task early. + A rule that unconditionally jumps to a destination step that its identifier specifies, or + to finish the task early. */ ORK_CLASS_AVAILABLE @interface ORKDirectStepNavigationRule : ORKStepNavigationRule @@ -280,6 +282,10 @@ ORK_CLASS_AVAILABLE @end +/** + A navigation rule that determines whether to skip a step. + */ + ORK_CLASS_AVAILABLE @interface ORKPredicateSkipStepNavigationRule : ORKSkipStepNavigationRule @@ -338,8 +344,8 @@ ORK_CLASS_AVAILABLE /** - The `ORKStepModifier` class is an abstract base class for an object that can be used to modify a step - if a given navigation rule is matched. + An abstract base class for an object that modifies a step + if a given navigation rule matches. Step modifiers can be used within an `ORKNavigableOrderedTask` object. You assign step modifiers to be triggered after a task step is shown. Each step can have one step modifier at most. @@ -362,8 +368,8 @@ ORK_CLASS_AVAILABLE /** - The `ORKKeyValueStepModifier` class is an class for an object that can be used to modify a step - if a given navigation rule is matched. + A class for an object that modifies a step if a + given navigation rule matches. Step modifiers can be used within an `ORKNavigableOrderedTask` object. You assign step modifiers to be triggered after a task step is shown. Each step can have one step modifier at most. diff --git a/ResearchKit/Common/ORKStepNavigationRule.swift b/ResearchKit/Common/ORKStepNavigationRule.swift index 20baac8cb1..aea69ab1ea 100644 --- a/ResearchKit/Common/ORKStepNavigationRule.swift +++ b/ResearchKit/Common/ORKStepNavigationRule.swift @@ -28,7 +28,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import ResearchKit.Private +import ResearchKit_Private public extension ORKPredicateStepNavigationRule { @@ -41,7 +41,6 @@ public extension ORKPredicateStepNavigationRule { resultPredicates.append(tuple.resultPredicate) destinationStepIdentifiers.append(tuple.destinationStepIdentifier) } - self.init(resultPredicates: resultPredicates, destinationStepIdentifiers: destinationStepIdentifiers, defaultStepIdentifier: defaultStepIdentifierOrNil, diff --git a/ResearchKit/Common/ORKStep_Private.h b/ResearchKit/Common/ORKStep_Private.h index a72d2e1674..998a7815c5 100644 --- a/ResearchKit/Common/ORKStep_Private.h +++ b/ResearchKit/Common/ORKStep_Private.h @@ -28,7 +28,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#if TARGET_OS_IOS #import +#endif NS_ASSUME_NONNULL_BEGIN @@ -43,28 +46,4 @@ NS_ASSUME_NONNULL_BEGIN @end -#pragma mark - iOS - -#if TARGET_OS_IOS -@interface ORKStep () - -/** - Returns the class that the task view controller should instantiate to display - this step. - - This method is used within the framework so that steps can define their - step view controller pairing. - - Outside the framework, developers should instantiate the required view - controller in their task view controller delegate to override the task - view controller's default. - */ -+ (Class)stepViewControllerClass; - -- (Class)stepViewControllerClass; - -@end - -#endif - NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKSurveyCardHeaderView.m b/ResearchKit/Common/ORKSurveyCardHeaderView.m deleted file mode 100644 index 6f9b86e12e..0000000000 --- a/ResearchKit/Common/ORKSurveyCardHeaderView.m +++ /dev/null @@ -1,419 +0,0 @@ -/* - Copyright (c) 2018, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import "ORKSurveyCardHeaderView.h" -#import "ORKSkin.h" -#import "ORKLearnMoreView.h" -#import "ORKTagLabel.h" -#import "ORKHelpers_Internal.h" - -static const CGFloat HeaderViewLabelTopBottomPadding = 6.0; -static const CGFloat TagBottomPadding = 4.0; -static const CGFloat TagTopPadding = 8.0; -static const CGFloat HeaderViewBottomPadding = 24.0; -static const CGFloat SelectAllThatApplyTopPadding = 24.0; -static const CGFloat SelectAllThatApplyBottomPadding = 6.0; - -@implementation ORKSurveyCardHeaderView { - - UIView *_headlineView; - NSString *_title; - UILabel *_titleLabel; - NSString *_detailText; - UILabel *_detailTextLabel; - ORKLearnMoreView *_learnMoreView; - NSString *_progressText; - UILabel *_progressLabel; - UILabel *_tagLabel; - UILabel *_selectAllThatApplyLabel; - BOOL _showBorder; - BOOL _hasMultipleChoiceItem; - NSString *_tagText; - CAShapeLayer *_headlineMaskLayer; - NSArray *_headerViewConstraints; - NSArray *_learnMoreViewConstraints; -} - -- (instancetype)initWithTitle:(NSString *)title { - - self = [super init]; - if (self) { - _title = title; - [self setupView]; - } - return self; -} - -- (instancetype)initWithTitle:(NSString *)title - detailText:(nullable NSString *)text - learnMoreView:(nullable ORKLearnMoreView *)learnMoreView - progressText:(nullable NSString *)progressText - tagText:(nullable NSString *)tagText { - - return [self initWithTitle:title - detailText:text - learnMoreView:learnMoreView - progressText:progressText - tagText:tagText - showBorder:NO - hasMultipleChoiceItem:NO]; -} - -- (instancetype)initWithTitle:(NSString *)title - detailText:(NSString *)text - learnMoreView:(ORKLearnMoreView *)learnMoreView - progressText:(NSString *)progressText - tagText:(nullable NSString *)tagText - showBorder:(BOOL)showBorder - hasMultipleChoiceItem:(BOOL)hasMultipleChoiceItem { - - self = [super init]; - if (self) { - _title = title; - _detailText = text; - _learnMoreView = learnMoreView; - _progressText = progressText; - _showBorder = showBorder; - _tagText = tagText; - _hasMultipleChoiceItem = hasMultipleChoiceItem; - [self setupView]; - } - return self; -} - -- (void)setupView { - [self setBackgroundColor:[UIColor clearColor]]; - [self setupHeaderView]; - [self setupConstraints]; -} - -- (void)setupHeaderView { - [self setupHeadlineView]; - [self addSubview:_headlineView]; - - if (_tagText) { - [self setupTagLabel]; - [_headlineView addSubview:_tagLabel]; - } - - if (_progressText) { - [self setUpProgressLabel]; - [_headlineView addSubview:_progressLabel]; - } - - [self setupTitleLabel]; - [_headlineView addSubview:_titleLabel]; - - if (_detailText) { - [self setUpDetailTextLabel]; - [_headlineView addSubview:_detailTextLabel]; - } - - if (_learnMoreView) { - [_headlineView addSubview:_learnMoreView]; - } - - if (_hasMultipleChoiceItem) { - [self setupSelectAllThatApplyLabel]; - [_headlineView addSubview:_selectAllThatApplyLabel]; - } -} - -- (void)setupHeadlineView { - if (!_headlineView) { - _headlineView = [UIView new]; - } -} - -- (void)setupTitleLabel { - if (!_titleLabel) { - _titleLabel = [UILabel new]; - } - _titleLabel.text = _title; - _titleLabel.numberOfLines = 0; - if (@available(iOS 13.0, *)) { - _titleLabel.textColor = [UIColor labelColor]; - } else { - _titleLabel.textColor = [UIColor blackColor]; - } - _titleLabel.lineBreakMode = NSLineBreakByWordWrapping; - _titleLabel.textAlignment = NSTextAlignmentNatural; - [_titleLabel setFont:[self titleLabelFont]]; -} - -- (void)setUpDetailTextLabel { - if (!_detailTextLabel) { - _detailTextLabel = [UILabel new]; - } - _detailTextLabel.text = _detailText; - _detailTextLabel.numberOfLines = 0; - _detailTextLabel.lineBreakMode = NSLineBreakByWordWrapping; - _detailTextLabel.textAlignment = NSTextAlignmentNatural; - [_detailTextLabel setFont:[self detailTextLabelFont]]; -} - -- (void)setUpProgressLabel { - if (!_progressLabel) { - _progressLabel = [UILabel new]; - } - _progressLabel.text = _progressText; - _progressLabel.numberOfLines = 0; - if (@available(iOS 13.0, *)) { - _progressLabel.textColor = [UIColor secondaryLabelColor]; - } else { - _progressLabel.textColor = [UIColor lightGrayColor]; - } - _progressLabel.textAlignment = NSTextAlignmentNatural; - [_progressLabel setFont:[self progressLabelFont]]; -} - -- (void)setupTagLabel { - if (!_tagLabel) { - _tagLabel = [ORKTagLabel new]; - } - _tagLabel.text = _tagText; -} - -- (void)setupSelectAllThatApplyLabel { - if (!_selectAllThatApplyLabel) { - _selectAllThatApplyLabel = [UILabel new]; - } - - _selectAllThatApplyLabel.text = ORKLocalizedString(@"AX_SELECT_ALL_THAT_APPLY", nil); - _selectAllThatApplyLabel.numberOfLines = 0; - if (@available(iOS 13.0, *)) { - _selectAllThatApplyLabel.textColor = [UIColor secondaryLabelColor]; - } else { - _selectAllThatApplyLabel.textColor = [UIColor lightGrayColor]; - } - _selectAllThatApplyLabel.textAlignment = NSTextAlignmentNatural; - [_selectAllThatApplyLabel setFont:[self selectAllThatApplyFont]]; -} - -- (UIFont *)titleLabelFont { - UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody]; - UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; - return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; -} - -- (UIFont *)detailTextLabelFont { - UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; - return [UIFont fontWithDescriptor:descriptor size:[[descriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; -} - -- (UIFont *)progressLabelFont { - UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleFootnote]; - UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; - return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; -} - -- (UIFont *)selectAllThatApplyFont { - UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleFootnote]; - UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; - return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - - if (_headlineView) { - if (!_headlineMaskLayer) { - _headlineMaskLayer = [CAShapeLayer layer]; - } - for (CALayer *sublayer in [_headlineMaskLayer.sublayers mutableCopy]) { - [sublayer removeFromSuperlayer]; - } - [_headlineMaskLayer removeFromSuperlayer]; - - _headlineMaskLayer.path = [UIBezierPath bezierPathWithRoundedRect: _headlineView.bounds byRoundingCorners: UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii: (CGSize){ORKCardDefaultCornerRadii, ORKCardDefaultCornerRadii}].CGPath; - - CAShapeLayer *foreLayer = [CAShapeLayer layer]; - UIColor *fillColor; - UIColor *borderColor; - if (@available(iOS 13.0, *)) { - fillColor = [UIColor secondarySystemGroupedBackgroundColor]; - borderColor = UIColor.separatorColor; - } else { - fillColor = [UIColor whiteColor]; - borderColor = [UIColor ork_midGrayTintColor]; - } - - [foreLayer setFillColor:[fillColor CGColor]]; - CGRect foreLayerBounds = CGRectMake(ORKCardDefaultBorderWidth, ORKCardDefaultBorderWidth, _headlineView.bounds.size.width - 2 * ORKCardDefaultBorderWidth, _headlineView.bounds.size.height - ORKCardDefaultBorderWidth); - - CGFloat foreLayerCornerRadii = ORKCardDefaultCornerRadii >= ORKCardDefaultBorderWidth ? ORKCardDefaultCornerRadii - ORKCardDefaultBorderWidth : ORKCardDefaultCornerRadii; - - foreLayer.path = [UIBezierPath bezierPathWithRoundedRect: foreLayerBounds byRoundingCorners: UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii: (CGSize){foreLayerCornerRadii, foreLayerCornerRadii}].CGPath; - foreLayer.zPosition = 0.0f; - - [_headlineMaskLayer addSublayer:foreLayer]; - - if (_titleLabel.text) { - CAShapeLayer *lineLayer = [CAShapeLayer layer]; - CGRect lineBounds = CGRectMake(0.0, _headlineView.bounds.size.height - 1.0, _headlineView.bounds.size.width, 0.5); - lineLayer.path = [UIBezierPath bezierPathWithRect:lineBounds].CGPath; - lineLayer.zPosition = 0.0f; - [lineLayer setFillColor:[borderColor CGColor]]; - - [_headlineMaskLayer addSublayer:lineLayer]; - } - - if (_showBorder) { - [_headlineMaskLayer setFillColor:[borderColor CGColor]]; - } else { - [_headlineMaskLayer setFillColor:[[UIColor clearColor] CGColor]]; - } - - [_headlineView.layer insertSublayer:_headlineMaskLayer atIndex:0]; - } - -} - -- (BOOL)useLearnMoreLeftAlignmentLayout { - return ((_learnMoreView != nil) && ([_learnMoreView isTextLink] == NO)); -} - -- (void)setupConstraints { - NSLayoutXAxisAnchor *trailingAnchor = [self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor; - NSLayoutYAxisAnchor *lastYAxisAnchor = self.topAnchor; - - _headlineView.translatesAutoresizingMaskIntoConstraints = NO; - - if (_progressLabel) { - _progressLabel.translatesAutoresizingMaskIntoConstraints = NO; - [[_progressLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:ORKSurveyItemMargin] setActive:YES]; - [[_progressLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor] setActive:YES]; - [[_progressLabel.trailingAnchor constraintEqualToAnchor:trailingAnchor constant:-ORKSurveyItemMargin] setActive:YES]; - lastYAxisAnchor = _progressLabel.bottomAnchor; - } - - if (_tagLabel) { - CGFloat topPadding = _progressLabel ? TagTopPadding : ORKSurveyItemMargin; - _tagLabel.translatesAutoresizingMaskIntoConstraints = NO; - [_tagLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:topPadding].active = YES; - [_tagLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor].active = YES; - [_tagLabel.trailingAnchor constraintLessThanOrEqualToAnchor:_headlineView.trailingAnchor constant:-ORKSurveyItemMargin].active = YES; - lastYAxisAnchor = _tagLabel.bottomAnchor; - } - - CGFloat titlePadding; - if (_tagLabel) { - titlePadding = TagBottomPadding; - } else if (_progressLabel) { - titlePadding = HeaderViewLabelTopBottomPadding; - } else { - titlePadding = ORKSurveyItemMargin; - } - _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; - [[_titleLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:titlePadding] setActive:YES]; - [[_titleLabel.leadingAnchor constraintEqualToAnchor:_headlineView.leadingAnchor constant:ORKSurveyItemMargin] setActive:YES]; - [[_titleLabel.trailingAnchor constraintEqualToAnchor:[self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor constant:-ORKSurveyItemMargin] setActive:YES]; - lastYAxisAnchor = _titleLabel.bottomAnchor; - NSLayoutYAxisAnchor *headlineViewBottomAnchor = _titleLabel.bottomAnchor; - - if (_detailTextLabel) { - _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; - - [[_detailTextLabel.topAnchor constraintEqualToAnchor:_titleLabel.bottomAnchor constant:HeaderViewLabelTopBottomPadding] setActive:YES]; - [[_detailTextLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor] setActive:YES]; - [[_detailTextLabel.trailingAnchor constraintEqualToAnchor:[self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor constant:-ORKSurveyItemMargin] setActive:YES]; - lastYAxisAnchor = _detailTextLabel.bottomAnchor; - headlineViewBottomAnchor = _detailTextLabel.bottomAnchor; - } - - if (_learnMoreView) { - [self setupLearnMoreViewConstraints]; - if ([_learnMoreView isTextLink] == YES) { - [_learnMoreView setLearnMoreButtonFont:[UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]]; - [_learnMoreView setLearnMoreButtonTextAlignment:NSTextAlignmentLeft]; - - [[_learnMoreView.topAnchor constraintEqualToAnchor:_detailTextLabel ? _detailTextLabel.bottomAnchor : _titleLabel.bottomAnchor constant:HeaderViewLabelTopBottomPadding] setActive:YES]; - [[_learnMoreView.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor] setActive:YES]; - [[_learnMoreView.trailingAnchor constraintEqualToAnchor:[self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor constant:-ORKSurveyItemMargin] setActive:YES]; - - lastYAxisAnchor = _learnMoreView.bottomAnchor; - headlineViewBottomAnchor = _learnMoreView.bottomAnchor; - } - } - - if (_selectAllThatApplyLabel) { - _selectAllThatApplyLabel.translatesAutoresizingMaskIntoConstraints = NO; - [[_selectAllThatApplyLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:SelectAllThatApplyTopPadding] setActive:YES]; - [[_selectAllThatApplyLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor] setActive:YES]; - [[_selectAllThatApplyLabel.trailingAnchor constraintEqualToAnchor:_titleLabel.trailingAnchor] setActive:YES]; - - headlineViewBottomAnchor = _selectAllThatApplyLabel.bottomAnchor; - } - - [[_headlineView.topAnchor constraintEqualToAnchor:self.topAnchor constant:0.0] setActive:YES]; - [[_headlineView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:ORKCardLeftRightMarginForWindow(self.window)] setActive:YES]; - [[_headlineView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-ORKCardLeftRightMarginForWindow(self.window)] setActive:YES]; - [[_headlineView.bottomAnchor constraintEqualToAnchor: headlineViewBottomAnchor constant: _selectAllThatApplyLabel ? SelectAllThatApplyBottomPadding : HeaderViewBottomPadding] setActive:YES]; - - [[self.bottomAnchor constraintEqualToAnchor:_headlineView.bottomAnchor constant:0.0] setActive:YES]; -} - -- (void)setupLearnMoreViewConstraints { - - if (_learnMoreViewConstraints) { - [NSLayoutConstraint deactivateConstraints:_learnMoreViewConstraints]; - } - _learnMoreView.translatesAutoresizingMaskIntoConstraints = NO; - - if ([_learnMoreView isTextLink] == NO) { - _learnMoreViewConstraints = @[ - [NSLayoutConstraint constraintWithItem:_learnMoreView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem: _titleLabel ? : _headlineView - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:_titleLabel ? 0.0 : ORKSurveyItemMargin], - [NSLayoutConstraint constraintWithItem:_learnMoreView - attribute:NSLayoutAttributeTrailing - relatedBy:NSLayoutRelationEqual - toItem: _headlineView - attribute:NSLayoutAttributeTrailing - multiplier:1.0 - constant:-ORKSurveyItemMargin], - [NSLayoutConstraint constraintWithItem:_learnMoreView - attribute:NSLayoutAttributeWidth - relatedBy:NSLayoutRelationEqual - toItem: _learnMoreView - attribute:NSLayoutAttributeHeight - multiplier:1.0 - constant: 0.0] - ]; - } - - [NSLayoutConstraint activateConstraints:_learnMoreViewConstraints]; -} - -@end diff --git a/ResearchKit/Common/ORKTableStep.h b/ResearchKit/Common/ORKTableStep.h index 05dbb4c710..247a1cb6de 100644 --- a/ResearchKit/Common/ORKTableStep.h +++ b/ResearchKit/Common/ORKTableStep.h @@ -29,12 +29,16 @@ */ -@import UIKit; +#import #import NS_ASSUME_NONNULL_BEGIN +/** + An enumeration for bullet style options. + */ + typedef NS_ENUM(NSInteger, ORKBulletType) { ORKBulletTypeNone = 0, ORKBulletTypeCircle, @@ -43,8 +47,9 @@ typedef NS_ENUM(NSInteger, ORKBulletType) { } ORK_ENUM_AVAILABLE; /** - The `ORKTableStepSource` is a protocol that can be used for presenting a list of model - objects in a UITableView. Any `ORKStep` subclass that implements this protocol can be used with + A protocol that you use to present a list of model objects in a table view. + + You can use any `ORKStep` subclass that implements this protocol with an `ORKTableStepViewController` to display the list of items. */ @protocol ORKTableStepSource @@ -123,8 +128,7 @@ typedef NS_ENUM(NSInteger, ORKBulletType) { @end /** - The `ORKTableStep` class is a concrete subclass of `ORKStep`, used for presenting a list of model - objects in a UITableView. + A concrete subclass that presents a list of model objects in a table view. To use `ORKTableStep`, instantiate the object, fill in its properties, and include it in a task. Next, create a task view controller for the task and present it. @@ -178,6 +182,11 @@ ORK_CLASS_AVAILABLE */ @property (nonatomic) BOOL pinNavigationContainer; +/** + A property that manually overrides the bottomPadding of the content view + */ +@property (nonatomic, copy, nullable) NSNumber *bottomPadding; + /** Returns the number of sections in the tableview used to display this step. Default = `1`. diff --git a/ResearchKit/Common/ORKTableStep.m b/ResearchKit/Common/ORKTableStep.m index aa15720998..7fa8771133 100644 --- a/ResearchKit/Common/ORKTableStep.m +++ b/ResearchKit/Common/ORKTableStep.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTableStep.h" -#import "ORKTableStepViewController.h" #import "ORKHelpers_Internal.h" static const CGFloat CellPadding = 20.0; @@ -45,10 +44,6 @@ @implementation ORKTableStep { UIImage * _circleBulletImage; } -+ (Class)stepViewControllerClass { - return [ORKTableStepViewController class]; -} - - (NSInteger)numberOfSections { return 1; } @@ -174,6 +169,8 @@ - (instancetype)copyWithZone:(NSZone *)zone { step->_bulletType = _bulletType; step->_bulletIconNames = ORKArrayCopyObjects(_bulletIconNames); step->_allowsSelection = _allowsSelection; + step->_bottomPadding = _bottomPadding; + return step; } @@ -191,6 +188,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { ORK_DECODE_OBJ_ARRAY(aDecoder, bulletIconNames, NSString); ORK_DECODE_BOOL(aDecoder, allowsSelection); ORK_DECODE_BOOL(aDecoder, pinNavigationContainer); + ORK_DECODE_OBJ_CLASS(aDecoder, bottomPadding, NSNumber); } return self; } @@ -202,6 +200,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { ORK_ENCODE_OBJ(aCoder, bulletIconNames); ORK_ENCODE_BOOL(aCoder, allowsSelection); ORK_ENCODE_BOOL(aCoder, pinNavigationContainer); + ORK_ENCODE_OBJ(aCoder, bottomPadding); } #pragma mark - Equality @@ -215,11 +214,12 @@ - (BOOL)isEqual:(id)object { && (self.bulletType == castObject.bulletType) && (self.allowsSelection == castObject.allowsSelection) && ORKEqualObjects(self.bulletIconNames, castObject.bulletIconNames) - && self.pinNavigationContainer == castObject.pinNavigationContainer); + && self.pinNavigationContainer == castObject.pinNavigationContainer) + && ORKEqualObjects(self.bottomPadding, castObject.bottomPadding); } - (NSUInteger)hash { - return super.hash ^ self.items.hash ^ self.bulletIconNames.hash ^ (_bulletType ? 0xf : 0x0) ^ (_allowsSelection ? 0xf : 0x0) ^ (_pinNavigationContainer ? 0xf : 0x0); + return super.hash ^ self.items.hash ^ self.bulletIconNames.hash ^ self.bottomPadding.hash ^ (_bulletType ? 0xf : 0x0) ^ (_allowsSelection ? 0xf : 0x0) ^ (_pinNavigationContainer ? 0xf : 0x0); } @end diff --git a/ResearchKit/Common/ORKTask.h b/ResearchKit/Common/ORKTask.h index ae5dd15bb2..ffe062b19c 100644 --- a/ResearchKit/Common/ORKTask.h +++ b/ResearchKit/Common/ORKTask.h @@ -29,19 +29,47 @@ */ -@import Foundation; -@import HealthKit; +#import +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import +#endif + + +#if TARGET_OS_IOS #import +#endif + NS_ASSUME_NONNULL_BEGIN @class ORKStep; @class ORKTaskResult; +/** + The `ORKTaskFinishReason` value indicates how the task has finished. + */ +typedef NS_ENUM(NSInteger, ORKTaskFinishReason) { + + /// The task was canceled by the participant or the developer, and the participant asked to save the current result. + ORKTaskFinishReasonSaved, + + /// The task was canceled by the participant or the developer, and the participant asked to discard the current result. + ORKTaskFinishReasonDiscarded, + + /// The task has completed successfully, because all steps have been completed. + ORKTaskFinishReasonCompleted, + + /// An error was detected during the current step. + ORKTaskFinishReasonFailed, + + /// Interntional early termination of a task + ORKTaskFinishReasonEarlyTermination +}; + /** - `ORKTaskProgress` is a structure that represents how far a task has progressed. + A structure that represents how far a task has progressed. Objects that implement the `ORKTask` protocol return the task progress structure to indicate to the task view controller how far the task has progressed. @@ -71,7 +99,7 @@ ORK_EXTERN ORKTaskProgress ORKTaskProgressMake(NSUInteger current, NSUInteger to /** - `ORKTaskTotalProgress` is a structure that represents how far a task has progressed based on the total amount of questions. + A structure that represents how far a task has progressed based on the total amount of questions. Note that the values in an `ORKTotalTaskProgress` structure are used only for display; you don't use the values to access the steps in a task. */ @@ -98,8 +126,9 @@ typedef struct { ORK_EXTERN ORKTaskTotalProgress ORKTaskTotalProgressMake(NSUInteger currentStepStartingProgressPosition, NSUInteger total, BOOL stepShouldShowTotalProgress) ORK_AVAILABLE_DECL; /** - The `ORKTask` protocol defines a task to be carried out by a participant - in a research study. To present the ResearchKit framework UI in your app, instantiate an + A protocol that defines a task that a participant carries out in a research study. + + To present the ResearchKit framework UI in your app, instantiate an object that implements the `ORKTask` protocol (such as `ORKOrderedTask`) and provide it to an `ORKTaskViewController` object. @@ -245,6 +274,7 @@ requests access to these HealthKit types. See also: `requestedHealthKitTypesForWriting`. */ +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @property (nonatomic, copy, readonly, nullable) NSSet *requestedHealthKitTypesForReading; /** @@ -257,7 +287,7 @@ requests access to these HealthKit types. See also: `requestedHealthKitTypesForReading`. */ @property (nonatomic, copy, readonly, nullable) NSSet *requestedHealthKitTypesForWriting; - +#endif /** The set of permissions requested by the task. diff --git a/ResearchKit/Common/ORKTask_Util.m b/ResearchKit/Common/ORKTask_Util.m new file mode 100644 index 0000000000..0572c19b2d --- /dev/null +++ b/ResearchKit/Common/ORKTask_Util.m @@ -0,0 +1,36 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import + +ORKTaskProgress ORKTaskProgressMake(NSUInteger current, NSUInteger total) { + return (ORKTaskProgress){.current=current, .total=total}; +} diff --git a/ResearchKit/Common/ORKTypes.h b/ResearchKit/Common/ORKTypes.h index 04649e5c7b..9ee0041fd9 100644 --- a/ResearchKit/Common/ORKTypes.h +++ b/ResearchKit/Common/ORKTypes.h @@ -28,10 +28,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; -@import UIKit; +#import +#import + +#if TARGET_OS_IOS #import +#endif NS_ASSUME_NONNULL_BEGIN @@ -126,7 +129,17 @@ typedef NS_ENUM(NSInteger, ORKQuestionType) { /** In a socio-economic ladder, participant can pick their socio economic status. */ - ORKQuestionTypeSES + ORKQuestionTypeSES, + + /** + In an age question, the participant can enter an age by using an age picker. + */ + ORKQuestionTypeAge, + + /** + In an age question, the participant can enter an age by using an age picker. ORKQuestionTypeYear will be used if the useYearForResult property of the question's ORKAgeAnswerFormat is set to true. + */ + ORKQuestionTypeYear } ORK_ENUM_AVAILABLE; @@ -265,7 +278,7 @@ typedef NS_OPTIONS(NSInteger, ORKPSATPresentationMode) { /** - Identify the type of passcode authentication for `ORKPasscodeStepViewController`. + The type of passcode authentication for passcode view controller. */ typedef NS_ENUM(NSInteger, ORKPasscodeType) { /// 4 digit pin entry @@ -297,8 +310,7 @@ typedef NS_OPTIONS(NSUInteger, ORKPredefinedTaskHandOption) { /** - The `ORKPredefinedTaskOption` flags let you exclude particular behaviors from the predefined active - tasks in the predefined category of `ORKOrderedTask`. + Flags that exclude particular behaviors from the predefined active tasks. By default, all predefined tasks include instructions and conclusion steps, and may also include one or more data collection recorder configurations. Although not all predefined tasks include all @@ -336,7 +348,7 @@ typedef NS_OPTIONS(NSUInteger, ORKPredefinedTaskOption) { /** - Progress indicator type for `ORKWaitStep`. + A progress indicator type for the wait step. */ typedef NS_ENUM(NSInteger, ORKProgressIndicatorType) { /// Spinner animation. @@ -388,14 +400,16 @@ ORK_EXTERN ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierAirPodsPro /// AirPods Max ORK_EXTERN ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierAirPodsMax; - /// Lightning and Audio Jack Earpods ORK_EXTERN ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierEarPods; /// Other vendors or even apple ones but not mapped. ORK_EXTERN ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierUnknown; - +/** + A base class object that you subclass to represent + results that aren't actual answers. + */ ORK_CLASS_AVAILABLE @interface ORKNoAnswer : NSObject @@ -404,6 +418,10 @@ ORK_CLASS_AVAILABLE @end +/** + An Answer object attached to results when a + person selects the Don't Know Button for an answer. + */ ORK_CLASS_AVAILABLE @interface ORKDontKnowAnswer : ORKNoAnswer @@ -425,8 +443,7 @@ ORK_EXTERN ORKTrailMakingTypeIdentifier const ORKTrailMakingTypeIdentifierB; /** - The `ORKTremorActiveTaskOption` flags let you exclude particular steps from the predefined active - tasks in the predefined Tremor `ORKOrderedTask`. + Flags that let you exclude particular steps from the predefined tremor active task. By default, all predefined active tasks will be included. The tremor active task option flags can be used to explicitly specify that an active task is not to be included. @@ -453,7 +470,7 @@ typedef NS_OPTIONS(NSUInteger, ORKTremorActiveTaskOption) { /** - Enums to exclude options from `ORKPDFViewerStep`. + Enumerations that exclude options from the PDF viewer step. */ typedef NS_OPTIONS(NSUInteger, ORKPDFViewerActionBarOption) { ORKPDFViewerActionBarOptionExcludeThumbnail = 1 << 0, @@ -520,7 +537,7 @@ typedef NS_ENUM(NSInteger, ORKNavigationContainerButtonStyle) { } ORK_ENUM_AVAILABLE; /** - An enumeration of the types of button styles for the ORKDontKnowButton. + An enumeration of the types of button styles for the "don't know" button. */ typedef NS_ENUM(NSInteger, ORKDontKnowButtonStyle) { ORKDontKnowButtonStyleStandard = 0, @@ -722,14 +739,5 @@ ORK_EXTERN ORKSpeechRecognizerLocale const ORKSpeechRecognizerLocaleChineseHK; /// Chinese (Taiwan) ORK_EXTERN ORKSpeechRecognizerLocale const ORKSpeechRecognizerLocaleChineseTW; -typedef NS_OPTIONS(NSUInteger, ORKTouchAbilityTaskOption) { - ORKTouchAbilityTaskOptionTap = 1 << 0, - ORKTouchAbilityTaskOptionLongPress = 1 << 1, - ORKTouchAbilityTaskOptionSwipe = 1 << 2, - ORKTouchAbilityTaskOptionVerticalScroll = 1 << 3, - ORKTouchAbilityTaskOptionHorizontalScroll = 1 << 4, - ORKTouchAbilityTaskOptionPinch = 1 << 5, - ORKTouchAbilityTaskOptionRotation = 1 << 6 -} ORK_ENUM_AVAILABLE; NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKTypes.m b/ResearchKit/Common/ORKTypes.m index 7e587fc7de..402563bb4c 100644 --- a/ResearchKit/Common/ORKTypes.m +++ b/ResearchKit/Common/ORKTypes.m @@ -46,7 +46,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierAirPodsProGen2 = @"AIRPODSPROV2"; ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierAirPodsMax = @"AIRPODSMAX"; - ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierEarPods = @"EARPODS"; ORKHeadphoneTypeIdentifier const ORKHeadphoneTypeIdentifierUnknown = @"UNKNOWN"; diff --git a/ResearchKit/Common/ORKTypes_Private.h b/ResearchKit/Common/ORKTypes_Private.h index f93d71647b..9c40ce448b 100644 --- a/ResearchKit/Common/ORKTypes_Private.h +++ b/ResearchKit/Common/ORKTypes_Private.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import #import diff --git a/ResearchKit/Common/ORKVideoCaptureStep.m b/ResearchKit/Common/ORKVideoCaptureStep.m index ca75f093a1..47e68a5306 100644 --- a/ResearchKit/Common/ORKVideoCaptureStep.m +++ b/ResearchKit/Common/ORKVideoCaptureStep.m @@ -32,15 +32,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKVideoCaptureStep.h" #import "ORKHelpers_Internal.h" #import "ORKStep_Private.h" -#import "ORKVideoCaptureStepViewController.h" @implementation ORKVideoCaptureStep -+ (Class)stepViewControllerClass { - return [ORKVideoCaptureStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/Common/ORKVideoInstructionStep.h b/ResearchKit/Common/ORKVideoInstructionStep.h index c74372fb4d..73f8fb532c 100644 --- a/ResearchKit/Common/ORKVideoInstructionStep.h +++ b/ResearchKit/Common/ORKVideoInstructionStep.h @@ -38,10 +38,9 @@ NS_ASSUME_NONNULL_BEGIN @class ORKBundleAsset; /** - An `ORKVideoInstructionStep` object gives the participant video-based instructions for a task. + An object that gives the participant video-based instructions for a task. You can use video instruction steps to present video content during a task. - */ ORK_CLASS_AVAILABLE @interface ORKVideoInstructionStep : ORKInstructionStep diff --git a/ResearchKit/Common/ORKVideoInstructionStep.m b/ResearchKit/Common/ORKVideoInstructionStep.m index 49c06e0117..f5c09b9fb1 100644 --- a/ResearchKit/Common/ORKVideoInstructionStep.m +++ b/ResearchKit/Common/ORKVideoInstructionStep.m @@ -30,17 +30,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKVideoInstructionStep.h" -#import "ORKVideoInstructionStepViewController.h" #import "ORKHelpers_Internal.h" #import @implementation ORKVideoInstructionStep -+ (Class)stepViewControllerClass { - return [ORKVideoInstructionStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/Common/ORKVideoInstructionStepResult.h b/ResearchKit/Common/ORKVideoInstructionStepResult.h index cf01d2e422..197aaff226 100644 --- a/ResearchKit/Common/ORKVideoInstructionStepResult.h +++ b/ResearchKit/Common/ORKVideoInstructionStepResult.h @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN /** - The `ORKVideoInstructionStepResult` class represents the result of a video instruction step (`ORKVideoInstructionStep`). + A result object from a video instruction step. A video instruction result is produced by the task view controller when it presents a video instruction step. diff --git a/ResearchKit/Common/ORKWaitStep.h b/ResearchKit/Common/ORKWaitStep.h index a96b82fe8d..ca0e017c40 100644 --- a/ResearchKit/Common/ORKWaitStep.h +++ b/ResearchKit/Common/ORKWaitStep.h @@ -38,15 +38,14 @@ */ -@import Foundation; +#import #import NS_ASSUME_NONNULL_BEGIN /** - The `ORKWaitStep` class represents a step that displays a label and an activity - indicator mask. + A step that displays a label and an activity-indicator mask. This task can be used to indicate to a user that a process is occuring that does not need their input, and possibly indicate the progress that process has made. diff --git a/ResearchKit/Common/ORKWaitStep.m b/ResearchKit/Common/ORKWaitStep.m index 89b5361107..f1b5ccf8bc 100644 --- a/ResearchKit/Common/ORKWaitStep.m +++ b/ResearchKit/Common/ORKWaitStep.m @@ -40,17 +40,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKWaitStep.h" -#import "ORKWaitStepViewController.h" - #import "ORKHelpers_Internal.h" @implementation ORKWaitStep -+ (Class)stepViewControllerClass { - return [ORKWaitStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/Common/ORKWebViewStep.h b/ResearchKit/Common/ORKWebViewStep.h index 078cb6c04b..a588b682ef 100644 --- a/ResearchKit/Common/ORKWebViewStep.h +++ b/ResearchKit/Common/ORKWebViewStep.h @@ -31,6 +31,8 @@ #import +@class ORKInstructionStep; + NS_ASSUME_NONNULL_BEGIN @protocol ORKCustomSignatureAccessoryViewProtocol; @@ -92,11 +94,26 @@ ORK_CLASS_AVAILABLE + (instancetype)webViewStepWithIdentifier:(NSString *)identifier html:(NSString *)html; +/** + Returns a new web view step that includes the specified identifier and will display the html + constructed from the provided instruction steps. + + @param identifier The identifier of the step (a step identifier should be unique within the task). + @param instructionSteps Instruction steps used to construct presented html. + */ ++ (instancetype)webViewStepWithIdentifier:(NSString *)identifier + instructionSteps:(NSArray *)instructionSteps; + /** Embedded html used for displaying the webview. */ @property (nonatomic, copy, nullable) NSString *html; +/** + Instruction steps used to generate html for webview.. + */ +@property (nonatomic, copy, nullable) NSArray *instructionSteps; + @property (nonatomic, copy, nullable) NSString *customCSS; @property (nonatomic) BOOL showSignatureAfterContent; diff --git a/ResearchKit/Common/ORKWebViewStep.m b/ResearchKit/Common/ORKWebViewStep.m index f6dc8b6d58..1b79c2917f 100644 --- a/ResearchKit/Common/ORKWebViewStep.m +++ b/ResearchKit/Common/ORKWebViewStep.m @@ -29,15 +29,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKWebViewStep.h" -#import "ORKWebViewStepViewController.h" #import "ORKHelpers_Internal.h" +#import "ORKInstructionStep.h" +#import "ORKInstructionStepHTMLFormatter.h" @implementation ORKWebViewStep -+ (Class)stepViewControllerClass { - return [ORKWebViewStepViewController class]; -} - + (instancetype)webViewStepWithIdentifier:(NSString *)identifier html:(NSString *)html { ORKWebViewStep *step = [[ORKWebViewStep alloc] initWithIdentifier:identifier]; @@ -45,12 +42,19 @@ + (instancetype)webViewStepWithIdentifier:(NSString *)identifier return step; } ++ (instancetype)webViewStepWithIdentifier:(NSString *)identifier + instructionSteps:(NSArray *)instructionSteps { + ORKWebViewStep *step = [[ORKWebViewStep alloc] initWithIdentifier:identifier]; + step.instructionSteps = [instructionSteps copy]; + return step; +} + - (void)validateParameters { [super validateParameters]; - if (self.html == nil) { + if (self.html == nil && self.instructionSteps == nil) { @throw [NSException exceptionWithName:NSInvalidArgumentException - reason:@"WebViewStep requires html property." + reason:@"WebViewStep requires html or instructionSteps property." userInfo:nil]; } } @@ -59,6 +63,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { ORK_DECODE_OBJ_CLASS(aDecoder, html, NSString); + ORK_DECODE_OBJ_ARRAY(aDecoder, instructionSteps, ORKInstructionStep); ORK_DECODE_OBJ_CLASS(aDecoder, customCSS, NSString); ORK_DECODE_BOOL(aDecoder, showSignatureAfterContent); ORK_DECODE_OBJ_CLASS(aDecoder, customViewProvider, NSObject); @@ -69,6 +74,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { - (void)encodeWithCoder:(NSCoder *)aCoder { [super encodeWithCoder:aCoder]; ORK_ENCODE_OBJ(aCoder, html); + ORK_ENCODE_OBJ(aCoder, instructionSteps); ORK_ENCODE_OBJ(aCoder, customCSS); ORK_ENCODE_BOOL(aCoder, showSignatureAfterContent); ORK_ENCODE_OBJ(aCoder, customViewProvider); @@ -81,6 +87,7 @@ + (BOOL)supportsSecureCoding { - (instancetype)copyWithZone:(NSZone *)zone { ORKWebViewStep *step = [super copyWithZone:zone]; step.html = self.html; + step.instructionSteps = [self.instructionSteps copy]; step.customCSS = self.customCSS; step.customViewProvider = self.customViewProvider; step.showSignatureAfterContent = self.showSignatureAfterContent; @@ -93,8 +100,18 @@ - (BOOL)isEqual:(id)object { __typeof(self) castObject = object; return (isParentSame && ORKEqualObjects(self.html, castObject.html) && + ORKEqualObjects(self.instructionSteps, castObject.instructionSteps) && ORKEqualObjects(self.customCSS, castObject.customCSS) && self.showSignatureAfterContent == castObject.showSignatureAfterContent); } +- (void)setInstructionSteps:(NSArray *)instructionSteps { + _instructionSteps = instructionSteps; + + if (_instructionSteps.count > 0) { + ORKInstructionStepHTMLFormatter *formatter = [ORKInstructionStepHTMLFormatter new]; + _html = [formatter HTMLForInstructionSteps:_instructionSteps]; + } +} + @end diff --git a/ResearchKit/Common/ORKWebViewStepResult.h b/ResearchKit/Common/ORKWebViewStepResult.h index 1dea4c057c..5c38f28067 100644 --- a/ResearchKit/Common/ORKWebViewStepResult.h +++ b/ResearchKit/Common/ORKWebViewStepResult.h @@ -31,7 +31,7 @@ #import /** - The `ORKWebViewStepResult` class represents the result of a web view step (`ORKWebViewStep`). + A result object from a web view step. A web view result is produced by the task view controller when it presents a web view step. @@ -42,6 +42,16 @@ ORK_CLASS_AVAILABLE /** The answer produced by the webview. */ -@property (nonatomic, nullable) NSString* result; +@property (nonatomic, nullable) NSString *result; + +/** + The html stored within the userInfo of the result. + */ +@property (nonatomic, nullable, readonly, getter=getHTML) NSString *html; + +/** + The html with a signature added stored within the userInfo of the result. + */ +@property (nonatomic, nullable, readonly, getter=getHTMLWithSignature) NSString *htmlWithSignature; @end diff --git a/ResearchKit/Common/ORKWebViewStepResult.m b/ResearchKit/Common/ORKWebViewStepResult.m index 126c398b15..f9b925620c 100644 --- a/ResearchKit/Common/ORKWebViewStepResult.m +++ b/ResearchKit/Common/ORKWebViewStepResult.m @@ -29,8 +29,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKWebViewStepResult.h" -#import "ORKResult_Private.h" + #import "ORKHelpers_Internal.h" +#import "ORKResult_Private.h" + + +NSString * const HTMLKey = @"html"; +NSString * const HTMLWithSignatureKey = @"htmlWithSignature"; @implementation ORKWebViewStepResult @@ -69,4 +74,20 @@ - (instancetype)copyWithZone:(NSZone *)zone { return result; } +- (nullable NSString *)getHTML { + return self.userInfo[[ORKWebViewStepResult getHTMLKey]]; +} + +- (NSString *)getHTMLWithSignature { + return self.userInfo[[ORKWebViewStepResult getHTMLWithDictionaryKey]]; +} + ++ (nonnull NSString *)getHTMLKey { + return HTMLKey; +} + ++ (nonnull NSString *)getHTMLWithDictionaryKey { + return HTMLWithSignatureKey; +} + @end diff --git a/ResearchKit/Common/ORKWebViewStepResult_Private.h b/ResearchKit/Common/ORKWebViewStepResult_Private.h new file mode 100644 index 0000000000..cf028b4e73 --- /dev/null +++ b/ResearchKit/Common/ORKWebViewStepResult_Private.h @@ -0,0 +1,38 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +@interface ORKWebViewStepResult() + ++ (NSString *)getHTMLKey; ++ (NSString *)getHTMLWithDictionaryKey; + +@end diff --git a/ResearchKit/Common/SwiftUIViewFactory.swift b/ResearchKit/Common/SwiftUIViewFactory.swift deleted file mode 100644 index 4a19963f03..0000000000 --- a/ResearchKit/Common/SwiftUIViewFactory.swift +++ /dev/null @@ -1,103 +0,0 @@ -/* - Copyright (c) 2021, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import Foundation -import SwiftUI - -@objc -public class SwiftUIViewFactory: NSObject { - - @objc public var answerDidUpdateClosure: ((Any) -> Void)? - - @objc public func makeSwiftUIView(answerFormat: ORKAnswerFormat, answer: Any) -> UIView? { - - if #available(iOS 13.0, *) { - - // SwiftUI view for ORKTextChoiceAnswerFormat when at least one of the textChoices - // has an image passed along with it - if let textChoiceAnswerFormat = answerFormat as? ORKTextChoiceAnswerFormat { - let textChoiceHelper = SwiftUITextChoiceHelper(answer: answer, - answerFormat: textChoiceAnswerFormat) - var textChoiceView = TextChoiceView(textChoiceHelper: textChoiceHelper) - textChoiceView.answerDidUpdateClosure = { answer in - - if let closure = self.answerDidUpdateClosure { - closure(answer) - } - } - - let hostingController = UIHostingController(rootView: textChoiceView) - hostingController.view.backgroundColor = .clear - return hostingController.view - } - - } - - return nil - } - -} - -@available(iOS 13.0, *) -struct WidthPreferenceKey: PreferenceKey { - static var defaultValue: CGFloat? - - static func reduce( - value: inout CGFloat?, - nextValue: () -> CGFloat? - ) { - if value == nil { - value = nextValue() - } - } -} - -@available(iOS 13.0, *) -struct FullScreenModifier: ViewModifier { - let isPresented: Binding - let builder: () -> V - - @ViewBuilder - func body(content: Content) -> some View { - if #available(iOS 14.0, *) { - content.fullScreenCover(isPresented: isPresented, content: builder) - } else { - content.sheet(isPresented: isPresented, content: builder) - } - } -} - -@available(iOS 13.0, *) -extension View { - func compatibleFullScreen(isPresented: Binding, - @ViewBuilder content: @escaping () -> Content) -> some View { - self.modifier(FullScreenModifier(isPresented: isPresented, builder: content)) - } -} diff --git a/ResearchKit/Common/UIBarButtonItem+ORKBarButtonItem.m b/ResearchKit/Common/UIBarButtonItem+ORKBarButtonItem.m deleted file mode 100644 index 3b8658b466..0000000000 --- a/ResearchKit/Common/UIBarButtonItem+ORKBarButtonItem.m +++ /dev/null @@ -1,78 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "UIBarButtonItem+ORKBarButtonItem.h" - -#import "ORKHelpers_Internal.h" - - -@implementation UIBarButtonItem (ORKBarButtonItem) - -+ (UIBarButtonItem *)ork_backBarButtonItemWithTarget:(id)target action:(SEL)selector { - - // Use SFSymbols for the back button on iOS 13+ - if (@available(iOS 13.0, *)) { - NSString *imageName = @"chevron.left"; - if ([UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft ) { - imageName = @"chevron.right"; - } - - UIImage *image = [UIImage systemImageNamed:imageName]; - UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:image - landscapeImagePhone:image - style:UIBarButtonItemStyleDone - target:target - action:selector]; - item.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_BACK", nil); - return item; - } - - // Use assets catalog below iOS 13 - NSString *regularImageName = @"arrowLeft"; - NSString *landscapeImageName = @"arrowLeftLandscape"; - - if ([UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft ) { - regularImageName = @"arrowRight"; - landscapeImageName = @"arrowRightLandscape"; - } - - UIImage *image = [UIImage imageNamed:regularImageName inBundle:ORKBundle() compatibleWithTraitCollection:nil]; - UIImage *landscapeImage = [UIImage imageNamed:landscapeImageName inBundle:ORKBundle() compatibleWithTraitCollection:nil]; - UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:image - landscapeImagePhone:landscapeImage - style:UIBarButtonItemStyleDone - target:target - action:selector]; - item.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_BACK", nil); - return item; -} - -@end diff --git a/ResearchKit/Common/UIImageView+ResearchKit.h b/ResearchKit/Common/UIImageView+ResearchKit.h new file mode 100644 index 0000000000..30b0647c9f --- /dev/null +++ b/ResearchKit/Common/UIImageView+ResearchKit.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIImageView (ResearchKit) + +- (void)updateRenderingModeForUserInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle API_AVAILABLE(ios(12.0)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/UIImageView+ResearchKit.m b/ResearchKit/Common/UIImageView+ResearchKit.m new file mode 100644 index 0000000000..11bf43dc03 --- /dev/null +++ b/ResearchKit/Common/UIImageView+ResearchKit.m @@ -0,0 +1,40 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "UIImage+ResearchKit.h" +#import "UIImageView+ResearchKit.h" + +@implementation UIImageView (ResearchKit) + +- (void)updateRenderingModeForUserInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle { + self.image = [self.image ork_imageWithRenderingModeForUserInterfaceStyle:userInterfaceStyle]; +} + +@end diff --git a/ResearchKit/Configuration/Project/Project-Debug.xcconfig b/ResearchKit/Configuration/Project/Project-Debug.xcconfig new file mode 100644 index 0000000000..9e02d11edd --- /dev/null +++ b/ResearchKit/Configuration/Project/Project-Debug.xcconfig @@ -0,0 +1,9 @@ +// +// Project-Debug.xcconfig +// + +#include "Project-Shared.xcconfig" + +ENABLE_TESTABILITY = YES +GCC_OPTIMIZATION_LEVEL = 0 +GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) diff --git a/ResearchKit/Configuration/Project/Project-Release.xcconfig b/ResearchKit/Configuration/Project/Project-Release.xcconfig new file mode 100644 index 0000000000..fa4b61cc16 --- /dev/null +++ b/ResearchKit/Configuration/Project/Project-Release.xcconfig @@ -0,0 +1,13 @@ +// +// Project-Release.xcconfig +// + +#include "Project-Shared.xcconfig" + +COPY_PHASE_STRIP = YES +ENABLE_NS_ASSERTIONS = NO +SWIFT_OPTIMIZATION_LEVEL = -Owholemodule +SWIFT_COMPILATION_MODE = wholemodule +VALIDATE_PRODUCT = YES +MTL_ENABLE_DEBUG_INFO = NO +ENABLE_TESTABILITY = YES diff --git a/ResearchKit/Configuration/Project/Project-Shared.xcconfig b/ResearchKit/Configuration/Project/Project-Shared.xcconfig new file mode 100644 index 0000000000..8918353b53 --- /dev/null +++ b/ResearchKit/Configuration/Project/Project-Shared.xcconfig @@ -0,0 +1,122 @@ +// +// Project-Shared.xcconfig +// + +COPY_PHASE_STRIP = NO + +ALWAYS_SEARCH_USER_PATHS = NO +ARCHS = $(ARCHS_STANDARD) +CLANG_ADDRESS_SANITIZER_CONTAINER_OVERFLOW = YES +CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES +CLANG_CXX_LIBRARY = libc++ +CLANG_ENABLE_MODULES = YES +CLANG_ENABLE_OBJC_ARC = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_INTEGER = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_ASSIGN_ENUM = YES +CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES +CLANG_WARN_BOOL_CONVERSION = YES +CLANG_WARN_COMMA = YES +CLANG_WARN_CONSTANT_CONVERSION = YES +CLANG_WARN_EMPTY_BODY = YES +CLANG_WARN_ENUM_CONVERSION = YES +CLANG_WARN_FLOAT_CONVERSION = NO +CLANG_WARN_INFINITE_RECURSION = YES +CLANG_WARN_INT_CONVERSION = NO +CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO +CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_PRIVATE_MODULE = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES +CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN_UNREACHABLE_CODE = YES +ENABLE_STRICT_OBJC_MSGSEND = YES +GCC_NO_COMMON_BLOCKS = YES +GCC_SYMBOLS_PRIVATE_EXTERN = NO +GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES +GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES +GCC_TREAT_WARNINGS_AS_ERRORS = NO +GCC_WARN_64_TO_32_BIT_CONVERSION = NO +GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES +GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES +GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES +GCC_WARN_ABOUT_MISSING_NEWLINE = YES +GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR +GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES +GCC_WARN_CHECK_SWITCH_STATEMENTS = YES +GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES +GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES +GCC_WARN_MISSING_PARENTHESES = YES +GCC_WARN_SHADOW = YES +GCC_WARN_SIGN_COMPARE = NO +GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES +GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE +GCC_WARN_UNKNOWN_PRAGMAS = YES +GCC_WARN_UNUSED_FUNCTION = YES +GCC_WARN_UNUSED_LABEL = YES +GCC_WARN_UNUSED_PARAMETER = NO +GCC_WARN_UNUSED_VALUE = YES +GCC_WARN_UNUSED_VARIABLE = YES +IPHONEOS_DEPLOYMENT_TARGET = 13.0 +SDKROOT = iphoneos +SKIP_INSTALL = YES +SWIFT_TREAT_WARNINGS_AS_ERRORS = NO +SWIFT_VERSION = 4.2 +TARGETED_DEVICE_FAMILY = 1 +TOOLCHAINS = default +//WARNING_CFLAGS = -Wunreachable-code -Wextra -Wno-unused-parameter -Wno-sign-compare + +// Apple Clang - Warnings - C++ +CLANG_WARN_VEXING_PARSE = YES +CLANG_WARN_DELETE_NON_VIRTUAL_DTOR = YES +CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES +GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES +GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES +CLANG_WARN_RANGE_LOOP_ANALYSIS = YES +CLANG_WARN_SUSPICIOUS_MOVE = YES +GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES +CLANG_WARN_CXX0X_EXTENSIONS = YES + +// Apple Clang - Warnings - Objective-C +CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR +CLANG_WARN__DUPLICATE_METHOD_MATCH = NO +CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO +CLANG_WARN_OBJC_LITERAL_CONVERSION = YES +CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = NO +GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES +CLANG_WARN_OBJC_INTERFACE_IVARS = NO +CLANG_WARN_MISSING_NOESCAPE = YES +CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = NO +GCC_WARN_STRICT_SELECTOR_MATCH = NO +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR + +// Apple Clang - Warnings - Objective-C and ARC +CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = NO +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = NO +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO +CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES + +// Static Analyzer - Generic Issues +CLANG_ANALYZER_DEADCODE_DEADSTORES = YES +CLANG_ANALYZER_MEMORY_MANAGEMENT = YES +CLANG_ANALYZER_NONNULL = NO + +// Static Analyzer - Issues - Apple APIs +CLANG_ANALYZER_OBJC_NSCFERROR = YES +CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES +CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = NO +CLANG_ANALYZER_OBJC_COLLECTIONS = YES +CLANG_ANALYZER_GCD = YES +CLANG_ANALYZER_GCD_PERFORMANCE = NO +CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = NO + +// Static Analyzer - Issues - Security +CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES + +MTL_ENABLE_DEBUG_INFO = YES +SWIFT_OPTIMIZATION_LEVEL = -Onone diff --git a/ResearchKit/Configuration/ResearchKit/ResearchKit-Debug.xcconfig b/ResearchKit/Configuration/ResearchKit/ResearchKit-Debug.xcconfig index 9928598a60..b78344cbcf 100644 --- a/ResearchKit/Configuration/ResearchKit/ResearchKit-Debug.xcconfig +++ b/ResearchKit/Configuration/ResearchKit/ResearchKit-Debug.xcconfig @@ -2,10 +2,10 @@ // ResearchKit-Debug.xcconfig // - RUN_CLANG_STATIC_ANALYZER = YES #include "ResearchKit-Shared.xcconfig" SUPPORTS_MACCATALYST = NO TARGETED_DEVICE_FAMILY = 1 +DEBUG_INFORMATION_FORMAT = dwarf diff --git a/ResearchKit/Configuration/ResearchKit/ResearchKit-Shared.xcconfig b/ResearchKit/Configuration/ResearchKit/ResearchKit-Shared.xcconfig index 066a1e8b4f..3b29f32f3e 100644 --- a/ResearchKit/Configuration/ResearchKit/ResearchKit-Shared.xcconfig +++ b/ResearchKit/Configuration/ResearchKit/ResearchKit-Shared.xcconfig @@ -6,7 +6,7 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES CODE_SIGN_IDENTITY = CODE_SIGN_STYLE = Manual DEFINES_MODULE = YES -DEVELOPMENT_TEAM = +DEVELOPMENT_TEAM = DYLIB_COMPATIBILITY_VERSION = 1 DYLIB_CURRENT_VERSION = 1 DYLIB_INSTALL_NAME_BASE = @rpath @@ -18,23 +18,53 @@ LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/ MODULEMAP_FILE = ResearchKit/ResearchKit.modulemap PRODUCT_BUNDLE_IDENTIFIER = org.researchkit.${PRODUCT_NAME:rfc1034identifier} PRODUCT_NAME = ResearchKit -PROVISIONING_PROFILE_SPECIFIER = +PROVISIONING_PROFILE_SPECIFIER = PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] = SWIFT_VERSION = 5.0 -SYSTEM_FRAMEWORK_SEARCH_PATHS = $(inherited) -SYSTEM_HEADER_SEARCH_PATHS = $(inherited) CLANG_STATIC_ANALYZER_MODE = deep -ORK_FRAMEWORK_VERSION_NUMBER = 2.2.9 +ORK_FRAMEWORK_VERSION_NUMBER = 3.1.1 ORK_FRAMEWORK_BUILD_NUMBER = $(ORK_FRAMEWORK_BUILD_NUMBER_CI_$(CI)) // ORK_FRAMEWORK_BUILD_NUMBER_CI_TRUE or ORK_FRAMEWORK_BUILD_NUMBER_CI_ ORK_FRAMEWORK_BUILD_NUMBER_CI_TRUE = $(CI_BUILD_NUMBER) ORK_FRAMEWORK_BUILD_NUMBER_CI_FALSE = $(ORK_FRAMEWORK_VERSION_NUMBER) // When not building in CI, assume build and version number are the same ORK_FRAMEWORK_BUILD_NUMBER_CI_ = $(ORK_FRAMEWORK_BUILD_NUMBER_CI_FALSE) +// Some CLLocationManager API calls would trigger authorization to use location. The presence of those +// API calls in ResearchKit **at compile time** mean apps that link ResearchKit also need Info.plist entries +// for NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription. +// If your app doesn't use ORKLocationRecorder and doesn't specify these Info.plist strings, disable +// ResearchKit's CLLocationManager authorization +ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION = 1 + +// Control whether ResearchKit compiles out CLLocationManager calls that would request authorization for location +// ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=0 compiles out the feature +// ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=1 compiles RK with the feature intact +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS = $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_$(ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION)) +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_0 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=0 +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_1 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=1 + + +// Some HealthKit API calls used within the framework require your app to disclose using HealthKit and provide a reason during app store review. +// If your app does not use HealthKit or any of the ResearchKit HealthKit APIs, disable ResearchKit's HealthKit authorization. +ORK_FEATURE_HEALTHKIT_AUTHORIZATION = 1 + +// GCC Preprocessor definitions +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC = $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_$(ORK_FEATURE_HEALTHKIT_AUTHORIZATION)) +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_0 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION=0 +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_1 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION=1 + +// Swift active compilation conditions +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT = $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_$(ORK_FEATURE_HEALTHKIT_AUTHORIZATION)) +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_0 = +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_1 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION + +#include? "../../../../xcconfig/ResearchKit-Shared.xcconfig" #include? "samples/ORKCatalog/ResearchKit-Shared.xcconfig" #include? "../xcconfig/ResearchKit-Shared.xcconfig" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(ORK_GCC_PREPROCESSOR_DEFINITIONS) +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) GLES_SILENCE_DEPRECATION=1 $(ORK_GCC_PREPROCESSOR_DEFINITIONS) $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS) $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC) + +SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT) diff --git a/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Debug.xcconfig b/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Debug.xcconfig new file mode 100644 index 0000000000..3c375c75c3 --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Debug.xcconfig @@ -0,0 +1,7 @@ +// +// ResearchKitActiveTask-Debug.xcconfig +// + +#include "ResearchKitActiveTask-Shared.xcconfig" + +DEBUG_INFORMATION_FORMAT = dwarf diff --git a/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Release.xcconfig b/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Release.xcconfig new file mode 100644 index 0000000000..f3d31f423d --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Release.xcconfig @@ -0,0 +1,5 @@ +// +// ResearchKitActiveTask-Release.xcconfig +// + +#include "ResearchKitActiveTask-Shared.xcconfig" diff --git a/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Shared.xcconfig b/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Shared.xcconfig new file mode 100644 index 0000000000..b68031c5dc --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitActiveTask/ResearchKitActiveTask-Shared.xcconfig @@ -0,0 +1,10 @@ +// +// ResearchKitActiveTask-Shared.xcconfig +// + +#include "../ResearchKit/ResearchKit-Shared.xcconfig" + +GCC_PREFIX_HEADER = +INFOPLIST_FILE = ResearchKitActiveTask/Info.plist +MODULEMAP_FILE = ResearchKitActiveTask/ResearchKitActiveTask.modulemap +PRODUCT_NAME = ResearchKitActiveTask diff --git a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Debug.xcconfig b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Debug.xcconfig new file mode 100644 index 0000000000..bd57c86d49 --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Debug.xcconfig @@ -0,0 +1,8 @@ +// +// ResearchKitTests-Debug.xcconfig +// + +#include "ResearchKitTests-Shared.xcconfig" + +SWIFT_OBJC_BRIDGING_HEADER = ResearchKitTests/ResearchKitTests-Bridging-Header.h +DEBUG_INFORMATION_FORMAT = dwarf diff --git a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Release.xcconfig b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Release.xcconfig new file mode 100644 index 0000000000..a78200fdab --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Release.xcconfig @@ -0,0 +1,7 @@ +// +// ResearchKitTests-Release.xcconfig +// + +#include "ResearchKitTests-Shared.xcconfig" + +SWIFT_OBJC_BRIDGING_HEADER = ResearchKitTests/ResearchKitTests-Bridging-Header.h diff --git a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Shared.xcconfig b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Shared.xcconfig new file mode 100644 index 0000000000..0d21f3484d --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Shared.xcconfig @@ -0,0 +1,60 @@ +// +// ResearchKitTests-Shared.xcconfig +// + +CLANG_CXX_LANGUAGE_STANDARD = gnu++0x +GCC_C_LANGUAGE_STANDARD = gnu99 +GCC_WARN_SHADOW = NO +INFOPLIST_FILE = ResearchKitTests/Info.plist +LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks +PRODUCT_BUNDLE_IDENTIFIER = org.researchkit.$(PRODUCT_NAME:rfc1034identifier) +PRODUCT_NAME = $(TARGET_NAME) +SWIFT_VERSION = 5.0 + +// Control whether ResearchKitTests expect CLLocationManager calls requesting authorization for location +// ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=0 compiles out the feature +// ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=1 compiles RK with the feature intact +// Use prefix ORKTEST_ so that we can use different values for 1) whether to test as if locationManager auth was +// enabled and 2)whether RK actually has locationManager auth compiled in for testing. +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS = $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_$(ORKTEST_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION)) +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_0 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=0 +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_1 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=1 + + +// Some CLLocationManager API calls would trigger authorization to use location. The presence of those +// API calls in ResearchKit **at compile time** mean apps that link ResearchKit also need Info.plist entries +// for NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription. +// If your app doesn't use ORKLocationRecorder and doesn't specify these Info.plist strings, disable +// ResearchKit's CLLocationManager authorization +ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION = 1 + +// Some HealthKit API calls used within the framework require your app to disclose using HealthKit and provide a reason during app store review. +// If your app does not use HealthKit or any of the ResearchKit HealthKit APIs, disable ResearchKit's HealthKit authorization. +ORK_FEATURE_HEALTHKIT_AUTHORIZATION = 1 + +// GCC Preprocessor definitions +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC = $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_$(ORK_FEATURE_HEALTHKIT_AUTHORIZATION)) +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_0 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION=0 +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_1 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION=1 + +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC = $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC_$(ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION)) +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC_0 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=0 +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC_1 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=1 + +// Swift active compilation conditions +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT = $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_$(ORK_FEATURE_HEALTHKIT_AUTHORIZATION)) +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_0 = + +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_1 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION + +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT = $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT_$(ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION)) +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT_0 = +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT_1 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + +#include? "../xcconfig/ResearchKit-Shared.xcconfig" + +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) GLES_SILENCE_DEPRECATION=1 $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC) $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC) + +SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT) $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT) + + diff --git a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Internal-Release.xcconfig b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Internal-Release.xcconfig deleted file mode 100644 index 7d3cc3ff5c..0000000000 --- a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Internal-Release.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -// -// ResearchKitTests-Skywagon-Internal-Release.xcconfig -// - -#include "ResearchKitTests-Shared.xcconfig" - -SWIFT_OBJC_BRIDGING_HEADER = ResearchKitTests/ResearchKitTests-Bridging-Header.h diff --git a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Public-Release.xcconfig b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Public-Release.xcconfig deleted file mode 100644 index 23eae0eb22..0000000000 --- a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Public-Release.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -// -// ResearchKitTests-Skywagon-Public-Release.xcconfig -// - -#include "ResearchKitTests-Shared.xcconfig" - -SWIFT_OBJC_BRIDGING_HEADER = ResearchKitTests/ResearchKitTests-Bridging-Header.h diff --git a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Stable.xcconfig b/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Stable.xcconfig deleted file mode 100644 index 9c396376d9..0000000000 --- a/ResearchKit/Configuration/ResearchKitTests/ResearchKitTests-Skywagon-Stable.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -// -// ResearchKitTests-Skywagon-Stable.xcconfig -// - -#include "ResearchKitTests-Shared.xcconfig" - -GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) -SWIFT_OBJC_BRIDGING_HEADER = ResearchKitTests/ResearchKitTests-Bridging-Header.h diff --git a/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Debug.xcconfig b/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Debug.xcconfig new file mode 100644 index 0000000000..52a28ec614 --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Debug.xcconfig @@ -0,0 +1,7 @@ +// +// ResearchKitUI-iOS-Debug.xcconfig +// + +#include "ResearchKitUI-iOS-Shared.xcconfig" + +DEBUG_INFORMATION_FORMAT = dwarf diff --git a/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Release.xcconfig b/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Release.xcconfig new file mode 100644 index 0000000000..a5118556d5 --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Release.xcconfig @@ -0,0 +1,5 @@ +// +// ResearchKitUI-iOS-Release.xcconfig +// + +#include "ResearchKitUI-iOS-Shared.xcconfig" diff --git a/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Shared.xcconfig b/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Shared.xcconfig new file mode 100644 index 0000000000..8dbadd2775 --- /dev/null +++ b/ResearchKit/Configuration/ResearchKitUI-iOS/ResearchKitUI-iOS-Shared.xcconfig @@ -0,0 +1,10 @@ +// +// ResearchKitUI-iOS-Shared.xcconfig +// + +#include "../ResearchKit/ResearchKit-Shared.xcconfig" + +GCC_PREFIX_HEADER = +INFOPLIST_FILE = ResearchKitUI/Info-iOS.plist +MODULEMAP_FILE = ResearchKitUI/ResearchKitUI.modulemap +PRODUCT_NAME = ResearchKitUI diff --git a/ResearchKit/Configuration/docs/docs-Shared.xcconfig b/ResearchKit/Configuration/docs/docs-Shared.xcconfig new file mode 100644 index 0000000000..6a8db64091 --- /dev/null +++ b/ResearchKit/Configuration/docs/docs-Shared.xcconfig @@ -0,0 +1,5 @@ +// +// docs-Shared.xcconfig +// + +PRODUCT_NAME = $(TARGET_NAME) diff --git a/ResearchKit/Consent/MovieTintShader.fsh b/ResearchKit/Consent/MovieTintShader.fsh deleted file mode 100644 index 9cb63f3d32..0000000000 --- a/ResearchKit/Consent/MovieTintShader.fsh +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -varying highp vec2 texCoordVarying; -precision mediump float; - -uniform sampler2D SamplerY; -uniform sampler2D SamplerUV; -uniform mat3 colorConversionMatrix; -uniform lowp vec3 tintColor; - -void main() { - mediump vec3 yuv; - lowp vec3 rgb; - - // Subtract constants to map the video range start at 0 - yuv.x = (texture2D(SamplerY, texCoordVarying).r - (16.0 / 255.0)); - yuv.yz = (texture2D(SamplerUV, texCoordVarying).rg - vec2(0.5, 0.5)); - - rgb = colorConversionMatrix * yuv; - rgb = vec3(1, 1, 1) - ((vec3(1, 1, 1) - rgb) * (vec3(1, 1, 1) - tintColor)); - - gl_FragColor = vec4(rgb, 1); -} diff --git a/ResearchKit/Consent/MovieTintShader.vsh b/ResearchKit/Consent/MovieTintShader.vsh deleted file mode 100644 index bff3c62da1..0000000000 --- a/ResearchKit/Consent/MovieTintShader.vsh +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -attribute vec4 position; -attribute vec2 texCoord; -uniform float preferredRotation; - -varying vec2 texCoordVarying; - -void main() { - mat4 rotationMatrix = mat4( cos(preferredRotation), -sin(preferredRotation), 0.0, 0.0, - sin(preferredRotation), cos(preferredRotation), 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0); - gl_Position = position * rotationMatrix; - texCoordVarying = texCoord; -} diff --git a/ResearchKit/Consent/ORKEAGLMoviePlayerView.h b/ResearchKit/Consent/ORKEAGLMoviePlayerView.h deleted file mode 100644 index 4a51234f21..0000000000 --- a/ResearchKit/Consent/ORKEAGLMoviePlayerView.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -//__attribute__((unavailable("ORKEAGLMoviePlayerView has been deprecated. Please use ORKInstructionStep instead."))) -API_DEPRECATED("Use ORKInstructionStep for obtaining consent.", ios(2.0, 11.0)) API_UNAVAILABLE(tvos, watchos, macos) -@interface ORKEAGLMoviePlayerView : UIView - -@property (nonatomic) CGSize presentationSize; - -- (void)setupGL; -- (BOOL)consumePixelBuffer:(CVPixelBufferRef)pixelBuffer; -- (void)render; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Consent/ORKEAGLMoviePlayerView.m b/ResearchKit/Consent/ORKEAGLMoviePlayerView.m deleted file mode 100644 index 16a2c5e95b..0000000000 --- a/ResearchKit/Consent/ORKEAGLMoviePlayerView.m +++ /dev/null @@ -1,737 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ORKEAGLMoviePlayerView.h" - -#import "ORKHelpers_Internal.h" - -@import AVFoundation; -@import OpenGLES; -@import QuartzCore; - - -// Uniform index. -enum { - UNIFORM_Y, - UNIFORM_UV, - UNIFORM_ROTATION_ANGLE, - UNIFORM_COLOR_CONVERSION_MATRIX, - UNIFORM_TINT_COLOR, - NUM_UNIFORMS -}; -GLint uniforms[NUM_UNIFORMS]; - -// Attribute index. -enum { - ATTRIB_VERTEX, - ATTRIB_TEXCOORD, - NUM_ATTRIBUTES -}; - -// Color Conversion Constants (YUV to RGB) including adjustment from 16-235/16-240 (video range) - -// BT.601, which is the standard for SDTV. -static const GLfloat ColorConversion601[] = { - 1.164, 1.164, 1.164, - 0.0, -0.392, 2.017, - 1.596, -0.813, 0.0, -}; - -// BT.709, which is the standard for HDTV. -static const GLfloat ColorConversion709[] = { - 1.164, 1.164, 1.164, - 0.0, -0.213, 2.112, - 1.793, -0.533, 0.0, -}; - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-function" -#if defined(DEBUG) - static void ORKCheckForGLError() - { - GLenum error = glGetError(); - if (error != GL_NO_ERROR) - { - ORK_Log_Error("glError: 0x%04X", error); - } - } -#else - #define ORKCheckForGLError(...) -#endif -#pragma GCC diagnostic pop - -#define ORKEAGLLog(...) - -@interface ORKEAGLMoviePlayerView () { - // The pixel dimensions of the CAEAGLLayer. - GLint _backingWidth; - GLint _backingHeight; - - EAGLContext *_context; - NSMutableArray *_contextStack; - CVOpenGLESTextureRef _lumaTexture; - CVOpenGLESTextureRef _chromaTexture; - CVOpenGLESTextureCacheRef _videoTextureCache; - - GLuint _programHandle; - GLuint _vertexArrayHandle; - GLuint _vertexBufferHandle; - GLuint _frameBufferHandle; - GLuint _colorBufferHandle; - - BOOL _glIsSetup; -} - -@property (nonatomic) const GLfloat *preferredConversion; - -- (void)setupBuffers; -- (void)cleanUpTextures; - -- (BOOL)loadShaders; -- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type URL:(NSURL *)URL; -- (BOOL)linkProgram:(GLuint)prog; -- (BOOL)validateProgram:(GLuint)prog; - -@end - - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" -@implementation ORKEAGLMoviePlayerView - -const GLfloat DefaultPreferredRotation = 0; - -+ (Class)layerClass { - return [CAEAGLLayer class]; -} - -- (instancetype)initWithFrame:(CGRect)frame { - if ((self = [super initWithFrame:frame])) { - // Use 2x scale factor on Retina displays. - self.contentScaleFactor = [UIScreen mainScreen].scale; - - self.backgroundColor = [UIColor whiteColor]; - - // Get and configure the layer. - CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer; - - eaglLayer.opaque = YES; - eaglLayer.drawableProperties = @{ kEAGLDrawablePropertyRetainedBacking : @YES, - kEAGLDrawablePropertyColorFormat : kEAGLColorFormatRGBA8}; - - // Set the context into which the frames will be drawn. - _context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; - - if (!_context || ![self loadShaders]) { - return nil; - } - - _preferredConversion = NULL; - } - return self; -} - -# pragma mark - OpenGL setup - -- (void)setupGL { - if (_glIsSetup) { - return; - } - _glIsSetup = YES; - - [self saveGLContext]; - - glDisable(GL_DEPTH_TEST); - [self setupBuffers]; - - glUseProgram(_programHandle); - - // 0 and 1 are the texture IDs of _lumaTexture and _chromaTexture respectively. - glUniform1i(uniforms[UNIFORM_Y], 0); - glUniform1i(uniforms[UNIFORM_UV], 1); - [self updateTintColorUniform]; - glUniform1f(uniforms[UNIFORM_ROTATION_ANGLE], DefaultPreferredRotation); - // Set the default conversion to BT.709, which is the standard for HDTV. - _preferredConversion = ColorConversion709; - [self updatePreferredConversionUniform]; - glUniformMatrix3fv(uniforms[UNIFORM_COLOR_CONVERSION_MATRIX], 1, GL_FALSE, _preferredConversion); - - // Create CVOpenGLESTextureCacheRef for optimal CVPixelBufferRef to GLES texture conversion. - if (!_videoTextureCache) { - CVReturn error = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, NULL, _context, NULL, &_videoTextureCache); - if (error != noErr) { - ORK_Log_Error("Error at CVOpenGLESTextureCacheCreate %d", error); - return; - } - } - - glGenVertexArraysOES(1, &_vertexArrayHandle); - glGenBuffers(1, &_vertexBufferHandle); - - [self restoreGLContext]; - ORKEAGLLog(@""); -} - -#pragma mark - Utilities - -- (void)setupBuffers { - if (!_glIsSetup) { - return; - } - - [self saveGLContext]; - - [self deleteBuffers]; - - glGenFramebuffers(1, &_frameBufferHandle); - glBindFramebuffer(GL_FRAMEBUFFER, _frameBufferHandle); - - glGenRenderbuffers(1, &_colorBufferHandle); - glBindRenderbuffer(GL_RENDERBUFFER, _colorBufferHandle); - - [_context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer]; - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &_backingWidth); - glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &_backingHeight); - - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, _colorBufferHandle); - if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { - ORK_Log_Error("Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER)); - } - - // Set the view port to the entire view. - glViewport(0, 0, _backingWidth, _backingHeight); - - [self restoreGLContext]; - ORKEAGLLog(@""); -} - -- (void)deleteBuffers { - [self saveGLContext]; - - if (_frameBufferHandle) { - glDeleteFramebuffers(1, &_frameBufferHandle); - _frameBufferHandle = 0; - } - if (_colorBufferHandle) { - glDeleteRenderbuffers(1, &_colorBufferHandle); - _colorBufferHandle = 0; - } - - [self restoreGLContext]; -} - -- (void)cleanUpTextures { - [self saveGLContext]; - - if (_lumaTexture) { - CFRelease(_lumaTexture); - _lumaTexture = NULL; - } - - if (_chromaTexture) { - CFRelease(_chromaTexture); - _chromaTexture = NULL; - } - - // Periodic texture cache flush every frame - CVOpenGLESTextureCacheFlush(_videoTextureCache, 0); - - [self restoreGLContext]; -} - -- (BOOL)saveGLContext { - BOOL success = YES; - - if (_contextStack == nil) { - _contextStack = [NSMutableArray new]; - } - - EAGLContext *currentContext = [EAGLContext currentContext]; - - // Switch context only when necessary - if (_context != currentContext) { - glFlush(); - success = [EAGLContext setCurrentContext:_context]; - } - - // Always push - [_contextStack addObject:currentContext ? : [NSNull null]]; - - return success; -} - -- (BOOL)restoreGLContext { - BOOL success = YES; - - id lastObject = [_contextStack lastObject]; - - if (lastObject) { - EAGLContext *contextToBeRestored = (lastObject != [NSNull null]) ? lastObject : nil; - - // Switch context only when necessary - if (_context != contextToBeRestored) { - glFlush(); - success = [EAGLContext setCurrentContext:contextToBeRestored]; - } - } - - // Always pop - [_contextStack removeLastObject]; - - return success; -} - -- (void)dealloc { - ORKEAGLLog(@""); - - [self saveGLContext]; - - [self cleanUpTextures]; - - if (_videoTextureCache) { - CFRelease(_videoTextureCache); - } - [self deleteBuffers]; - if (_programHandle) { - glDeleteProgram(_programHandle); - _programHandle = 0; - } - - [self restoreGLContext]; -} - -- (void)setPresentationSize:(CGSize)presentationSize { - _presentationSize = presentationSize; - [self updateVertexAndTextureData]; -} - -- (void)setTintColor:(UIColor *)tintColor { - [super setTintColor:tintColor]; - [self updateTintColorUniform]; -} - -- (void)setPreferredConversion:(const GLfloat *)preferredConversion { - if (_preferredConversion != preferredConversion) { - _preferredConversion = preferredConversion; - [self updatePreferredConversionUniform]; - } -} - -- (void)layoutSubviews { - [super layoutSubviews]; - [self setupBuffers]; - [self updateVertexAndTextureData]; -} - -#pragma mark - OpenGLES drawing - -- (BOOL)consumePixelBuffer:(CVPixelBufferRef)pixelBuffer { - if (!_glIsSetup) { - return NO; - } - - CVReturn error; - if (pixelBuffer != NULL) { - ORKEAGLLog(@"Have buffer"); - - if (!_videoTextureCache) { - ORK_Log_Error("No video texture cache"); - return NO; - } - - [self saveGLContext]; - - [self cleanUpTextures]; - - /* - Use the color attachment of the pixel buffer to determine the appropriate color conversion matrix. - */ - CFTypeRef colorAttachments = CVBufferGetAttachment(pixelBuffer, kCVImageBufferYCbCrMatrixKey, NULL); - - if (colorAttachments == kCVImageBufferYCbCrMatrix_ITU_R_601_4) { - self.preferredConversion = ColorConversion601; - } else { - self.preferredConversion = ColorConversion709; - } - - /* - CVOpenGLESTextureCacheCreateTextureFromImage will create GLES texture optimally from CVPixelBufferRef. - */ - - /* - Create Y and UV textures from the pixel buffer. These textures will be drawn on the frame buffer Y-plane. - */ - error = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, - _videoTextureCache, - pixelBuffer, - NULL, - GL_TEXTURE_2D, - GL_RED_EXT, - (GLint)CVPixelBufferGetWidthOfPlane(pixelBuffer, 0), - (GLint)CVPixelBufferGetHeightOfPlane(pixelBuffer, 0), - GL_RED_EXT, - GL_UNSIGNED_BYTE, - 0, - &_lumaTexture); - if (0 == error) { - - glActiveTexture(GL_TEXTURE0); - glBindTexture(CVOpenGLESTextureGetTarget(_lumaTexture), CVOpenGLESTextureGetName(_lumaTexture)); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - // UV-plane. - error = CVOpenGLESTextureCacheCreateTextureFromImage(kCFAllocatorDefault, - _videoTextureCache, - pixelBuffer, - NULL, - GL_TEXTURE_2D, - GL_RG_EXT, - (GLint)CVPixelBufferGetWidthOfPlane(pixelBuffer, 1), - (GLint)CVPixelBufferGetHeightOfPlane(pixelBuffer, 1), - GL_RG_EXT, - GL_UNSIGNED_BYTE, - 1, - &_chromaTexture); - - if (0 == error) { - glActiveTexture(GL_TEXTURE1); - glBindTexture(CVOpenGLESTextureGetTarget(_chromaTexture), CVOpenGLESTextureGetName(_chromaTexture)); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - } - } - - [self restoreGLContext]; - - if (error) { - ORK_Log_Error("Error at CVOpenGLESTextureCacheCreateTextureFromImage %d", error); - return NO; - } - - return YES; - } - return NO; -} - -- (void)updateVertexAndTextureData { - if (!_glIsSetup) { - return; - } - - // Set up the quad vertices with respect to the orientation and aspect ratio of the video. - CGRect vertexSamplingRect = AVMakeRectWithAspectRatioInsideRect(_presentationSize, self.layer.bounds); - ORKEAGLLog(@"%@", NSStringFromCGRect(vertexSamplingRect)); - - // Compute normalized quad coordinates to draw the frame into. - CGSize normalizedSamplingSize = CGSizeMake(0.0, 0.0); - CGSize cropScaleAmount = CGSizeMake(vertexSamplingRect.size.width/self.layer.bounds.size.width, vertexSamplingRect.size.height/self.layer.bounds.size.height); - - // Normalize the quad vertices. - if (cropScaleAmount.width > cropScaleAmount.height) { - normalizedSamplingSize.width = 1.0; - normalizedSamplingSize.height = cropScaleAmount.height/cropScaleAmount.width; - } else { - normalizedSamplingSize.height = 1.0; - normalizedSamplingSize.width = cropScaleAmount.width/cropScaleAmount.height; - } - - /* - The quad vertex data defines the region of 2D plane onto which we draw our pixel buffers. - Vertex data formed using (-1,-1) and (1,1) as the bottom left and top right coordinates respectively, covers the entire screen. - - The texture vertices are set up such that we flip the texture vertically. This is so that our top left origin buffers match OpenGL's bottom left texture coordinate system. - */ - CGRect textureSamplingRect = CGRectMake(0, 0, 1, 1); - - GLfloat quadVertexAndTextureData[] = { - // Vertex - -1 * normalizedSamplingSize.width, -1 * normalizedSamplingSize.height, - normalizedSamplingSize.width, -1 * normalizedSamplingSize.height, - -1 * normalizedSamplingSize.width, normalizedSamplingSize.height, - normalizedSamplingSize.width, normalizedSamplingSize.height, - // Texture - CGRectGetMinX(textureSamplingRect), CGRectGetMaxY(textureSamplingRect), - CGRectGetMaxX(textureSamplingRect), CGRectGetMaxY(textureSamplingRect), - CGRectGetMinX(textureSamplingRect), CGRectGetMinY(textureSamplingRect), - CGRectGetMaxX(textureSamplingRect), CGRectGetMinY(textureSamplingRect) - }; - - [self saveGLContext]; - - glBindVertexArrayOES(_vertexArrayHandle); - - glBindBuffer(GL_ARRAY_BUFFER, _vertexBufferHandle); - glBufferData(GL_ARRAY_BUFFER, sizeof(quadVertexAndTextureData), quadVertexAndTextureData, GL_STATIC_DRAW); - - // Set the position - glEnableVertexAttribArray(ATTRIB_VERTEX); - glEnableVertexAttribArray(ATTRIB_TEXCOORD); - glVertexAttribPointer(ATTRIB_VERTEX, 2, GL_FLOAT, GL_FALSE, 0, 0); - glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, (void *)(8 * sizeof(GLfloat))); - - [self restoreGLContext]; -} - -- (void)updateTintColorUniform { - if (!_glIsSetup) { - return; - } - - [self saveGLContext]; - - CGFloat tintColorCG[4]; - [self.tintColor getRed:&tintColorCG[0] green:&tintColorCG[1] blue:&tintColorCG[2] alpha:&tintColorCG[3]]; - glUniform3f(uniforms[UNIFORM_TINT_COLOR], tintColorCG[0], tintColorCG[1], tintColorCG[2]); - - [self restoreGLContext]; -} - -- (void)updatePreferredConversionUniform { - if (!_glIsSetup) { - return; - } - [self saveGLContext]; - glUniformMatrix3fv(uniforms[UNIFORM_COLOR_CONVERSION_MATRIX], 1, GL_FALSE, _preferredConversion); - [self restoreGLContext]; -} - -- (void)render { - if (!_glIsSetup) { - return; - } - - [self saveGLContext]; - - glClearColor(1.0f, 1.0f, 1.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); - - glBindFramebuffer(GL_FRAMEBUFFER, _frameBufferHandle); - - // Use the shader program and bin the VAO. - glUseProgram(_programHandle); - glBindVertexArrayOES(_vertexArrayHandle); - - glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - - glBindRenderbuffer(GL_RENDERBUFFER, _colorBufferHandle); - if (![_context presentRenderbuffer:GL_RENDERBUFFER]) { - ORK_Log_Error("presentRenderBuffer failed"); - } - - glBindRenderbuffer(GL_RENDERBUFFER, 0); - glBindVertexArrayOES(0); - glUseProgram(0); - glBindFramebuffer(GL_FRAMEBUFFER, 0); - - [self restoreGLContext]; -} - -#pragma mark - OpenGL ES 2 shader compilation - -- (BOOL)loadShaders { - - [self saveGLContext]; - - GLuint vertShader, fragShader; - NSURL *vertShaderURL, *fragShaderURL; - - // Create the shader program. - _programHandle = glCreateProgram(); - - [self restoreGLContext]; - - // Create and compile the vertex shader. - vertShaderURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"MovieTintShader" withExtension:@"vsh"]; - if (![self compileShader:&vertShader type:GL_VERTEX_SHADER URL:vertShaderURL]) { - ORK_Log_Error("Failed to compile vertex shader"); - return NO; - } - - // Create and compile fragment shader. - fragShaderURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"MovieTintShader" withExtension:@"fsh"]; - if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER URL:fragShaderURL]) { - ORK_Log_Error("Failed to compile fragment shader"); - return NO; - } - - [self saveGLContext]; - - // Attach vertex shader to program. - glAttachShader(_programHandle, vertShader); - - // Attach fragment shader to program. - glAttachShader(_programHandle, fragShader); - - // Bind attribute locations. This needs to be done prior to linking. - glBindAttribLocation(_programHandle, ATTRIB_VERTEX, "position"); - glBindAttribLocation(_programHandle, ATTRIB_TEXCOORD, "texCoord"); - - // Link the program. - if (![self linkProgram:_programHandle]) { - ORK_Log_Error("Failed to link program: %d", _programHandle); - - if (vertShader) { - glDeleteShader(vertShader); - vertShader = 0; - } - if (fragShader) { - glDeleteShader(fragShader); - fragShader = 0; - } - if (_programHandle) { - glDeleteProgram(_programHandle); - _programHandle = 0; - } - [self restoreGLContext]; - return NO; - } - - // Get uniform locations. - uniforms[UNIFORM_Y] = glGetUniformLocation(_programHandle, "SamplerY"); - uniforms[UNIFORM_UV] = glGetUniformLocation(_programHandle, "SamplerUV"); - uniforms[UNIFORM_ROTATION_ANGLE] = glGetUniformLocation(_programHandle, "preferredRotation"); - uniforms[UNIFORM_COLOR_CONVERSION_MATRIX] = glGetUniformLocation(_programHandle, "colorConversionMatrix"); - uniforms[UNIFORM_TINT_COLOR] = glGetUniformLocation(_programHandle, "tintColor"); - - // Release vertex and fragment shaders. - if (vertShader) { - glDetachShader(_programHandle, vertShader); - glDeleteShader(vertShader); - } - if (fragShader) { - glDetachShader(_programHandle, fragShader); - glDeleteShader(fragShader); - } - - [self restoreGLContext]; - return YES; -} - -- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type URL:(NSURL *)URL { - NSError *error; - NSString *sourceString = [[NSString alloc] initWithContentsOfURL:URL encoding:NSUTF8StringEncoding error:&error]; - if (sourceString == nil) { - ORK_Log_Error("Failed to load vertex shader: %@", [error localizedDescription]); - return NO; - } - - [self saveGLContext]; - - GLint status; - const GLchar *source; - source = (GLchar *)[sourceString UTF8String]; - - *shader = glCreateShader(type); - glShaderSource(*shader, 1, &source, NULL); - glCompileShader(*shader); - -#if defined(DEBUG) - GLint logLength; - glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); - if (logLength > 0) { - GLchar *log = (GLchar *)malloc(logLength); - glGetShaderInfoLog(*shader, logLength, &logLength, log); - ORK_Log_Debug("Shader compile log:\n%s", log); - free(log); - } -#endif - - glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); - if (status == 0) { - [self restoreGLContext]; - glDeleteShader(*shader); - return NO; - } - - [self restoreGLContext]; - return YES; -} - -- (BOOL)linkProgram:(GLuint)prog { - [self saveGLContext]; - - GLint status; - glLinkProgram(prog); - - glGetProgramiv(prog, GL_LINK_STATUS, &status); - -#if defined(DEBUG) - GLint logLength; - glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); - if (logLength > 0) { - GLchar *log = (GLchar *)malloc(logLength); - glGetProgramInfoLog(prog, logLength, &logLength, log); - ORK_Log_Debug("Program link log:\n%s", log); - free(log); - } -#endif - - [self restoreGLContext]; - - if (status == 0) { - return NO; - } - - return YES; -} - -- (BOOL)validateProgram:(GLuint)prog { - [self saveGLContext]; - - GLint logLength, status; - - glValidateProgram(prog); - glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength); - if (logLength > 0) { - GLchar *log = (GLchar *)malloc(logLength); - glGetProgramInfoLog(prog, logLength, &logLength, log); - ORK_Log_Debug("Program validate log:\n%s", log); - free(log); - } - - glGetProgramiv(prog, GL_VALIDATE_STATUS, &status); - - [self restoreGLContext]; - - if (status == 0) { - return NO; - } - - return YES; -} - -@end -#pragma clang diagnostic pop diff --git a/ResearchKit/Consent/ORKInstructionStepHTMLFormatter.h b/ResearchKit/Consent/ORKInstructionStepHTMLFormatter.h new file mode 100644 index 0000000000..43ac982dd4 --- /dev/null +++ b/ResearchKit/Consent/ORKInstructionStepHTMLFormatter.h @@ -0,0 +1,46 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ORKInstructionStep; + +/** + A formatter object that converts a signature to HTML. + */ +@interface ORKInstructionStepHTMLFormatter : NSObject + +- (NSString *)HTMLForInstructionSteps:(NSArray *)instructionSteps; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Consent/ORKInstructionStepHTMLFormatter.m b/ResearchKit/Consent/ORKInstructionStepHTMLFormatter.m new file mode 100644 index 0000000000..8ed46253d4 --- /dev/null +++ b/ResearchKit/Consent/ORKInstructionStepHTMLFormatter.m @@ -0,0 +1,145 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKInstructionStepHTMLFormatter.h" +#import "ORKInstructionStep.h" +#import "ORKBodyItem.h" + +@implementation ORKInstructionStepHTMLFormatter + +NSString * const OpeningHTMLTag = @" "; +NSString * const HeaderTagContent = @"" + "" + "" + "" + ""; + +NSString * const OpeningBodyTag = @""; +NSString * const OpeningContainerDivTag = @"
"; + +NSString * const IconImageTagWrappingDiv = @"


%@

"; +NSString * const IconImageTag = @""; + +NSString * const ImageTagWrappingDiv = @"


%@

"; +NSString * const ImageTag = @""; + +NSString * const HeaderForTitleTag = @"

%@

"; +NSString * const ParagraphForDetailTextTag = @"

%@

"; + +NSString * const OpeningUnorderedListTag = @"
    "; +NSString * const ListItemElement = @"
  • %@
  • "; +NSString * const ClosingUnorderedListTag = @"
"; + +NSString * const ClosingContainerDivTag = @"
"; +NSString * const ClosingBodyTag = @""; +NSString * const ClosingHTMLTag = @""; + +- (NSString *)HTMLForInstructionSteps:(NSArray *)instructionSteps { + NSMutableString *htmlContent = [NSMutableString new]; + + [htmlContent appendString:[self _getOpeningHTMLTags]]; + + for (ORKInstructionStep *instructionStep in instructionSteps) { + [htmlContent appendString:[self _getHTMLImageContentFromInstructionStep:instructionStep] ?: @""]; + [htmlContent appendString:[self _getHTMLTitleContentFromInstructionStep:instructionStep] ?: @""]; + [htmlContent appendString:[self _getHTMLDetailTextContentFromInstructionStep:instructionStep] ?: @""]; + [htmlContent appendString:[self _getHTMLBodyItemContentFromInstructionStep:instructionStep] ?: @""]; + } + + [htmlContent appendString:[self _getClosingHTMLTags]]; + + return htmlContent; +} + +- (NSString *)_getOpeningHTMLTags { + return [NSString stringWithFormat:@"%@%@%@%@", OpeningHTMLTag, HeaderTagContent, OpeningBodyTag, OpeningContainerDivTag]; +} + +- (nullable NSString *)_getHTMLImageContentFromInstructionStep:(ORKInstructionStep *)instructionStep { + if (instructionStep.iconImage) { + NSString *encodedImg = [self _getEncodedStringFromImage:instructionStep.iconImage]; + NSString *imageTag = [NSString stringWithFormat:IconImageTag, encodedImg]; + return [NSString stringWithFormat:IconImageTagWrappingDiv, imageTag]; + } else if (instructionStep.image) { + NSString *encodedImg = [self _getEncodedStringFromImage:instructionStep.image]; + NSString *imageTag = [NSString stringWithFormat:ImageTag, encodedImg]; + return [NSString stringWithFormat:ImageTagWrappingDiv, imageTag]; + } + + return nil; +} + +- (NSString *)_getEncodedStringFromImage:(UIImage *)image { + NSString *base64 = [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; + return base64; +} + +- (nullable NSString *)_getHTMLTitleContentFromInstructionStep:(ORKInstructionStep *)instructionStep { + if (instructionStep.title) { + return [NSString stringWithFormat:HeaderForTitleTag, instructionStep.title]; + } + + return nil; +} + +- (nullable NSString *)_getHTMLDetailTextContentFromInstructionStep:(ORKInstructionStep *)instructionStep { + if (instructionStep.detailText) { + return [NSString stringWithFormat:ParagraphForDetailTextTag, instructionStep.detailText]; + } + + return nil; +} + +- (nullable NSString *)_getHTMLBodyItemContentFromInstructionStep:(ORKInstructionStep *)instructionStep { + if (instructionStep.bodyItems.count > 0) { + NSMutableString *content = [NSMutableString new]; + [content appendString:OpeningUnorderedListTag]; + + for (ORKBodyItem *bodyItem in instructionStep.bodyItems) { + NSString *listItemContent = [NSString stringWithFormat:ListItemElement, bodyItem.text]; + [content appendString: listItemContent]; + } + + [content appendString:ClosingUnorderedListTag]; + return content; + } + + return nil; +} + +- (NSString *)_getClosingHTMLTags { + return [NSString stringWithFormat:@"%@%@%@", ClosingContainerDivTag, ClosingBodyTag, ClosingHTMLTag]; +} + +@end diff --git a/ResearchKit/Consent/ORKSignatureFormatter.h b/ResearchKit/Consent/ORKSignatureFormatter.h new file mode 100644 index 0000000000..39faf18baf --- /dev/null +++ b/ResearchKit/Consent/ORKSignatureFormatter.h @@ -0,0 +1,51 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import + + +NS_ASSUME_NONNULL_BEGIN + +@class ORKSignatureResult; + +/** + A formatter object that converts a signature to HTML. + */ +@interface ORKSignatureFormatter : NSObject + +- (NSString *)HTMLForSignatureResult:(ORKSignatureResult *)signatureResult; + +- (nullable NSString *)appendSignatureToHTML:(NSString *)html + signatureResult:(ORKSignatureResult *)signatureResult; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Consent/ORKSignatureFormatter.m b/ResearchKit/Consent/ORKSignatureFormatter.m new file mode 100644 index 0000000000..62a9fcfdd9 --- /dev/null +++ b/ResearchKit/Consent/ORKSignatureFormatter.m @@ -0,0 +1,93 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKSignatureFormatter.h" +#import "ORKSignatureResult.h" +#import "ORKHelpers_Internal.h" + +NSString * const ClosingBodyTagText = @""; +NSString * const ClosingHTMLTagText = @""; +NSString * const HorizontalRowHTMLText = @"
"; +NSString * const ImageTagHTMLText = @"star"; +NSString * const SignatureEnclosingDiveHTMLText = @"
%@
"; +NSString * const SignatureImageWrapperHTMLText = @"


%@
%@%@

"; + + +@implementation ORKSignatureFormatter + +- (NSString *)HTMLForSignatureResult:(ORKSignatureResult *)signatureResult { + NSString *hr = HorizontalRowHTMLText; + NSString *signatureImageWrapper = SignatureImageWrapperHTMLText; + NSString *imageTag = [self getImgTagFromImage:signatureResult.signatureImage]; + + NSMutableArray *signatureElements = [NSMutableArray array]; + [signatureElements addObject:[NSString stringWithFormat:signatureImageWrapper, imageTag, hr, ORKLocalizedString(@"CONSENT_DOC_LINE_SIGNATURE", nil)]]; + + NSString *html = [NSString stringWithFormat:SignatureEnclosingDiveHTMLText, signatureElements.lastObject]; + return html; +} + +- (NSString *)appendSignatureToHTML:(NSString *)html signatureResult:(ORKSignatureResult *)signatureResult { + if (![html containsString:ClosingBodyTagText] || ![html containsString:ClosingHTMLTagText]) { + return nil; + } + + NSString *htmlForSignature = [self HTMLForSignatureResult:signatureResult]; + + NSString *htmlWithoutClosingTags = [self removeClosingTagsFromHTML:html]; + NSMutableString *body = [NSMutableString new]; + [body appendString:htmlForSignature]; + + NSString *groupedBodyAndHTMLClosingTags = [NSString stringWithFormat:@"%@%@", ClosingBodyTagText, ClosingHTMLTagText]; + NSString *finalHTMLString = [htmlWithoutClosingTags stringByAppendingString:body]; + finalHTMLString = [finalHTMLString stringByAppendingString:groupedBodyAndHTMLClosingTags]; + + return finalHTMLString; +} + +#pragma mark - private + +- (NSString *)removeClosingTagsFromHTML:(NSString *)html { + NSRange bodyReplaceRangeRange = [html rangeOfString:ClosingBodyTagText]; + NSString *tempString = [html stringByReplacingCharactersInRange:bodyReplaceRangeRange withString:@""]; + + NSRange htmlReplaceRangeRange = [tempString rangeOfString:ClosingHTMLTagText]; + tempString = [tempString stringByReplacingCharactersInRange:htmlReplaceRangeRange withString:@""]; + + return [tempString copy]; +} + +- (NSString *)getImgTagFromImage:(UIImage *)image { + NSString *base64 = [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; + NSString *imageTag = [NSString stringWithFormat:ImageTagHTMLText, base64]; + return imageTag; +} + +@end diff --git a/ResearchKit/Consent/ORKVisualConsentStep.h b/ResearchKit/Consent/ORKVisualConsentStep.h deleted file mode 100644 index d6a43d67ed..0000000000 --- a/ResearchKit/Consent/ORKVisualConsentStep.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import Foundation; -#import - - -NS_ASSUME_NONNULL_BEGIN - -@class ORKConsentDocument; - -/** - The `ORKVisualConsentStep` class represents a step in the visual consent sequence. - - To use a visual consent step, first create a consent document with at least one - section (at least one section must not be of type `ORKConsentSectionTypeOnlyInDocument`) and attach the document to a visual consent step. Put the visual consent step - into a ResearchKit task, and present it with a task view controller. - - In the ResearchKit framework, an `ORKVisualConsentStep` object is used to present a series of simple - graphics to help study participants understand the content of an informed - consent document. The default graphics include animated transitions. - The textual content you need to provide in the `consentDocument` property should relate to the specific study being run and should be localized. - - An `ORKVisualConsentStep` object produces an `ORKStepResult` object, in which the dates indicate the total amount of time participants have spent in the consent process, and the route by which they can exit the consent process. - */ - -API_DEPRECATED("Use ORKInstructionStep for obtaining consent.", ios(3.0, 11.0)) API_UNAVAILABLE(watchos, tvos) -@interface ORKVisualConsentStep : ORKStep - -/** - Returns an initialized visual consent step using the specified identifier and consent document. - - @param identifier The identifier of the visual consent step, unique within the document. - @param consentDocument The informed consent document. - */ -- (instancetype)initWithIdentifier:(NSString *)identifier document:(nullable ORKConsentDocument *)consentDocument; - -/** - The consent document whose sections determine the order and appearance of scenes - in the visual consent step. - */ -@property (nonatomic, strong, nullable) ORKConsentDocument *consentDocument; - -@end - -NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Localized/ResearchKit.stringsdict b/ResearchKit/Localized/ResearchKit.stringsdict deleted file mode 100644 index edd4158db2..0000000000 --- a/ResearchKit/Localized/ResearchKit.stringsdict +++ /dev/null @@ -1,22 +0,0 @@ - - - - - TRAILMAKING_ERROR_FORMAT - - NSStringLocalizedFormatKey - %#@_errors@ - _errors - - NSStringFormatSpecTypeKey - NSStringPluralRuleType - NSStringFormatValueTypeKey - d - one - (%d error) - other - (%d errors) - - - - diff --git a/ResearchKit/Localized/ar.lproj/ResearchKit.strings b/ResearchKit/Localized/ar.lproj/ResearchKit.strings index bd9d26ffa8..3383537474 100644 --- a/ResearchKit/Localized/ar.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/ar.lproj/ResearchKit.strings @@ -268,7 +268,7 @@ /* Short walk back and forth. */ "WALK_INTRO_2_TEXT_BACK_AND_FORTH_INSTRUCTION" = "اذهب إلى مكان يمكنك السير فيه بأمان ذهابًا وإيابًا في خط مستقيم. حاول السير بشكل متواصل عن طريق الانعطاف عند طرفي مسارك وكأنك تسير حول قمع.\n\nسيتم توجيهك بعد ذلك للاستدارة في دائرة كاملة، ثم الوقوف ويداك على جانبيك والمسافة بين قدميك تساوي عرض كتفك تقريبًا."; -"WALK_INTRO_2_DETAIL_BACK_AND_FORTH_INSTRUCTION" = "اضغط على \“البدء\” عندما تكون مستعدًا للبدء.\nبعد ذلك ضع جهازك في حافظة أو حقيبة واتبع الإرشادات الصوتية."; +"WALK_INTRO_2_DETAIL_BACK_AND_FORTH_INSTRUCTION" = "اضغط على \"البدء\" عندما تكون مستعدًا للبدء.\nبعد ذلك ضع جهازك في حافظة أو حقيبة واتبع الإرشادات الصوتية."; "WALK_BACK_AND_FORTH_INSTRUCTION_FORMAT" = "قم بالمشي ذهابًا وإيابًا في خط مستقيم %@. قم بالمشي كما تفعل عادةً."; "WALK_BACK_AND_FORTH_STAND_INSTRUCTION_FORMAT" = "استدر بمقدار دائرة كاملة ثم قف ثابتًا لمدة %@."; "WALK_BACK_AND_FORTH_FINISHED_VOICE" = "لقد أكملت النشاط."; @@ -305,8 +305,8 @@ /* Audio active task. */ "AUDIO_TASK_TITLE" = "الصوت"; "AUDIO_CALL_TO_ACTION" = "اضغط على البدء لكي تبدأ."; -"AUDIO_INSTRUCTION" = "انطق \“آااااه\” في الميكروفون لأطول فترة ممكنة بالنسبة إليك."; -"AUDIO_INTRO_TEXT" = "خذ نفسًا عميقًا وانطق \“آااااه\” في الميكروفون لأطول فترة ممكنة بالنسبة إليك. حافظ على ثبات مستوى صوتك حتى تظل أشرطة الصوت باللون الأزرق."; +"AUDIO_INSTRUCTION" = "انطق \"آااااه\" في الميكروفون لأطول فترة ممكنة بالنسبة إليك."; +"AUDIO_INTRO_TEXT" = "خذ نفسًا عميقًا وانطق \"آااااه\" في الميكروفون لأطول فترة ممكنة بالنسبة إليك. حافظ على ثبات مستوى صوتك حتى تظل أشرطة الصوت باللون الأزرق."; "AUDIO_INTENDED_USE" = "يقيّم هذا النشاط صوتك عن طريق تسجيله باستخدام الميكروفون في أسفل الجهاز."; "AUDIO_TOO_LOUD_LABEL" = "عالٍ جدًا"; "AUDIO_GENERIC_ERROR_LABEL" = "غير قادر على تسجيل الصوت"; @@ -341,7 +341,7 @@ "dBHL_TONE_AUDIOMETRY_INTRO_TEXT" = "تأكد من تعيين مستوى صوت الجهاز على الحد الأقصى.\n\nأثناء هذه المهمة، سيتم تشغيل نغمة رقيقة في الأذن اليسرى أو اليمنى.\n\nاستمع بعناية واضغط على الزر في كل مرة تسمع فيها النغمة."; "dBHL_TONE_AUDIOMETRY_INTRO_TEXT_2" = "يحدد هذا الاختبار مستوى علوّ الصوت الذي تحتاجه حتى تسمع."; "dBHL_TONE_AUDIOMETRY_ONBOARDING" = "استطلاع الالتحاق."; -"dBHL_TONE_AUDIOMETRY_ONBOARDING_QUESTION" = "حدد تفضيلك بخصوص \“الأذن الأفضل\”، إذا كانت هناك أذن أفضل من الأخرى."; +"dBHL_TONE_AUDIOMETRY_ONBOARDING_QUESTION" = "حدد تفضيلك بخصوص \"الأذن الأفضل\"، إذا كانت هناك أذن أفضل من الأخرى."; "dBHL_TONE_AUDIOMETRY_OPTION_LEFT" = "يسار"; "dBHL_TONE_AUDIOMETRY_OPTION_RIGHT" = "يمين"; "dBHL_TONE_AUDIOMETRY_OPTION_NO_PREFERENCE" = "بلا تفضيل"; @@ -461,7 +461,7 @@ "TIMED_WALK_INSTRUCTION_%@" = "قم بالمشي حتى %@ في خط مستقيم."; "TIMED_WALK_INSTRUCTION_TURN" = "قم بالدوران."; "TIMED_WALK_INSTRUCTION_2" = "قم بالمشي رجوعًا إلى المكان الذي بدأت منه."; -"TIMED_WALK_INSTRUCTION_TEXT" = "اضغط على \“التالي\” عند الانتهاء."; +"TIMED_WALK_INSTRUCTION_TEXT" = "اضغط على \"التالي\" عند الانتهاء."; /* PSAT active task. */ "PASAT_TITLE" = "PASAT"; @@ -535,8 +535,8 @@ /* Trail making task. */ "TRAILMAKING_TASK_TITLE" = "اختبار إجراء التعقب"; "TRAILMAKING_INTENDED_USE" = "يعمل هذا النشاط على تقييم انتباهك البصري وتبديل المهام لديك عن طريق تسجيل الوقت اللازم للضغط على سلسلة من النقاط بالترتيب."; -"TRAILMAKING_INTENDED_USE2_A" = "بعد العد التنازلي، اضغط على النقاط بالتبادل بين الأرقام والحروف. ابدأ بالضغط على أول رقم \“١\” متبوعًا بالأرقام \“٢\”، \“٣\”، \“٤\”… حتى تصل إلى رقم \“٧\”."; -"TRAILMAKING_INTENDED_USE2_B" = "بعد العد التنازلي، اضغط على النقاط بالتبادل بين الأرقام والحروف. ابدأ بالضغط على أول رقم \“١\” ثم اضغط على أول حرف \“ا\”، ثم \“٢\”، \“ب\”، \“٣\”، \“ت\”… حتى تصل إلى رقم \“٧\”."; +"TRAILMAKING_INTENDED_USE2_A" = "بعد العد التنازلي، اضغط على النقاط بالتبادل بين الأرقام والحروف. ابدأ بالضغط على أول رقم \"١\" متبوعًا بالأرقام \"٢\"، \"٣\"، \"٤\"… حتى تصل إلى رقم \"٧\"."; +"TRAILMAKING_INTENDED_USE2_B" = "بعد العد التنازلي، اضغط على النقاط بالتبادل بين الأرقام والحروف. ابدأ بالضغط على أول رقم \"١\" ثم اضغط على أول حرف \"ا\"، ثم \"٢\"، \"ب\"، \"٣\"، \"ت\"… حتى تصل إلى رقم \"٧\"."; "TRAILMAKING_INTRO_TEXT" = "افعل ذلك بأسرع ما يمكنك دون الوقوع في أخطاء. \n "; "TRAILMAKING_CALL_TO_ACTION" = "اضغط على البدء لكي تبدأ."; "TRAILMAKING_LETTER_A" = "‎أ"; @@ -566,7 +566,7 @@ "SPEECH_IN_NOISE_INTRO_TEXT" = "يقيس هذا النشاط مدى وضوح الكلام عند نطقه في بيئات ضوضائية."; "SPEECH_IN_NOISE_DETAIL_TEXT" = "كجزء من هذا الاختبار، ستفعل ما يلي:\n\nالاستماع إلى جملة.\n\nتكرار ما سمعته بوضوح أو التخطي لكتابة ما سمعته باستخدام لوحة المفاتيح.\n\nفي حالة تكرار ما سمعته، سيكون لديك الخيار لتعديل النسخة المكتوبة التي أنشأها محرك التعرّف على الكلام."; "SPEECH_IN_NOISE_CALIBRATION_TITLE" = "معايرة مستوى الصوت"; -"SPEECH_IN_NOISE_CALIBRATION_TEXT" = "اضغط على \“تشغيل الصوت\”، اضبط مستوى الصوت على مستوى مريح لك ثم اضغط على \“إيقاف الصوت\” للمتابعة."; +"SPEECH_IN_NOISE_CALIBRATION_TEXT" = "اضغط على \"تشغيل الصوت\"، اضبط مستوى الصوت على مستوى مريح لك ثم اضغط على \"إيقاف الصوت\" للمتابعة."; "SPEECH_IN_NOISE_STEP_TITLE" = "استماع"; "SPEECH_IN_NOISE_STEP_TEXT" = "سيتم تشغيل جملة لمرة واحدة، وهي جملة مختلطة بضوضاء في الخلفية بقيمة عشوائية لمعدل الإشارة إلى الضوضاء (SNR)."; "SPEECH_IN_NOISE_SPEAK_TITLE" = "تحدث"; @@ -576,7 +576,7 @@ "ERROR_DATALOGGER_CREATE_FILE" = "تعذر إنشاء الملف"; "ERROR_DATALOGGER_COULD_NOT_FREE_SPACE" = "تعذر إزالة ملفات السجل الكافية للوصول إلى الحد"; "ERROR_DATALOGGER_SET_ATTRIBUTE" = "حدث خطأ في تعيين السمة"; -"ERROR_DATALOGGER_COULD_NOT_MAORK" = "لم يتم تمييز الملف كمحذوف (لم يتم التمييز كـ \“تم التحميل\”)"; +"ERROR_DATALOGGER_COULD_NOT_MAORK" = "لم يتم تمييز الملف كمحذوف (لم يتم التمييز كـ \"تم التحميل\")"; "ERROR_DATALOGGER_MULTIPLE" = "حدثت عدة أخطاء أثناء إزالة السجلات"; "ERROR_RECORDER_NO_DATA" = "لم يتم العثور على أي بيانات تم جمعها."; "ERROR_RECORDER_NO_OUTPUT_DIRECTORY" = "لم يتم تحديد دليل إخراج"; diff --git a/ResearchKit/Localized/cs.lproj/ResearchKit.strings b/ResearchKit/Localized/cs.lproj/ResearchKit.strings index 472d78c49f..88ea0dae1c 100644 --- a/ResearchKit/Localized/cs.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/cs.lproj/ResearchKit.strings @@ -305,8 +305,8 @@ /* Audio active task. */ "AUDIO_TASK_TITLE" = "Hlas"; "AUDIO_CALL_TO_ACTION" = "Začněte klepnutím na Začít."; -"AUDIO_INSTRUCTION" = "Řekněte \“Ááááá\” do mikrofonu a vydržte co nejdéle."; -"AUDIO_INTRO_TEXT" = "Hluboce se nadechněte a při výdechu hlasitě a co nejdéle do mikrofonu vyslovujte \“Ááááá\”. Udržujte konstantní úroveň hlasitosti, při které budou proužky zbarvené modře."; +"AUDIO_INSTRUCTION" = "Řekněte \"Ááááá\" do mikrofonu a vydržte co nejdéle."; +"AUDIO_INTRO_TEXT" = "Hluboce se nadechněte a při výdechu hlasitě a co nejdéle do mikrofonu vyslovujte \"Ááááá\". Udržujte konstantní úroveň hlasitosti, při které budou proužky zbarvené modře."; "AUDIO_INTENDED_USE" = "Tato aktivita nahraje váš hlas pomocí mikrofonu u dolního okraje zařízení a vyhodnotí ho."; "AUDIO_TOO_LOUD_LABEL" = "Příliš nahlas"; "AUDIO_GENERIC_ERROR_LABEL" = "Nelze zaznamenávat zvuk"; diff --git a/ResearchKit/Localized/da.lproj/ResearchKit.strings b/ResearchKit/Localized/da.lproj/ResearchKit.strings index d39aad5eba..0cc31ebc2e 100644 --- a/ResearchKit/Localized/da.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/da.lproj/ResearchKit.strings @@ -188,7 +188,7 @@ /* Measuring unit abbreviations */ "MEASURING_UNIT_CM" = "cm"; "MEASURING_UNIT_FT" = "fod"; -"MEASURING_UNIT_IN" = "\\\“"; +"MEASURING_UNIT_IN" = "\\\""; "MEASURING_UNIT_KG" = "kg"; "MEASURING_UNIT_LB" = "lb"; "MEASURING_UNIT_OZ" = "oz"; diff --git a/ResearchKit/Localized/en.lproj/ResearchKit.strings b/ResearchKit/Localized/en.lproj/ResearchKit.strings index 0c4d70e891..1a1a0b3bd0 100644 --- a/ResearchKit/Localized/en.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/en.lproj/ResearchKit.strings @@ -86,7 +86,7 @@ "REVIEW_EDIT_ANSWER" = "EDIT"; /* Alert for out of range values. */ -"RANGE_ALERT_TITLE" = "Invalid value"; +"RANGE_ALERT_TITLE" = "Invalid Value"; "RANGE_ALERT_MESSAGE_ABOVE_MAXIMUM" = "%1$@ exceeds the maximum allowed value (%2$@)."; "RANGE_ALERT_MESSAGE_BELOW_MAXIMUM" = "%1$@ is less than the minimum allowed value (%2$@)."; "RANGE_ALERT_MESSAGE_OTHER" = "%@ is not a valid value."; @@ -103,7 +103,7 @@ "LOCATION_ERROR_GEOCODE_NETWORK" = "Either you are not connected to the internet or you have exceeded the maximum amount of address lookup requests. If you are not connected to the internet, please turn on your Wi-Fi to answer this question, skip this question if skip button is available, or come back to the survey when you are connected to the internet. Otherwise, please try again in a few minutes."; /* Alert for exceeding length limit in text answer */ -"TEXT_ANSWER_EXCEEDING_MAX_LENGTH_ALERT_MESSAGE" = "Text content exceeding maximum length: %@"; +"TEXT_ANSWER_EXCEEDING_MAX_LENGTH_ALERT_MESSAGE" = "Text is limited to %@ characters"; /* Camera not available during multitasking */ "CAMERA_UNAVAILABLE_MESSAGE" = "Camera not available in split screen."; @@ -134,7 +134,7 @@ /* Login step */ "LOGIN_CONTINUE_BUTTON_TITLE" = "Login"; -"FORGOT_PASSWORD_BUTTON_TITLE" = "Forgot password?"; +"FORGOT_PASSWORD_BUTTON_TITLE" = "Forgot Password?"; /* Passcode step */ "PASSCODE_PROMPT_MESSAGE" = "Enter passcode"; @@ -149,7 +149,7 @@ "PASSCODE_TOUCH_ID_MESSAGE" = "Please authenticate with Touch ID"; "PASSCODE_TOUCH_ID_ERROR_ALERT_TITLE" = "Touch ID error"; "PASSCODE_FACE_ID_MESSAGE" = "Please authenticate with Face ID"; -"PASSCODE_FACE_ID_ERROR_ALERT_TITLE" = "Face ID error"; +"PASSCODE_FACE_ID_ERROR_ALERT_TITLE" = "Face ID Error"; "PASSCODE_TEXTFIELD_INVALID_INPUT_MESSAGE" = "Only numeric characters allowed."; "PASSCODE_TEXTFIELD_ACCESSIBILITY_LABEL" = "Passcode entry progress indicator"; "PASSCODE_TEXTFIELD_ACCESSIBILTIY_VALUE" = "%@ of %@ digits entered"; @@ -216,17 +216,17 @@ "BUTTON_DISAGREE" = "Disagree"; "BUTTON_DONE" = "Done"; "BUTTON_GET_STARTED" = "Get Started"; -"BUTTON_LEARN_MORE" = "Learn more"; +"BUTTON_LEARN_MORE" = "Learn More"; "BUTTON_NEXT" = "Next"; "BUTTON_SKIP" = "Skip"; -"BUTTON_SKIP_QUESTION" = "Skip this question"; +"BUTTON_SKIP_QUESTION" = "Skip This Question"; "BUTTON_START_TIMER" = "Start Timer"; "BUTTON_OPTION_SAVE" = "Save for Later"; "BUTTON_OPTION_DISCARD" = "Discard Results"; "BUTTON_OPTION_STOP_TASK" = "End Task"; "BUTTON_SAVE" = "Save"; -"BUTTON_CLEAR_ANSWER" = "Clear answer"; -"BUTTON_READ_ONLY_MODE" = "This answer cannot be modified."; +"BUTTON_CLEAR_ANSWER" = "Clear Answer"; +"BUTTON_READ_ONLY_MODE" = "This Answer Cannot Be Modified."; "BUTTON_COPYRIGHT" = "Copyright"; "BUTTON_CLOSE" = "Close"; "BUTTON_START_TEST" = "Start Test"; @@ -357,7 +357,6 @@ "dBHL_TONE_AUDIOMETRY_TESTING_IN_PROGRESS" = "TEST IN PROGRESS"; "dBHL_TONE_AUDIOMETRY_TESTING_IN_PROGRESS_FMT" = "TEST IN PROGRESS \U2022 %@"; - /* Spatial span memory active task. */ "SPATIAL_SPAN_MEMORY_TITLE" = "Spatial Memory"; "SPATIAL_SPAN_MEMORY_INTRO_TEXT_%@" = "This activity measures your short-term spatial memory by asking you to repeat the order in which %@ light up."; @@ -384,13 +383,13 @@ /* Reaction time active task. */ "REACTION_TIME_TASK_TITLE" = "Reaction Time"; -"REACTION_TIME_TASK_NORM_BUTTON_TITLE" = "hold"; "REACTION_TIME_TASK_INTENDED_USE" = "This activity evaluates the time it takes for you to respond to a visual cue."; "REACTION_TIME_TASK_INTRO_TEXT_FORMAT" = "Shake the device in any direction as soon as the blue dot appears on screen. You will be asked to do this %D times."; "REACTION_TIME_TASK_CALL_TO_ACTION" = "Tap Get Started to begin."; "REACTION_TIME_TASK_ATTEMPTS_FORMAT" = "Attempt %@ of %@"; "REACTION_TIME_TASK_ACTIVE_STEP_TITLE" = "Quickly shake the device when the blue circle appears"; "REACTION_TIME_NORMALIZED_TASK_ACTIVE_STEP_TITLE" = "Tap the hold button, and then the blue circle"; +"REACTION_TIME_TASK_NORM_BUTTON_TITLE" = "hold"; /* Stroop active task.*/ "STROOP_TASK_TITLE" = "Stroop"; @@ -406,11 +405,6 @@ "STROOP_COLOR_GREEN_INITIAL" = "G"; "STROOP_COLOR_BLUE_INITIAL" = "B"; "STROOP_COLOR_YELLOW_INITIAL" = "Y"; -"TIME_OUT_TILE" = "Time Out"; -"TIME_OUT_BODY" = "You have not responded in 30 seconds. Would you like to restart?"; -"TIME_OUT_RESTART_ACTION" = "Restart"; -"TIME_OUT_END_ACTION" = "End Task"; - /* Tower of Hanoi active task */ "TOWER_OF_HANOI_TASK_TITLE" = "Tower of Hanoi"; @@ -436,10 +430,6 @@ "KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_2_RIGHT" = "Place your device on your right knee with the screen facing out, as pictured."; "KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_LEFT" = "When ready, tap the screen to begin and extend your left knee as far as you can. Return to the start position and tap again when you are done."; "KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_RIGHT" = "When ready, tap the screen to begin and extend your right knee as far as you can. Return to the start position and tap again when you are done."; -"KNEE_RANGE_OF_MOTION_TOUCH_ANYWHERE_STEP_INSTRUCTION_LEFT" = "Place your device on your left knee.\n\nTap the screen and extend your left knee as far as you can."; -"KNEE_RANGE_OF_MOTION_TOUCH_ANYWHERE_STEP_INSTRUCTION_RIGHT" = "Place your device on your right knee.\n\nTap the screen and extend your right knee as far as you can.\n"; -"KNEE_RANGE_OF_MOTION_SPOKEN_INSTRUCTION_LEFT" = "When you are done, return your left knee to the start position.\n\nThen tap anywhere."; -"KNEE_RANGE_OF_MOTION_SPOKEN_INSTRUCTION_RIGHT" = "When you are done, return your right knee to the start position.\n\nThen tap anywhere."; /* Shoulder Range of Motion active task */ "SHOULDER_RANGE_OF_MOTION_TITLE_LEFT" = "Left Shoulder Range of Motion"; @@ -462,10 +452,10 @@ "TIMED_WALK_INTRO_DETAIL" = "This activity measures your lower extremity function."; "TIMED_WALK_INTRO_2_TEXT_%@" = "Find a place, preferably outside, where you can walk for about %@ in a straight line as quickly as possible, but safely. Do not slow down until after you’ve passed the finish line."; "TIMED_WALK_INTRO_2_DETAIL" = "Tap Next to begin."; -"TIMED_WALK_FORM_TITLE" = "Assistive device"; +"TIMED_WALK_FORM_TITLE" = "Assistive Device"; "TIMED_WALK_FORM_TEXT" = "Use the same assistive device for each test."; "TIMED_WALK_QUESTION_TEXT" = "Do you wear an ankle foot orthosis?"; -"TIMED_WALK_QUESTION_2_TITLE" = "Do you use assistive device?"; +"TIMED_WALK_QUESTION_2_TITLE" = "Do you use an assistive device?"; "TIMED_WALK_QUESTION_2_TEXT" = "Tap here to select an answer."; "TIMED_WALK_QUESTION_2_CHOICE" = "None"; "TIMED_WALK_QUESTION_2_CHOICE_2" = "Unilateral Cane"; @@ -573,6 +563,7 @@ "SPEECH_RECOGNITION_TRANSCRIPTION_LABEL" = "Your transcription will appear here."; "SPEECH_RECOGNITION_FAILED" = "Speech recognition failed."; "SPEECH_RECOGNITION_FAILED_TRY_AGAIN" = "Could not record. Tap to try again."; +"SPEECH_RECOGNITION_NOT_DETECTED_TRY_AGAIN" = "Speech was not detected in your recording. Tap to try again."; "SPEECH_RECOGNITION_INIT_FAILURE" = "Failed to initialize speech recognition."; /* Speech In Noise active task. */ @@ -589,24 +580,6 @@ "SPEECH_IN_NOISE_SPEAK_TEXT" = "Repeat what you heard."; "SPEECH_IN_NOISE_PREDEFINED_USE_KEYBOARD_INSTEAD" = "Use Keyboard Instead"; -/* Touch Ability active task. */ -"TOUCH_ABILITY_INSTRUCTION_TITLE" = "Touch Ability Activity"; -"TOUCH_ABILITY_INSTRUCTION_DETAIL" = "This activity will measure your touch screen usability. Please locate a comfortable spot to proceed with this activity."; -"TOUCH_ABILITY_TAP_TITLE" = "Tap Ability"; -"TOUCH_ABILITY_TAP_TEXT" = "Please click on the squares appear on the screen. Square will disappear upon clicking. Please await for next square to appear before next click."; -"TOUCH_ABILITY_LONG_PRESS_TITLE" = "Long Press Ability"; -"TOUCH_ABILITY_LONG_PRESS_TEXT" = "Please long press on the squares appear on the screen for at least one second before lift up from screen. Once finger lift up, square will disappear despite whether it is long pressed for one second or not. Please await for next square to appear before next press."; -"TOUCH_ABILITY_SWIPE_TITLE" = "Swipe Ability"; -"TOUCH_ABILITY_SWIPE_TEXT" = "Please swipe in direction of the arrow on the screen. arrow will disappear upon swiping completion. Please await for next arrow to appear before next swipe."; -"TOUCH_ABILITY_VERTICAL_SCROLL_TITLE" = "Vertical Scroll Ability"; -"TOUCH_ABILITY_VERTICAL_SCROLL_TEXT" = "This test will require you to scroll through a list of number, and drag the item labeled by the color into a dotted line box. Once hand is lifted up from the list and stop scrolling for one second, list and box will disappear. Please await for next list to appear before next test."; -"TOUCH_ABILITY_HORIZONTAL_SCROLL_TITLE" = "Horizontal Scroll Ability"; -"TOUCH_ABILITY_HORIZONTAL_SCROLL_TEXT" = "This test will require you to scroll through a horizontal list of number, and drag the item labeled by the color into a dotted line box. Once hand is lifted up from the list and stop scrolling for one second, list and box will disappear. Please await for next list to appear before next trial."; -"TOUCH_ABILITY_PINCH_TITLE" = "Pinch Ability"; -"TOUCH_ABILITY_PINCH_TEXT" = "Please use two finger pinching gesture to readjust the size of cube similar the dash line box. Once completing and lifting up your fingers, cube and box will disappear. Please await for cube and box to appear before next trial."; -"TOUCH_ABILITY_ROTATION_TITLE" = "Rotation Ability"; -"TOUCH_ABILITY_ROTATION_TEXT" = "Please use two finger rotating gesture to readjust the arrow to align with dashed arrow. Once completing and lifting up your fingers, arrow will disappear. Please await for cube and box to appear before next trial."; - /* ORKRecordButton */ "PLAY" = "Play"; "RECORD" = "Record"; @@ -636,7 +609,7 @@ "ENVIRONMENTSPL_UNIT" = "dBA"; "ENVIRONMENTSPL_CALCULATING" = "Measuring…"; "ENVIRONMENTSPL_THRESHOLD" = "Threshold: %@ dBA"; -"ENVIRONMENTSPL_OK" = "Background Noise OK"; +"ENVIRONMENTSPL_OK" = "Good"; "ENVIRONMENTSPL_NOISE" = "Too Loud"; "ENVIRONMENTSPL_TITLE_2" = "Find a Quiet Place"; "ENVIRONMENTSPL_INTRO_TEXT_2" = "For accurate results, this task should be completed in a quiet location. Once the background noise measurement reading is completed, you may continue."; @@ -736,8 +709,43 @@ /* This contains the visual text, followed by a VoiceOver-specific description. */ "AX_dBHL_TONE_AUDIOMETRY_INTRO_TEXT" = "%@ Using VoiceOver, the button will be directly tappable. It will be located near the center of the screen."; -/* 6 minute walk test task. */ +/* This contains the visual text, followed by a VoiceOver-specific description. */ +"AX_TRAILMAKING_CALL_TO_ACTION_VOICEOVER" = "%@ Using VoiceOver, the buttons in the test will be directly tappable."; + +"AX_SES_TOP" = "Top"; +"AX_SES_BOTTOM" = "Bottom"; +"AX_SES_PERCENT" = "Percent"; +/* Restore error */ +"RESTORE_ERROR_CANNOT_DECODE" = "Cannot decode restoreData for initialization"; + +/* Request Permission Step */ +"REQUEST_PERMISSION_BUTTON_STATE_DEFAULT" = "Review"; +"REQUEST_PERMISSION_BUTTON_STATE_CONNECTED" = "Reviewed"; +"REQUEST_PERMISSION_BUTTON_STATE_NOT_SUPPORTED" = "Not Supported"; +"REQUEST_PERMISSION_BUTTON_STATE_ERROR" = "Error"; + +/* Request Health Data Step */ +"REQUEST_HEALTH_DATA_STEP_VIEW_TITLE" = "Health Data"; +"REQUEST_HEALTH_DATA_STEP_VIEW_DESCRIPTION" = "The study is requesting access to health data."; + +/* Request Notification Permission Step */ +"REQUEST_NOTIFICATIONS_STEP_VIEW_TITLE" = "Notifications"; +"REQUEST_NOTIFICATIONS_STEP_VIEW_DESCRIPTION" = "The study is requesting to send you notifications."; + +/* Request Sensor Permission Step */ +"REQUEST_SENSOR_STEP_VIEW_TITLE" = "Sensor Data"; +"REQUEST_SENSOR_STEP_VIEW_DESCRIPTION" = "The study is requesting access to sensor data from your devices."; + +/* Request Device Motion Permission Step */ +"REQUEST_MOTION_ACTIVITY_STEP_VIEW_TITLE" = "Device Motion"; +"REQUEST_MOTION_ACTIVITY_STEP_VIEW_DESCRIPTION" = "The study is requesting access to motion data from your devices."; + +/* Request Location Permission Step */ +"REQUEST_LOCATION_DATA_STEP_VIEW_TITLE" = "Location Data"; +"REQUEST_LOCATION_DATA_STEP_VIEW_DESCRIPTION" = "The study is requesting access to location data from your devices."; + +/* 6 minute walk test task. */ "6MWT_TASK_TITLE" = "6 Minute Walk Test"; "6MWT_INTRO" = "The goal of this test is to walk as far as possible at a comfortable pace for 6 minutes."; "6MWT_INTRO_DETAILS" = "Details"; @@ -759,6 +767,11 @@ "6MWT_LOW_SCORE" = "1: Not Any"; "6MWT_HIGH_SCORE" = "10: A Lot"; +/* Fitness test. */ +"FITNESS_STOP_TEST_CONFIRMATION" = "Are you sure you want to end this activity early?"; +"FITNESS_STOP_TEST_DETAIL" = "Your progress will be saved and this test will be marked as completed."; +"FITNESS_RESUME_TEST" = "Resume Activity"; + /* Tecumseh cube active task. */ "TC_TASK_TITLE" = "Tecumseh Cube Test"; "TC_INTRO" = "The goal of this test is to raise your heart rate while you are stepping up and down for 3 minutes following a beat."; @@ -777,38 +790,25 @@ "TC_COMPLETION_TITLE" = "Nicely Done"; "TC_COMPLETION_DETAIL" = "Congratulation on completing the Tecumseh Cube Test!"; -/* Request Permission Step */ -"REQUEST_PERMISSION_BUTTON_STATE_DEFAULT" = "Review"; -"REQUEST_PERMISSION_BUTTON_STATE_CONNECTED" = "Reviewed"; -"REQUEST_PERMISSION_BUTTON_STATE_NOT_SUPPORTED" = "Not Supported"; -"REQUEST_PERMISSION_BUTTON_STATE_ERROR" = "Error"; - -/* Request Health Data Step */ -"REQUEST_HEALTH_DATA_STEP_VIEW_TITLE" = "Health Data"; -"REQUEST_HEALTH_DATA_STEP_VIEW_DESCRIPTION" = "The study is requesting access to Health data."; - -/* Request Notification Permission Step */ -"REQUEST_NOTIFICATIONS_STEP_VIEW_TITLE" = "Notifications"; -"REQUEST_NOTIFICATIONS_STEP_VIEW_DESCRIPTION" = "The study is requesting to send you notifications."; - -/* Request Sensor Permission Step */ -"REQUEST_SENSOR_STEP_VIEW_TITLE" = "Sensor Data"; -"REQUEST_SENSOR_STEP_VIEW_DESCRIPTION" = "The study is requesting access to sensor data from your devices."; - -/* Request Device Motion Permission Step */ -"REQUEST_MOTION_ACTIVITY_STEP_VIEW_TITLE" = "Device Motion"; -"REQUEST_MOTION_ACTIVITY_STEP_VIEW_DESCRIPTION" = "The study is requesting access to motion data from your devices."; - -/* Request Location Permission Step */ -"REQUEST_LOCATION_DATA_STEP_VIEW_TITLE" = "Location Data"; -"REQUEST_LOCATION_DATA_STEP_VIEW_DESCRIPTION" = "The study is requesting access to location data from your device."; - -/* This contains the visual text, followed by a VoiceOver-specific description. */ -"AX_TRAILMAKING_CALL_TO_ACTION_VOICEOVER" = "%@ Using VoiceOver, the buttons in the test will be directly tappable."; - -"AX_SES_TOP" = "Top"; -"AX_SES_BOTTOM" = "Bottom"; -"AX_SES_PERCENT" = "Percent"; +"KNEE_RANGE_OF_MOTION_TOUCH_ANYWHERE_STEP_INSTRUCTION_LEFT" = "Place your device on your left knee.\n\nTap the screen and extend your left knee as far as you can."; +"KNEE_RANGE_OF_MOTION_TOUCH_ANYWHERE_STEP_INSTRUCTION_RIGHT" = "Place your device on your right knee.\n\nTap the screen and extend your right knee as far as you can.\n"; +"KNEE_RANGE_OF_MOTION_SPOKEN_INSTRUCTION_LEFT" = "When you are done, return your left knee to the start position.\n\nThen tap anywhere."; +"KNEE_RANGE_OF_MOTION_SPOKEN_INSTRUCTION_RIGHT" = "When you are done, return your right knee to the start position.\n\nThen tap anywhere."; -/* Restore error */ -"RESTORE_ERROR_CANNOT_DECODE" = "Cannot decode restoreData for initialization"; +/* Family History */ +"FAMILY_HISTORY_I_DONT_KNOW" = "I don't know"; +"FAMILY_HISTORY_CONDITIONS_FORM_ITEM_TEXT" = "Have they been diagnosed with any of the following diseases or health conditions?"; +"FAMILY_HISTORY_CONDITIONS_STEP_TITLE" = "Health Conditions"; +"FAMILY_HISTORY_CONDITIONS_STEP_DESCRIPTION" = "Answer these questions to the best of your ability"; +"FAMILY_HISTORY_COMPLETION_STEP_TITLE" = "Task Complete"; +"FAMILY_HISTORY_NONE_OF_THE_ABOVE" = "None of the above"; +"FAMILY_HISTORY_PREFER_NOT_TO_ANSWER" = "I prefer not to answer"; +"FAMILY_HISTORY_CONDITIONS" = "Conditions"; +"FAMILY_HISTORY_NONE_SELECTED" = "None selected"; +"FAMILY_HISTORY_EDIT_ENTRY" = "Edit Entry"; +"FAMILY_HISTORY_DELETE_ENTRY_TITLE" = "Are you sure you want to delete this entry from your Family Health History?"; +"FAMILY_HISTORY_DELETE_ENTRY" = "Delete Entry"; +"FAMILY_HISTORY_CANCEL" = "Cancel"; +"FAMILY_HISTORY_ADD" = "Add %@"; +"FAMILY_HISTORY_CONDITIONS_STEP_DESCRIPTION_TEMP" = "Confirm any diagnosed diseases or health conditions."; +"AX_FAMILY_HISTORY_EDIT_BUTTON" = "Edit button"; diff --git a/ResearchKit/Localized/en_GB.lproj/ResearchKit.strings b/ResearchKit/Localized/en_GB.lproj/ResearchKit.strings index 311bc8021d..878ae44c4c 100644 --- a/ResearchKit/Localized/en_GB.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/en_GB.lproj/ResearchKit.strings @@ -450,7 +450,7 @@ "TIMED_WALK_FORM_TITLE" = "Assistive device"; "TIMED_WALK_FORM_TEXT" = "Use the same assistive device for each test."; "TIMED_WALK_QUESTION_TEXT" = "Do you wear an ankle-foot orthosis?"; -"TIMED_WALK_QUESTION_2_TITLE" = "Do you use assistive device?"; +"TIMED_WALK_QUESTION_2_TITLE" = "Do you use an assistive device?"; "TIMED_WALK_QUESTION_2_TEXT" = "Tap here to select an answer."; "TIMED_WALK_QUESTION_2_CHOICE" = "None"; "TIMED_WALK_QUESTION_2_CHOICE_2" = "Unilateral Cane"; diff --git a/ResearchKit/Localized/fi.lproj/ResearchKit.strings b/ResearchKit/Localized/fi.lproj/ResearchKit.strings index b7e0c981f1..4285ed3d4c 100644 --- a/ResearchKit/Localized/fi.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/fi.lproj/ResearchKit.strings @@ -306,7 +306,7 @@ "AUDIO_TASK_TITLE" = "Ääni"; "AUDIO_CALL_TO_ACTION" = "Aloita napauttamalla Aloita-painiketta."; "AUDIO_INSTRUCTION" = "Sano ”aaa” mikrofoniin niin kauan kuin voit."; -"AUDIO_INTRO_TEXT" = "Hengitä syvään ja sano \”Aaaaa\” mikrofoniin niin pitkään kuin pystyt. Pidä äänenvoimakkuus tasaisena siten, että äänipalkit pysyvät sinisinä."; +"AUDIO_INTRO_TEXT" = "Hengitä syvään ja sano ”Aaaaa\" mikrofoniin niin pitkään kuin pystyt. Pidä äänenvoimakkuus tasaisena siten, että äänipalkit pysyvät sinisinä."; "AUDIO_INTENDED_USE" = "Tämä aktiviteetti arvioi ääntäsi tallentamalla sitä laitteen alareunassa olevalla mikrofonilla."; "AUDIO_TOO_LOUD_LABEL" = "Liian kovaa"; "AUDIO_GENERIC_ERROR_LABEL" = "Ei voida äänittää"; diff --git a/ResearchKit/Localized/nl.lproj/ResearchKit.strings b/ResearchKit/Localized/nl.lproj/ResearchKit.strings index fcb62c0ce1..ef041348a0 100644 --- a/ResearchKit/Localized/nl.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/nl.lproj/ResearchKit.strings @@ -341,7 +341,7 @@ "dBHL_TONE_AUDIOMETRY_INTRO_TEXT" = "Zorg ervoor dat het volume van het apparaat op het hoogste niveau is ingesteld.\n\nTijdens deze taak wordt er een subtiele toon afgespeeld in het linker- of rechteroor.\n\nLuister aandachtig en tik telkens wanneer je een toon hoort op de knop."; "dBHL_TONE_AUDIOMETRY_INTRO_TEXT_2" = "Deze test stelt vast hoe hard een geluid moet zijn, zodat jij het kunt horen."; "dBHL_TONE_AUDIOMETRY_ONBOARDING" = "Intakevragenlijst."; -"dBHL_TONE_AUDIOMETRY_ONBOARDING_QUESTION" = "Selecteer je voorkeur voor \“beter oor\”, indien van toepassing"; +"dBHL_TONE_AUDIOMETRY_ONBOARDING_QUESTION" = "Selecteer je voorkeur voor \"beter oor\", indien van toepassing"; "dBHL_TONE_AUDIOMETRY_OPTION_LEFT" = "links"; "dBHL_TONE_AUDIOMETRY_OPTION_RIGHT" = "rechts"; "dBHL_TONE_AUDIOMETRY_OPTION_NO_PREFERENCE" = "geen voorkeur"; diff --git a/ResearchKit/Localized/zh_TW.lproj/ResearchKit.strings b/ResearchKit/Localized/zh_TW.lproj/ResearchKit.strings index f8b5cf532a..6046610ac2 100644 --- a/ResearchKit/Localized/zh_TW.lproj/ResearchKit.strings +++ b/ResearchKit/Localized/zh_TW.lproj/ResearchKit.strings @@ -1,21 +1,21 @@ /* Copyright (c) 2015, Apple Inc. All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - + 3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. No license is granted to the trademarks of the copyright holders even if such marks are included in this software. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -546,24 +546,6 @@ "TRAILMAKING_LETTER_E" = "E"; "TRAILMAKING_LETTER_F" = "F"; -/* Touch Ability active task. */ -"TOUCH_ABILITY_INSTRUCTION_TITLE" = "觸控能力測試活動"; -"TOUCH_ABILITY_INSTRUCTION_DETAIL" = "此項活動會測量您的觸控螢幕使用能力。請找一個可以讓您舒適使用本裝置的位置,來完成此項活動。"; -"TOUCH_ABILITY_TAP_TITLE" = "點按能力測驗"; -"TOUCH_ABILITY_TAP_TEXT" = "請點按畫面中出現的方塊,點按後方塊即會消失,請待方塊再次出現再進行下一次點按。"; -"TOUCH_ABILITY_LONG_PRESS_TITLE" = "長按能力測驗"; -"TOUCH_ABILITY_LONG_PRESS_TEXT" = "請長按畫面中出現的方塊,持續至少一秒鐘再抬起。無論是否確實長按至少一秒鐘,當您將手抬起後方塊即會消失,請待方塊再次出現再進行下一次長按。"; -"TOUCH_ABILITY_SWIPE_TITLE" = "掃動能力測驗"; -"TOUCH_ABILITY_SWIPE_TEXT" = "請依畫面中箭頭的方向掃動。當您完成掃動手勢後,箭頭即會消失,請待箭頭再次出現再進行下一次掃動。"; -"TOUCH_ABILITY_VERTICAL_SCROLL_TITLE" = "垂直滾動測驗"; -"TOUCH_ABILITY_VERTICAL_SCROLL_TEXT" = "此項測驗將要求您滾動一個數字列表,請將其中被色彩標記的項目移至虛線方框內。當您將手抬起並且列表停止滾動一秒鐘後,列表和方框即會消失,請待列表再次出現再進行下一次測驗。"; -"TOUCH_ABILITY_HORIZONTAL_SCROLL_TITLE" = "水平滾動測驗"; -"TOUCH_ABILITY_HORIZONTAL_SCROLL_TEXT" = "此項測驗將要求您滾動一個水平的數字列表,請將其中被色彩標記的項目移至虛線方框內。當您將手抬起並且列表停止滾動一秒鐘後,列表和方框即會消失,請待列表再次出現再進行下一次測驗。"; -"TOUCH_ABILITY_PINCH_TITLE" = "兩指縮放測驗"; -"TOUCH_ABILITY_PINCH_TEXT" = "請透過兩指縮放手勢將畫面中的方塊調整至與虛線方框相同大小。當您完成並將手指全數抬起後,方塊和方框即會消失,請待它們重新出現後再進行下一次測驗。"; -"TOUCH_ABILITY_ROTATION_TITLE" = "兩指旋轉測驗"; -"TOUCH_ABILITY_ROTATION_TEXT" = "請透過兩指旋轉手勢將畫面中的箭頭調整至對齊虛線箭頭。當您完成並將手指全數抬起後,箭頭即會消失,請待它們重新出現後再進行下一次測驗。"; - /* Speech Recognition active task. */ "SPEECH_TASK_TITLE" = "語音辨識"; "SPEECH_RECOGNITION_INTRO_TEXT" = "此活動會用裝置底部的麥克風錄下您的語音,並聽寫成文字。"; diff --git a/ResearchKit/Onboarding/ORKLoginStep.h b/ResearchKit/Onboarding/ORKLoginStep.h index deffb78e85..9d8d38fba0 100644 --- a/ResearchKit/Onboarding/ORKLoginStep.h +++ b/ResearchKit/Onboarding/ORKLoginStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/Onboarding/ORKLoginStep.m b/ResearchKit/Onboarding/ORKLoginStep.m index 96e6a17c82..062d1cb556 100644 --- a/ResearchKit/Onboarding/ORKLoginStep.m +++ b/ResearchKit/Onboarding/ORKLoginStep.m @@ -32,8 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKLoginStep.h" #import "ORKLoginStep_Internal.h" -#import "ORKLoginStepViewController.h" - #import "ORKAnswerFormat.h" #import "ORKStep_Private.h" @@ -45,10 +43,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKLoginStep -- (Class)stepViewControllerClass { - return self.loginViewControllerClass; -} - // Don't throw on -initWithIdentifier: because it's internally used by -copyWithZone: - (instancetype)initWithIdentifier:(NSString *)identifier @@ -62,8 +56,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier text:(NSString *)text loginViewControllerClass:(Class)loginViewControllerClass { - NSParameterAssert([loginViewControllerClass isSubclassOfClass:[ORKLoginStepViewController class]]); - self = [super initWithIdentifier:identifier title:title text:text]; if (self) { _loginViewControllerString = NSStringFromClass(loginViewControllerClass); diff --git a/ResearchKit/Onboarding/ORKRegistrationStep.h b/ResearchKit/Onboarding/ORKRegistrationStep.h index c839888959..be81ff521d 100644 --- a/ResearchKit/Onboarding/ORKRegistrationStep.h +++ b/ResearchKit/Onboarding/ORKRegistrationStep.h @@ -29,15 +29,15 @@ */ -@import UIKit; +#import #import NS_ASSUME_NONNULL_BEGIN /** - The `ORKRegistrationStepOption` flags let you include particular fields in addition - to the default fields (email and password) in the registration step. + Flags that let you include particular fields in addition + to the default fields in the registration step. */ typedef NS_OPTIONS(NSUInteger, ORKRegistrationStepOption) { /// Default behavior. @@ -74,8 +74,7 @@ ORK_EXTERN NSString *const ORKRegistrationFormItemIdentifierPhoneNumber ORK_AVAI /** - The `ORKRegistrationStep` class represents a form step that provides fields commonly used - for account registration. + A form step subclass that provides fields for account registration. The registration step contains email and password fields by default. Optionally, any of the additional fields can be included based on context and requirements. diff --git a/ResearchKit/Onboarding/ORKRegistrationStep.m b/ResearchKit/Onboarding/ORKRegistrationStep.m index 40423eec95..69b2444446 100644 --- a/ResearchKit/Onboarding/ORKRegistrationStep.m +++ b/ResearchKit/Onboarding/ORKRegistrationStep.m @@ -73,13 +73,8 @@ static _Nullable id ORKFindInArrayByFormItemId(NSArray *array, NSString *formIte answerFormat.autocapitalizationType = UITextAutocapitalizationTypeNone; answerFormat.autocorrectionType = UITextAutocorrectionTypeNo; answerFormat.spellCheckingType = UITextSpellCheckingTypeNo; - - if (@available(iOS 12.0, *)) { - answerFormat.textContentType = UITextContentTypeNewPassword; - } else { - answerFormat.textContentType = UITextContentTypePassword; - } - + answerFormat.textContentType = UITextContentTypeOneTimeCode; + ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:ORKRegistrationFormItemIdentifierPassword text:ORKLocalizedString(@"PASSWORD_FORM_ITEM_TITLE", nil) answerFormat:answerFormat diff --git a/ResearchKit/Onboarding/ORKVerificationStep.h b/ResearchKit/Onboarding/ORKVerificationStep.h index 455f0f43f1..c048435d1d 100644 --- a/ResearchKit/Onboarding/ORKVerificationStep.h +++ b/ResearchKit/Onboarding/ORKVerificationStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/Onboarding/ORKVerificationStep.m b/ResearchKit/Onboarding/ORKVerificationStep.m index 67d3108de8..6532ae099c 100644 --- a/ResearchKit/Onboarding/ORKVerificationStep.m +++ b/ResearchKit/Onboarding/ORKVerificationStep.m @@ -32,8 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKVerificationStep.h" #import "ORKVerificationStep_Internal.h" -#import "ORKVerificationStepViewController.h" - #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -41,18 +39,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKVerificationStep -- (Class)stepViewControllerClass { - return self.verificationViewControllerClass; -} - // Don't throw on -initWithIdentifier: because it's internally used by -copyWithZone: - (instancetype)initWithIdentifier:(NSString *)identifier text:(NSString *)text verificationViewControllerClass:(Class)verificationViewControllerClass { - NSParameterAssert([verificationViewControllerClass isSubclassOfClass:[ORKVerificationStepViewController class]]); - self = [super initWithIdentifier:identifier]; if (self) { self.title = ORKLocalizedString(@"VERIFICATION_STEP_TITLE", nil); diff --git a/ResearchKit/PrivacyInfo.xcprivacy b/ResearchKit/PrivacyInfo.xcprivacy new file mode 100644 index 0000000000..f274381337 --- /dev/null +++ b/ResearchKit/PrivacyInfo.xcprivacy @@ -0,0 +1,72 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePhotosorVideos + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeSensitiveInfo + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeHealth + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePreciseLocation + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + + diff --git a/ResearchKit/PrivateHeaders/ResearchKit_Private.h b/ResearchKit/PrivateHeaders/ResearchKit_Private.h deleted file mode 100644 index 51f926183c..0000000000 --- a/ResearchKit/PrivateHeaders/ResearchKit_Private.h +++ /dev/null @@ -1,185 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import - -#import -#import -#import - -#import - -// Active step support -#import -#import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - -#import - -#import -#import -#import -#import -#import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - -#import -#import -#import -#import -#import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - -// For custom steps -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - -#import -#import -#import -#import -#import -#import - -#import -#import -#import -#import -#import - -#import -#import -#import -#import - -#import -#import -#import -#import -#import - -#import -#import diff --git a/ResearchKit/ResearchKit.docc/API Collections/AnswerFormats.md b/ResearchKit/ResearchKit.docc/API Collections/AnswerFormats.md new file mode 100644 index 0000000000..710cd2a8b7 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/AnswerFormats.md @@ -0,0 +1,73 @@ +# Answer formats + +Present a specific question and collect an answer. + +## Topics + +### Age + +- ``ORKAgeAnswerFormat`` + +### Color Choice + +- ``ORKColorChoiceAnswerFormat`` +- ``ORKColorChoice`` + +### Essentials + +- ``ORKAnswerFormat`` +- ``ORKNumericPrecision`` + +### Height and Weight + +- ``ORKHeightAnswerFormat`` +- ``ORKWeightAnswerFormat`` +- ``ORKDoubleDefaultValue`` +- ``ORKMeasurementSystem`` + +### Date and time + +- ``ORKDateAnswerFormat`` +- ``ORKTimeIntervalAnswerFormat`` +- ``ORKTimeOfDayAnswerFormat`` +- ``ORKDateAnswerStyle`` + +### HealthKit + +- ``ORKHealthKitQuantityTypeAnswerFormat`` +- ``ORKHealthKitCharacteristicTypeAnswerFormat`` + +### Image + +- ``ORKImageChoice`` +- ``ORKImageChoiceAnswerFormat`` + +### Numeric + +- ``ORKNumericAnswerFormat`` +- ``ORKNumericAnswerStyle`` + +### Scale + +- ``ORKScaleAnswerFormat`` +- ``ORKContinuousScaleAnswerFormat`` +- ``ORKNumberFormattingStyle`` + +### Text + +- ``ORKTextAnswerFormat`` +- ``ORKTextChoiceAnswerFormat`` +- ``ORKTextScaleAnswerFormat`` +- ``ORKTextChoice`` +- ``ORKTextChoiceOther`` +- ``ORKChoiceAnswerStyle`` +- ``ORKQuestionType`` + +### Other formats + +- ``ORKBooleanAnswerFormat`` +- ``ORKEmailAnswerFormat`` +- ``ORKLocationAnswerFormat`` +- ``ORKMultipleValuePickerAnswerFormat`` +- ``ORKSESAnswerFormat`` +- ``ORKValuePickerAnswerFormat`` diff --git a/ResearchKit/ResearchKit.docc/API Collections/Consent.md b/ResearchKit/ResearchKit.docc/API Collections/Consent.md new file mode 100644 index 0000000000..5b2514ae41 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Consent.md @@ -0,0 +1,20 @@ +# Consent + +Obtain a participant's consent to collect research data. + +## Topics + +### Consent presentation + +- ``ORKConsentDocument`` +- ``ORKConsentSection`` +- ``ORKCustomSignatureAccessoryViewDelegate`` +- ``ORKCustomSignatureAccessoryViewProtocol`` +- ``ORKCustomSignatureAccessoryViewProvider`` +- ``ORKConsentSectionType`` + +### Signature acquisition + +- ``ORKConsentSignature`` +- ``ORKSignatureFormatter`` +- ``ORKHTMLPDFWriter`` diff --git a/ResearchKit/ResearchKit.docc/API Collections/Constants.md b/ResearchKit/ResearchKit.docc/API Collections/Constants.md new file mode 100644 index 0000000000..6f2053d923 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Constants.md @@ -0,0 +1,46 @@ +# Constants + +Constants utilized throughout ResearchKit. + +## Topics + +### Constants + +- ``CheckmarkViewDimension`` +- ``ORKAuxiliaryImageTintColorKey`` +- ``ORKBackgroundColorKey`` +- ``ORKBlueHighlightColorKey`` +- ``ORKBodyToBodyPaddingStandard`` +- ``ORKBodyToBodyParagraphPaddingStandard`` +- ``ORKBulletItemTextColorKey`` +- ``ORKCaptionTextColorKey`` +- ``ORKCardDefaultBorderWidth`` +- ``ORKCardDefaultCornerRadii`` +- ``ORKCardDefaultFontSize`` +- ``ORKConsentBackgroundColorKey`` +- ``ORKDarkTintColorKey`` +- ``ORKDoneButtonPressedKey`` +- ``ORKEffectViewOpacityHidden`` +- ``ORKEffectViewOpacityVisible`` +- ``ORKFormStepLargeTextMinimumHeaderHeight`` +- ``ORKFormStepMinimumHeaderHeight`` +- ``ORKImageChoiceButtonCornerRadii`` +- ``ORKLightTintColorKey`` +- ``ORKNavigationContainerColorKey`` +- ``ORKNavigationContainerShadowColorKey`` +- ``ORKProgressLabelColorKey`` +- ``ORKQuestionStepMinimumHeaderHeight`` +- ``ORKResetDoneButtonKey`` +- ``ORKScreenMetricMaxDimension`` +- ``ORKSignatureColorKey`` +- ``ORKStepContainerTitleToBodyTopPaddingStandard`` +- ``ORKStepContentIconImageViewDimension`` +- ``ORKStepTopContentImageChangedKey`` +- ``ORKSurveyItemMargin`` +- ``ORKSurveyTableContainerLeftRightPadding`` +- ``ORKToolBarTintColorKey`` +- ``ORKTopContentImageViewBackgroundColorKey`` +- ``ORKiPadBackgroundViewBottomPadding`` +- ``ORKiPadBackgroundViewColorKey`` +- ``ORKiPadBackgroundViewCornerRadius`` +- ``ORKiPadBackgroundViewLeftRightPadding`` diff --git a/ResearchKit/ResearchKit.docc/API Collections/Enumerations.md b/ResearchKit/ResearchKit.docc/API Collections/Enumerations.md new file mode 100644 index 0000000000..e071b36c68 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Enumerations.md @@ -0,0 +1,17 @@ +# Enumerations + +Enumerations utilized throughout ResearchKit. + +## Topics + +### Enumerations + +- ``ORKAudioChannel`` +- ``ORKBodySagittal`` +- ``ORKHeadphoneTypeIdentifier`` +- ``ORKRequestPermissionsState`` +- ``ORKSampleJSONOptions`` +- ``ORKScreenMetric`` +- ``ORKScreenType`` +- ``ORKSpeechRecognizerLocale`` +- ``ORKTaskFinishReason`` diff --git a/ResearchKit/ResearchKit.docc/API Collections/Helper Functions.md b/ResearchKit/ResearchKit.docc/API Collections/Helper Functions.md new file mode 100644 index 0000000000..3ff116ab7f --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Helper Functions.md @@ -0,0 +1,31 @@ +# Helper Functions + +Helper Functions utilized throughout ResearchKit. + +## Topics + +### Helper Functions + +- ``ORKCardLeftRightMarginForWindow`` +- ``ORKColor`` +- ``ORKColorSetColorForKey`` +- ``ORKGetMetricForWindow`` +- ``ORKGetVerticalScreenTypeForWindow`` +- ``ORKNeedWideScreenDesign`` +- ``ORKScrollIndicatorInsetsForScrollView`` +- ``ORKStandardFullScreenLayoutMarginsForView`` +- ``ORKStandardHorizontalMarginForView`` +- ``ORKStandardLayoutMarginsForTableViewCell`` +- ``ORKStandardLeftMarginForTableViewCell`` +- ``ORKStepContainerExtendedLeftRightPaddingForWindow`` +- ``ORKStepContainerFirstItemTopPaddingForWindow`` +- ``ORKStepContainerLeftRightPaddingForWindow`` +- ``ORKStepContainerTitleToBodyTopPaddingForWindow`` +- ``ORKStepContainerTitleToBulletTopPaddingForWindow`` +- ``ORKStepContainerTopContentHeightForWindow`` +- ``ORKStepContainerTopPaddingForWindow`` +- ``ORKTaskProgressMake`` +- ``ORKTaskTotalProgressMake`` +- ``ORKTitleLabelFontTextStyleForWindow`` +- ``ORKUpdateScrollViewBottomInset`` +- ``ORKWidthForSignatureView`` diff --git a/ResearchKit/ResearchKit.docc/API Collections/Results.md b/ResearchKit/ResearchKit.docc/API Collections/Results.md new file mode 100644 index 0000000000..f525f63d70 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Results.md @@ -0,0 +1,63 @@ +# Results + +Obtain information from a step. + +## Topics + +### Essentials + +- ``ORKResult`` +- ``ORKTaskResult`` +- ``ORKStepResult`` +- ``ORKCollectionResult`` + +### Result source + +- ``ORKTaskResultSource`` + +### Family History + +- ``ORKFamilyHistoryResult`` + +### File storage + +- ``ORKFileResult`` + +### Authentication and consent + +- ``ORKPasscodeResult`` +- ``ORKSignatureResult`` +- ``ORKConsentSignatureResult`` + +### Data collection + +- ``ORKCollector`` +- ``ORKHealthCollector`` +- ``ORKHealthCorrelationCollector`` +- ``ORKDataCollectionManager`` +- ``ORKDataCollectionManagerDelegate`` +- ``ORKBundleAsset`` + +### Surveys + +- ``ORKQuestionResult`` +- ``ORKSESQuestionResult`` +- ``ORKScaleQuestionResult`` +- ``ORKTextQuestionResult`` +- ``ORKTimeIntervalQuestionResult`` +- ``ORKTimeOfDayQuestionResult`` +- ``ORKBooleanQuestionResult`` +- ``ORKChoiceQuestionResult`` +- ``ORKDateQuestionResult`` +- ``ORKLocationQuestionResult`` +- ``ORKNumericQuestionResult`` +- ``ORKMultipleComponentQuestionResult`` + +### Video + +- ``ORKFrontFacingCameraStepResult`` +- ``ORKVideoInstructionStepResult`` + +### Web + +- ``ORKWebViewStepResult`` diff --git a/ResearchKit/ResearchKit.docc/API Collections/Steps.md b/ResearchKit/ResearchKit.docc/API Collections/Steps.md new file mode 100644 index 0000000000..19c0d99e50 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Steps.md @@ -0,0 +1,149 @@ +# Steps + +Create tasks for participants to perform. + +## Overview + +Using ResearchKit, you can build apps that obtain consent, give instructions, present a form or survey, or run an active task. You create all of these interactions with a collection of steps. Steps are based on ``ORKStep`` and are the building blocks of tasks. + +## Topics + +### Essentials + +- ``ORKStep`` + +### Active steps + +- ``ORKActiveStep`` +- ``ORKMotionActivityCollector`` +- ``ORKMotionActivityPermissionType`` + +### Authentication and consent steps + +- ``ORKLoginStep`` +- ``ORKSignatureStep`` +- ``ORKVerificationStep`` +- ``ORKLoginFormItemIdentifierEmail`` +- ``ORKLoginFormItemIdentifierPassword`` +- ``ORKKeychainWrapper`` + +### Permissions + +- ``ORKPermissionType`` +- ``ORKHealthKitPermissionType`` +- ``ORKSensorPermissionType`` +- ``SRSensor`` +- ``ORKPermissionMask`` +- ``ORKNotificationPermissionType`` +- ``ORKRequestPermissionsStep`` +- ``ORKBiologicalSexIdentifier`` +- ``ORKBloodTypeIdentifier`` + +### Consent and completion steps + +- ``ORKConsentReviewStep`` +- ``ORKConsentSharingStep`` +- ``ORKCompletionStep`` + +### Custom steps + +- ``ORKCustomStep`` + +### Family History + +- ``ORKFamilyHistoryStep`` +- ``ORKConditionStepConfiguration`` +- ``ORKHealthCondition`` +- ``ORKRelatedPerson`` +- ``ORKRelativeGroup`` + +### Form steps + +- ``ORKFormStep`` +- ``ORKBodyItem`` +- ``ORKBulletType`` +- ``ORKBodyItemStyle`` +- ``ORKFormItem`` +- ``ORKNoAnswer`` +- ``ORKDontKnowAnswer`` +- ``ORKDontKnowButtonStyle`` +- ``ORKCardViewStyle`` +- ``ORKLearnMoreItem`` + +### Image and 3D model steps + +- ``ORKFrontFacingCameraStep`` +- ``ORKImageCaptureStep`` + +### Location steps + +- ``ORKLocation`` +- ``ORKLocationPermissionType`` + +### Passcode steps + +- ``ORKPasscodeStep`` +- ``ORKPasscodeFlow`` +- ``ORKPasscodeType`` + +### PDF and page steps + +- ``ORKPDFViewerStep`` +- ``ORKPageStep`` +- ``ORKPDFViewerActionBarOption`` + +### Question and instruction steps + +- ``ORKQuestionStep`` +- ``ORKInstructionStep`` +- ``ORKLearnMoreInstructionStep`` +- ``ORKNavigablePageStep`` + +### Registration steps + +- ``ORKRegistrationStep`` +- ``ORKRegistrationStepOption`` +- ``ORKRegistrationFormItemIdentifierDOB`` +- ``ORKRegistrationFormItemIdentifierEmail`` +- ``ORKRegistrationFormItemIdentifierFamilyName`` +- ``ORKRegistrationFormItemIdentifierGender`` +- ``ORKRegistrationFormItemIdentifierGivenName`` +- ``ORKRegistrationFormItemIdentifierPassword`` +- ``ORKRegistrationFormItemIdentifierPhoneNumber`` + +### Review steps + +- ``ORKReviewStep`` + +### Step recording + +- ``ORKRecorder`` +- ``ORKRecorderDelegate`` +- ``ORKFileProtectionMode`` + +### Table steps + +- ``ORKTableStep`` +- ``ORKTableStepSource`` + +### Video steps + +- ``ORKVideoCaptureStep`` +- ``ORKVideoInstructionStep`` + +### Vision steps + +- ``ORKAmslerGridEyeSide`` + +### Wait steps + +- ``ORKWaitStep`` + +### Web steps + +- ``ORKWebViewStep`` + +### Other steps + +- ``ORKSecondaryTaskStep`` +- ``ORKSkipStepNavigationRule`` diff --git a/ResearchKit/ResearchKit.docc/API Collections/Surveys.md b/ResearchKit/ResearchKit.docc/API Collections/Surveys.md new file mode 100644 index 0000000000..4b72500fa7 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Surveys.md @@ -0,0 +1,14 @@ +# Surveys + +Construct surveys that ask a wide range of questions. + +## Topics + +### Survey creation + +- ``ORKFormStep`` +- ``ORKFormItem`` + +### Answer formats + +- diff --git a/ResearchKit/ResearchKit.docc/API Collections/Tasks.md b/ResearchKit/ResearchKit.docc/API Collections/Tasks.md new file mode 100644 index 0000000000..de05362f06 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/API Collections/Tasks.md @@ -0,0 +1,50 @@ +# Tasks + +Build research apps to collect information. + +## Overview + +A task can be a simple ordered sequence of steps, or be dynamic with previous results informing what your app presents next. The task view controller supports saving task progress and restoring it along with the UI state. This prevents data loss if the user switches out of your app in the middle of a task. + +## Topics + +### Essentials + +- ``ORKTask`` +- ``ORKOrderedTask`` +- ``ORKNavigableOrderedTask`` + +### Audio + +- ``ORKAudioRecorderConfiguration`` + +### Dexterity + +- ``ORKPredefinedTaskHandOption`` +- ``ORKPredefinedTaskOption`` +- ``ORKPredefinedTaskLimbOption`` +- ``ORKPSATPresentationMode`` +- ``ORKTrailMakingTypeIdentifier`` +- ``ORKTremorActiveTaskOption`` + +### Navigation + +- ``ORKStepNavigationRule`` +- ``ORKDirectStepNavigationRule`` +- ``ORKFormItemVisibilityRule`` +- ``ORKNavigableOrderedTask`` +- ``ORKPredicateFormItemVisibilityRule`` +- ``ORKPredicateSkipStepNavigationRule`` +- ``ORKPredicateStepNavigationRule`` +- ``ORKStepModifier`` +- ``ORKResultPredicateTaskIdentifierVariableName`` +- ``ORKNullStepIdentifier`` +- ``ORKKeyValueStepModifier`` +- ``ORKResultPredicate`` +- ``ORKResultSelector`` + +### Progress tracking + +- ``ORKTaskProgress`` +- ``ORKTaskTotalProgress`` +- ``ORKProgressIndicatorType`` diff --git a/ResearchKit/ResearchKit.docc/Info.plist b/ResearchKit/ResearchKit.docc/Info.plist new file mode 100644 index 0000000000..1e25f9eefe --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleName + ResearchKit + CFBundleDisplayName + ResearchKit + CFBundleIdentifier + com.apple.ResearchKit + CFBundleDevelopmentRegion + en + CFBundleIconFile + DocumentationIcon + CFBundleIconName + DocumentationIcon + CFBundlePackageType + DOCS + CFBundleShortVersionString + 0.1.0 + CFBundleVersion + 0.1.0 + + diff --git a/ResearchKit/ResearchKit.docc/ResearchKit.md b/ResearchKit/ResearchKit.docc/ResearchKit.md new file mode 100644 index 0000000000..af95ed594f --- /dev/null +++ b/ResearchKit/ResearchKit.docc/ResearchKit.md @@ -0,0 +1,56 @@ +# ``ResearchKit`` + +Create apps that securely collect information for research. + +## Overview + +ResearchKit is open source software for developers and researchers that +leverages iPhone sensors and capabilities to track movement, take measurements, and +record data. People can perform activities and generate data from anywhere. + +There are three customizable components that address +common elements of research: *consent*, *surveys*, and *active tasks*. You can use these components as they +are, build on them, and even create completely new components of your own. Whether your app is obtaining consent, giving instructions, or presenting a +form or survey, every task in ResearchKit is a collection of steps. + +Consent provides customizable templates that explain study details and +obtain participant consent. Clarifying exactly what information you collect from people, and who +can access that information is crucial to help protect participant privacy. + +Surveys have a predefined user interface so you can quickly build screens with +questions and types of answers. The survey component is localized, so you just need +to support localization for your questions. + +Active tasks invite people to perform activities in their own environment using +iPhone sensors to actively collect data. This is important for studies that require the data-collection +capabilities of frameworks such as HealthKit and CoreMotion. + +## Topics + +### Essentials + +- +- +- +- + +### Research components + +- +- +- + +### Articles + +- +- +- +- +- +- + +### Other + +- +- +- diff --git a/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/Conditional-Logic-in-ResearchKit.md b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/Conditional-Logic-in-ResearchKit.md new file mode 100644 index 0000000000..74e701c217 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/Conditional-Logic-in-ResearchKit.md @@ -0,0 +1,115 @@ +# Conditional Logic in ResearchKit + +How to use conditional logic for ResearchKit steps and forms. + +## Understanding Conditional Logic + +When presenting a survey or task, conditionally show specific content based on the participant's responses. ResearchKit provides two solutions for conditional logic. + +- **Step Navigation rules**: Conditionally navigate to a specific step based on the participant's response. +- **Form Item Visibility rules** - Conditionally hide or show specific form questions based on results from the same form or a form within another step. + + + +### Navigating Steps Conditionally +Review the following classes to conditionally navigate to or skip specific steps during an `ORKTask`. + +- `ORKResultSelector` - A class that identifies a result within a set of task results. +- `ORKResultPredicate` - Creates a predicate by accepting an `ORKResultSelector` and the expected result. +- `ORKPredicateStepNavigationRule` - A class that determines what step to navigate to if a given `ORKResultPredicate` is true. +- `ORKNavigableOrderedTask` - A subclass of the `ORKOrderedTask` that can accept one or more `ORKPredicateStepNavigationRule` objects and apply the expected conditional navigation. + + +The task for this example includes the steps seen below. + +![Step 1](conditional-logic-in-researchKit-step1) +![Step 2](conditional-logic-in-researchKit-step2) +![Step 3](conditional-logic-in-researchKit-step3) + +The conditional logic is based on answering `Yes` or `No` for the first question ("Do you like Apples?"): + +- **Answering yes**: navigates to the second screen to select your favorite apple. +- **Answering no**: skips the second screen and navigates directly to the completion step. + +```swift + +//Construct Steps +let boolFormStep = ORKFormStep(identifier: "FormStep1") +boolFormStep.title = "Apple Task" +boolFormStep.text = "Please answer the following question." + +let boolAnswerFormat = ORKAnswerFormat.booleanAnswerFormat() +let boolFormItem = ORKFormItem(identifier: "BooleanFormItemIdentifier", + text: "Do you like Apples?", + answerFormat: boolAnswerFormat) + +boolFormStep.formItems = [boolFormItem] + +let appleTextChoiceFormStep = appleTextChoiceFormStepExample() +let completionStep = completionStepExample() + +//Conditional Logic +let boolResultSelector = ORKResultSelector(stepIdentifier: boolFormStep.identifier, resultIdentifier: boolFormItem.identifier) +let boolResultPredicate = ORKResultPredicate.predicateForBooleanQuestionResult(with: boolResultSelector, expectedAnswer: false) +let navigationRule = ORKPredicateStepNavigationRule(resultPredicatesAndDestinationStepIdentifiers: [ (boolResultPredicate, completionStep.identifier) ]) + +//Construct Navigable Task + Set Navigation Rule +let navigableTask = ORKNavigableOrderedTask(identifier: "NavigableTaskIdentifier", steps: [formStep1, appleTextChoiceFormStep, completionStep]) +navigableTask.setNavigationRule(navigationRule, forTriggerStepIdentifier: formStep1.identifier) +``` + +Selecting yes: + +@Video(source: "conditional-logic-in-researchKit-step-yes") + +Selecting no: + +@Video(source: "conditional-logic-in-researchKit-step-no") + +### Managing Form Item Visibility + +Familiarize yourself with the following classes to conditionally hide or show a question based on results from questions within the same form. + +- `ORKResultSelector` - A class that identifies a result within a set of task results. +- `ORKResultPredicate` - Creates a predicate by accepting an `ORKResultSelector` and the expected result. +- `ORKPredicateFormItemVisibilityRule` - A class that determines if the form item it's attached to is hidden or visible if a given `ORKResultPredicate` is true. + +Following the previous example, use the same questions but now with both on the same page. + + +- **Answering yes**: makes the apple choice question visible. +- **Answering no**: hides the apple choice question if visible. + + +```swift +//Construct FormStep +let formStep = ORKFormStep(identifier: "FormStep1") +formStep.title = "Apple Task" +formStep.text = "Please answer the following question." + +let boolAnswerFormat = ORKAnswerFormat.booleanAnswerFormat() +let boolFormItem = ORKFormItem(identifier: "BooleanFormItemIdentifier", + text: "Do you like Apples?", + answerFormat: boolAnswerFormat) + + +let appleChoiceFormItem = appleChoiceFormItem() + +formStep.formItems = [boolFormItem, appleChoiceFormItem] + +let completionStep = completionStepExample() + +//Conditional Logic +let resultSelector: ORKResultSelector = .init(stepIdentifier: formStep.identifier, resultIdentifier: boolFormItem.identifier) +let predicate = ORKResultPredicate.predicateForBooleanQuestionResult(with: resultSelector, expectedAnswer: true) +let visibilityRule = ORKPredicateFormItemVisibilityRule(predicate: predicate) + +appleChoiceFormItem.visibilityRule = visibilityRule + +//Construct Navigable Task + let navigableTask = ORKNavigableOrderedTask(identifier: "NavigableTaskIdentifier", steps: [formStep, completionStep]) +``` + +Selecting yes & no: + +@Video(source: "conditional-logic-in-researchKit-formItem-yes-no") diff --git a/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-formItem-yes-no.mov b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-formItem-yes-no.mov new file mode 100644 index 0000000000..2476c33b8d Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-formItem-yes-no.mov differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step-no.mov b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step-no.mov new file mode 100644 index 0000000000..a156b213c7 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step-no.mov differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step-yes.mov b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step-yes.mov new file mode 100644 index 0000000000..71fe719d3c Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step-yes.mov differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step1@3x.png b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step1@3x.png new file mode 100644 index 0000000000..0ba840de97 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step1@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step2@3x.png b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step2@3x.png new file mode 100644 index 0000000000..ee81a02352 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step2@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step3@3x.png b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step3@3x.png new file mode 100644 index 0000000000..4fc4889eb3 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Conditional-Logic-in-ResearchKit/conditional-logic-in-researchKit-step3@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Configurations/Configurations.md b/ResearchKit/ResearchKit.docc/Resources/Configurations/Configurations.md new file mode 100644 index 0000000000..93c1af768f --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Configurations/Configurations.md @@ -0,0 +1,27 @@ +# Configurations + +Provide collection and presentation information to a step. + +## Topics + +### Active step configurations + +- ``ORKAccelerometerRecorderConfiguration`` +- ``ORKDeviceMotionRecorderConfiguration`` +- ``ORKLocationRecorderConfiguration`` +- ``ORKPedometerRecorderConfiguration`` +- ``ORKRecorderConfiguration`` +- ``ORKStreamingAudioRecorderConfiguration`` + + +### Early termination configuration + +- ``ORKEarlyTerminationConfiguration`` + +### Data types + +- ``ORKCGFloatDefaultValue`` + +### Style selection + +- ``ORKNavigationContainerButtonStyle`` diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/Creating-Surveys.md b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/Creating-Surveys.md new file mode 100644 index 0000000000..86f932ff63 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/Creating-Surveys.md @@ -0,0 +1,198 @@ +# Creating surveys + +Configure and present surveys with ResearchKit. + +## Overview + +A survey is a sequence of questions that you use to collect data from your users. In a ResearchKit app, a survey is composed of a survey task that has a collection of step objects (``ORKStep``). ``ORKFormStep`` instances can be added to the collection of steps to handle one or more questions each such as "What medications are you taking?" or "How many hours did you sleep last night?". + +You can collect results for the individual steps or for the task as a whole. There are two types of survey tasks: an ordered task (``ORKOrderedTask``) and a navigable ordered task (``ORKNavigableOrderedTask``) which can be used to apply conditional logic. + +In an ordered task, the order that the steps appear are always the same. + + +![Ordered Tasks](creating-surveys-ordered-tasks) + +In a navigable ordered task, the order of the tasks can change, or branch out, depending on how the user answered a question in a previous task. + +![Navigable Ordered Tasks](creating-surveys-navigable-ordered-tasks) + +The steps for creating a task to present a survey are: + +1. Create one or more steps +2. Create a task +3. Collect results + +## 1. Create steps + +The survey module provides a form step that can contain one or more questions +(``ORKFormStep``). You can also use an instruction step +(``ORKInstructionStep``) or a video instruction step (``ORKVideoInstructionStep``) to introduce the survey or provide instructions. + +### Instruction step + +An instruction step explains the purpose of a task and provides +instructions for the user. An ``ORKInstructionStep`` object includes an +identifier, title, text, detail text, and an image. An +instruction step doesn't collect any data and yields an empty +``ORKStepResult`` that records how long the instruction was +on screen. + +```swift +let instructionStep = ORKInstructionStep(identifier: "identifier") +instructionStep.title = "Selection Survey" +instructionStep.text = "This survey helps us understand your eligibility for the fitness study." +``` + +Creating a step as shown in the code above, including it in a task, and presenting with a task view controller, yields something like this: + +![Instruction Step](creating-surveys-instruction-step) + +### Form Step + +Whether your survey has one question or several related questions, you can use a form step (``ORKFormStep``) to present them on one page. Each question in a form step is represented as a form item (``ORKFormItem``), each with its +own answer format. + +The result of a form step contains one question result for each form +item. The results are matched to their corresponding form items using +their identifier property. + +The following code shows how to create a form that requests some basic details: + + +```swift +let sectionHeaderFormItem = ORKFormItem(sectionTitle: "Basic Information") +let nameFormItem = ORKFormItem(identifier: "NameIdentifier", text: "What is your name?", answerFormat: ORKTextAnswerFormat()) +let emailFormItem = ORKFormItem(identifier: "EmailIdentifier", text: "What is your email?", answerFormat: ORKEmailAnswerFormat()) +let headacheFormItem = ORKFormItem(identifier: "HeadacheIdentifier", text: "Do you have a headache?", answerFormat: ORKBooleanAnswerFormat()) + +let formStep = ORKFormStep(identifier: "FormStepIdentifier") +formStep.title = "Basic Information" +formStep.detailText = "please answer the questions below" +formStep.formItems = [sectionHeaderFormItem, nameFormItem, emailFormItem, headacheFormItem] +``` + +The code above creates this form step: + +![Form Step](creating-surveys-form-step) + +### Answer Formats + +In the ResearchKit™ framework, an answer format defines how the user should be asked to +answer a question or an item in a form. For example, consider a +survey question such as "On a scale of 1 to 10, how much pain do you +feel?" The answer format for this question would naturally be a +discrete scale on that range, so you can use scale answer format (``ORKScaleAnswerFormat``), +and set its minimum and maximum +properties to reflect the desired range. + +The screenshots below show the standard answer formats that the ResearchKit framework provides. + +| | | +|---|---| +| ![Background Check Question](creating-surveys-background-check) | ![Blood Type Question](creating-surveys-blood-type) | +| ![Symptoms Question](creating-surveys-symptom-choice) | ![Age Question](creating-surveys-age) | +| ![Time of Day Question](creating-surveys-time-of-day) | ![Next Meeting Question](creating-surveys-next-meeting) | +| ![Text Entry Question](creating-surveys-feeling-text-entry) | ![Mood Question](creating-surveys-slider) | +| ![Email Question](creating-surveys-email) | ![Location Question](creating-surveys-location) | + +## 2. Create a survey task + +Once you create one or more steps, create an ``ORKOrderedTask`` object to +contain the steps. The code below shows the steps created above being added to a task. + +```swift +// Create a task wrapping the instruction and form steps created earlier. +let orderedTask = ORKOrderedTask(identifier: "OrderedTaskIdentifier", steps: [instructionStep, formStep]) +``` + + +You must assign a string identifier to each step. The step identifier must be unique within the task, because it's the key that connects a step in the task hierarchy with the step result in the result hierarchy. + +To present the task, attach it to a task view controller and present +it. The code below shows how to create a task view controller and present it modally. + +```swift +let taskViewController = ORKTaskViewController(task: task, taskRun: nil) +taskViewController.delegate = self + +present(taskViewController, animated: true) +``` + +## 3. Collect Results +The result property of the task view controller gives you the results of the task. +Each step view controller that the user views produces a step result +(``ORKStepResult``). The task view controller collates these results as +the user navigates through the task, in order to produce an +``ORKTaskResult``. + +Both the task result and step result are collection results, in that +they can contain other result objects. For example, a task result contains an array of step results. + +The results contained in a step result vary depending on the type of +step. For example, a form step produces one question result for +every form item; and an active task with recorders generally produces +one result for each recorder. + +The hierarchy of results corresponds closely to the input +model hierarchy of task and steps as you can see here: + +![Results Hierarchy](creating-surveys-results-hierarchy) + +Among other properties, every result has an identifier. This +identifier is what connects the result to the model object (task, +step, form item, or recorder) that produced it. Every result also +includes start and end times, using the startDate and endDate +properties respectively. Use these properties to infer how long the user +spent on the step. + + +#### Saving Results on Task Completion + +After a task is completed, you can save or upload the results. This approach +will likely include serializing the result hierarchy in some form, +either using the built-in `NSSecureCoding` support, or another +format appropriate for your application. + +If your task can produce file output, the files are generally referenced by an ``ORKFileResult`` object and they are placed in the output directory that you set on the task view controller. After you complete a task, one implementation might be to serialize the result hierarchy into the output directory, compress the entire output +directory, and share it. + +In the following example, the result is archived with +`NSKeyedArchiver` on successful completion. If you choose to support +saving and restoring tasks, the user may save the task. This +example also demonstrates how to obtain the restoration data that +would later be needed to restore the task. + +```swift + func taskViewController(_ taskViewController: ORKTaskViewController, + didFinishWith reason: ORKTaskFinishReason, + error: Error?) { + switch reason { + case .completed: + // Archive the result object first + do { + let data = try NSKeyedArchiver.archivedData(withRootObject: taskViewController.result, + requiringSecureCoding: true) + // Save the data to disk with file protection + // or upload to a remote server securely. + + // If any file results are expected, also zip up the outputDirectory. + } catch { + print("error archiving result data: \(error.localizedDescription)") + } + + break; + case .failed, .discarded, .earlyTermination: + // Generally, discard the result. + // Consider clearing the contents of the output directory. + break; + case .saved: + let data = taskViewController.restorationData + // Store the restoration data persistently for later use. + // Normally, keep the output directory for when you will restore. + break; + } + + taskViewController.dismiss(animated: true, completion: nil) +} +``` diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-age@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-age@3x.png new file mode 100644 index 0000000000..75ce34ad47 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-age@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-background-check@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-background-check@3x.png new file mode 100644 index 0000000000..afd5d0a55b Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-background-check@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-blood-type@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-blood-type@3x.png new file mode 100644 index 0000000000..fe4565f5a0 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-blood-type@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-email@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-email@3x.png new file mode 100644 index 0000000000..97d5c04dbc Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-email@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-feeling-text-entry@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-feeling-text-entry@3x.png new file mode 100644 index 0000000000..f638224e30 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-feeling-text-entry@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-form-step@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-form-step@3x.png new file mode 100644 index 0000000000..daf99a6d46 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-form-step@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-instruction-step@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-instruction-step@3x.png new file mode 100644 index 0000000000..6b48a9f690 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-instruction-step@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-location@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-location@3x.png new file mode 100644 index 0000000000..55b0b1c649 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-location@3x.png differ diff --git a/docs/Survey/SurveyImages/NavigableOrderedTasks.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-navigable-ordered-tasks@2x.png similarity index 100% rename from docs/Survey/SurveyImages/NavigableOrderedTasks.png rename to ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-navigable-ordered-tasks@2x.png diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-next-meeting@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-next-meeting@3x.png new file mode 100644 index 0000000000..ec1f155d67 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-next-meeting@3x.png differ diff --git a/docs/Survey/SurveyImages/OrderedTasks.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-ordered-tasks@1x.png similarity index 100% rename from docs/Survey/SurveyImages/OrderedTasks.png rename to ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-ordered-tasks@1x.png diff --git a/docs/Survey/SurveyImages/ResultsHierarchy.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-results-hierarchy@1x.png similarity index 100% rename from docs/Survey/SurveyImages/ResultsHierarchy.png rename to ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-results-hierarchy@1x.png diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-slider@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-slider@3x.png new file mode 100644 index 0000000000..907cdaf94e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-slider@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-symptom-choice@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-symptom-choice@3x.png new file mode 100644 index 0000000000..64bc43b346 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-symptom-choice@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-time-of-day@3x.png b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-time-of-day@3x.png new file mode 100644 index 0000000000..13ff2e6fb5 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Creating-Surveys/creating-surveys-time-of-day@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/Family-History-Step.md b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/Family-History-Step.md new file mode 100644 index 0000000000..b5a7c83ce5 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/Family-History-Step.md @@ -0,0 +1,107 @@ +# Family History Step + +Use the Family History Step to collect insightful health trends. + +## Overview + +Accurate family health history is a highly valuable data set that can help patients prepare for or avoid common health conditions they might face in the future. However, obtaining this information has always been a struggle to collect manually and even digitally. Now, with ResearchKit, developers and researchers can quickly construct an ORKFamilyHistoryStep and present a survey to collect data for family health history that is tailored to their specific needs. + +With the ``ORKFamilyHistoryStep`` you can specify: + +- **Relative Types** - Determine the exact type of family members the survey asks about. +- **Survey Questions** - Use the same questions for each relative group or create a different survey for each. +- **Health Conditions** - Include a list of health conditions that can be the same or different for each relative group. +- **Displayed Results** - Determine which results are displayed back to the user after completing each relative's survey. + +## Understanding the Family History Step classes + +Before initializing an ``ORKFamilyHistoryStep`` you should familiarize yourself with the classes required. + +- **ORKHealthCondition** - This represents a single health condition presented in your survey. +- **ORKConditionStepConfiguration** - This object provides the information needed for the health conditions list presented to the user. +- **ORKRelativeGroup** - This represents a specific relative group such as Grandparents, Children, or Siblings. +- **ORKRelatedPerson** -This represents a family member added during the survey. Retrieve this object from the result of the ``ORKFamilyHistoryStep``. + +In the next section, we will construct an ``ORKFamilyHistoryStep`` using the classes above. + +## Constructing a Family History Step + +Following the example below, we will recreate the same Family History Step only for the parent group. + +![Instruction Step](family-history-step-instruction-step) +![Family History Step With No Relatives](family-history-step-no-relatives) +![Family History Step With Parent Added](family-history-step-parent-added) + +### Creating Health Condition Objects + +First, create the ``ORKHealthCondition`` objects necessary to display the health conditions specific to your survey. + +```swift + let healthConditions = [ + ORKHealthCondition(identifier: "healthConditionIdentifier1", displayName: "Diabetes", value: "Diabetes" as NSString), + ORKHealthCondition(identifier: "healthConditionIdentifier2", displayName: "Heart Attack", value: "Heart Attack" as NSString), + ORKHealthCondition(identifier: "healthConditionIdentifier3", displayName: "Stroke", value: "Stroke" as NSString) + ] +``` + +### Create Condition Step Configuration + +Next, initialize an ``ORKConditionStepConfiguration`` and add the necessary information, which includes the health conditions array created before this. + +```swift +let conditionStepConfiguration = ORKConditionStepConfiguration(stepIdentifier: "FamilyHistoryConditionStepIdentifier", + conditionsFormItemIdentifier: "HealthConditionsFormItemIdentifier", + conditions: healthConditions, + formItems: []) +``` + +- **stepIdentifier** - When the user is presented with the health conditions to select, they are technically looking at an ``ORKFormStep`` that was initialized by the ``ORKFamilyHistoryStep`` itself. The value you set for this property is the step identifier for the health conditions form step. +- **conditionsFormItemIdentifier** - The string used as the identifier for the health conditions text choice question. Use this identifier to locate each family member's health condition selected in the ORKResult. +- **conditions** - The user will be presented with an individual text choice for each "ORKHealthCondition" in this list. +- **formItems** - Optionally, provide more form items to present additional questions under the health conditions text choices. + +### Create Relative Group + +The last object needed for the family history step is the ``ORKRelativeGroup``. + +```swift +let parentFormStep = ORKFormStep(identifier: "ParentSurveyIdentifier") +parentFormStep.isOptional = false +parentFormStep.title = "Parent" +parentFormStep.detailText = "Answer these questions to the best of your ability." +parentFormStep.formItems = parentFormStepFormItems() + +let parentRelativeGroup = ORKRelativeGroup(identifier: "ParentGroupIdentifier", + name: "Biological Parent", + sectionTitle: "Biological Parents", + sectionDetailText: "Include your blood-related parents.", + identifierForCellTitle: "ParentNameIdentifier", + maxAllowed: 2, + formSteps: [parentFormStep], + detailTextIdentifiers: ["ParentSexAtBirthIdentifier", "ParentVitalStatusIdentifier", "ParentAgeFormItemIdentifier"]) +``` + +### Create Family History Step + +For the last step, we will construct an ``ORKFamilyHistoryStep`` and pass in the initialized objects from above. + +```swift +let familyHistoryStep = ORKFamilyHistoryStep(identifier: "FamilyHistoryStepIdentifier) +familyHistoryStep.title = "Family Health History" +familyHistoryStep.detailText = "The overview of your biological family members can inform health risks and lifestyle." +familyHistoryStep.conditionStepConfiguration = conditionStepConfiguration +familyHistoryStep.relativeGroups = relativeGroups +``` + +### Parsing Family History Step Result + +After presenting the task, parse the ``ORKTaskResult`` to access the ``ORKFamilyHistoryResult``. + + +```swift +guard let stepResult = (taskViewController.result.results?[1] as? ORKStepResult) else { return } + +if let familyHistoryResult = stepResult.results?.first as? ORKFamilyHistoryResult { + let relatedPersons = familyHistoryResult.relatedPersons +} +``` diff --git a/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-instruction-step@3x.png b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-instruction-step@3x.png new file mode 100644 index 0000000000..b323accd7c Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-instruction-step@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-no-relatives@3x.png b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-no-relatives@3x.png new file mode 100644 index 0000000000..77c3a9782c Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-no-relatives@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-parent-added@3x.png b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-parent-added@3x.png new file mode 100644 index 0000000000..b0047aac6f Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Family-History-Step/family-history-step-parent-added@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/Obtaining-Consent.md b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/Obtaining-Consent.md new file mode 100644 index 0000000000..58bf1522da --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/Obtaining-Consent.md @@ -0,0 +1,158 @@ +# Obtaining Consent + +Guide your participants through the Informed Consent process. + +## Overview + +Research studies that involve human subjects typically require some form of ethics review. Depending on the country, an institutional review board (IRB) or an ethics committee (EC) might perform this. Some studies may require informed consent to conduct a research study; the researcher must ensure that each participant is fully informed about the nature of the study, and must obtain a signed consent from each participant. Additionally, app review may require consent. + +The ResearchKit™ framework makes it easy to display your consent document and obtain a participant's signature. If the signature needs to be verifiable and irrevocable, you're responsible for producing a digital signature or generating a PDF to attest to the identity of the participant and the time they signed the form. + +The ResearchKit framework makes obtaining consent easier by providing APIs to help with: + +- **Informing Participants** - `ORKInstructionStep` +- **Reviewing Consent + Signature** - `ORKWebViewStep` +- **Consent Sharing** - `ORKFormStep` +- **PDF Viewing/Sharing** - `ORKPDFViewerStep` + + +## Informing Participants + +When providing informed consent to prospective study participants, it's important to cover the necessary topics pertaining to your study. Here are some common topics usually addressed during informed consent. + +- **Overview** - A brief, concise description of the purpose and goal of the study. +- **Data gathering** - The types of data gathered, where it will be stored, and who will have access to it. +- **Privacy** - How your study ensures privacy is maintained while participating. +- **Data use** - How you intend to use the data collected during this study. +- **Time commitment** - The estimated amount of time a participant should expect to dedicate to your study. +- **Surveys** - The types of surveys and questions you present to the participants. +- **Tasks** - The tasks the participant must complete for the study. +- **Withdrawal** - Information about withdrawal from the study and what happens to the participant's data. + + +Create two instruction steps to present both a 'Welcome' & 'Before You Join' page. + +```swift +// Welcome page. +let welcomeStep = ORKInstructionStep(identifier: String(describing: Identifier.consentWelcomeInstructionStep)) +welcomeStep.iconImage = UIImage(systemName: "hand.wave") +welcomeStep.title = "Welcome!" +welcomeStep.detailText = "Thank you for joining our study. Tap Next to learn more before signing up." + +// Before You Join page. +let beforeYouJoinStep = ORKInstructionStep(identifier: String(describing: Identifier.informedConsentInstructionStep)) +beforeYouJoinStep.iconImage = UIImage(systemName: "doc.text.magnifyingglass") +beforeYouJoinStep.title = "Before You Join" + +let sharingHealthDataBodyItem = ORKBodyItem(text: "The study will ask you to share some of your Health data.", + detailText: nil, + image: UIImage(systemName: "heart.fill"), + learnMoreItem: nil, + bodyItemStyle: .image) + +let completingTasksBodyItem = ORKBodyItem(text: "You will be asked to complete various tasks over the duration of the study.", + detailText: nil, + image: UIImage(systemName: "checkmark.circle.fill"), + learnMoreItem: nil, + bodyItemStyle: .image) + +let signatureBodyItem = ORKBodyItem(text: "Before joining, we will ask you to sign an informed consent document.", + detailText: nil, + image: UIImage(systemName: "signature"), + learnMoreItem: nil, + bodyItemStyle: .image) + +let secureDataBodyItem = ORKBodyItem(text: "Your data is kept private and secure.", + detailText: nil, + image: UIImage(systemName: "lock.fill"), + learnMoreItem: nil, + bodyItemStyle: .image) + +beforeYouJoinStep.bodyItems = [ + sharingHealthDataBodyItem, + completingTasksBodyItem, + signatureBodyItem, + secureDataBodyItem +] +``` + +The instruction steps are presented in Figure 1. + +| | | +|---|---| +| ![Welcome instruction step](obtaining-consent-welcome-step) | ![Before you join instruction step](obtaining-consent-before-you-join-step) | + +## Review consent + +Participants can review the consent in the ``ORKWebViewStep`` as HTML. Depending on your signature requirements, you can also ask participants to write their signature on the same screen. + +Produce the content for consent review by converting the previous instructions steps to HTML, or provide entirely separate review content as custom HTML in the web view step's html property. + +```swift +let instructionSteps = [welcomeStep, beforeYouJoinStep] + +let webViewStep = ORKWebViewStep(identifier: "WebViewStepIdentifier", instructionSteps: instructionSteps) +webViewStep.showSignatureAfterContent = true +return webViewStep +``` +The web view step appears as shown in Figure 2. + +| | | +|---|---| +| ![Review Consent](obtaining-consent-review-1) | ![Provide signature](obtaining-consent-review-2) | + +## Consent sharing + +Apps that use the ResearchKit framework primarily collect data for a specific study. If you want to ask participants to share their data with other researchers, participants must be able to control that decision. + +Use ``ORKFormStep`` to explicitly obtain permission to share participants' data that you collect for your study with other researchers, if allowed by your IRB or EC. To use a form step, include it in a task, just before a consent review step. + +```swift +// Construct the text choices. +let textChoices: [ORKTextChoice] = [ORKTextChoice(text: "Institution and qualified researchers worldwide", value: 1 as NSNumber), + ORKTextChoice(text: "Only institution and its partners", value: 2 as NSNumber)] +let textChoiceAnswerFormat = ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: textChoices) + +// Construct a form item for text choices. +let textChoiceFormItem = ORKFormItem(identifier: "TextChoiceFormItem", text: "Who would you like to share your data with?", answerFormat: textChoiceAnswerFormat) + +// Construct the form step. +let formStepText = "Institution and its partners will receive your study data from your participation in this study.\n \nSharing your coded study data more broadly (without information such as your name) may benefit this and future research." +let formStep = ORKFormStep(identifier: "ConsentSharingFormStepIdentifier", title: "Sharing Options", text: formStepText) +formStep.formItems = [textChoiceFormItem] + +return formStep +``` + +The form step is in Figure 3. + +![Consent sharing](obtaining-consent-sharing) + +## Enhanced PDF Viewing + +Providing clear and concise material for the user to review is an important part of the data collection process. With ``ORKPDFViewerStep``, the user can view a PDF in detail, perform text search, and mark up sections of the document. Other available features include viewing the pages of the PDF as thumbnails for quick perusal, printing, and saving the document. + +When the ``ORKTask`` is finished, use ``ORKHTMLPDFWriter`` to store the web view step's html as a PDF then view it later with the ``ORKPDFViewerStep``. + +```swift +guard let stepResult = taskViewController.result.result(forIdentifier: "WebViewStepIdentifier") as? ORKStepResult else { + return +} + +if let webViewStepResult = stepResult.results?.first as? ORKWebViewStepResult, let html = webViewStepResult.htmlWithSignature { + let htmlFormatter = ORKHTMLPDFWriter() + + htmlFormatter.writePDF(fromHTML: html) { data, error in + let pdfURL = FileManager.default.temporaryDirectory + .appendingPathComponent("consentTask") + .appendingPathExtension("pdf") + try? data.write(to: pdfURL) + } +} +``` + +The PDF viewer step is in Figure 4. + +| | | +|---|---| +| ![PDF page 1](obtaining-consent-pdf-1) | ![PDF page 2](obtaining-consent-pdf-2) | diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-before-you-join-step@3x.png b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-before-you-join-step@3x.png new file mode 100644 index 0000000000..6bc9b8499a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-before-you-join-step@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-pdf-1@3x.png b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-pdf-1@3x.png new file mode 100644 index 0000000000..ba759a0a4d Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-pdf-1@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-pdf-2@3x.png b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-pdf-2@3x.png new file mode 100644 index 0000000000..273c16aa14 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-pdf-2@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-review-1@3x.png b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-review-1@3x.png new file mode 100644 index 0000000000..368fcdf895 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-review-1@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-review-2@3x.png b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-review-2@3x.png new file mode 100644 index 0000000000..b24ca77062 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-review-2@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-sharing@3x.png b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-sharing@3x.png new file mode 100644 index 0000000000..c7765788ce Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-sharing@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-welcome-step@3x.png b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-welcome-step@3x.png new file mode 100644 index 0000000000..8cf6992845 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Obtaining-Consent/obtaining-consent-welcome-step@3x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/Setting-up-Your-Project-to-Use-ResearchKit.md b/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/Setting-up-Your-Project-to-Use-ResearchKit.md new file mode 100644 index 0000000000..5291f95951 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/Setting-up-Your-Project-to-Use-ResearchKit.md @@ -0,0 +1,49 @@ +# Setting up your project to use ResearchKit + +Add the ResearchKit framework to your app as a dynamic framework + +## Overview + +ResearchKit is an open source framework and is not shipped with native IOS. To use it, you can embed ResearchKit into your app as dynamic framework. + +### Installation + +Clone the latest stable version of ResearchKit. + +``` +git clone -b stable https://github.com/ResearchKit/ResearchKit.git +``` + +Or, for the latest changes, use the main branch: + +``` +git clone https://github.com/ResearchKit/ResearchKit.git +``` + +### Add the ResearchKit framework to your app + +To get started, drag ResearchKit.xcodeproj from your checkout into your iOS app project in Xcode: + +![drag ResearchKit.xcodeproj from your checkout](setting-up-your-project-to-use-researchkit-1) + + +Embed the ResearchKit framework as a dynamic framework in your app by adding it to the Embedded Binaries section of the General pane for your target as shown in the figure below. + +![Embed the ResearchKit framework as a dynamic framework](setting-up-your-project-to-use-researchkit-2) + +### Import the correct modules + +If you only want to present Consent and Survey UI, import ResearchKit & ResearchKitUI. + +```swift +import ResearchKit +import ResearchKitUI +``` + +If you also want to use ResearchKit Active Tasks, import ResearchKitActiveTask + +```swift +import ResearchKit +import ResearchKitUI +import ResearchKitActiveTask +``` diff --git a/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/setting-up-your-project-to-use-researchkit-1@1x.png b/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/setting-up-your-project-to-use-researchkit-1@1x.png new file mode 100644 index 0000000000..b20f3091eb Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/setting-up-your-project-to-use-researchkit-1@1x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/setting-up-your-project-to-use-researchkit-2@1x.png b/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/setting-up-your-project-to-use-researchkit-2@1x.png new file mode 100644 index 0000000000..3245b3d342 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Setting-up-Your-Project-to-Use-ResearchKit/setting-up-your-project-to-use-researchkit-2@1x.png differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Steps-Tasks-Results/Steps-Tasks-Results.md b/ResearchKit/ResearchKit.docc/Resources/Steps-Tasks-Results/Steps-Tasks-Results.md new file mode 100644 index 0000000000..f8db4bb469 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Steps-Tasks-Results/Steps-Tasks-Results.md @@ -0,0 +1,15 @@ +# Steps, tasks, and results + +Design and create research-centered apps that guide the participant. + +## Overview + +In ResearchKit, you collect information by having participants complete a *task* such as walking or listening to audio. To complete a task, participants perform a series of discrete *steps*. You can build a task to perform the same steps over and over, or change steps dynamically so a previous result informs what appears next. You collect data from tasks using *results*. A result can represent how the task was performed, or whether the participant successfuly completed it. + +## Topics + +### Data collection and analysis + +- +- +- diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-1@3x.PNG new file mode 100644 index 0000000000..d478cd60c8 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-2@3x.PNG new file mode 100644 index 0000000000..31aa8abbb9 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-3@3x.PNG new file mode 100644 index 0000000000..14686ba7b2 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-4@3x.PNG new file mode 100644 index 0000000000..369ebde587 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-5@3x.PNG new file mode 100644 index 0000000000..4a96decceb Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-6@3x.PNG new file mode 100644 index 0000000000..d6e9e58ad8 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AmslerGridImages/amsler-grid-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-1@3x.PNG new file mode 100644 index 0000000000..20a9453ad3 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-2@3x.PNG new file mode 100644 index 0000000000..82f1fa1249 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-3@3x.PNG new file mode 100644 index 0000000000..7d02c9e116 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-4@3x.PNG new file mode 100644 index 0000000000..da1a78e934 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-5@3x.PNG new file mode 100644 index 0000000000..115071b8f5 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/AudioTaskImages/audio-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-1@3x.PNG new file mode 100644 index 0000000000..950ef47318 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-2@3x.PNG new file mode 100644 index 0000000000..607fc6e841 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-3@3x.PNG new file mode 100644 index 0000000000..8b093e7b9a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/EnvironmentSPLImages/spl-meter-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-1@3x.PNG new file mode 100644 index 0000000000..12d7ed17c5 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-2@3x.PNG new file mode 100644 index 0000000000..5b7358a4bf Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-3@3x.PNG new file mode 100644 index 0000000000..7d32a34929 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-4@3x.PNG new file mode 100644 index 0000000000..6e9a4954e9 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-5@3x.PNG new file mode 100644 index 0000000000..048f1b0a21 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-6@3x.PNG new file mode 100644 index 0000000000..8d9c7e3a99 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-7@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-7@3x.PNG new file mode 100644 index 0000000000..5a8cad90b3 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/FitnessTaskImages/fitness-task-7@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-1@3x.PNG new file mode 100644 index 0000000000..a3a6b21a26 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-2@3x.PNG new file mode 100644 index 0000000000..c6c303753d Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-3@3x.PNG new file mode 100644 index 0000000000..8216325c97 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-4@3x.PNG new file mode 100644 index 0000000000..508e440aad Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-5@3x.PNG new file mode 100644 index 0000000000..3d758add42 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-6@3x.PNG new file mode 100644 index 0000000000..700d667a21 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-7@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-7@3x.PNG new file mode 100644 index 0000000000..72e405123b Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/HolePegTaskImages/hole-peg-task-7@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-1@3x.PNG new file mode 100644 index 0000000000..4949dde5d7 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-2@3x.PNG new file mode 100644 index 0000000000..1aa098620e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-3@3x.PNG new file mode 100644 index 0000000000..257de98840 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-4@3x.PNG new file mode 100644 index 0000000000..f796074040 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/KneeRangeOfMotionTaskImages/knee-range-of-motion-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-1@3x.PNG new file mode 100644 index 0000000000..a80bf3300f Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-2@3x.PNG new file mode 100644 index 0000000000..719a805a02 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-3@3x.PNG new file mode 100644 index 0000000000..bb086fc920 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-4@3x.PNG new file mode 100644 index 0000000000..b477a10920 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-5@3x.PNG new file mode 100644 index 0000000000..2fb9e13b30 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/PsatTaskImages/psat-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-1@3x.PNG new file mode 100644 index 0000000000..6bebce3aee Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-2@3x.PNG new file mode 100644 index 0000000000..a6740091c2 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-3@3x.PNG new file mode 100644 index 0000000000..4a6218b0b6 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-4@3x.PNG new file mode 100644 index 0000000000..c4fec2550a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ReactionTimeTaskImages/reaction-time-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-1@3x.PNG new file mode 100644 index 0000000000..17a3a6459a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-2@3x.PNG new file mode 100644 index 0000000000..46e882be0e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-3@3x.PNG new file mode 100644 index 0000000000..63d76a6ca0 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-4@3x.PNG new file mode 100644 index 0000000000..1b29cc07ce Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-5@3x.PNG new file mode 100644 index 0000000000..81c66214e9 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-6@3x.PNG new file mode 100644 index 0000000000..529af2305d Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-7@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-7@3x.PNG new file mode 100644 index 0000000000..26808cb7a2 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ShortWalkTaskImages/short-walk-task-7@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-1@3x.PNG new file mode 100644 index 0000000000..5676932ef7 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-2@3x.PNG new file mode 100644 index 0000000000..d08fa5766b Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-3@3x.PNG new file mode 100644 index 0000000000..4ae9b6960e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-4@3x.PNG new file mode 100644 index 0000000000..c2100e2627 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpatialSpanMemoryTaskImages/spatial-span-memory-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-1@3x.PNG new file mode 100644 index 0000000000..6e1103f1b0 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-2@3x.PNG new file mode 100644 index 0000000000..88788aaca8 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-3@3x.PNG new file mode 100644 index 0000000000..ba26700956 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-4@3x.PNG new file mode 100644 index 0000000000..f40929481c Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-5@3x.PNG new file mode 100644 index 0000000000..a0fca14708 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-6@3x.PNG new file mode 100644 index 0000000000..82e33bef77 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechInNoiseImages/speech-in-noise-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-1@3x.PNG new file mode 100644 index 0000000000..1f09515325 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-2@3x.PNG new file mode 100644 index 0000000000..496b51a3f8 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-3@3x.PNG new file mode 100644 index 0000000000..39f1b55a3e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-4@3x.PNG new file mode 100644 index 0000000000..2658055b3e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-5@3x.PNG new file mode 100644 index 0000000000..20c98a472a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/SpeechRecognitionImages/speech-recognition-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-1@3x.PNG new file mode 100644 index 0000000000..4b0783e9c7 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-2@3x.PNG new file mode 100644 index 0000000000..921c58d1ea Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-3@3x.PNG new file mode 100644 index 0000000000..fef3ac183f Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-4@3x.PNG new file mode 100644 index 0000000000..1079fb10b2 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-5@3x.PNG new file mode 100644 index 0000000000..ddefa3ea21 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/StroopTaskImages/stroop-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-1@3x.PNG new file mode 100644 index 0000000000..1d6d1fbf1e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-2@3x.PNG new file mode 100644 index 0000000000..6d6c777fce Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-3@3x.PNG new file mode 100644 index 0000000000..fb557569d8 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-4@3x.PNG new file mode 100644 index 0000000000..40aecc1799 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TOHTaskImages/tower-of-hanoi-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-1@3x.PNG new file mode 100644 index 0000000000..16e20b0a8a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-2@3x.PNG new file mode 100644 index 0000000000..58e283fd21 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-3@3x.PNG new file mode 100644 index 0000000000..ff16714cfb Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-4@3x.PNG new file mode 100644 index 0000000000..7361d9ea1d Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-5@3x.PNG new file mode 100644 index 0000000000..8b299ed914 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-6@3x.PNG new file mode 100644 index 0000000000..a2e7bde453 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-7@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-7@3x.PNG new file mode 100644 index 0000000000..d97d358fa3 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-7@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-8@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-8@3x.PNG new file mode 100644 index 0000000000..150490c5cf Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TimedWalkTaskImages/timed-walk-task-8@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-1@3x.PNG new file mode 100644 index 0000000000..02b8938943 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-2@3x.PNG new file mode 100644 index 0000000000..bfa73946fd Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-3@3x.PNG new file mode 100644 index 0000000000..ee25843f03 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-4@3x.PNG new file mode 100644 index 0000000000..213a572021 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-5@3x.PNG new file mode 100644 index 0000000000..96393d1f06 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-6@3x.PNG new file mode 100644 index 0000000000..e9efb5bbde Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/ToneAudiometryTaskImages/tone-audiometry-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-1@3x.PNG new file mode 100644 index 0000000000..485347ecf7 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-2@3x.PNG new file mode 100644 index 0000000000..5b9a323af2 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-3@3x.PNG new file mode 100644 index 0000000000..d7f689960a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-4@3x.PNG new file mode 100644 index 0000000000..c9ee83ba9f Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-5@3x.PNG new file mode 100644 index 0000000000..09dcb51696 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-6@3x.PNG new file mode 100644 index 0000000000..aa7b7618df Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TrailMakingTaskImages/trail-making-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-1@3x.PNG new file mode 100644 index 0000000000..edce99c290 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-2@3x.PNG new file mode 100644 index 0000000000..9fe886268a Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-3@3x.PNG new file mode 100644 index 0000000000..ecf7223d53 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-4@3x.PNG new file mode 100644 index 0000000000..c7d28c9c31 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-5@3x.PNG new file mode 100644 index 0000000000..b8acfbf215 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-6@3x.PNG new file mode 100644 index 0000000000..85d5b4456e Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/TwoFingerTappingTaskImages/two-finger-tapping-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/Understanding-Active-Tasks.md b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/Understanding-Active-Tasks.md new file mode 100644 index 0000000000..25f59d92f6 --- /dev/null +++ b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/Understanding-Active-Tasks.md @@ -0,0 +1,435 @@ +# Understanding Active Tasks + +Learn more about the Active Tasks provided by ResearchKit™. + +## Overview + +Active tasks invite users to perform activities under partially +controlled conditions while iPhone sensors are used to collect data. +For example, an active task for analyzing gait and balance might ask +the user to walk a short distance, while collecting accelerometer data on the device. + +## Predefined Active Tasks + +ResearchKit includes a number of predefined tasks, which fall into seven categories: motor activities, fitness, cognition, speech, hearing, hand dexterity, and vision. The table below summarizes each task and describes the data it generates. + +Category | Task | Sensor | Data Collected +-------------|------------------------------|-----------------------------------------------|---------------- +Motor Skills | Range of Motion | Accelerometer, Gyroscope | Device Motion +^ | Gait and Balance | Accelerometer, Gyroscope | Device Motion, Pedometer +^ | Tapping Speed | Multi-Touch display, Accelerometer (optional) | Touch Activity +Fitness | Fitness | GPS, Gyroscope | Device motion, Pedometer, Location, Heart rate +^ | Timed Walk | GPS, Gyroscope | Device motion, Pedometer, Location, Heart rate +Cognition | Spatial Memory | Multi-Touch display, Accelerometer (optional) | Touch Activity, Actual sequences +^ | Stroop Test | Multi-Touch display | User selection, Completion time +^ | Trail Making Test | Multi-Touch display | Completion time, Touch activity +^ | Paced Serial Addition (PSAT) | Multi-Touch display | Addition results from user +^ | Tower of Hanoi | Multi-Touch display | Every move taken by user +^ | Reaction Time | Accelerometer, Gyroscope | Device motion +Speech | Sustained Phonation | Microphone | Uncompressed audio +^ | Speech Recognition | Microphone | Raw audio, Transcription, Edited transcript +^ | Speech-in-Noise | Microphone | Raw audio, Transcription, Edited transcript, Reception Threshold (SRT) +Hearing | Environment SPL | Microphone | Environment sound pressure level in dBA +^ | Tone Audiometry | AirPods Headphones | Minimum amplitude recognized by the user +^ | DBHL Tone Audiometry | AirPods Headphones | Hearing threshold in dB HL scale +Hand Dexterity | 9-Hole Peg | Multi-Touch display | Completion time, Move distance +Vision | Amsler Grid | Multi-Touch display | Touch activity, Eye side, Areas of distortion annotated by the user + + +You can disable the instruction or completion steps that are automatically +included in the framework by passing appropriate options when you create an active task. See the +`ORKPredefinedTaskOption` constants for the available options. + +You can use options flags to exclude data collection for data types that are not needed for your study. For example, to perform the fitness task without recording heart rate data, use the `ORKPredefinedTaskOptionExcludeHeartRate` option. + +## Range of Motion +In the range of motion task, participants follow movement instructions while accelerometer and gyroscope data is captured to measure flexed and extended positions for the knee or shoulder. Range of motion steps for the knee are shown in Figure 1. + + +| | | +|------------------------------------------------------------------|-----------------------------------------------------| +| ![Instruction step introducing the task](knee-range-of-motion-1) | ![A touch anywhere step](knee-range-of-motion-2) | +| ![A further touch anywhere step](knee-range-of-motion-3) | ![Confirms task completion](knee-range-of-motion-4) | + +Figure 1. Range of motion steps for the right knee + +## Gait and Balance + +In the gait and balance task, +the user walks for a short distance, which may be indoors. You might +use this semi-controlled task to collect objective measurements that +can be used to estimate stride length, smoothness, sway, and other +aspects of the participant's walking. + +Gait and balance steps are shown in Figure 2. + +| | | +|---------------------------------------------------------------------|-------------------------------------------------------------| +| ![Instruction step introducing the task](short-walk-task-1) | ![Instruction step introducing the task](short-walk-task-2) | +| ![Count down a specified duration into the task](short-walk-task-3) | ![Asking user to walk](short-walk-task-4) | +| ![Asking user to walk](short-walk-task-5) | ![Asking user to rest](short-walk-task-6) | +| ![Confirms task completion](short-walk-task-7) + + +Figure 2. Gait and balance steps + +## Tapping Speed + +In the tapping task, the user rapidly alternates between tapping two +targets on the touch screen. The resulting touch data can be used to +assess basic motor capabilities such as speed, accuracy, and rhythm. + +Touch data, and optionally accelerometer data from CoreMotion in iOS, are +collected using public APIs. No analysis is performed by the ResearchKit framework on the data. + +Tapping speed steps are shown in Figure 3. + +| | | +|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| +| ![Instruction step introducing the task](two-finger-tapping-task-1) | ![Providing instruction for the right hand task](two-finger-tapping-task-2) | +| ![The user rapidly taps on the targets using the right hand](two-finger-tapping-task-3) | ![Providing instruction for the left hand task](two-finger-tapping-task-4) | +| ![The user rapidly taps on the targets using the left hand](two-finger-tapping-task-5) | ![Confirms task completion](two-finger-tapping-task-6) | + + +Figure 3. Tapping speed steps + +## Fitness + +In the fitness task, the user walks for a specified duration (usually +several minutes). Sensor data is collected and returned through the +task view controller's delegate. Sensor data can include +accelerometer, device motion, pedometer, location, and heart rate data +where available. + +Toward the end of the walk, if heart rate data is available, the user +is asked to sit down and rest for a period. Data collection continues +during the rest period. + +Fitness steps are shown in Figure 4. + +| | | +|----------------------------------------------------------|-----------------------------------------------------------------------------------------| +| ![Instruction step introducing the task](fitness-task-1) | ![Instruction step introducing the task](fitness-task-2) | +| ![Health access alert](fitness-task-3) | ![Count down a specified duration to begin the task](fitness-task-4) | +| ![Displays distance and heart rate](fitness-task-5) | ![The rest step, which can be skipped if heart rate data is unavailable](fitness-task-6)| +| ![Confirms task completion](fitness-task-7) + +Figure 4. Fitness task + +All of the data is collected from public [CoreMotion](https://developer.apple.com/library/ios/documentation/CoreMotion/Reference/CoreMotion_Reference/index.html) and [HealthKit](https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HealthKit_Framework/) APIs on iOS, and serialized to JSON. No analysis is applied to the data by the ResearchKit framework. + +## Timed Walk +In the timed walk task, the user is asked to walk quickly and safely for a specific distance. The task is immediately administered again by having the user walk the same distance in the opposite direction. The timed walk task differs from both the fitness and the short walk tasks in that the distance walked by the user is fixed. A timed walk task measures the user's lower-extremity function. + +The data collected by this task includes accelerometer, device motion, pedometer data, and location of the user. Note that the location is available only if the user agrees to share their location. +Data collected by the task is in the form of an `ORKTimedWalkResult` object. + +Timed walk steps are shown in Figure 5. + +| | | +|---------------------------------------------------------------|-----------------------------------------------------------------------------| +| ![Instruction step introducing the task](timed-walk-task-1) | ![Gathers information about the user’s assistive device](timed-walk-task-2) | +| ![Instructions on how to perform the task](timed-walk-task-3) | ![Count down a specified duration to begin the task](timed-walk-task-4) | +| ![Actual task screen](timed-walk-task-5) | ![Instruct the user to turn around](timed-walk-task-6) | +| ![Actual task screen](timed-walk-task-7) | ![Task completion](timed-walk-task-8) | + +Figure 5. Timed walk steps + +## Spatial Memory + +In the spatial memory task, +the user is asked to observe and then recall pattern sequences of +increasing length in a game-like environment. The task collects data that +can be used to assess visuospatial memory and executive function. + +The span (that is, the length of the pattern sequence) is automatically varied +during the task, increasing after successful completion of a sequence, +and decreasing after failures, in the range from `minimumSpan` to +`maximumSpan`. The `playSpeed` property lets you control the speed of sequence +playback, and the `customTargetImage` property lets you customize the shape of the tap target. The game finishes when either `maxTests` tests have been +completed, or the user has made `maxConsecutiveFailures` errors in a +row. + +The results collected are scores derived from the game, the details of +the game, and the touch inputs made by the user. + +Spatial memory test steps are shown in Figure 6. + +| | | +|------------------------------------------------------------------------|----------------------------------------------------------------| +| ![Instruction step introducing the task](spatial-span-memory-task-1) | ![Describes what the user must do](spatial-span-memory-task-2) | +| ![The user must recall the sequence](spatial-span-memory-task-3) | ![Confirms task completion](spatial-span-memory-task-4) | + +Figure 6. Spatial memory steps + +## Stroop Test +In the Stroop test, the participant is shown a series of words that are displayed in color, and must select the first letter of the color's name. Stroop test steps are shown in Figure 7. + +| | | +|-------------------------------------------------------------------------|------------------------------------------------------------------------------| +| ![Instruction step introducing the task](stroop-task-1) | ![Further instructions](stroop-task-2) | +| ![Count down a specified duration to begin the activity](stroop-task-3) | ![A typical Stroop test; the correct answer is “Y” for yellow](stroop-task-4)| +| ![Confirms task completion](stroop-task-5) + +Figure 7. Stroop test steps + +## Trail Making Test +In the trail making test, the participant connects a series of labelled circles, in order. The time to complete the test is recorded. The circles can be labelled with sequential numbers (1, 2, 3, ...) or with alternating numbers and letters (1, a, 2, b, 3, c, ...). + +Trail making test steps are shown in Figure 8. + +| | | +|---------------------------------------------------------------|-------------------------------------------------------------------------------| +| ![Instruction step introducing the task](trail-making-task-1) | ![Instruction step introducing the task](trail-making-task-2) | +| ![Further instructions](trail-making-task-3) | ![Count down a specified duration to begin the activity](trail-making-task-4) | +| ![The activity screen, shown mid-task](trail-making-task-5) | ![Confirms task completion](trail-making-task-6) | + +Figure 8. Trail making test steps + +## Paced Serial Addition Test (PSAT) + +The Paced Serial Addition Test (PSAT) task measures the cognitive function that assesses auditory and/or visual information processing speed, flexibility, and the calculation ability of the user. + +Single digits are presented every two or three seconds and the user must add each new digit to the one immediately before. + +There are three variations of this test: + +1. PASAT: Paced Auditory Serial Addition Test - the device speaks the digit every two or three seconds. +2. PVSAT: Paced Visual Serial Addition Test - the device shows the digit on screen. +3. PAVSAT: Paced Auditory and Visual Serial Addition Test - the device speaks the digit and shows it onscreen every two to three seconds. + +The score for the PSAT task is the total number of correct answers out of the number of possible correct answers. Data collected by the task is in the form of an `ORKPSATResult` object. + +PVSAT steps are shown in Figure 9. + +Note that the visual and auditory components of the task are optional. You can choose to include either of them or both. + +| | | +|---------------------------------------------------------------|---------------------------------------------------------------------------------------------------| +| ![Instruction step introducing the task](psat-task-1) | ![Describes what the user must do](psat-task-2) | +| ![Count down a specified duration into the task](psat-task-3) | ![The user must add each new digit on the screen to the one immediately prior to it](psat-task-4) | +| ![Confirms task completion](psat-task-5) + +Figure 9. PVSAT memory steps + +## Tower of Hanoi + +In the Tower of Hanoi task, the user is asked to solve the classic Tower of Hanoi puzzle in a minimum number of moves. To solve the puzzle, the user must move the entire stack to the highlighted platform in as few moves as possible. This task measures the user's problem solving skills. A Tower of Hanoi task finishes when the user completes the puzzle correctly or concedes that they cannot solve the puzzle. + +Data collected by this task is in the form of an `ORKTowerOfHanoiResult` object. It contains every move taken by the user and indicates whether the puzzle was successfully completed or not. + +Tower of Hanoi steps are shown in Figure 10. + +| | | +|------------------------------------------------------------|------------------------------------------------------| +| ![Instruction step introducing the task](tower-of-hanoi-1) | ![Describes what the user must do](tower-of-hanoi-2) | +| ![Actual task](tower-of-hanoi-3) | ![Confirms task completion](tower-of-hanoi-4) | + +Figure 10. Tower of Hanoi steps + +## Reaction Time + +In the reaction time task, the user shakes the device in response to a visual cue on the device's screen. The task is divided into a number of attempts, which you determine. To complete an attempt in a task, the user must shake or move the device with an acceleration that exceeds a threshold value ( `thresholdAcceleration` property) within the given time. The task finishes when the user successfully completes all the attempts as instructed in the task. Use this task to evaluate a user's response to the stimulus and calculate their reaction time. + +Data collected by this task is in the form of `ORKReactionTimeResult` objects. Each of these objects contain a timestamp representing the delivery of the stimulus and an `ORKFileResult` object that references the motion data collected during an attempt. To present this task, use an `ORKTaskViewController` object. + +Reaction time steps are shown in Figure 11. + +| | | +|----------------------------------------------------------------|----------------------------------------------------------| +| ![Instruction step introducing the task](reaction-time-task-1) | ![Describes what the user must do](reaction-time-task-2) | +| ![Actual task](reaction-time-task-3) | ![Confirms task completion](reaction-time-task-4) | + +Figure 11. Reaction time steps + +## Sustained Phonation + +In the sustained phonation task, the user makes a sustained sound, and an audio +recording is made. The ResearchKit framework uses the [AVFoundation](https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVFoundationFramework/) framework to collect this +data and to present volume indication during recording. Analysis of the audio data is not included in the +ResearchKit framework, but might naturally involve looking at the power spectrum +and how it relates to the ability to produce certain +sounds. You can define your analysis on this +task according to your own requirements. +Audio steps are shown in Figure 12. + +| | | +|--------------------------------------------------------------------|---------------------------------------------------------------------------------| +| ![Instruction step introducing the task](audio-task-1) | ![Instruction step describes user action during the task](audio-task-2) | +| ![Count down a specified duration to begin the task](audio-task-3) | ![Displays a graph during audio playback (audio collection step)](audio-task-4) | +| ![Confirms task completion](audio-task-5) + +Figure 12. Audio steps + +## Speech Recognition + +Researchers and developers can use ResearchKit to record audio data and produce transcriptions generated by Apple’s speech recognition system. ResearchKit also provides word alignments, confidence scores, and alternative speech recognition hypotheses in the form of an n-best list. Medical researchers and developers can leverage this information to analyze speech and language features like speaking rate, word usage, and pause durations. + +The n-best list and the confidence measure detect uncertainty in the speech recognition system's hypothesis in certain cases of unintelligible speech or speech containing word fragments or meaningless words. These conditions are found to be a useful indicator of cognitive decline associated with Alzheimer's disease and related dementias (1, 2), as well as other mental health issues (3). Additionally, researchers and developers can use the raw audio data captured through ResearchKit to investigate and deploy speech indicators for research and system design. + +The `ORKSpeechRecognitionStep` class represents a single recording step. In this step, the user's speech is recorded from the microphone. + +Speech recognition steps showing capturing and displaying recorded text are in Figure 13. + +| | | +|---------------------------------------------------------------------|-----------------------------------------------------------------------------| +| ![Instruction step introducing the task](speech-recognition-task-1) | ![Instruct the user to prepare for recording](speech-recognition-task-2) | +| ![Records the user’s speech](speech-recognition-task-3) | ![Provides the transcription and allows editing](speech-recognition-task-4) | +| ![Task completion](speech-recognition-task-5) + +Figure 13. Speech recognition steps + +Once a user completes the recording, they are given the option to edit the transcript generated by the speech recognition engine. The data collected by this task consists of three main components: + +1. The raw audio recording of what the user said. +2. The transcription generated by the speech recognition engine returned as an object of type `SFTranscript`. +3. The edited transcript, if any, by the user. + +## Speech-in-Noise + +Understanding speech in noisy environments depends on both the level of the background noise and the hearing health of the listener. A speech-in-noise test quantifies the difficulty of understanding speech in noisy environments. + +A speech-in-noise test consists of presenting spoken sentences at different noise levels and asking listeners to repeat what they heard. Based on the sentence and word recognition rate, a metric is calculated. The speech intelligibility metric used in this test is the Speech Reception Threshold (SRT). It represents the SNR at which 50% of the words are correctly repeated by the user. The SRT is calculated using the Tillman-Olsen formula (4). + +The `ORKSpeechInNoiseStep` class plays the speech from a file set by the `speechFileNameWithExtension` property mixed with noise from a file set by the `noiseFileNameWithExtension` property. The noise gain is set through the `gainAppliedToNoise` property. Use the `filterFileNameWithExtension` property to specify a ramp-up/ramp-down filter. + +Speech-in-noise steps are shown in Figure 14. + +| | | +|----------------------------------------------------------------------------|-----------------------------------------------------------------------| +| ![Instruction step introducing the task](speech-in-noise-1) | ![Instructs the user how to proceed with the task](speech-in-noise-2) | +| ![Plays the spoken sentence with background noise](speech-in-noise-3) | ![Records the user’s voice](speech-in-noise-4) | +| ![Displays spoken text and provides transcript editing](speech-in-noise-5) | ![Task completion](speech-in-noise-6) | + +Figure 14. Speech-in-noise steps + +## Environment SPL Meter + +The Environment SPL Meter is not a task, but a single step that detects the sound pressure level in the user's environment. Configure this step with the following properties: + +- `thresholdValue` is the maximum permissible value for the environment sound pressure level in dBA. +- `samplingInterval` is the rate at which the `AVAudioPCMBuffer` is queried and A-weighted filter is applied. +- `requiredContiguousSamples` is the number of consecutive samples less than threshold value required for the step to proceed. + +| | | +|--------------------------------------------------------|--------------------------------------------------------------------| +| ![Prompt the user if environment is too loud](spl-meter-1) | ![Task collects required samples under the threshold](spl-meter-2) | +| ![Step is complete](spl-meter-3) + +The environment SPL meter step is shown in Figure 15. + +## Tone Audiometry + +In the tone audiometry task, users listen through headphones to a series of tones, and tap left or right buttons on the screen when they hear each tone. These tones are of different audio frequencies, playing on different channels (left and right), with the volume being progressively increased until the user taps one of the buttons. A tone audiometry task measures different properties of a user's hearing ability, based on their reaction to a wide range of frequencies. + +Data collected in this task consists of audio signal amplitude for specific frequencies and channels for each ear. + +Tone audiometry steps are shown in Figure 16. + +| | | +|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------| +| ![Instruction step introducing the task](tone-audiometry-task-1) | ![Instruction step introducing the task](tone-audiometry-task-2) | +| ![Further instructions](tone-audiometry-task-3) | ![Count down a specified duration to begin the activity](tone-audiometry-task-4) | +| ![The tone test screen with buttons for left and right ears](tone-audiometry-task-5) | ![Confirms task completion](speech-in-noise-6) | + +Figure 16. Tone audiometry steps + +## dBHL Tone Audiometry + +The dBHL tone audiometry task implements the Hughson-Westlake method of determining hearing threshold. It is similar to the tone audiometry task, except that it utilizes a dB HL scale. + +Data collected in this task consists of audio signal amplitude for specific frequencies and channels for each ear. + +dBHL tone audiometry steps are shown in Figure 17. + +| | | +|------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------| +| ![Instruction step introducing the task](dbhl-tone-audiometry-task-1) | ![Instruction step introducing the task](dbhl-tone-audiometry-task-2) | +| ![Further instructions](dbhl-tone-audiometry-task-3) | ![Check noise levels](dbhl-tone-audiometry-task-4) | +| ![Instruction step displaying which ear the user will hear sounds from](dbhl-tone-audiometry-task-5) | ![The tone test screen with buttons for the right ear](dbhl-tone-audiometry-task-6) | +| ![Instruction step displaying which ear the user will hear sounds from](dbhl-tone-audiometry-task-7) | ![The tone test screen with buttons for the left ear](dbhl-tone-audiometry-task-8) | +| ![Confirms task completion](dbhl-tone-audiometry-task-9) + +Figure 17. dBHL tone audiometry steps + +## 9-Hole Peg Test + +The 9-hole peg test is a two-step test of hand dexterity to measure the [MSFC score in Multiple Sclerosis](http://www.nationalmssociety.org/For-Professionals/Researchers/Resources-for-Researchers/Clinical-Study-Measures/9-Hole-Peg-Test-(9-HPT)), or signs of [Parkinson's disease or stroke](http://www.rehabmeasures.org/Lists/RehabMeasures/DispForm.aspx?ID=925). This task is well documented in the scientific literature (see [Earhart et al., 2011](http://www.ncbi.nlm.nih.gov/pubmed/22020457)). + +The data collected by this task includes the number of pegs, an array of move samples, and the total duration that the user spent taking the test. Practically speaking, this task generates a two-step test in which the participant must put a variable number of pegs in a hole (the place step), and then remove them (the remove step). This task tests both hands. + +The `ORKHolePegTestPlaceStep` class represents the place step. In this step, the user uses two fingers to touch the peg and drag it into the hole using their left hand. The `ORKHolePegTestRemoveStep` class represents the remove step. Here, the user moves the peg over a line using two fingers on their right hand. + +9-Hole peg test steps are shown in Figure 18. + +| | | +|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------| +| ![Instruction step introducing the task](hole-peg-task-1) | ![Describes what the user must do](hole-peg-task-2) | +| ![Instructs the user to perform the step with the right hand](hole-peg-task-3) | ![Instructs the user to perform the step with the right hand](hole-peg-task-4) | +| ![Instructs the user to perform the step with the left hand](hole-peg-task-5) | ![Instructs the user to perform the step with the left hand](hole-peg-task-6) | +| ![Task completion](hole-peg-task-7) | + +Figure 18. 9-hole peg test steps + + +## Amsler Grid + +The Amsler Grid task is a tool used to detect the onset of vision problems such as macular degeneration. + +The `ORKAmslerGridStep` class represents a single measurement step. In this step, the user observes the grid while closing one eye for any anomalies and marks the areas that appear distorted, using their finger or a stylus. + +Data collected by this task is in the form of an `ORKAmslerGridResult` object for the eye. It contains the eye side (specified by `ORKAmslerGridEyeSide`) and the image of the grid, along with the user's annotations for the corresponding eye. + +Amsler grid steps for the left and right eyes are shown in Figure 19. + +| | | +|---------------------------------------------------------|------------------------------------------------------------------| +| ![Instruction step introducing the task](amsler-grid-1) | ![Instruct the user how to measure the left eye](amsler-grid-2) | +| ![Perform the left eye test](amsler-grid-3) | ![Instruct the user how to measure the right eye](amsler-grid-4) | +| ![Perform the right eye test](amsler-grid-5) | ![Task completion](amsler-grid-6) | + +Figure 19. Amsler grid steps + +## Collect the Data + +The data collected in active tasks is recorded in a hierarchy of `ORKResult` objects in memory. It is up to you to serialize this hierarchy for storage or transmission in a way that’s appropriate for your application. + +For high sample rate data, such as from the accelerometer, use the `ORKFileResult` in the hierarchy. This object references a file in the output directory (specified by the `outputDirectory` property of `ORKTaskViewController`) where the data is logged. + +The recommended approach for handling file-based output is to create a new directory per task and to remove it after you have processed the results of the task. + +Active steps support attaching recorder configurations +(`ORKRecorderConfiguration`). A recorder configuration defines a type of +data that should be collected for the duration of the step from a sensor or +a database on the device. For example: + +- The pedometer sensor returns a `CMPedometerData` object that provides step counts computed by the motion coprocessor on supported devices. +- The accelerometer sensor returns a `CMAccelerometerData` object that provides raw accelerometer samples indicating the forces on the device. +- A `CMDeviceMotion` object provides information about the orientation and movement of the device by combining data collected from the accelerometer, gyroscope, and magnetometer. +- HealthKit returns sample types, such as heart rate. +- CoreLocation returns location data (combined from GPS, Wi-Fi and cell tower information). + +The recorders used by ResearchKit's predefined active tasks always use +`NSFileProtectionCompleteUnlessOpen` while writing data to disk, and +then change the file protection level on any files generated to +`NSFileProtectionComplete` when recording is finished. + +### Access Health Data + +For HealthKit related data, there are two recorder configurations: + +- `ORKHealthQuantityTypeRecorderConfiguration` to access quantity data such as heart rate. +- `ORKHealthClinicalTypeRecorderConfiguration` to access health records data. + +Access to health quantity data and health records requires explicit permission that the user must grant explicitly. More information about accessing health records [can be found here](https://developer.apple.com/documentation/healthkit/health_and_fitness_samples/accessing_health_records?language=objc). + +-- +### References + +1. [Yancheva et. al., 2015] M. Yancheva, K. C. Fraser and F. Rudzicz, “Using linguistic features longitudinally to predict clinical scores for Alzheimer's disease and related dementias,” Proceedings of SLPAT 2015: 6th Workshop on Speech and Language Processing for Assistive Technologies, 2015. + +2. [Konig et al., 2015] A. König, A. Satt, A. Sorin, R. Hoory, O. Toledo-Ronen, A. Derreumaux, V. Manera, F. Verhey, P. Aalten, P. H. Robert, and R. David. “Automatic speech analysis for the assessment of patients with predementia and Alzheimer's disease,” Alzheimers Dement (Amst). 2015 Mar; 1(1): 112–124. + +3. [Gong and Poellabauer’ 17] Y. Gong and C. Poellabauer, “Topic Modeling Based Multi-modal Depression Detection,” AVEC@ACM Multimedia, 2017. + +4. [T.W. Tillman and W.O. Olsen] "Speech audiometry, Modern Development in Audiology (2nd Edition)," 1972. diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-1@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-1@3x.PNG new file mode 100644 index 0000000000..f81a8c0775 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-1@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-2@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-2@3x.PNG new file mode 100644 index 0000000000..f88d924379 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-2@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-3@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-3@3x.PNG new file mode 100644 index 0000000000..6271decd1c Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-3@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-4@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-4@3x.PNG new file mode 100644 index 0000000000..87375d0152 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-4@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-5@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-5@3x.PNG new file mode 100644 index 0000000000..8b816f628f Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-5@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-6@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-6@3x.PNG new file mode 100644 index 0000000000..4d22e27a83 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-6@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-7@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-7@3x.PNG new file mode 100644 index 0000000000..9054f54d9d Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-7@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-8@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-8@3x.PNG new file mode 100644 index 0000000000..111edb7e27 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-8@3x.PNG differ diff --git a/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-9@3x.PNG b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-9@3x.PNG new file mode 100644 index 0000000000..88a3843019 Binary files /dev/null and b/ResearchKit/ResearchKit.docc/Resources/Understanding-Active-Tasks/dBHLToneAudiometryTaskImages/dbhl-tone-audiometry-task-9@3x.PNG differ diff --git a/ResearchKit/ResearchKit.h b/ResearchKit/ResearchKit.h index b913eedfa0..d72f2bd3a6 100644 --- a/ResearchKit/ResearchKit.h +++ b/ResearchKit/ResearchKit.h @@ -38,6 +38,8 @@ #import #import #import +#import +#import #import #import #import @@ -45,13 +47,13 @@ #import #import #import +#import #import #import #import +#import #import -#import #import -#import #import #import #import @@ -59,16 +61,12 @@ #import #import #import -#import #import #import #import -#import - #import #import -#import #import #import @@ -76,7 +74,6 @@ #import #import -#import #import #import #import @@ -85,62 +82,23 @@ #import #import #import -#import #import -#import - -#import -#import -#import -#import - -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import #import -#import -#import - #import +#import #import #import #import -#import -#import -#import -#import -#import - -#import - #import #import #import #import -#import -#import - #import #import #import @@ -148,20 +106,19 @@ #import #import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import - #import #import #import - - +#import + +#import +#import + +// Family History +#import +#import +#import +#import +#import +#import diff --git a/ResearchKit/ResearchKit.modulemap b/ResearchKit/ResearchKit.modulemap index 8818f1c2ce..6509a07dec 100644 --- a/ResearchKit/ResearchKit.modulemap +++ b/ResearchKit/ResearchKit.modulemap @@ -1,11 +1,8 @@ framework module ResearchKit { umbrella header "ResearchKit.h" - module Private { - umbrella header "ResearchKit_Private.h" + export * + module * { export * } - - export * - module * { export * } } diff --git a/ResearchKit/ResearchKit_Private.h b/ResearchKit/ResearchKit_Private.h new file mode 100644 index 0000000000..b8a94726c4 --- /dev/null +++ b/ResearchKit/ResearchKit_Private.h @@ -0,0 +1,57 @@ +/* + Copyright (c) 2015, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ResearchKit/ResearchKit_Private.modulemap b/ResearchKit/ResearchKit_Private.modulemap new file mode 100644 index 0000000000..29860eee5e --- /dev/null +++ b/ResearchKit/ResearchKit_Private.modulemap @@ -0,0 +1,36 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +framework module ResearchKit_Private { + umbrella header "ResearchKit_Private.h" + + export * + module * { export * } +} diff --git a/ResearchKit/Stale/ORKConsentDocument+ORKInstructionStep.h b/ResearchKit/Stale/ORKConsentDocument+ORKInstructionStep.h new file mode 100644 index 0000000000..4b1a9af325 --- /dev/null +++ b/ResearchKit/Stale/ORKConsentDocument+ORKInstructionStep.h @@ -0,0 +1,56 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKConsentDocument (ORKInstructionStep) + +/** + Converts an ORKConsentDocument to ORKInstructionSteps + -`consentDocument` An existing ORKConsentDocument + -`returns`: Array of ORKInstructionStep + */ + +@property (nonatomic, readonly, copy) NSArray *instructionSteps; + +/** + Converts ORKInstructionSteps to an ORKConsentReviewStep + -`instructionSteps` An array of instructionSteps + -`identifier` an string identifier + -`signatureStep` an optional signature step + -`returns`: an ORKConsentReviewStep + */ +- (ORKConsentReviewStep *)consentReviewStepFromInstructionSteps:(NSArray *)steps withIdentifier:(NSString *)identifier signature:(ORKConsentSignature *)signature; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Stale/ORKConsentDocument+ORKInstructionStep.m b/ResearchKit/Stale/ORKConsentDocument+ORKInstructionStep.m new file mode 100644 index 0000000000..5dff917b68 --- /dev/null +++ b/ResearchKit/Stale/ORKConsentDocument+ORKInstructionStep.m @@ -0,0 +1,86 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKConsentDocument+ORKInstructionStep.h" +#import "ORKHelpers_Internal.h" + +@implementation ORKConsentDocument (ORKInstructionStep) + +/** + Converts an ORKConsentDocument to ORKInstructionSteps + -`consentDocument` An existing ORKConsentDocument + -`returns`: Array of ORKInstructionStep + */ + +-(NSArray*)instructionSteps { + NSMutableArray *instructionSteps = [[NSMutableArray alloc] init]; + for (ORKConsentSection* section in self.sections) { + ORKInstructionStep* instructionStep = [[ORKInstructionStep alloc] initWithIdentifier: section.title]; + instructionStep.title = section.title; + instructionStep.detailText = section.summary; + instructionStep.text = section.content; + NSString* convertedImageName = [NSString stringWithFormat:@"consent_%02ld", section.type + 1]; + instructionStep.type = section.type; + instructionStep.image = [UIImage imageNamed:convertedImageName inBundle:ORKBundle() withConfiguration:nil]; + [instructionSteps addObject:instructionStep]; + } + + return [instructionSteps copy]; +} + +/** + Converts ORKInstructionSteps to an ORKConsentReviewStep + -`instructionSteps` An array of instructionSteps + -`identifier` an string identifier + -`signatureStep` an optional signature step + -`returns`: an ORKConsentReviewStep + */ +- (ORKConsentReviewStep *)consentReviewStepFromInstructionSteps:(NSArray *)steps withIdentifier:(NSString *)identifier signature:(ORKConsentSignature *)signature { + NSMutableArray *contentSections = [[NSMutableArray alloc] init]; + + for (ORKInstructionStep* instructionStep in steps) { + ORKConsentSection* section = [[ORKConsentSection alloc] initWithType:instructionStep.type]; + section.summary = NSLocalizedString(instructionStep.title ?: @"", comment: ""); + section.content = NSLocalizedString(instructionStep.text ?: @"", comment: ""); + + [contentSections addObject:section]; + } + + self.sections = contentSections; + + if (signature != nil) { + [self addSignature:signature]; + } + + return [[ORKConsentReviewStep alloc] initWithIdentifier:identifier signature:signature inDocument:self]; +} + + +@end diff --git a/ResearchKit/Consent/ORKConsentDocument.h b/ResearchKit/Stale/ORKConsentDocument.h similarity index 97% rename from ResearchKit/Consent/ORKConsentDocument.h rename to ResearchKit/Stale/ORKConsentDocument.h index f980216a8e..91e29b27c5 100644 --- a/ResearchKit/Consent/ORKConsentDocument.h +++ b/ResearchKit/Stale/ORKConsentDocument.h @@ -30,7 +30,7 @@ */ -@import Foundation; +#import #import @class ORKHTMLPDFPageRenderer; @@ -44,8 +44,9 @@ NS_ASSUME_NONNULL_BEGIN @class ORKHTMLPDFWriter; /** - The `ORKConsentDocument` class represents the content of an informed consent - document, which is a document that's used to obtain informed consent from participants + A base class that represents the content of an informed consent document. + + A consent document is used to obtain informed consent from participants in a medical or other research study. The ResearchKit framework uses an `ORKConsentDocument` object to provide content for visual consent steps (`ORKVisualConsentStep`) and for consent review steps (`ORKConsentReviewStep`). diff --git a/ResearchKit/Consent/ORKConsentDocument.m b/ResearchKit/Stale/ORKConsentDocument.m similarity index 94% rename from ResearchKit/Consent/ORKConsentDocument.m rename to ResearchKit/Stale/ORKConsentDocument.m index f017bbee41..1ccbbf61d0 100644 --- a/ResearchKit/Consent/ORKConsentDocument.m +++ b/ResearchKit/Stale/ORKConsentDocument.m @@ -33,10 +33,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKConsentDocument_Internal.h" -#import "ORKBodyLabel.h" -#import "ORKHeadlineLabel.h" -#import "ORKSubheadlineLabel.h" - #import "ORKConsentSection_Private.h" #import "ORKConsentSectionFormatter.h" #import "ORKConsentSignature.h" @@ -45,7 +41,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKErrors.h" +#import "ORKSkin_Private.h" +static NSString *const _ORKSignaturesKey = @"signatures"; @implementation ORKConsentDocument { NSMutableArray *_signatures; @@ -129,9 +127,13 @@ + (NSString *)cssStyleSheet:(BOOL)mobile { [css appendString:@".header { margin-top: 36px ; margin-bottom: 30px; text-align: center; }\n"]; [css appendString:@"body { margin-left: 0px; margin-right: 0px; }\n"]; + CGFloat pointSize = ORKDefaultFontSizeForStyle(UIFontTextStyleSubheadline, -15 + ORKGetMetricForWindow(ORKScreenMetricFontSizeSubheadline, nil)); + CGFloat pointSize2 = ORKDefaultFontSizeForStyle(UIFontTextStyleHeadline, -17 + ORKGetMetricForWindow(ORKScreenMetricFontSizeHeadline, nil)); + CGFloat maxFontSize = ORKGetMetricForWindow(ORKScreenMetricMaxFontSizeHeadline, nil); + CGFloat fontSize = ORKLightFontWithSize(MIN(maxFontSize, pointSize2)).pointSize; - CGFloat adjustment = [[ORKSubheadlineLabel defaultFont] pointSize] - 17.0; - NSArray *hPointSizes = @[ @([[ORKHeadlineLabel defaultFont] pointSize]), + CGFloat adjustment = pointSize - 17.0; + NSArray *hPointSizes = @[ @(fontSize), @(24.0 + adjustment), @(19.0 + adjustment), @(17.0 + adjustment), @@ -233,7 +235,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { ORK_DECODE_OBJ_CLASS(aDecoder, signaturePageTitle, NSString); ORK_DECODE_OBJ_CLASS(aDecoder, signaturePageContent, NSString); ORK_DECODE_OBJ_CLASS(aDecoder, htmlReviewContent, NSString); - _signatures = [aDecoder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableArray.self, ORKConsentSignature.self]] forKey:@"signatures"]; + _signatures = [aDecoder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableArray.self, ORKConsentSignature.self]] forKey:_ORKSignaturesKey]; ORK_DECODE_OBJ_ARRAY(aDecoder, sections, ORKConsentSection); } return self; diff --git a/ResearchKit/Consent/ORKConsentDocument_Internal.h b/ResearchKit/Stale/ORKConsentDocument_Internal.h similarity index 100% rename from ResearchKit/Consent/ORKConsentDocument_Internal.h rename to ResearchKit/Stale/ORKConsentDocument_Internal.h diff --git a/ResearchKit/Consent/ORKConsentDocument_Private.h b/ResearchKit/Stale/ORKConsentDocument_Private.h similarity index 100% rename from ResearchKit/Consent/ORKConsentDocument_Private.h rename to ResearchKit/Stale/ORKConsentDocument_Private.h diff --git a/ResearchKit/Consent/ORKConsentReviewStep.h b/ResearchKit/Stale/ORKConsentReviewStep.h similarity index 97% rename from ResearchKit/Consent/ORKConsentReviewStep.h rename to ResearchKit/Stale/ORKConsentReviewStep.h index b7c2c3cd89..05a8147510 100644 --- a/ResearchKit/Consent/ORKConsentReviewStep.h +++ b/ResearchKit/Stale/ORKConsentReviewStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import @@ -39,7 +39,8 @@ NS_ASSUME_NONNULL_BEGIN @class ORKConsentSignature; /** - The `ORKConsentReviewStep` class is used to represent the consent review process. + A step that represents the consent review process. + Typically, the consent review process consists of three main parts: 1. Consent document review. In this part, you display the consent document for review. Users diff --git a/ResearchKit/Consent/ORKConsentReviewStep.m b/ResearchKit/Stale/ORKConsentReviewStep.m similarity index 96% rename from ResearchKit/Consent/ORKConsentReviewStep.m rename to ResearchKit/Stale/ORKConsentReviewStep.m index bedbf2cfc6..4007e07063 100644 --- a/ResearchKit/Consent/ORKConsentReviewStep.m +++ b/ResearchKit/Stale/ORKConsentReviewStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKConsentReviewStep.h" -#import "ORKConsentReviewStepViewController.h" - #import "ORKConsentDocument_Internal.h" #import "ORKConsentSection_Private.h" #import "ORKConsentSignature.h" @@ -43,10 +41,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKConsentReviewStep -+ (Class)stepViewControllerClass { - return [ORKConsentReviewStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier signature:(ORKConsentSignature *)signature inDocument:(ORKConsentDocument *)consentDocument { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/Consent/ORKConsentSection.h b/ResearchKit/Stale/ORKConsentSection.h similarity index 96% rename from ResearchKit/Consent/ORKConsentSection.h rename to ResearchKit/Stale/ORKConsentSection.h index 219e2242c4..d5bde189b2 100644 --- a/ResearchKit/Consent/ORKConsentSection.h +++ b/ResearchKit/Stale/ORKConsentSection.h @@ -29,15 +29,14 @@ */ -@import UIKit; +#import #import NS_ASSUME_NONNULL_BEGIN /** - `ORKConsentSectionType` enumerates the predefined visual consent sections - available in the ResearchKit framework. + An enumeration that represents visual consent sections available in ResearchKit. Although the visuals are predefined, and default localized titles and Learn More button titles are provided, you need to provide in `ORKConsentSection` the summary strapline on each visual consent @@ -133,8 +132,9 @@ typedef NS_ENUM(NSInteger, ORKConsentSectionType) { } ORK_ENUM_AVAILABLE; /** - The `ORKConsentSection` class represents one section in a consent document. Each - `ORKConsentSection` object (apart from those of type `ORKConsentSectionTypeOnlyInDocument`) + An object that represents one section in a consent document. + + Each `ORKConsentSection` object (apart from those of type `ORKConsentSectionTypeOnlyInDocument`) corresponds to a page in a visual consent step, or a section in the document reviewed in consent review step. diff --git a/ResearchKit/Consent/ORKConsentSection.m b/ResearchKit/Stale/ORKConsentSection.m similarity index 99% rename from ResearchKit/Consent/ORKConsentSection.m rename to ResearchKit/Stale/ORKConsentSection.m index ce6647710a..b919a63425 100644 --- a/ResearchKit/Consent/ORKConsentSection.m +++ b/ResearchKit/Stale/ORKConsentSection.m @@ -46,7 +46,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE CGFloat scale = [UIScreen mainScreen].scale; // For iPad, use the movie for the next scale up - if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad && scale < 3) { + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && scale < 3) { scale++; } diff --git a/ResearchKit/Consent/ORKConsentSectionFormatter.h b/ResearchKit/Stale/ORKConsentSectionFormatter.h similarity index 100% rename from ResearchKit/Consent/ORKConsentSectionFormatter.h rename to ResearchKit/Stale/ORKConsentSectionFormatter.h diff --git a/ResearchKit/Consent/ORKConsentSectionFormatter.m b/ResearchKit/Stale/ORKConsentSectionFormatter.m similarity index 100% rename from ResearchKit/Consent/ORKConsentSectionFormatter.m rename to ResearchKit/Stale/ORKConsentSectionFormatter.m diff --git a/ResearchKit/Consent/ORKConsentSection_Private.h b/ResearchKit/Stale/ORKConsentSection_Private.h similarity index 100% rename from ResearchKit/Consent/ORKConsentSection_Private.h rename to ResearchKit/Stale/ORKConsentSection_Private.h diff --git a/ResearchKit/Consent/ORKConsentSharingStep.h b/ResearchKit/Stale/ORKConsentSharingStep.h similarity index 99% rename from ResearchKit/Consent/ORKConsentSharingStep.h rename to ResearchKit/Stale/ORKConsentSharingStep.h index f95ab34a82..f8980631a5 100644 --- a/ResearchKit/Consent/ORKConsentSharingStep.h +++ b/ResearchKit/Stale/ORKConsentSharingStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/Consent/ORKConsentSharingStep.m b/ResearchKit/Stale/ORKConsentSharingStep.m similarity index 97% rename from ResearchKit/Consent/ORKConsentSharingStep.m rename to ResearchKit/Stale/ORKConsentSharingStep.m index e51131f5e3..b1e4836427 100644 --- a/ResearchKit/Consent/ORKConsentSharingStep.m +++ b/ResearchKit/Stale/ORKConsentSharingStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKConsentSharingStep.h" -#import "ORKConsentSharingStepViewController.h" - #import "ORKStep_Private.h" #import "ORKAnswerFormat.h" @@ -41,10 +39,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKConsentSharingStep -+ (Class)stepViewControllerClass { - return [ORKConsentSharingStepViewController class]; -} - - (BOOL)useSurveyMode { return NO; } diff --git a/ResearchKit/Consent/ORKConsentSignature.h b/ResearchKit/Stale/ORKConsentSignature.h similarity index 98% rename from ResearchKit/Consent/ORKConsentSignature.h rename to ResearchKit/Stale/ORKConsentSignature.h index 5b30f1b9f1..44cee9be25 100644 --- a/ResearchKit/Consent/ORKConsentSignature.h +++ b/ResearchKit/Stale/ORKConsentSignature.h @@ -29,14 +29,15 @@ */ -@import UIKit; +#import #import NS_ASSUME_NONNULL_BEGIN /** - The `ORKConsentSignature` class represents a signature in as `ORKConsentDocument` object. + A class that represents a signature in a consent document object. + The signature can be that of an investigator, possibly prefilled with an image, date, and first and last name; or you might need to collect the details of a signature. diff --git a/ResearchKit/Consent/ORKConsentSignature.m b/ResearchKit/Stale/ORKConsentSignature.m similarity index 100% rename from ResearchKit/Consent/ORKConsentSignature.m rename to ResearchKit/Stale/ORKConsentSignature.m diff --git a/ResearchKit/Consent/ORKConsentSignatureFormatter.h b/ResearchKit/Stale/ORKConsentSignatureFormatter.h similarity index 100% rename from ResearchKit/Consent/ORKConsentSignatureFormatter.h rename to ResearchKit/Stale/ORKConsentSignatureFormatter.h diff --git a/ResearchKit/Consent/ORKConsentSignatureFormatter.m b/ResearchKit/Stale/ORKConsentSignatureFormatter.m similarity index 100% rename from ResearchKit/Consent/ORKConsentSignatureFormatter.m rename to ResearchKit/Stale/ORKConsentSignatureFormatter.m diff --git a/ResearchKit/Consent/ORKConsentSignatureResult.h b/ResearchKit/Stale/ORKConsentSignatureResult.h similarity index 94% rename from ResearchKit/Consent/ORKConsentSignatureResult.h rename to ResearchKit/Stale/ORKConsentSignatureResult.h index bc38d0db82..77f56fec0a 100644 --- a/ResearchKit/Consent/ORKConsentSignatureResult.h +++ b/ResearchKit/Stale/ORKConsentSignatureResult.h @@ -38,8 +38,9 @@ NS_ASSUME_NONNULL_BEGIN @class ORKConsentDocument; /** - The `ORKConsentSignatureResult` class represents a signature obtained during - a consent review step (`ORKConsentReviewStep`). The consent signature result is usually found as a child result of the + A result object from the consent review step. + + The consent signature result is typically found as a child result of the `ORKStepResult` object for the consent review step. You can apply the result to a document to facilitate the generation of a diff --git a/ResearchKit/Consent/ORKConsentSignatureResult.m b/ResearchKit/Stale/ORKConsentSignatureResult.m similarity index 100% rename from ResearchKit/Consent/ORKConsentSignatureResult.m rename to ResearchKit/Stale/ORKConsentSignatureResult.m diff --git a/ResearchKit/Common/ORKQuestionStep.h b/ResearchKit/Stale/ORKQuestionStep.h similarity index 84% rename from ResearchKit/Common/ORKQuestionStep.h rename to ResearchKit/Stale/ORKQuestionStep.h index 61a9b44160..5f9ff9415f 100644 --- a/ResearchKit/Common/ORKQuestionStep.h +++ b/ResearchKit/Stale/ORKQuestionStep.h @@ -29,14 +29,18 @@ */ -@import Foundation; +#import + +#if TARGET_OS_IOS #import +#endif NS_ASSUME_NONNULL_BEGIN @class ORKAnswerFormat; @class ORKLearnMoreItem; +@class ORKFormStep; /** The `ORKQuestionStep` class is a concrete subclass of `ORKStep` that represents @@ -47,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN When the task completes, the user's answer is encoded in the result hierarchy in the task view controller. - When a task view controller presents an `ORKQuestionStep` object, it instantiates an `ORKQuestionStepViewController` object to present the step. The actual + When a task view controller presents an `ORKQuestionStep` object, it instantiates an `ORKFormStepViewController` object to present the step. The actual visual presentation depends on the answer format. When you need to present more than one question at the same time, it can be appropriate @@ -73,20 +77,32 @@ ORK_CLASS_AVAILABLE question:(nullable NSString *)question answer:(nullable ORKAnswerFormat *)answerFormat; +#if TARGET_OS_IOS /** - Returns a new question step that includes the specified identifier, title, question, answer, and learnMoreItem format. + Returns a new question step that includes the specified identifier, title, question, and answer format. @param identifier The identifier of the step (a step identifier should be unique within the task). + @param text A localized string that represents the text. @param title A localized string that represents the primary text of the question. + @param placeholder A localized string that represents the placeholder text displayed before an answer has been entered. @param question A localized string that represents the question as a text. + @param presentationStyle An enum that represents the presentation styles to apply to the question + @param tagText The value displayed as a tag if set. + @param learnMoreItem A LearnMoreItem object that presents a learn more button in the card header view + @param useCardView A property to present the question with a card view. Default to YES; @param answerFormat The format in which the answer is expected. - @param learnMoreItem A LearnMoreItem object that presents a learn more button in the card header view */ + (instancetype)questionStepWithIdentifier:(NSString *)identifier + text:(nullable NSString *)text + placeholder:(nullable NSString *)placeholder title:(nullable NSString *)title question:(nullable NSString *)question + presentationStyle:(nullable NSString *)presentationStyle + tagText:(nullable NSString *)tagText answer:(nullable ORKAnswerFormat *)answerFormat - learnMoreItem:(nullable ORKLearnMoreItem *)learnMoreItem; + learnMoreItem:(nullable ORKLearnMoreItem *)learnMoreItem + useCardView:(nullable NSNumber *)useCardView; +#endif /** The format of the answer. diff --git a/ResearchKit/Common/ORKQuestionStep.m b/ResearchKit/Stale/ORKQuestionStep.m similarity index 89% rename from ResearchKit/Common/ORKQuestionStep.m rename to ResearchKit/Stale/ORKQuestionStep.m index 637ba889c4..4de9b2d381 100644 --- a/ResearchKit/Common/ORKQuestionStep.m +++ b/ResearchKit/Stale/ORKQuestionStep.m @@ -28,15 +28,15 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "ORKQuestionStep.h" + +#if TARGET_OS_IOS #import "ORKAnswerFormat_Internal.h" #import "ORKAnswerFormat_Private.h" -#import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" -#if TARGET_OS_IOS -#import "ORKQuestionStep_Private.h" -#import "ORKQuestionStepViewController.h" #import "ORKLearnMoreItem.h" +#import "ORKQuestionStep_Private.h" +#import "ORKStep_Private.h" +#import "ORKQuestionStep.h" #endif #if TARGET_OS_IOS @@ -59,6 +59,7 @@ + (instancetype)questionStepWithIdentifier:(NSString *)identifier step.question = question; step.answerFormat = answerFormat; step.tagText = nil; + return step; } @@ -78,10 +79,6 @@ + (instancetype)platterQuestionWithIdentifier:(NSString *)identifier return step; } -+ (Class)stepViewControllerClass { - return [ORKQuestionStepViewController class]; -} - + (instancetype)questionStepWithIdentifier:(NSString *)identifier title:(nullable NSString *)title question:(nullable NSString *)question @@ -97,6 +94,30 @@ + (instancetype)questionStepWithIdentifier:(NSString *)identifier return step; } ++ (instancetype)questionStepWithIdentifier:(NSString *)identifier + text:(nullable NSString *)text + placeholder:(nullable NSString *)placeholder + title:(nullable NSString *)title + question:(nullable NSString *)question + presentationStyle:(nullable NSString *)presentationStyle + tagText:(nullable NSString *)tagText + answer:(nullable ORKAnswerFormat *)answerFormat + learnMoreItem:(nullable ORKLearnMoreItem *)learnMoreItem + useCardView:(nullable NSNumber *)useCardView { + ORKQuestionStep *step = [[ORKQuestionStep alloc] initWithIdentifier:identifier]; + step.question = question; + step.answerFormat = answerFormat; + step.learnMoreItem = learnMoreItem; + step.tagText = tagText; + step.placeholder = placeholder; + + step.title = title; + step.question = question; + step.useCardView = useCardView ? useCardView.boolValue : YES; + step.presentationStyle = presentationStyle; + return step; +} + - (BOOL)isFormatChoiceWithImageOptions { return [[self impliedAnswerFormat] isKindOfClass:[ORKImageChoiceAnswerFormat class]]; } @@ -110,11 +131,12 @@ - (BOOL)isFormatTextfield { return [impliedAnswerFormat isKindOfClass:[ORKTextAnswerFormat class]] && ![(ORKTextAnswerFormat *)impliedAnswerFormat multipleLines]; } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (NSSet *)requestedHealthKitTypesForReading { HKObjectType *objType = [[self answerFormat] healthKitObjectTypeForAuthorization]; return (objType != nil) ? [NSSet setWithObject:objType] : nil; } - +#endif #endif - (instancetype)initWithIdentifier:(NSString *)identifier { @@ -126,7 +148,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { self.useCardView = YES; self.showsProgress = YES; self.tagText = nil; - #if TARGET_OS_IOS self.presentationStyle = ORKQuestionStepPresentationStyleDefault; #endif @@ -180,7 +201,6 @@ - (instancetype)copyWithZone:(NSZone *)zone { ORKQuestionStep *questionStep = [super copyWithZone:zone]; questionStep.answerFormat = [self.answerFormat copy]; questionStep.placeholder = [self.placeholder copy]; - #if TARGET_OS_IOS questionStep.learnMoreItem = [self.learnMoreItem copy]; questionStep.presentationStyle = self.presentationStyle; @@ -246,6 +266,7 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder { #endif ORK_DECODE_BOOL(aDecoder, useCardView); ORK_DECODE_OBJ_CLASS(aDecoder, tagText, NSString); + } return self; } diff --git a/ResearchKit/Common/ORKQuestionStep_Internal.h b/ResearchKit/Stale/ORKQuestionStep_Internal.h similarity index 100% rename from ResearchKit/Common/ORKQuestionStep_Internal.h rename to ResearchKit/Stale/ORKQuestionStep_Internal.h diff --git a/ResearchKit/Common/ORKQuestionStep_Private.h b/ResearchKit/Stale/ORKQuestionStep_Private.h similarity index 97% rename from ResearchKit/Common/ORKQuestionStep_Private.h rename to ResearchKit/Stale/ORKQuestionStep_Private.h index 03a4887208..37ae14b731 100644 --- a/ResearchKit/Common/ORKQuestionStep_Private.h +++ b/ResearchKit/Stale/ORKQuestionStep_Private.h @@ -28,8 +28,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + + +#if TARGET_OS_IOS #import #import +#endif NS_ASSUME_NONNULL_BEGIN @@ -44,12 +48,15 @@ ORK_EXTERN ORKQuestionStepPresentationStyle const ORKQuestionStepPresentationSty @protocol ORKQuestionStepPresentation +#if TARGET_OS_IOS @property (nonatomic, copy) ORKQuestionStepPresentationStyle presentationStyle; +#endif @end @interface ORKQuestionStep () +#if TARGET_OS_IOS /** Platter presentation style initializer. Since this uses a custom layout for step details, this is the recommended way use the ORKQuestionStepPresentationStylePlatter. @@ -63,10 +70,12 @@ ORK_EXTERN ORKQuestionStepPresentationStyle const ORKQuestionStepPresentationSty Using configurations other than what is specified above will cause a runtime exception. */ + + (instancetype)platterQuestionWithIdentifier:(NSString *)identifier question:(NSString *)question text:(NSString *)text answerFormat:(ORKAnswerFormat *)answerFormat; +#endif @end diff --git a/ResearchKit/ActiveTasks/ORK3DModelManager.h b/ResearchKitActiveTask/3D Model/3D Model Manager/ORK3DModelManager.h similarity index 100% rename from ResearchKit/ActiveTasks/ORK3DModelManager.h rename to ResearchKitActiveTask/3D Model/3D Model Manager/ORK3DModelManager.h diff --git a/ResearchKit/ActiveTasks/ORK3DModelManager.m b/ResearchKitActiveTask/3D Model/3D Model Manager/ORK3DModelManager.m similarity index 100% rename from ResearchKit/ActiveTasks/ORK3DModelManager.m rename to ResearchKitActiveTask/3D Model/3D Model Manager/ORK3DModelManager.m diff --git a/ResearchKit/ActiveTasks/ORK3DModelManager_Internal.h b/ResearchKitActiveTask/3D Model/3D Model Manager/ORK3DModelManager_Internal.h similarity index 100% rename from ResearchKit/ActiveTasks/ORK3DModelManager_Internal.h rename to ResearchKitActiveTask/3D Model/3D Model Manager/ORK3DModelManager_Internal.h diff --git a/ResearchKit/ActiveTasks/ORK3DModelStep.h b/ResearchKitActiveTask/3D Model/ORK3DModelStep.h similarity index 97% rename from ResearchKit/ActiveTasks/ORK3DModelStep.h rename to ResearchKitActiveTask/3D Model/ORK3DModelStep.h index bf9849cfdb..a10c9c5d0c 100644 --- a/ResearchKit/ActiveTasks/ORK3DModelStep.h +++ b/ResearchKitActiveTask/3D Model/ORK3DModelStep.h @@ -28,13 +28,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import #import #import NS_ASSUME_NONNULL_BEGIN - ORK_CLASS_AVAILABLE @interface ORK3DModelStep : ORKActiveStep diff --git a/ResearchKit/ActiveTasks/ORK3DModelStep.m b/ResearchKitActiveTask/3D Model/ORK3DModelStep.m similarity index 95% rename from ResearchKit/ActiveTasks/ORK3DModelStep.m rename to ResearchKitActiveTask/3D Model/ORK3DModelStep.m index f53de046e2..7d5a9b6ef1 100644 --- a/ResearchKit/ActiveTasks/ORK3DModelStep.m +++ b/ResearchKitActiveTask/3D Model/ORK3DModelStep.m @@ -29,15 +29,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORK3DModelStep.h" -#import "ORK3DModelStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORK3DModelStep -+ (Class)stepViewControllerClass { - return [ORK3DModelStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier modelManager:(nonnull ORK3DModelManager *)modelManager { self = [super initWithIdentifier:identifier]; @@ -90,7 +85,8 @@ - (BOOL)isEqual:(id)object { return (isParentSame && ORKEqualObjects(self.modelManager, castObject.modelManager)); } -- (NSUInteger)hash { +- (NSUInteger)hash +{ return [super hash] ^ [_modelManager hash]; } diff --git a/ResearchKit/ActiveTasks/ORK3DModelStepContentView.h b/ResearchKitActiveTask/3D Model/ORK3DModelStepContentView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORK3DModelStepContentView.h rename to ResearchKitActiveTask/3D Model/ORK3DModelStepContentView.h index 58d1cddd2e..1701a76911 100644 --- a/ResearchKit/ActiveTasks/ORK3DModelStepContentView.h +++ b/ResearchKitActiveTask/3D Model/ORK3DModelStepContentView.h @@ -31,7 +31,7 @@ @import UIKit; #import "ORK3DModelStep.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORK3DModelStepContentView.m b/ResearchKitActiveTask/3D Model/ORK3DModelStepContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORK3DModelStepContentView.m rename to ResearchKitActiveTask/3D Model/ORK3DModelStepContentView.m diff --git a/ResearchKit/ActiveTasks/ORK3DModelStepViewController.h b/ResearchKitActiveTask/3D Model/ORK3DModelStepViewController.h similarity index 94% rename from ResearchKit/ActiveTasks/ORK3DModelStepViewController.h rename to ResearchKitActiveTask/3D Model/ORK3DModelStepViewController.h index cf8e94b70e..96259f6757 100644 --- a/ResearchKit/ActiveTasks/ORK3DModelStepViewController.h +++ b/ResearchKitActiveTask/3D Model/ORK3DModelStepViewController.h @@ -28,8 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; -#import +#import +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORK3DModelStepViewController.m b/ResearchKitActiveTask/3D Model/ORK3DModelStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORK3DModelStepViewController.m rename to ResearchKitActiveTask/3D Model/ORK3DModelStepViewController.m index 4a4b1ad7ed..5b111b0340 100644 --- a/ResearchKit/ActiveTasks/ORK3DModelStepViewController.m +++ b/ResearchKitActiveTask/3D Model/ORK3DModelStepViewController.m @@ -35,7 +35,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORK3DModelStepViewController.h" #import "ORKActiveStepView.h" #import "ORKActiveStepViewController_Internal.h" -#import "ORKBorderedButton.h" #import "ORKCollectionResult_Private.h" #import "ORKHelpers_Internal.h" #import "ORKNavigationContainerView_Internal.h" diff --git a/ResearchKit/ActiveTasks/ORKUSDZModelManager.h b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManager.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKUSDZModelManager.h rename to ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManager.h index fdaa0ea1b3..075c8d9c99 100644 --- a/ResearchKit/ActiveTasks/ORKUSDZModelManager.h +++ b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManager.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKUSDZModelManager.m b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManager.m similarity index 88% rename from ResearchKit/ActiveTasks/ORKUSDZModelManager.m rename to ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManager.m index 4fbe443075..afd737f421 100644 --- a/ResearchKit/ActiveTasks/ORKUSDZModelManager.m +++ b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManager.m @@ -152,32 +152,29 @@ - (void)addContentToView:(UIView *)view { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ MDLAsset *mdlAsset = [[MDLAsset alloc] initWithURL:url]; [mdlAsset loadTextures]; - _usdzModelManagerScene = [[ORKUSDZModelManagerScene alloc] initWithMDLAsset:mdlAsset + self->_usdzModelManagerScene = [[ORKUSDZModelManagerScene alloc] initWithMDLAsset:mdlAsset hightlightColor:self.highlightColor - fileName:_fileName]; + fileName:self->_fileName]; dispatch_async(dispatch_get_main_queue(), ^(void) { - _sceneView = [SCNView new]; - _sceneView.scene = _usdzModelManagerScene; - [_sceneView setAllowsCameraControl:YES]; - [_sceneView setAutoenablesDefaultLighting:YES]; - [_sceneView setAntialiasingMode:SCNAntialiasingModeMultisampling4X]; - _sceneView.translatesAutoresizingMaskIntoConstraints = NO; + self->_sceneView = [SCNView new]; + self->_sceneView.scene = self->_usdzModelManagerScene; + [self->_sceneView setAllowsCameraControl:YES]; + [self->_sceneView setAutoenablesDefaultLighting:YES]; + [self->_sceneView setAntialiasingMode:SCNAntialiasingModeMultisampling4X]; + self->_sceneView.translatesAutoresizingMaskIntoConstraints = NO; + self->_sceneView.backgroundColor = [UIColor secondarySystemBackgroundColor]; + [self->_parentView addSubview:self->_sceneView]; - if (@available(iOS 13.0, *)) { - _sceneView.backgroundColor = [UIColor secondarySystemBackgroundColor]; - } - - [_parentView addSubview:_sceneView]; [self setupSceneViewConstraints]; if (self.allowsSelection) { UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleTap:)]; - [_sceneView addGestureRecognizer:tapRecognizer]; + [self->_sceneView addGestureRecognizer:tapRecognizer]; } if (self.identifiersOfObjectsToHighlight) { - [_usdzModelManagerScene hightlightModelObjectsWithIdentifiers:self.identifiersOfObjectsToHighlight]; + [self->_usdzModelManagerScene hightlightModelObjectsWithIdentifiers:self.identifiersOfObjectsToHighlight]; } }); diff --git a/ResearchKit/ActiveTasks/ORKUSDZModelManagerResult.h b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerResult.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKUSDZModelManagerResult.h rename to ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerResult.h index c5f9c83eac..4729f5564c 100644 --- a/ResearchKit/ActiveTasks/ORKUSDZModelManagerResult.h +++ b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerResult.h @@ -32,6 +32,7 @@ NS_ASSUME_NONNULL_BEGIN + ORK_CLASS_AVAILABLE @interface ORKUSDZModelManagerResult: ORKResult diff --git a/ResearchKit/ActiveTasks/ORKUSDZModelManagerResult.m b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKUSDZModelManagerResult.m rename to ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerResult.m diff --git a/ResearchKit/ActiveTasks/ORKUSDZModelManagerScene.h b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerScene.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKUSDZModelManagerScene.h rename to ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerScene.h diff --git a/ResearchKit/ActiveTasks/ORKUSDZModelManagerScene.m b/ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerScene.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKUSDZModelManagerScene.m rename to ResearchKitActiveTask/3D Model/USDZ Model Manager/ORKUSDZModelManagerScene.m diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridContentView.h b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKAmslerGridContentView.h rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridContentView.h index 73ac9aae7d..63f62905a4 100644 --- a/ResearchKit/ActiveTasks/ORKAmslerGridContentView.h +++ b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridContentView.h @@ -29,7 +29,8 @@ */ #import -#import "ORKCustomStepView_Internal.h" + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridContentView.m b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAmslerGridContentView.m rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridContentView.m diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridResult.h b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKAmslerGridResult.h rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridResult.h diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridResult.m b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAmslerGridResult.m rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridResult.m diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridStep.h b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStep.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKAmslerGridStep.h rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStep.h diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridStep.m b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStep.m similarity index 95% rename from ResearchKit/ActiveTasks/ORKAmslerGridStep.m rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStep.m index 33f3e7749f..60873b19aa 100644 --- a/ResearchKit/ActiveTasks/ORKAmslerGridStep.m +++ b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStep.m @@ -31,7 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKAmslerGridStep.h" #import "ORKHelpers_Internal.h" -#import "ORKAmslerGridStepViewController.h" @implementation ORKAmslerGridStep @@ -47,10 +46,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { return self; } -+ (Class)stepViewControllerClass { - return [ORKAmslerGridStepViewController class]; -} - - (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridStepViewController.h b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKAmslerGridStepViewController.h rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStepViewController.h index 80f2a92185..13daf26796 100644 --- a/ResearchKit/ActiveTasks/ORKAmslerGridStepViewController.h +++ b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStepViewController.h @@ -30,7 +30,7 @@ #import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAmslerGridStepViewController.m b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKAmslerGridStepViewController.m rename to ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStepViewController.m index f16cba5157..9ddcee9314 100644 --- a/ResearchKit/ActiveTasks/ORKAmslerGridStepViewController.m +++ b/ResearchKitActiveTask/AmslerGrid/ORKAmslerGridStepViewController.m @@ -43,7 +43,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKAmslerGridResult.h" #import "ORKResult_Private.h" #import "ORKCollectionResult_Private.h" -#import "ORKBorderedButton.h" @interface ORKAmslerGridStepViewController () { diff --git a/ResearchKit/ActiveTasks/ORKAudioContentView.h b/ResearchKitActiveTask/Audio/ORKAudioContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKAudioContentView.h rename to ResearchKitActiveTask/Audio/ORKAudioContentView.h index 9ce19b830e..ec9f0683b4 100644 --- a/ResearchKit/ActiveTasks/ORKAudioContentView.h +++ b/ResearchKitActiveTask/Audio/ORKAudioContentView.h @@ -30,7 +30,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN @@ -68,4 +69,3 @@ typedef void (^ORKAudioStepContentViewEventHandler)(ORKAudioContentViewEvent); @end NS_ASSUME_NONNULL_END - diff --git a/ResearchKit/ActiveTasks/ORKAudioContentView.m b/ResearchKitActiveTask/Audio/ORKAudioContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioContentView.m rename to ResearchKitActiveTask/Audio/ORKAudioContentView.m diff --git a/ResearchKit/ActiveTasks/ORKAudioGraphView.h b/ResearchKitActiveTask/Audio/ORKAudioGraphView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKAudioGraphView.h rename to ResearchKitActiveTask/Audio/ORKAudioGraphView.h index dbfb56f0a9..6357170f4a 100644 --- a/ResearchKit/ActiveTasks/ORKAudioGraphView.h +++ b/ResearchKitActiveTask/Audio/ORKAudioGraphView.h @@ -30,7 +30,7 @@ @import UIKit; -#import +#import "ORKAudioMeteringView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAudioGraphView.m b/ResearchKitActiveTask/Audio/ORKAudioGraphView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioGraphView.m rename to ResearchKitActiveTask/Audio/ORKAudioGraphView.m diff --git a/ResearchKit/ActiveTasks/ORKAudioLevelNavigationRule.h b/ResearchKitActiveTask/Audio/ORKAudioLevelNavigationRule.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioLevelNavigationRule.h rename to ResearchKitActiveTask/Audio/ORKAudioLevelNavigationRule.h diff --git a/ResearchKit/ActiveTasks/ORKAudioLevelNavigationRule.m b/ResearchKitActiveTask/Audio/ORKAudioLevelNavigationRule.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioLevelNavigationRule.m rename to ResearchKitActiveTask/Audio/ORKAudioLevelNavigationRule.m diff --git a/ResearchKit/ActiveTasks/ORKAudioMeteringView.h b/ResearchKitActiveTask/Audio/ORKAudioMeteringView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKAudioMeteringView.h rename to ResearchKitActiveTask/Audio/ORKAudioMeteringView.h index dc84a08453..432d22611a 100644 --- a/ResearchKit/ActiveTasks/ORKAudioMeteringView.h +++ b/ResearchKitActiveTask/Audio/ORKAudioMeteringView.h @@ -30,7 +30,7 @@ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN @@ -54,6 +54,7 @@ extern NSArray * ORKLastNSamples(NSArray *samples, NSInt @interface ORKAudioMeteringView : UIView + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKAudioMeteringView.m b/ResearchKitActiveTask/Audio/ORKAudioMeteringView.m similarity index 85% rename from ResearchKit/ActiveTasks/ORKAudioMeteringView.m rename to ResearchKitActiveTask/Audio/ORKAudioMeteringView.m index 0234d350bf..8d8286a7d4 100644 --- a/ResearchKit/ActiveTasks/ORKAudioMeteringView.m +++ b/ResearchKitActiveTask/Audio/ORKAudioMeteringView.m @@ -29,8 +29,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKAudioMeteringView.h" - - #import "ORKAudioGraphView.h" NSArray * ORKLastNSamples(NSArray *samples, NSInteger limit) { @@ -43,96 +41,83 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE return [samples copy]; } + @interface ORKAudioMeteringView () @property (nonatomic, strong) UIView *meteringView; @end @implementation ORKAudioMeteringView -- (instancetype)init -{ +- (instancetype)init { self = [super init]; - if (self) - { + if (self) { [self configureMeteringView]; } return self; } -- (instancetype)initWithFrame:(CGRect)frame -{ +- (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; - if (self) - { + if (self) { [self configureMeteringView]; } return self; } -- (instancetype)initWithCoder:(NSCoder *)coder -{ +- (instancetype)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder]; - if (self) - { + if (self) { [self configureMeteringView]; } return self; } -- (void)configureMeteringView -{ +- (void)configureMeteringView { if (!_meteringView) { [self setMeteringView:[[ORKAudioGraphView alloc] init]]; + } } -- (void)layoutSubviews -{ +- (void)layoutSubviews { [super layoutSubviews]; [_meteringView setFrame:[self bounds]]; } -- (void)setHidden:(BOOL)hidden -{ +- (void)setHidden:(BOOL)hidden { [super setHidden:hidden]; [_meteringView setHidden:hidden]; } -- (void)didMoveToSuperview -{ +- (void)didMoveToSuperview { [super didMoveToSuperview]; - if ([self superview] == nil) - { + if ([self superview] == nil) { [_meteringView removeFromSuperview]; } - else - { + else { [self addSubview:_meteringView]; } } + #pragma mark - ORKAudioMetering -- (void)setSamples:(NSArray *)samples -{ +- (void)setSamples:(NSArray *)samples { [_meteringView setSamples:samples]; } -- (void)setAlertThreshold:(float)threshold -{ +- (void)setAlertThreshold:(float)threshold { [_meteringView setAlertThreshold:threshold]; } #pragma mark - ORKAudioMeteringDisplay -- (void)setMeterColor:(UIColor *)meterColor -{ +- (void)setMeterColor:(UIColor *)meterColor { [_meteringView setMeterColor:meterColor]; } -- (void)setAlertColor:(UIColor *)alertColor -{ +- (void)setAlertColor:(UIColor *)alertColor { [_meteringView setAlertColor:alertColor]; } diff --git a/ResearchKit/ActiveTasks/ORKAudioStep.h b/ResearchKitActiveTask/Audio/ORKAudioStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKAudioStep.h rename to ResearchKitActiveTask/Audio/ORKAudioStep.h index fe114dba0b..e44c6f2566 100644 --- a/ResearchKit/ActiveTasks/ORKAudioStep.h +++ b/ResearchKitActiveTask/Audio/ORKAudioStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/ActiveTasks/ORKAudioStep.m b/ResearchKitActiveTask/Audio/ORKAudioStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKAudioStep.m rename to ResearchKitActiveTask/Audio/ORKAudioStep.m index ab60911e9c..e5c38c00a5 100644 --- a/ResearchKit/ActiveTasks/ORKAudioStep.m +++ b/ResearchKitActiveTask/Audio/ORKAudioStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKAudioStep.h" -#import "ORKAudioStepViewController.h" - #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -40,10 +38,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKAudioStep -+ (Class)stepViewControllerClass { - return [ORKAudioStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKAudioStepViewController.h b/ResearchKitActiveTask/Audio/ORKAudioStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKAudioStepViewController.h rename to ResearchKitActiveTask/Audio/ORKAudioStepViewController.h index b732c7ec8b..ec032d541f 100644 --- a/ResearchKit/ActiveTasks/ORKAudioStepViewController.h +++ b/ResearchKitActiveTask/Audio/ORKAudioStepViewController.h @@ -30,9 +30,9 @@ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAudioStepViewController.m b/ResearchKitActiveTask/Audio/ORKAudioStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKAudioStepViewController.m rename to ResearchKitActiveTask/Audio/ORKAudioStepViewController.m index 476b1028e9..1fdc28d78b 100644 --- a/ResearchKit/ActiveTasks/ORKAudioStepViewController.m +++ b/ResearchKitActiveTask/Audio/ORKAudioStepViewController.m @@ -34,7 +34,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKActiveStepTimer.h" #import "ORKActiveStepView.h" #import "ORKAudioContentView.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKVerticalContainerView.h" #import "ORKActiveStepViewController_Internal.h" diff --git a/ResearchKit/ActiveTasks/ORKActiveStepViewController.h b/ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKActiveStepViewController.h rename to ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController.h index dee18bce82..7150aff1c9 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStepViewController.h +++ b/ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import #import diff --git a/ResearchKit/ActiveTasks/ORKActiveStepViewController.m b/ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKActiveStepViewController.m rename to ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController.m index dc6258bba4..cbd3e447a3 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStepViewController.m +++ b/ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController.m @@ -45,6 +45,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTaskViewController_Internal.h" #import "ORKRecorder_Internal.h" +#import "ORKStepView_Private.h" +#import "ORKStepContentView.h" + #import "ORKActiveStep_Internal.h" #import "ORKCollectionResult_Private.h" #import "ORKResult.h" @@ -54,6 +57,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKSkin.h" +NSString * const ORKActiveStepViewAccessibilityIdentifier = @"ORKActiveStepView"; @interface ORKActiveStepViewController () { ORKActiveStepView *_activeStepView; @@ -125,9 +129,14 @@ - (void)setActiveStepView { if (_customView) { _activeStepView.customContentView = _customView; } + _activeStepView.stepContentView.shouldAutomaticallyAdjustImageTintColor = YES; [self.view addSubview:_activeStepView]; } +- (void)setNavigationFooterViewHidden:(BOOL)hidden { + [_navigationFooterView setHidden:hidden]; +} + - (void)setNavigationFooterView { if (!_navigationFooterView) { _navigationFooterView = _activeStepView.navigationFooterView; @@ -330,6 +339,7 @@ - (void)prepareStep { [self resetTimer]; [self prepareRecorders]; + _activeStepView.accessibilityIdentifier = ORKActiveStepViewAccessibilityIdentifier; } - (void)startRecorders { diff --git a/ResearchKit/ActiveTasks/ORKActiveStepViewController_Internal.h b/ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController_Internal.h similarity index 94% rename from ResearchKit/ActiveTasks/ORKActiveStepViewController_Internal.h rename to ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController_Internal.h index ec75f5acdd..65dc15aff2 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStepViewController_Internal.h +++ b/ResearchKitActiveTask/Common/Active Step/ORKActiveStepViewController_Internal.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -56,6 +56,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign, getter=isStarted) BOOL started; +@property (nonatomic, assign, getter=isNavigationFooterViewHidden) BOOL navigationFooterViewHidden; + - (void)countDownTimerFired:(ORKActiveStepTimer *)timer finished:(BOOL)finished; // Let subclass receive timer fires - (void)applicationWillResignActive:(NSNotification *)notification; diff --git a/ResearchKitActiveTask/Common/Active Step/ORKActiveTaskResult.h b/ResearchKitActiveTask/Common/Active Step/ORKActiveTaskResult.h new file mode 100644 index 0000000000..ce8da7a1fd --- /dev/null +++ b/ResearchKitActiveTask/Common/Active Step/ORKActiveTaskResult.h @@ -0,0 +1,56 @@ +/* + Copyright (c) 2015, Apple Inc. All rights reserved. + Copyright (c) 2017, Sage Bionetworks + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ResearchKit/ActiveTasks/ORKVoiceEngine.h b/ResearchKitActiveTask/Common/Active Step/Speech Synthesis/ORKVoiceEngine.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKVoiceEngine.h rename to ResearchKitActiveTask/Common/Active Step/Speech Synthesis/ORKVoiceEngine.h index 3406ad640e..cc36b90c2e 100644 --- a/ResearchKit/ActiveTasks/ORKVoiceEngine.h +++ b/ResearchKitActiveTask/Common/Active Step/Speech Synthesis/ORKVoiceEngine.h @@ -29,8 +29,8 @@ */ -@import Foundation; -@import AVFoundation; +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKVoiceEngine.m b/ResearchKitActiveTask/Common/Active Step/Speech Synthesis/ORKVoiceEngine.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKVoiceEngine.m rename to ResearchKitActiveTask/Common/Active Step/Speech Synthesis/ORKVoiceEngine.m diff --git a/ResearchKit/ActiveTasks/ORKVoiceEngine_Internal.h b/ResearchKitActiveTask/Common/Active Step/Speech Synthesis/ORKVoiceEngine_Internal.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKVoiceEngine_Internal.h rename to ResearchKitActiveTask/Common/Active Step/Speech Synthesis/ORKVoiceEngine_Internal.h diff --git a/ResearchKit/ActiveTasks/ORKActiveStepTimer.h b/ResearchKitActiveTask/Common/Active Step/Timing/ORKActiveStepTimer.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKActiveStepTimer.h rename to ResearchKitActiveTask/Common/Active Step/Timing/ORKActiveStepTimer.h index d09548482c..09fd99f6d6 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStepTimer.h +++ b/ResearchKitActiveTask/Common/Active Step/Timing/ORKActiveStepTimer.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKActiveStepTimer.m b/ResearchKitActiveTask/Common/Active Step/Timing/ORKActiveStepTimer.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKActiveStepTimer.m rename to ResearchKitActiveTask/Common/Active Step/Timing/ORKActiveStepTimer.m index 36b145e295..78a1925733 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStepTimer.m +++ b/ResearchKitActiveTask/Common/Active Step/Timing/ORKActiveStepTimer.m @@ -131,7 +131,7 @@ - (void)queue_event { } dispatch_async(dispatch_get_main_queue(), ^{ - _handler(self, finished); + self->_handler(self, finished); }); } diff --git a/ResearchKit/ActiveTasks/ORKActiveStepQuantityView.h b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepQuantityView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKActiveStepQuantityView.h rename to ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepQuantityView.h index db004107d4..180e9d628e 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStepQuantityView.h +++ b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepQuantityView.h @@ -30,7 +30,7 @@ @import UIKit; -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKActiveStepQuantityView.m b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepQuantityView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKActiveStepQuantityView.m rename to ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepQuantityView.m diff --git a/ResearchKit/ActiveTasks/ORKActiveStepTimerView.h b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepTimerView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKActiveStepTimerView.h rename to ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepTimerView.h index 51eae5cb53..6c364b16cc 100644 --- a/ResearchKit/ActiveTasks/ORKActiveStepTimerView.h +++ b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepTimerView.h @@ -30,7 +30,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKActiveStepTimerView.m b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepTimerView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKActiveStepTimerView.m rename to ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepTimerView.m diff --git a/ResearchKit/Common/ORKActiveStepView.h b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepView.h similarity index 96% rename from ResearchKit/Common/ORKActiveStepView.h rename to ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepView.h index c93656fc20..31926ff83c 100644 --- a/ResearchKit/Common/ORKActiveStepView.h +++ b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepView.h @@ -29,8 +29,8 @@ */ -@import Foundation; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKActiveStepView.m b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepView.m similarity index 98% rename from ResearchKit/Common/ORKActiveStepView.m rename to ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepView.m index 0112e56d38..34ea74ed5c 100644 --- a/ResearchKit/Common/ORKActiveStepView.m +++ b/ResearchKitActiveTask/Common/Active Step/Views/ORKActiveStepView.m @@ -31,7 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKActiveStepView.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKTintedImageView.h" #import "ORKStepContainerView_Private.h" diff --git a/ResearchKit/ActiveTasks/ORKCountdownStep.h b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKCountdownStep.h rename to ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStep.h index 1410a44a2c..d435e9982c 100644 --- a/ResearchKit/ActiveTasks/ORKCountdownStep.h +++ b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKCountdownStep.m b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStep.m similarity index 94% rename from ResearchKit/ActiveTasks/ORKCountdownStep.m rename to ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStep.m index f47046e318..c28077ee69 100644 --- a/ResearchKit/ActiveTasks/ORKCountdownStep.m +++ b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStep.m @@ -31,15 +31,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKCountdownStep.h" -#import "ORKCountdownStepViewController.h" - - @implementation ORKCountdownStep -+ (Class)stepViewControllerClass { - return [ORKCountdownStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKCountdownStepViewController.h b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKCountdownStepViewController.h rename to ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStepViewController.h index 0cc20ce446..3a1928f475 100644 --- a/ResearchKit/ActiveTasks/ORKCountdownStepViewController.h +++ b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKCountdownStepViewController.m b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKCountdownStepViewController.m rename to ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStepViewController.m index d014a75197..a43e964182 100644 --- a/ResearchKit/ActiveTasks/ORKCountdownStepViewController.m +++ b/ResearchKitActiveTask/Common/Countdown Step/ORKCountdownStepViewController.m @@ -33,7 +33,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKActiveStepTimer.h" #import "ORKActiveStepView.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKLabel.h" #import "ORKSubheadlineLabel.h" diff --git a/ResearchKitActiveTask/Common/Custom View/ORKActiveStepCustomView.h b/ResearchKitActiveTask/Common/Custom View/ORKActiveStepCustomView.h new file mode 100644 index 0000000000..8693e8abc7 --- /dev/null +++ b/ResearchKitActiveTask/Common/Custom View/ORKActiveStepCustomView.h @@ -0,0 +1,52 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + + +NS_ASSUME_NONNULL_BEGIN + +@class ORKActiveStepViewController; + +@interface ORKActiveStepCustomView : UIView + +@property (nonatomic, weak, nullable) ORKActiveStepViewController *activeStepViewController; + +- (void)resetStep:(ORKActiveStepViewController *)viewController; +- (void)startStep:(ORKActiveStepViewController *)viewController; +- (void)suspendStep:(ORKActiveStepViewController *)viewController; +- (void)resumeStep:(ORKActiveStepViewController *)viewController; +- (void)finishStep:(ORKActiveStepViewController *)viewController; + +- (void)updateDisplay:(ORKActiveStepViewController *)viewController; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitActiveTask/Common/Custom View/ORKActiveStepCustomView.m b/ResearchKitActiveTask/Common/Custom View/ORKActiveStepCustomView.m new file mode 100644 index 0000000000..b806fa6557 --- /dev/null +++ b/ResearchKitActiveTask/Common/Custom View/ORKActiveStepCustomView.m @@ -0,0 +1,62 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKActiveStepCustomView.h" + +#import "ORKActiveStepViewController.h" + +#import +#import +#import + +#import + + +@implementation ORKActiveStepCustomView + +- (void)resetStep:(ORKStepViewController *)viewController { +} + +- (void)startStep:(ORKStepViewController *)viewController { +} + +- (void)suspendStep:(ORKStepViewController *)viewController { +} + +- (void)resumeStep:(ORKStepViewController *)viewController { +} + +- (void)finishStep:(ORKStepViewController *)viewController { +} + +- (void)updateDisplay:(ORKActiveStepViewController *)viewController { +} + +@end diff --git a/ResearchKit/Common/ORKOrderedTask+ORKPredefinedActiveTask.h b/ResearchKitActiveTask/Common/ORKOrderedTask+ORKPredefinedActiveTask.h similarity index 96% rename from ResearchKit/Common/ORKOrderedTask+ORKPredefinedActiveTask.h rename to ResearchKitActiveTask/Common/ORKOrderedTask+ORKPredefinedActiveTask.h index 44d1aaec3a..cddca3cb7a 100644 --- a/ResearchKit/Common/ORKOrderedTask+ORKPredefinedActiveTask.h +++ b/ResearchKitActiveTask/Common/ORKOrderedTask+ORKPredefinedActiveTask.h @@ -29,9 +29,10 @@ */ -@import UIKit; +#import #import + @class ORKNavigableOrderedTask; @@ -142,6 +143,36 @@ NS_ASSUME_NONNULL_BEGIN intendedUseDescription:(nullable NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options API_AVAILABLE(ios(14.0)); +/** + Returns a predefined task that consists of a Tecumseh Cube Test. + + In a Tecumseh Cube Task task, the participant is asked to step up and down onto 20cm high + step or block for 3 minutes, and then prompted to result for 3 minutes. During this period, + various sensor data is collected and returned by the task view controller's delegate. Sensor + data can include accelerometer, device motion, pedometer, location, and heart rate data + where available. + + By default, the task includes an instruction step that explains what the user needs to do during + the task, but this can be excluded with `ORKPredefinedTaskOptionExcludeInstructions`. + + @param identifier The task identifier to use for this task, appropriate to the study. + @param intendedUseDescription A localized string describing the intended use of the data + collected. If the value of this parameter is `nil`, the default + localized text is displayed. + @param audioBundleIdentifier The identifier for the bundle in which the audio file can be found. + @param audioResourceName The name of the audio file to be played. + @param audioFileExtension The file extension for the audio file to be played. + @param options Options that affect the features of the predefined task. + + @return An active Tecumseh Cube Test task that can be presented with an `ORKTaskViewController` object. + */ ++ (ORKOrderedTask *)tecumsehCubeTaskWithIdentifier:(NSString *)identifier + intendedUseDescription:(nullable NSString *)intendedUseDescription + audioBundleIdentifier:(NSString *)audioBundleIdentifier + audioResourceName:(NSString *)audioResourceName + audioFileExtension:(nullable NSString*)audioFileExtension + options:(ORKPredefinedTaskOption)options API_AVAILABLE(ios(14.0)); + /** Returns a predefined task that consists of a short walk. @@ -500,7 +531,6 @@ NS_ASSUME_NONNULL_BEGIN intendedUseDescription:(nullable NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options; - /** Returns a predefined task that tests the participant's reaction time. @@ -753,38 +783,6 @@ NS_ASSUME_NONNULL_BEGIN trailType:(ORKTrailMakingTypeIdentifier)trailType options:(ORKPredefinedTaskOption)options; -/** - Returns a predefined task that measures visual acuity using landolt C. - - @param identifier The task identifier to use for this task, appropriate to the study. - @param intendedUseDescription A localized string describing the intended use of the data - collected. If the value of this parameter is `nil`, the default - localized text is displayed. - - @return An landolt C visual acuity task that can be presented with an `ORKTaskViewController` object. - */ -+ (ORKOrderedTask *)landoltCVisualAcuityTaskWithIdentifier:(NSString *)identifier - intendedUseDescription:(nullable NSString *)itendedDescription; - -/** - Returns a predefined task that measures contrast sensitivity using landolt C. - - @param identifier The task identifier to use for this task, appropriate to the study. - @param intendedUseDescription A localized string describing the intended use of the data - collected. If the value of this parameter is `nil`, the default - localized text is displayed. - - @return An landolt C contrast sensitivity task that can be presented with an `ORKTaskViewController` object. - */ -+ (ORKOrderedTask *)landoltCContrastSensitivityTaskWithIdentifier:(NSString *)identifier - intendedUseDescription:(nullable NSString *)itendedDescription; - - -+ (ORKOrderedTask *)touchAbilityTaskWithIdentifier:(NSString *)identifier - intendedUseDescription:(nullable NSString *)intendedUseDescription - taskOptions:(ORKTouchAbilityTaskOption)taskOptions - options:(ORKPredefinedTaskOption)options; - @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKOrderedTask+ORKPredefinedActiveTask.m b/ResearchKitActiveTask/Common/ORKOrderedTask+ORKPredefinedActiveTask.m similarity index 86% rename from ResearchKit/Common/ORKOrderedTask+ORKPredefinedActiveTask.m rename to ResearchKitActiveTask/Common/ORKOrderedTask+ORKPredefinedActiveTask.m index 4bc7a79b72..42df4d34cf 100644 --- a/ResearchKit/Common/ORKOrderedTask+ORKPredefinedActiveTask.m +++ b/ResearchKitActiveTask/Common/ORKOrderedTask+ORKPredefinedActiveTask.m @@ -33,17 +33,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKOrderedTask+ORKPredefinedActiveTask.h" #import "ORKOrderedTask_Private.h" -#import "ORKAudioStepViewController.h" -#import "ORKAmslerGridStepViewController.h" -#import "ORKCountdownStepViewController.h" -#import "ORKTouchAnywhereStepViewController.h" -#import "ORKFitnessStepViewController.h" -#import "ORKToneAudiometryStepViewController.h" -#import "ORKSpatialSpanMemoryStepViewController.h" -#import "ORKSpeechRecognitionStepViewController.h" -#import "ORKStroopStepViewController.h" -#import "ORKWalkingTaskStepViewController.h" - #import "ORKAccelerometerRecorder.h" #import "ORKActiveStep_Internal.h" #import "ORKAmslerGridStep.h" @@ -59,6 +48,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTouchAnywhereStep.h" #import "ORKFitnessStep.h" #import "ORKFormStep.h" +#import "ORKHealthQuantityTypeRecorder.h" #import "ORKNavigableOrderedTask.h" #import "ORKPSATStep.h" #import "ORKQuestionStep.h" @@ -83,25 +73,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKdBHLToneAudiometryStep.h" #import "ORKdBHLToneAudiometryOnboardingStep.h" - #import "ORKSkin.h" -#import -#import "ORKTouchAbilityTapStep.h" -#import "ORKTouchAbilityLongPressStep.h" -#import "ORKTouchAbilitySwipeStep.h" -#import "ORKTouchAbilityPinchStep.h" -#import "ORKTouchAbilityRotationStep.h" -#import "ORKTouchAbilityScrollStep.h" #import "ORKHelpers_Internal.h" #import "UIImage+ResearchKit.h" #import - -ORKTaskProgress ORKTaskProgressMake(NSUInteger current, NSUInteger total) { - return (ORKTaskProgress){.current=current, .total=total}; -} - #pragma mark - Predefined NSString *const ORKInstruction0StepIdentifier = @"instruction"; @@ -150,9 +127,11 @@ @implementation ORKOrderedTask (ORKMakeTaskUtilities) + (NSArray*)makeRecorderConfigurationsWithOptions:(ORKPredefinedTaskOption)options { +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION HKUnit *bpmUnit = [[HKUnit countUnit] unitDividedByUnit:[HKUnit minuteUnit]]; HKQuantityType *heartRateType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]; - +#endif + NSMutableArray *recorderConfigurations = [NSMutableArray arrayWithCapacity:5]; if (!(ORKPredefinedTaskOptionExcludePedometer & options)) { @@ -166,13 +145,18 @@ @implementation ORKOrderedTask (ORKMakeTaskUtilities) [recorderConfigurations addObject:[[ORKDeviceMotionRecorderConfiguration alloc] initWithIdentifier:ORKDeviceMotionRecorderIdentifier frequency:100]]; } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION if (!(ORKPredefinedTaskOptionExcludeLocation & options)) { [recorderConfigurations addObject:[[ORKLocationRecorderConfiguration alloc] initWithIdentifier:ORKLocationRecorderIdentifier]]; } +#endif +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION if (!(ORKPredefinedTaskOptionExcludeHeartRate & options)) { [recorderConfigurations addObject:[[ORKHealthQuantityTypeRecorderConfiguration alloc] initWithIdentifier:ORKHeartRateRecorderIdentifier healthQuantityType:heartRateType unit:bpmUnit]]; } +#endif + return [recorderConfigurations copy]; } @@ -181,6 +165,7 @@ + (ORKCompletionStep *)makeCompletionStep { step.title = ORKLocalizedString(@"TASK_COMPLETE_TITLE", nil); step.text = ORKLocalizedString(@"TASK_COMPLETE_TEXT", nil); step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; return step; } @@ -227,6 +212,7 @@ + (ORKOrderedTask *)amslerGridTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"amslerGrid" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } { @@ -243,6 +229,7 @@ + (ORKOrderedTask *)amslerGridTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"amslerGrid" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } } @@ -263,7 +250,8 @@ + (ORKOrderedTask *)amslerGridTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"amslerGrid" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -311,7 +299,8 @@ + (ORKNavigableOrderedTask *)holePegTestTaskWithIdentifier:(NSString *)identifie step.image = [UIImage imageNamed:@"phoneholepeg" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -329,7 +318,8 @@ + (ORKNavigableOrderedTask *)holePegTestTaskWithIdentifier:(NSString *)identifie step.image = [UIImage animatedImageWithImages:@[image1, image2, image3, image4, image5, image6] duration:4]; step.imageContentMode = UIViewContentModeScaleAspectFit; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -446,6 +436,7 @@ + (ORKOrderedTask *)twoFingerTappingIntervalTaskWithIdentifier:(NSString *)ident step.image = [UIImage imageNamed:imageName inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeScaleAspectFit; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } } @@ -531,7 +522,8 @@ + (ORKOrderedTask *)twoFingerTappingIntervalTaskWithIdentifier:(NSString *)ident } step.imageContentMode = UIViewContentModeScaleAspectFit; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -612,6 +604,7 @@ + (ORKNavigableOrderedTask *)audioTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phonewaves" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -620,9 +613,10 @@ + (ORKNavigableOrderedTask *)audioTaskWithIdentifier:(NSString *)identifier step.title = ORKLocalizedString(@"AUDIO_TASK_TITLE", nil); step.text = speechInstruction ? : ORKLocalizedString(@"AUDIO_INTRO_TEXT", nil); step.detailText = ORKLocalizedString(@"AUDIO_CALL_TO_ACTION", nil); - step.image = [UIImage imageNamed:@"phonewaves" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; + step.image = [UIImage imageNamed:@"phonesoundwaves" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } } @@ -649,7 +643,8 @@ + (ORKNavigableOrderedTask *)audioTaskWithIdentifier:(NSString *)identifier step.title = ORKLocalizedString(@"AUDIO_TASK_TITLE", nil); step.text = ORKLocalizedString(@"AUDIO_TOO_LOUD_MESSAGE", nil); step.detailText = ORKLocalizedString(@"AUDIO_TOO_LOUD_ACTION_NEXT", nil); - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -709,6 +704,7 @@ + (ORKOrderedTask *)fitnessCheckTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"heartbeat" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -719,6 +715,7 @@ + (ORKOrderedTask *)fitnessCheckTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"walkingman" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } } @@ -801,6 +798,7 @@ + (ORKOrderedTask *)sixMinuteWalkTaskWithIdentifier:(NSString *)identifier // Explanation Step ORKInstructionStep *explainStep = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction0StepIdentifier]; explainStep.iconImage = [UIImage systemImageNamed:@"figure.walk"]; + explainStep.shouldAutomaticallyAdjustImageTintColor = YES; explainStep.title = ORKLocalizedString(@"6MWT_TASK_TITLE", nil); explainStep.text = intendedUseDescription ? : ORKLocalizedString(@"6MWT_INTRO", nil); explainStep.bodyItems = @[ @@ -940,6 +938,139 @@ + (ORKOrderedTask *)sixMinuteWalkTaskWithIdentifier:(NSString *)identifier return task; } +#pragma mark - tecusehCubeTask + +NSString *const ORKTecumsehCubeStepIdentifier = @"tecumseh"; + ++ (ORKOrderedTask *)tecumsehCubeTaskWithIdentifier:(NSString *)identifier + intendedUseDescription:(nullable NSString *)intendedUseDescription + audioBundleIdentifier:(NSString *)audioBundleIdentifier + audioResourceName:(NSString *)audioResourceName + audioFileExtension:(nullable NSString*)audioFileExtension + options:(ORKPredefinedTaskOption)options { + + NSTimeInterval stepDuration = 180; // 3 minutes + NSTimeInterval restDuration = 180; // 3 minutes + + NSMutableArray *steps = [NSMutableArray array]; + + if (!(options & ORKPredefinedTaskOptionExcludeInstructions)) { + + // Explanation Step + ORKInstructionStep *explainStep = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction0StepIdentifier]; + explainStep.iconImage = [UIImage systemImageNamed:@"cube"]; + explainStep.title = ORKLocalizedString(@"TC_TASK_TITLE", nil); + explainStep.text = intendedUseDescription ? : ORKLocalizedString(@"TC_INTRO", nil); + explainStep.shouldAutomaticallyAdjustImageTintColor = YES; + explainStep.bodyItems = @[ + [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"TC_INTRO_DETAILS", nil) + detailText:nil + image:nil + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleText], + + [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"TC_INTRO_DETAIL_TIME", nil) + detailText:nil + image:[UIImage systemImageNamed:@"stopwatch"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + + [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"TC_INTRO_DETAIL_WATCH", nil) + detailText:nil + image:[UIImage systemImageNamed:@"applewatch"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + + [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"TC_INTRO_DETAIL_DANGER", nil) + detailText:nil + image:[UIImage systemImageNamed:@"exclamationmark.triangle"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage] + ]; + + ORKStepArrayAddStep(steps, explainStep); + + // Instructions Step + ORKInstructionStep *instructStep = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction1StepIdentifier]; + instructStep.iconImage = [UIImage systemImageNamed:@"cube"]; + instructStep.title = ORKLocalizedString(@"TC_INSTRUCTIONS_TITLE", nil); + instructStep.shouldAutomaticallyAdjustImageTintColor = YES; + + instructStep.bodyItems = @[ + [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"TC_INSTRUCTIONS_1", nil) + detailText:nil + image:[UIImage systemImageNamed:@"1.circle"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + + [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"TC_INSTRUCTIONS_2", nil) + detailText:nil + image:[UIImage systemImageNamed:@"2.circle"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + + [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"TC_INSTRUCTIONS_3", nil) + detailText:nil + image:[UIImage systemImageNamed:@"3.circle"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage] + ]; + + ORKStepArrayAddStep(steps, instructStep); + } + + // Fitness Step + ORKBundleAsset *audio = [[ORKBundleAsset alloc] initWithName:audioResourceName + bundleIdentifier:audioBundleIdentifier + fileExtension:audioFileExtension]; + + ORKAudioFitnessStep *cubeStep = [[ORKAudioFitnessStep alloc] initWithIdentifier:identifier + audioAsset:audio + vocalCues:nil]; + + cubeStep.stepDuration = stepDuration; + cubeStep.title = ORKLocalizedString(@"TC_TEST_IN_PROGRESS", nil); + cubeStep.text = ORKLocalizedString(@"TC_TEST_IN_PROGRESS_DETAIL", nil); + cubeStep.spokenInstruction = cubeStep.text; + cubeStep.recorderConfigurations = [self makeRecorderConfigurationsWithOptions:options]; + cubeStep.shouldContinueOnFinish = YES; + cubeStep.optional = NO; + cubeStep.shouldStartTimerAutomatically = YES; + cubeStep.shouldVibrateOnStart = YES; + cubeStep.shouldVibrateOnFinish = YES; + cubeStep.shouldPlaySoundOnStart = YES; + cubeStep.shouldPlaySoundOnFinish = YES; + cubeStep.shouldSpeakRemainingTimeAtHalfway = YES; + cubeStep.shouldSpeakCountDown = YES; + ORKStepArrayAddStep(steps, cubeStep); + + // Rest Step + ORKFitnessStep *stillStep = [[ORKFitnessStep alloc] initWithIdentifier:ORKFitnessRestStepIdentifier]; + stillStep.stepDuration = restDuration; + stillStep.title = ORKLocalizedString(@"TC_REST_IN_PROGRESS", nil); + stillStep.text = ORKLocalizedString(@"TC_REST_IN_PROGRESS_DETAIL", nil); + stillStep.spokenInstruction = stillStep.text; + stillStep.recorderConfigurations = [self makeRecorderConfigurationsWithOptions:options]; + stillStep.shouldContinueOnFinish = YES; + stillStep.optional = NO; + stillStep.shouldStartTimerAutomatically = YES; + stillStep.shouldVibrateOnStart = YES; + stillStep.shouldVibrateOnFinish = YES; + stillStep.shouldPlaySoundOnStart = YES; + stillStep.shouldPlaySoundOnFinish = YES; + stillStep.shouldSpeakRemainingTimeAtHalfway = YES; + stillStep.shouldSpeakCountDown = YES; + ORKStepArrayAddStep(steps, stillStep); + + if (!(options & ORKPredefinedTaskOptionExcludeConclusion)) { + ORKInstructionStep *completionStep = [self makeCompletionStep]; + ORKStepArrayAddStep(steps, completionStep); + } + + ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; + return task; +} + #pragma mark - shortWalkTask NSString *const ORKShortWalkOutboundStepIdentifier = @"walking.outbound"; @@ -963,6 +1094,7 @@ + (ORKOrderedTask *)shortWalkTaskWithIdentifier:(NSString *)identifier step.detailText = ORKLocalizedString(@"WALK_INTRO_TEXT", nil); step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -974,6 +1106,7 @@ + (ORKOrderedTask *)shortWalkTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"pocket" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } } @@ -1108,6 +1241,7 @@ + (ORKOrderedTask *)walkBackAndForthTaskWithIdentifier:(NSString *)identifier step.detailText = ORKLocalizedString(@"WALK_INTRO_TEXT", nil); step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -1119,6 +1253,7 @@ + (ORKOrderedTask *)walkBackAndForthTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"pocket" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } } @@ -1229,92 +1364,54 @@ + (ORKOrderedTask *)kneeRangeOfMotionTaskWithIdentifier:(NSString *)identifier } if (!(options & ORKPredefinedTaskOptionExcludeInstructions)) { - if (@available(iOS 13.0, *)) { - // Use body items with SFSymbols in iOS 13+ - ORKInstructionStep *instructionStep = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction0StepIdentifier]; - - instructionStep.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); - instructionStep.text = intendedUseDescription; - instructionStep.shouldTintImages = YES; - instructionStep.iconImage = kneeStartImage; - instructionStep.imageContentMode = UIViewContentModeCenter; - - instructionStep.bodyItems = @[ - - [[ORKBodyItem alloc] initWithText: - ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_LEFT", nil) : - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_RIGHT", nil) - detailText:nil - image:[UIImage systemImageNamed:@"1.circle.fill"] - learnMoreItem:nil - bodyItemStyle:ORKBodyItemStyleImage], - - [[ORKBodyItem alloc] initWithText: - ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_LEFT", nil) : - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_RIGHT", nil) - detailText:nil - image:[UIImage systemImageNamed:@"2.circle.fill"] - learnMoreItem:nil - bodyItemStyle:ORKBodyItemStyleImage], - - [[ORKBodyItem alloc] initWithText: - ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_2_LEFT", nil) : - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_2_RIGHT", nil) - detailText:nil - image:[UIImage systemImageNamed:@"3.circle.fill"] - learnMoreItem:nil - bodyItemStyle:ORKBodyItemStyleImage], - - [[ORKBodyItem alloc] initWithText: - ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_LEFT", nil) : - ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_RIGHT", nil) - detailText:nil - image:[UIImage systemImageNamed:@"4.circle.fill"] - learnMoreItem:nil - bodyItemStyle:ORKBodyItemStyleImage], - ]; - - ORKStepArrayAddStep(steps, instructionStep); - - } else { - - // Fallback for iOS 12 and earlier - ORKInstructionStep *instructionStep0 = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction0StepIdentifier]; - instructionStep0.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); - instructionStep0.text = intendedUseDescription; - instructionStep0.detailText = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_LEFT", nil) : ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_RIGHT", nil); - instructionStep0.shouldTintImages = YES; - instructionStep0.imageContentMode = UIViewContentModeCenter; - ORKStepArrayAddStep(steps, instructionStep0); - - ORKInstructionStep *instructionStep1 = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction1StepIdentifier]; - instructionStep1.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); - instructionStep1.text = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_LEFT", nil) : ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_RIGHT", nil); - ORKStepArrayAddStep(steps, instructionStep1); - - ORKInstructionStep *instructionStep2 = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction2StepIdentifier]; - instructionStep2.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); - instructionStep2.text = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TITLE_LEFT", nil) : ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TITLE_RIGHT", nil); - - instructionStep2.detailText = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_2_LEFT", nil) : ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_2_RIGHT", nil); - instructionStep2.image = kneeStartImage; - instructionStep2.imageContentMode = UIViewContentModeCenter; - instructionStep2.shouldTintImages = YES; - ORKStepArrayAddStep(steps, instructionStep2); - - ORKInstructionStep *instructionStep3 = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction3StepIdentifier]; - instructionStep3.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); - instructionStep3.text = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_LEFT", nil) : ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_RIGHT", nil); - - instructionStep3.image = kneeMaximumImage; - instructionStep3.imageContentMode = UIViewContentModeCenter; - instructionStep3.shouldTintImages = YES; - ORKStepArrayAddStep(steps, instructionStep3); - } + ORKInstructionStep *instructionStep = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction0StepIdentifier]; + instructionStep.shouldAutomaticallyAdjustImageTintColor = YES; + + instructionStep.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); + instructionStep.text = intendedUseDescription; + instructionStep.shouldTintImages = YES; + instructionStep.iconImage = kneeStartImage; + instructionStep.imageContentMode = UIViewContentModeCenter; + instructionStep.bodyItems = @[ + + [[ORKBodyItem alloc] initWithText: + ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_LEFT", nil) : + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_RIGHT", nil) + detailText:nil + image:[UIImage systemImageNamed:@"1.circle.fill"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + + [[ORKBodyItem alloc] initWithText: + ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_LEFT", nil) : + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_RIGHT", nil) + detailText:nil + image:[UIImage systemImageNamed:@"2.circle.fill"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + + [[ORKBodyItem alloc] initWithText: + ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_2_LEFT", nil) : + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_2_RIGHT", nil) + detailText:nil + image:[UIImage systemImageNamed:@"3.circle.fill"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + + [[ORKBodyItem alloc] initWithText: + ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_LEFT", nil) : + ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TEXT_INSTRUCTION_3_RIGHT", nil) + detailText:nil + image:[UIImage systemImageNamed:@"4.circle.fill"] + learnMoreItem:nil + bodyItemStyle:ORKBodyItemStyleImage], + ]; + + ORKStepArrayAddStep(steps, instructionStep); } NSString *instructionText = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TOUCH_ANYWHERE_STEP_INSTRUCTION_LEFT", nil) : ORKLocalizedString(@"KNEE_RANGE_OF_MOTION_TOUCH_ANYWHERE_STEP_INSTRUCTION_RIGHT", nil); @@ -1376,12 +1473,14 @@ + (ORKOrderedTask *)shoulderRangeOfMotionTaskWithIdentifier:(NSString *)identifi instructionStep0.text = intendedUseDescription; instructionStep0.detailText = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"SHOULDER_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_LEFT", nil) : ORKLocalizedString(@"SHOULDER_RANGE_OF_MOTION_TEXT_INSTRUCTION_0_RIGHT", nil); instructionStep0.shouldTintImages = YES; + instructionStep0.shouldAutomaticallyAdjustImageTintColor = YES; instructionStep0.imageContentMode = UIViewContentModeCenter; ORKStepArrayAddStep(steps, instructionStep0); ORKInstructionStep *instructionStep1 = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction1StepIdentifier]; instructionStep1.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); instructionStep1.text = ([limbType isEqualToString:ORKLocalizedString(@"LIMB_LEFT", nil)])? ORKLocalizedString(@"SHOULDER_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_LEFT", nil) : ORKLocalizedString(@"SHOULDER_RANGE_OF_MOTION_TEXT_INSTRUCTION_1_RIGHT", nil); + instructionStep1.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, instructionStep1); ORKInstructionStep *instructionStep2 = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction2StepIdentifier]; @@ -1390,6 +1489,7 @@ + (ORKOrderedTask *)shoulderRangeOfMotionTaskWithIdentifier:(NSString *)identifi instructionStep2.image = shoulderStartImage; instructionStep2.imageContentMode = UIViewContentModeCenter; instructionStep2.shouldTintImages = YES; + instructionStep2.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, instructionStep2); ORKInstructionStep *instructionStep3 = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction3StepIdentifier]; @@ -1398,6 +1498,7 @@ + (ORKOrderedTask *)shoulderRangeOfMotionTaskWithIdentifier:(NSString *)identifi instructionStep3.image = shoulderMaximumImage; instructionStep3.imageContentMode = UIViewContentModeCenter; instructionStep3.shouldTintImages = YES; + instructionStep3.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, instructionStep3); } @@ -1406,7 +1507,7 @@ + (ORKOrderedTask *)shoulderRangeOfMotionTaskWithIdentifier:(NSString *)identifi touchAnywhereStep.title = ORKLocalizedString(@"RANGE_OF_MOTION_TITLE", nil); ORKStepArrayAddStep(steps, touchAnywhereStep); - touchAnywhereStep.spokenInstruction = touchAnywhereStep.text; + touchAnywhereStep.spokenInstruction = touchAnywhereStep.title; ORKDeviceMotionRecorderConfiguration *deviceMotionRecorderConfig = [[ORKDeviceMotionRecorderConfiguration alloc] initWithIdentifier:ORKDeviceMotionRecorderIdentifier frequency:100]; @@ -1463,7 +1564,8 @@ + (ORKOrderedTask *)spatialSpanMemoryTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"memory" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeScaleAspectFit; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -1474,13 +1576,14 @@ + (ORKOrderedTask *)spatialSpanMemoryTaskWithIdentifier:(NSString *)identifier step.detailText = ORKLocalizedString(@"SPATIAL_SPAN_MEMORY_CALL_TO_ACTION", nil); if (!customTargetImage) { - step.image = [UIImage imageNamed:@"memory" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; + step.image = [UIImage imageNamed:@"memory-second-screen" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; } else { step.image = customTargetImage; } step.imageContentMode = UIViewContentModeScaleAspectFit; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -1536,7 +1639,8 @@ + (ORKOrderedTask *)speechRecognitionTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phonewaves" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.shouldTintImages = YES; step.imageContentMode = UIViewContentModeCenter; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -1548,7 +1652,8 @@ + (ORKOrderedTask *)speechRecognitionTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phonewavesspeech" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -1601,11 +1706,12 @@ + (ORKOrderedTask *)speechInNoiseTaskWithIdentifier:(NSString *)identifier ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction0StepIdentifier]; step.title = ORKLocalizedString(@"SPEECH_IN_NOISE_TITLE", nil); step.detailText = intendedUseDescription; - step.text = intendedUseDescription ? : ORKLocalizedString(@"SPEECH_IN_NOISE_INTRO_TEXT", nil); + step.text = ORKLocalizedString(@"SPEECH_IN_NOISE_INTRO_TEXT", nil); step.image = [UIImage imageNamed:@"speechInNoise" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } { @@ -1615,7 +1721,8 @@ + (ORKOrderedTask *)speechInNoiseTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"speechInNoise" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -1694,7 +1801,8 @@ + (ORKOrderedTask *)stroopTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phonestrooplabel" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } { @@ -1704,7 +1812,8 @@ + (ORKOrderedTask *)stroopTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phonestroopbutton" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -1762,6 +1871,7 @@ + (ORKOrderedTask *)toneAudiometryTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phonewaves_inverted" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -1774,6 +1884,7 @@ + (ORKOrderedTask *)toneAudiometryTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phonefrequencywaves" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -1827,7 +1938,6 @@ + (ORKOrderedTask *)toneAudiometryTaskWithIdentifier:(NSString *)identifier NSString *const ORKdBHLToneAudiometryStep1Identifier = @"dBHL1.tone.audiometry"; NSString *const ORKdBHLToneAudiometryStep2Identifier = @"dBHL2.tone.audiometry"; - + (ORKNavigableOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options { @@ -1846,19 +1956,17 @@ + (ORKNavigableOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)id step.image = [UIImage imageNamed:@"audiometry" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - if (@available(iOS 13.0, *)) { - ORKBodyItem * item1 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_1", nil) detailText:nil image:[UIImage systemImageNamed:@"ear"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; - ORKBodyItem * item2 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_2", nil) detailText:nil image:[UIImage systemImageNamed:@"hand.draw.fill"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; - ORKBodyItem * item3 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_3", nil) detailText:nil image:[UIImage systemImageNamed:@"volume.2.fill"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; - ORKBodyItem * item4 = [[ORKBodyItem alloc] initWithHorizontalRule]; - ORKBodyItem * item5 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_4", nil) detailText:nil image:[UIImage systemImageNamed:@"stopwatch"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; - item5.useSecondaryColor = YES; - ORKBodyItem * item6 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_5", nil) detailText:nil image:[UIImage systemImageNamed:@"moon.fill"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; - item6.useSecondaryColor = YES; - step.bodyItems = @[item1, item2, item3, item4, item5, item6]; - } else { - // Fallback on earlier versions - } + step.shouldAutomaticallyAdjustImageTintColor = YES; + + ORKBodyItem * item1 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_1", nil) detailText:nil image:[UIImage systemImageNamed:@"ear"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; + ORKBodyItem * item2 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_2", nil) detailText:nil image:[UIImage systemImageNamed:@"hand.draw.fill"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; + ORKBodyItem * item3 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_3", nil) detailText:nil image:[UIImage systemImageNamed:@"volume.2.fill"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; + ORKBodyItem * item4 = [[ORKBodyItem alloc] initWithHorizontalRule]; + ORKBodyItem * item5 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_4", nil) detailText:nil image:[UIImage systemImageNamed:@"stopwatch"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; + item5.useSecondaryColor = YES; + ORKBodyItem * item6 = [[ORKBodyItem alloc] initWithText:ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_BODY_ITEM_TEXT_5", nil) detailText:nil image:[UIImage systemImageNamed:@"moon.fill"] learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleImage]; + item6.useSecondaryColor = YES; + step.bodyItems = @[item1, item2, item3, item4, item5, item6]; ORKStepArrayAddStep(steps, step); } @@ -1876,7 +1984,8 @@ + (ORKNavigableOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)id step.image = [UIImage imageNamed:@"audiometry" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -1888,12 +1997,16 @@ + (ORKNavigableOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)id step.thresholdValue = 45; step.title = ORKLocalizedString(@"ENVIRONMENTSPL_TITLE_2", nil); step.text = ORKLocalizedString(@"ENVIRONMENTSPL_INTRO_TEXT_2", nil); + ORKStepArrayAddStep(steps, step); } { ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction2StepIdentifier]; - step.title = ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_STEP_TITLE_LEFT_EAR", nil); + step.title = ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_STEP_TITLE_RIGHT_EAR", nil); + step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -1901,15 +2014,16 @@ + (ORKNavigableOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)id ORKdBHLToneAudiometryStep *step = [[ORKdBHLToneAudiometryStep alloc] initWithIdentifier:ORKdBHLToneAudiometryStep1Identifier]; step.title = ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_TASK_TITLE_2", nil); step.stepDuration = CGFLOAT_MAX; + // manually adding the headphone type here for testing purposes within ORKCatalog step.headphoneType = ORKHeadphoneTypeIdentifierAirPodsGen1; - step.earPreference = ORKAudioChannelLeft; + step.earPreference = ORKAudioChannelRight; ORKStepArrayAddStep(steps, step); } { ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction3StepIdentifier]; - step.title = ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_STEP_TITLE_RIGHT_EAR", nil); - step.shouldTintImages = YES; + step.title = ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_STEP_TITLE_LEFT_EAR", nil); + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -1917,7 +2031,8 @@ + (ORKNavigableOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)id ORKdBHLToneAudiometryStep *step = [[ORKdBHLToneAudiometryStep alloc] initWithIdentifier:ORKdBHLToneAudiometryStep2Identifier]; step.title = ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_TASK_TITLE_2", nil); step.stepDuration = CGFLOAT_MAX; - step.earPreference = ORKAudioChannelRight; + step.earPreference = ORKAudioChannelLeft; + // manually adding the headphone type here for testing purposes within ORKCatalog step.headphoneType = ORKHeadphoneTypeIdentifierAirPodsGen1; ORKStepArrayAddStep(steps, step); } @@ -1932,7 +2047,6 @@ + (ORKNavigableOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)id return task; } - #pragma mark - towerOfHanoiTask NSString *const ORKTowerOfHanoiStepIdentifier = @"towerOfHanoi"; @@ -1953,7 +2067,8 @@ + (ORKOrderedTask *)towerOfHanoiTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phone-tower-of-hanoi" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -1965,7 +2080,8 @@ + (ORKOrderedTask *)towerOfHanoiTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"tower-of-hanoi-second-screen" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -2014,7 +2130,8 @@ + (ORKOrderedTask *)reactionTimeTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phoneshake" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2026,7 +2143,8 @@ + (ORKOrderedTask *)reactionTimeTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"phoneshakecircle" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -2082,7 +2200,8 @@ + (ORKOrderedTask *)normalizedReactionTimeTaskWithIdentifier:(NSString *)identif step.image = [UIImage imageNamed:@"phoneshake" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2094,7 +2213,8 @@ + (ORKOrderedTask *)normalizedReactionTimeTaskWithIdentifier:(NSString *)identif step.image = [UIImage imageNamed:@"phoneshakecircle" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -2154,6 +2274,7 @@ + (ORKOrderedTask *)timedWalkTaskWithIdentifier:(NSString *)identifier step.text = intendedUseDescription; step.detailText = ORKLocalizedString(@"TIMED_WALK_INTRO_DETAIL", nil); step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -2201,6 +2322,7 @@ + (ORKOrderedTask *)timedWalkTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"timer" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; + step.shouldAutomaticallyAdjustImageTintColor = YES; ORKStepArrayAddStep(steps, step); } @@ -2227,10 +2349,12 @@ + (ORKOrderedTask *)timedWalkTaskWithIdentifier:(NSString *)identifier [recorderConfigurations addObject:[[ORKDeviceMotionRecorderConfiguration alloc] initWithIdentifier:ORKDeviceMotionRecorderIdentifier frequency:100]]; } + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION if (! (options & ORKPredefinedTaskOptionExcludeLocation)) { [recorderConfigurations addObject:[[ORKLocationRecorderConfiguration alloc] initWithIdentifier:ORKLocationRecorderIdentifier]]; } - +#endif { ORKTimedWalkStep *step = [[ORKTimedWalkStep alloc] initWithIdentifier:ORKTimedWalkTrial1StepIdentifier]; step.title = ORKLocalizedString(@"TIMED_WALK_TITLE", nil); @@ -2326,7 +2450,8 @@ + (ORKOrderedTask *)PSATTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"psatDice" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } { @@ -2342,7 +2467,8 @@ + (ORKOrderedTask *)PSATTaskWithIdentifier:(NSString *)identifier NSString *seconds = [secondsFormatter stringFromTimeInterval:interStimulusInterval]; step.text = [NSString localizedStringWithFormat:ORKLocalizedString(@"PSAT_INTRO_TEXT_2_%@", nil), seconds]; step.detailText = ORKLocalizedString(@"PSAT_CALL_TO_ACTION", nil); - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -2422,10 +2548,11 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden NSString *imageName = leftHand ? @"tremortestLeft" : @"tremortestRight"; step.image = [UIImage imageNamed:imageName inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - + // TODO: Awaiting newer assets. step.imageContentMode = UIViewContentModeScaleAspectFit; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2437,7 +2564,7 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden step.text = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_IN_LAP_INTRO", nil); step.detailText = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_INTRO_TEXT", nil); step.image = [UIImage imageNamed:@"tremortest3a" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - + // TODO: Awaiting newer assets. step.imageContentMode = UIViewContentModeScaleAspectFit; step.auxiliaryImage = [UIImage imageNamed:@"tremortest3b" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; if (leftHand) { @@ -2448,7 +2575,8 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden step.text = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_IN_LAP_INTRO_RIGHT", nil); } step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2488,7 +2616,7 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden step.text = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_EXTEND_ARM_INTRO", nil); step.detailText = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_INTRO_TEXT", nil); step.image = [UIImage imageNamed:@"tremortest4a" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - + // TODO: Awaiting newer assets. step.imageContentMode = UIViewContentModeScaleAspectFit; step.auxiliaryImage = [UIImage imageNamed:@"tremortest4b" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; if (leftHand) { @@ -2499,7 +2627,8 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden step.text = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_EXTEND_ARM_INTRO_RIGHT", nil); } step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2555,7 +2684,8 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden step.text = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_BEND_ARM_INTRO_RIGHT", nil); } step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2605,7 +2735,8 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden step.text = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_TOUCH_NOSE_INTRO_RIGHT", nil); } step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2653,7 +2784,8 @@ + (NSMutableArray *)stepsForOneHandTremorTestTaskWithIdentifier:(NSString *)iden step.text = ORKLocalizedString(@"TREMOR_TEST_ACTIVE_STEP_TURN_WRIST_INTRO_RIGHT", nil); } step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2723,7 +2855,8 @@ + (ORKNavigableOrderedTask *)tremorTestTaskWithIdentifier:(NSString *)identifier step.image = [step.image ork_flippedImage:UIImageOrientationUpMirrored]; } step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -2880,7 +3013,8 @@ + (ORKOrderedTask *)trailmakingTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"trailmaking" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2895,7 +3029,8 @@ + (ORKOrderedTask *)trailmakingTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"trailmaking" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } @@ -2911,7 +3046,8 @@ + (ORKOrderedTask *)trailmakingTaskWithIdentifier:(NSString *)identifier step.image = [UIImage imageNamed:@"trailmaking" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; step.imageContentMode = UIViewContentModeCenter; step.shouldTintImages = YES; - + step.shouldAutomaticallyAdjustImageTintColor = YES; + ORKStepArrayAddStep(steps, step); } } @@ -2944,302 +3080,4 @@ + (ORKOrderedTask *)trailmakingTaskWithIdentifier:(NSString *)identifier return task; } -#pragma mark - landoltC Visual Acuity - -+ (ORKOrderedTask *)landoltCVisualAcuityTaskWithIdentifier:(NSString *)identifier - intendedUseDescription:(nullable NSString *)intendedDescription { - - - NSMutableArray<__kindof ORKStep *> *steps = [NSMutableArray array]; - - ORKInstructionStep *instructionStep = [[ORKInstructionStep alloc] initWithIdentifier:@"visualAcuityLandoltCInstructionStep"]; - instructionStep.title = @"Landolt C Acuity Task"; - instructionStep.text = @"This task collects data to better understand your visual acuity."; - instructionStep.image = [UIImage imageNamed:@"VisualExam" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instructionStep.imageContentMode = UIViewContentModeCenter; - instructionStep.shouldTintImages = YES; - - ORKLearnMoreInstructionStep *learnMoreStep = [[ORKLearnMoreInstructionStep alloc] initWithIdentifier:@"LearnMoreInstructionIdentifier"]; - ORKLearnMoreItem *learnMoreItem = [[ORKLearnMoreItem alloc] initWithText:@"Learn more about Landolt C." learnMoreInstructionStep:learnMoreStep]; - - ORKBodyItem *bodyItemOne = [[ORKBodyItem alloc] initWithText:nil detailText:@"During this task, a Landolt C will appear on the screen in various orientations and sizes for a few seconds." image:nil learnMoreItem:learnMoreItem bodyItemStyle:ORKBodyItemStyleBulletPoint]; - - ORKBodyItem *bodyItemTwo = [[ORKBodyItem alloc] initWithText:nil detailText:@"Each time this happens, use your finger to align the dial with the opening gap in the C and tap the 'Next' button." image:nil learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleBulletPoint]; - - NSMutableArray *bodyItems = [[NSMutableArray alloc] initWithObjects:bodyItemOne, bodyItemTwo, nil]; - - instructionStep.bodyItems = bodyItems; - - ORKStepArrayAddStep(steps, instructionStep); - - ORKLandoltCStep *landoltCStep = [[ORKLandoltCStep alloc]initWithIdentifier:@"landoltCStep" testType:VisionStepTypeVisualAcuity eyeToTest:VisionStepLeftOrRightEyeRight]; - ORKStepArrayAddStep(steps, landoltCStep); - - ORKCompletionStep *completionStep = [self makeCompletionStep]; - - ORKStepArrayAddStep(steps, completionStep); - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - - return task; -} - -#pragma mark - landoltC Contrast Sensitivity - -+ (ORKOrderedTask *)landoltCContrastSensitivityTaskWithIdentifier:(NSString *)identifier - intendedUseDescription:(nullable NSString *)intendedDescription { - - - NSMutableArray<__kindof ORKStep *> *steps = [NSMutableArray array]; - - ORKInstructionStep *instructionStep = [[ORKInstructionStep alloc] initWithIdentifier:@"contrastSensitivityInstructionStep"]; - instructionStep.title = @"Landolt C Contrast Sensitivity"; - instructionStep.text = @"This task collects data to better understand your visual contrast sensitivity."; - instructionStep.image = [UIImage imageNamed:@"ContrastExam" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instructionStep.imageContentMode = UIViewContentModeCenter; - instructionStep.shouldTintImages = YES; - - ORKLearnMoreInstructionStep *learnMoreStep = [[ORKLearnMoreInstructionStep alloc] initWithIdentifier:@"LearnMoreInstructionIdentifier"]; - ORKLearnMoreItem *learnMoreItem = [[ORKLearnMoreItem alloc] initWithText:@"Learn more about Landolt C." learnMoreInstructionStep:learnMoreStep]; - - ORKBodyItem *bodyItemOne = [[ORKBodyItem alloc] initWithText:nil detailText:@"During this task, a Landolt C will appear on the screen in various orientations and contrasts for a few seconds." image:nil learnMoreItem:learnMoreItem bodyItemStyle:ORKBodyItemStyleBulletPoint]; - - ORKBodyItem *bodyItemTwo = [[ORKBodyItem alloc] initWithText:nil detailText:@"Each time this happens, use your finger to align the dial with the opening gap in the C and tap the 'Next' button.\n" image:nil learnMoreItem:nil bodyItemStyle:ORKBodyItemStyleBulletPoint]; - - NSMutableArray *bodyItems = [[NSMutableArray alloc] initWithObjects:bodyItemOne, bodyItemTwo, nil]; - instructionStep.bodyItems = bodyItems; - - ORKStepArrayAddStep(steps, instructionStep); - - ORKLandoltCStep *landoltCStep = [[ORKLandoltCStep alloc]initWithIdentifier:@"landoltCStep" testType:VisionStepTypeContrastSensitivity eyeToTest:VisionStepLeftOrRightEyeLeft]; - ORKStepArrayAddStep(steps, landoltCStep); - - ORKCompletionStep *completionStep = [self makeCompletionStep]; - - ORKStepArrayAddStep(steps, completionStep); - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - - return task; -} - -#pragma mark - touch ability - -NSString *const ORKTouchAbilityTapStepIdentifier = @"touchAbilityTap"; -NSString *const ORKTouchAbilityLongPressStepIdentifier = @"touchAbilityLongPress"; -NSString *const ORKTouchAbilitySwipeStepIdentifier = @"touchAbilitySwipe"; -NSString *const ORKTouchAbilityPinchStepIdentifier = @"touchAbilityPinch"; -NSString *const ORKTouchAbilityRotationStepIdentifier = @"touchAbilityRotation"; -NSString *const ORKTouchAbilityVerticalScrollStepIdentifier = @"touchAbilityVerticalScroll"; -NSString *const ORKTouchAbilityHorizontalScrollStepIdentifier = @"touchAbilityHorizontalScroll"; - -+ (ORKOrderedTask *)touchAbilityTaskWithIdentifier:(NSString *)identifier - intendedUseDescription:(nullable NSString *)intendedUseDescription - taskOptions:(ORKTouchAbilityTaskOption)taskOptions - options:(ORKPredefinedTaskOption)options { - - NSMutableArray<__kindof ORKStep *> *steps = [NSMutableArray array]; - - if (!(options & ORKPredefinedTaskOptionExcludeInstructions)) { - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction0StepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_INSTRUCTION_TITLE", nil); - step.text = intendedUseDescription; - step.detailText = ORKLocalizedString(@"TOUCH_ABILITY_INSTRUCTION_DETAIL", nil); - step.image = [UIImage imageNamed:@"touchAbilityInstruction" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - step.shouldTintImages = YES; - - ORKStepArrayAddStep(steps, step); - } - } - - NSUInteger count = 0; - - if (taskOptions & ORKTouchAbilityTaskOptionTap) { - - ORKInstructionStep *instruction = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction1StepIdentifier]; - instruction.title = ORKLocalizedString(@"TOUCH_ABILITY_TAP_TITLE", nil); - instruction.text = ORKLocalizedString(@"TOUCH_ABILITY_TAP_TEXT", nil); - instruction.image = [UIImage imageNamed:@"touchAbilityTap" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instruction.shouldTintImages = YES; - - if (count == 0) { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION", nil); - } else { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION_NEXT", nil); - } - - ORKStepArrayAddStep(steps, instruction); - - ORKTouchAbilityTapStep *step = [[ORKTouchAbilityTapStep alloc] initWithIdentifier:ORKTouchAbilityTapStepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_TAP_TITLE", nil); - - ORKStepArrayAddStep(steps, step); - - count += 1; - } - - if (taskOptions & ORKTouchAbilityTaskOptionLongPress) { - - ORKInstructionStep *instruction = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction2StepIdentifier]; - instruction.title = ORKLocalizedString(@"TOUCH_ABILITY_LONG_PRESS_TITLE", nil); - instruction.text = ORKLocalizedString(@"TOUCH_ABILITY_LONG_PRESS_TEXT", nil); - instruction.image = [UIImage imageNamed:@"touchAbilityTap" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instruction.shouldTintImages = YES; - - if (count == 0) { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION", nil); - } else { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION_NEXT", nil); - } - - ORKStepArrayAddStep(steps, instruction); - - ORKTouchAbilityLongPressStep *step = [[ORKTouchAbilityLongPressStep alloc] initWithIdentifier:ORKTouchAbilityLongPressStepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_LONG_PRESS_TITLE", nil); - - ORKStepArrayAddStep(steps, step); - - count += 1; - } - - if (taskOptions & ORKTouchAbilityTaskOptionSwipe) { - - ORKInstructionStep *instruction = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction3StepIdentifier]; - instruction.title = ORKLocalizedString(@"TOUCH_ABILITY_SWIPE_TITLE", nil); - instruction.text = ORKLocalizedString(@"TOUCH_ABILITY_SWIPE_TEXT", nil); - - NSArray *images = @[[UIImage imageNamed:@"touchAbilitySwipe1" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil], - [UIImage imageNamed:@"touchAbilitySwipe2" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil], - [UIImage imageNamed:@"touchAbilitySwipe3" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil], - [UIImage imageNamed:@"touchAbilitySwipe4" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil], - [UIImage imageNamed:@"touchAbilitySwipe1" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]]; - - instruction.image = [UIImage animatedImageWithImages:images duration:2]; - instruction.shouldTintImages = YES; - - if (count == 0) { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION", nil); - } else { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION_NEXT", nil); - } - - ORKStepArrayAddStep(steps, instruction); - - ORKTouchAbilitySwipeStep *step = [[ORKTouchAbilitySwipeStep alloc] initWithIdentifier:ORKTouchAbilitySwipeStepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_SWIPE_TITLE", nil); - - ORKStepArrayAddStep(steps, step); - - count += 1; - } - - - if (taskOptions & ORKTouchAbilityTaskOptionVerticalScroll) { - - ORKInstructionStep *instruction = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction4StepIdentifier]; - instruction.title = ORKLocalizedString(@"TOUCH_ABILITY_VERTICAL_SCROLL_TITLE", nil); - instruction.text = ORKLocalizedString(@"TOUCH_ABILITY_VERTICAL_SCROLL_TEXT", nil); - instruction.image = [UIImage imageNamed:@"touchAbilityVerticalScroll" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instruction.shouldTintImages = YES; - - if (count == 0) { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION", nil); - } else { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION_NEXT", nil); - } - - ORKStepArrayAddStep(steps, instruction); - - ORKTouchAbilityScrollStep *step = [[ORKTouchAbilityScrollStep alloc] initWithIdentifier:ORKTouchAbilityVerticalScrollStepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_VERTICAL_SCROLL_TITLE", nil); - step.horizontal = NO; - - ORKStepArrayAddStep(steps, step); - - count += 1; - } - - if (taskOptions & ORKTouchAbilityTaskOptionHorizontalScroll) { - - ORKInstructionStep *instruction = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction5StepIdentifier]; - instruction.title = ORKLocalizedString(@"TOUCH_ABILITY_HORIZONTAL_SCROLL_TITLE", nil); - instruction.text = ORKLocalizedString(@"TOUCH_ABILITY_HORIZONTAL_SCROLL_TEXT", nil); - instruction.image = [UIImage imageNamed:@"touchAbilityHorizontalScroll" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instruction.shouldTintImages = YES; - - if (count == 0) { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION", nil); - } else { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION_NEXT", nil); - } - - ORKStepArrayAddStep(steps, instruction); - - ORKTouchAbilityScrollStep *step = [[ORKTouchAbilityScrollStep alloc] initWithIdentifier:ORKTouchAbilityHorizontalScrollStepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_HORIZONTAL_SCROLL_TITLE", nil); - step.horizontal = YES; - - ORKStepArrayAddStep(steps, step); - - count += 1; - } - - if (taskOptions & ORKTouchAbilityTaskOptionPinch) { - - ORKInstructionStep *instruction = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction6StepIdentifier]; - instruction.title = ORKLocalizedString(@"TOUCH_ABILITY_PINCH_TITLE", nil); - instruction.text = ORKLocalizedString(@"TOUCH_ABILITY_PINCH_TEXT", nil); - instruction.image = [UIImage imageNamed:@"touchAbilityPinch" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instruction.shouldTintImages = YES; - - if (count == 0) { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION", nil); - } else { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION_NEXT", nil); - } - - ORKStepArrayAddStep(steps, instruction); - - ORKTouchAbilityPinchStep *step = [[ORKTouchAbilityPinchStep alloc] initWithIdentifier:ORKTouchAbilityPinchStepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_PINCH_TITLE", nil); - - ORKStepArrayAddStep(steps, step); - - count += 1; - } - - if (taskOptions & ORKTouchAbilityTaskOptionRotation) { - - ORKInstructionStep *instruction = [[ORKInstructionStep alloc] initWithIdentifier:ORKInstruction7StepIdentifier]; - instruction.title = ORKLocalizedString(@"TOUCH_ABILITY_ROTATION_TITLE", nil); - instruction.text = ORKLocalizedString(@"TOUCH_ABILITY_ROTATION_TEXT", nil); - instruction.image = [UIImage imageNamed:@"touchAbilityRotation" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; - instruction.shouldTintImages = YES; - - if (count == 0) { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION", nil); - } else { - instruction.detailText = ORKLocalizedString(@"TAPPING_CALL_TO_ACTION_NEXT", nil); - } - - ORKStepArrayAddStep(steps, instruction); - - ORKTouchAbilityRotationStep *step = [[ORKTouchAbilityRotationStep alloc] initWithIdentifier:ORKTouchAbilityRotationStepIdentifier]; - step.title = ORKLocalizedString(@"TOUCH_ABILITY_ROTATION_TITLE", nil); - - ORKStepArrayAddStep(steps, step); - } - - if (!(options & ORKPredefinedTaskOptionExcludeConclusion)) { - ORKInstructionStep *step = [self makeCompletionStep]; - - ORKStepArrayAddStep(steps, step); - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - - return task; -} - @end diff --git a/ResearchKit/ActiveTasks/CMAccelerometerData+ORKJSONDictionary.h b/ResearchKitActiveTask/Common/Recorders/Accelerometer/CMAccelerometerData+ORKJSONDictionary.h similarity index 100% rename from ResearchKit/ActiveTasks/CMAccelerometerData+ORKJSONDictionary.h rename to ResearchKitActiveTask/Common/Recorders/Accelerometer/CMAccelerometerData+ORKJSONDictionary.h diff --git a/ResearchKit/ActiveTasks/CMAccelerometerData+ORKJSONDictionary.m b/ResearchKitActiveTask/Common/Recorders/Accelerometer/CMAccelerometerData+ORKJSONDictionary.m similarity index 100% rename from ResearchKit/ActiveTasks/CMAccelerometerData+ORKJSONDictionary.m rename to ResearchKitActiveTask/Common/Recorders/Accelerometer/CMAccelerometerData+ORKJSONDictionary.m diff --git a/ResearchKit/ActiveTasks/ORKAccelerometerRecorder.h b/ResearchKitActiveTask/Common/Recorders/Accelerometer/ORKAccelerometerRecorder.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKAccelerometerRecorder.h rename to ResearchKitActiveTask/Common/Recorders/Accelerometer/ORKAccelerometerRecorder.h index 72b4dabe19..296dfff5a9 100644 --- a/ResearchKit/ActiveTasks/ORKAccelerometerRecorder.h +++ b/ResearchKitActiveTask/Common/Recorders/Accelerometer/ORKAccelerometerRecorder.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import diff --git a/ResearchKit/ActiveTasks/ORKAccelerometerRecorder.m b/ResearchKitActiveTask/Common/Recorders/Accelerometer/ORKAccelerometerRecorder.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKAccelerometerRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Accelerometer/ORKAccelerometerRecorder.m index 288ebc59af..9ef94482ab 100644 --- a/ResearchKit/ActiveTasks/ORKAccelerometerRecorder.m +++ b/ResearchKitActiveTask/Common/Recorders/Accelerometer/ORKAccelerometerRecorder.m @@ -115,11 +115,11 @@ - (void)start { [self.motionManager startAccelerometerUpdatesToQueue:[[NSOperationQueue alloc] init] withHandler:^(CMAccelerometerData *data, NSError *error) { BOOL success = NO; if (data) { - success = [_logger append:[data ork_JSONDictionary] error:&error]; + success = [self->_logger append:[data ork_JSONDictionary] error:&error]; } if (!success) { dispatch_async(dispatch_get_main_queue(), ^{ - _recordingError = error; + self->_recordingError = error; [self stop]; }); } diff --git a/ResearchKit/ActiveTasks/ORKAudioRecorder.h b/ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioRecorder.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKAudioRecorder.h rename to ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioRecorder.h index 90e6239a6c..b98dd2abd0 100644 --- a/ResearchKit/ActiveTasks/ORKAudioRecorder.h +++ b/ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioRecorder.h @@ -29,8 +29,8 @@ */ -@import UIKit; -@import AVFoundation; +#import +#import #import diff --git a/ResearchKit/ActiveTasks/ORKAudioRecorder.m b/ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioRecorder.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioRecorder.m diff --git a/ResearchKit/ActiveTasks/ORKAudioStreamer.h b/ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioStreamer.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioStreamer.h rename to ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioStreamer.h diff --git a/ResearchKit/ActiveTasks/ORKAudioStreamer.m b/ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioStreamer.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKAudioStreamer.m rename to ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioStreamer.m index 71b2258e87..1028d2bbc5 100644 --- a/ResearchKit/ActiveTasks/ORKAudioStreamer.m +++ b/ResearchKitActiveTask/Common/Recorders/Audio/ORKAudioStreamer.m @@ -39,16 +39,29 @@ @implementation ORKAudioStreamerConfiguration - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; + + if (self != nil) { + _bypassAudioEngineStart = NO; + } + return self; } - (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory { + if (_bypassAudioEngineStart) { + return nil; + } + ORKAudioStreamer *obj = [[ORKAudioStreamer alloc] initWithIdentifier:self.identifier step:step]; + return obj; } - (instancetype)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; + + _bypassAudioEngineStart = NO; + return self; } diff --git a/ResearchKit/ActiveTasks/ORKStreamingAudioRecorder.h b/ResearchKitActiveTask/Common/Recorders/Audio/ORKStreamingAudioRecorder.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKStreamingAudioRecorder.h rename to ResearchKitActiveTask/Common/Recorders/Audio/ORKStreamingAudioRecorder.h index 3e6ba72a32..abeb66a042 100644 --- a/ResearchKit/ActiveTasks/ORKStreamingAudioRecorder.h +++ b/ResearchKitActiveTask/Common/Recorders/Audio/ORKStreamingAudioRecorder.h @@ -29,8 +29,8 @@ */ -@import UIKit; -@import AVFoundation; +#import +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKStreamingAudioRecorder.m b/ResearchKitActiveTask/Common/Recorders/Audio/ORKStreamingAudioRecorder.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKStreamingAudioRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Audio/ORKStreamingAudioRecorder.m diff --git a/ResearchKit/ActiveTasks/CMDeviceMotion+ORKJSONDictionary.h b/ResearchKitActiveTask/Common/Recorders/Device Motion/CMDeviceMotion+ORKJSONDictionary.h similarity index 100% rename from ResearchKit/ActiveTasks/CMDeviceMotion+ORKJSONDictionary.h rename to ResearchKitActiveTask/Common/Recorders/Device Motion/CMDeviceMotion+ORKJSONDictionary.h diff --git a/ResearchKit/ActiveTasks/CMDeviceMotion+ORKJSONDictionary.m b/ResearchKitActiveTask/Common/Recorders/Device Motion/CMDeviceMotion+ORKJSONDictionary.m similarity index 100% rename from ResearchKit/ActiveTasks/CMDeviceMotion+ORKJSONDictionary.m rename to ResearchKitActiveTask/Common/Recorders/Device Motion/CMDeviceMotion+ORKJSONDictionary.m diff --git a/ResearchKit/ActiveTasks/ORKDeviceMotionRecorder.h b/ResearchKitActiveTask/Common/Recorders/Device Motion/ORKDeviceMotionRecorder.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKDeviceMotionRecorder.h rename to ResearchKitActiveTask/Common/Recorders/Device Motion/ORKDeviceMotionRecorder.h index fcd91ebd8c..e4d5be961e 100644 --- a/ResearchKit/ActiveTasks/ORKDeviceMotionRecorder.h +++ b/ResearchKitActiveTask/Common/Recorders/Device Motion/ORKDeviceMotionRecorder.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import diff --git a/ResearchKit/ActiveTasks/ORKDeviceMotionRecorder.m b/ResearchKitActiveTask/Common/Recorders/Device Motion/ORKDeviceMotionRecorder.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKDeviceMotionRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Device Motion/ORKDeviceMotionRecorder.m index 7e2b4e57ff..7e5c434d47 100644 --- a/ResearchKit/ActiveTasks/ORKDeviceMotionRecorder.m +++ b/ResearchKitActiveTask/Common/Recorders/Device Motion/ORKDeviceMotionRecorder.m @@ -106,7 +106,7 @@ - (void)start { [self.motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue] withHandler:^(CMDeviceMotion *data, NSError *error) { BOOL success = NO; if (data) { - success = [_logger append:[data ork_JSONDictionary] error:&error]; + success = [self->_logger append:[data ork_JSONDictionary] error:&error]; id delegate = self.delegate; if ([delegate respondsToSelector:@selector(deviceMotionRecorderDidUpdateWithMotion:)]) { [delegate deviceMotionRecorderDidUpdateWithMotion:data]; diff --git a/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthClinicalTypeRecorder.h b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthClinicalTypeRecorder.h new file mode 100644 index 0000000000..c3e440ef8b --- /dev/null +++ b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthClinicalTypeRecorder.h @@ -0,0 +1,114 @@ +/* + Copyright (c) 2018, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import +#import +#import + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +NS_ASSUME_NONNULL_BEGIN + +/** + The `ORKHealthClinicalTypeRecorder` class represents a recorder for collecting health records data from HealthKit during + an active task. + */ +#if defined(__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0 +ORK_CLASS_AVAILABLE +API_AVAILABLE(ios(12.0)) +@interface ORKHealthClinicalTypeRecorder : ORKRecorder + +@property (nonatomic, copy, readonly) HKClinicalType *healthClinicalType; + +@property (nonatomic, copy, readonly) HKFHIRResourceType healthFHIRResourceType; + +/** + Returns an initialized health clinical type recorder using the specified HKClinicalType and HKFHIRResourceType. + + @param identifier The unique identifier of the recorder (assigned by the recorder configuration). + @param healthClinicalType The HKClinicalType data that should be collected during the active task. + @param healthFHIRResourceType The HKFHIRResourceType for the predicate used to query the HKClinicalType. + @param step The step that requested this recorder. + @param outputDirectory The directory in which the health records data queried from HealthKit should be stored. + + @return An initialized health quantity type recorder. + */ +- (instancetype)initWithIdentifier:(NSString *)identifier + healthClinicalType:(HKClinicalType *)healthClinicalType + healthFHIRResourceType:(nullable HKFHIRResourceType)healthFHIRResourceType + step:(nullable ORKStep *)step + outputDirectory:(nullable NSURL *)outputDirectory NS_DESIGNATED_INITIALIZER API_AVAILABLE(ios(12.0)); + +@end + +ORK_CLASS_AVAILABLE +API_AVAILABLE(ios(12.0)) +@interface ORKHealthClinicalTypeRecorderConfiguration : ORKRecorderConfiguration + +/** + Returns an initialized health clinical type recorder configuration using the specified clinical type. + + This method is the designated initializer. + + @param identifier The unique identifier of the recorder configuration. + @param healthClinicalType The HKClinicalType that should be collected during the active task. + @param healthFHIRResourceType The HKFHIRResourceType that should be used as predicate while querying for the healthClinicalType. Providing a HKFHIRResourceType that does not correspond to a HKClinicalType will NOT generate any result. + + @return An initialized health clinical type recorder configuration. + */ +- (instancetype)initWithIdentifier:(NSString *)identifier + healthClinicalType:(HKClinicalType *)healthClinicalType + healthFHIRResourceType:(nullable HKFHIRResourceType)healthFHIRResourceType NS_DESIGNATED_INITIALIZER API_AVAILABLE(ios(12.0)); + +/** + Returns a new health clinical type recorder configuration initialized from data in the given unarchiver. + + @param aDecoder Coder from which to initialize the health clinical type recorder configuration. + + @return A new health clinical type recorder configuration. + */ +- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; + +/** + The HKClinicalType to be collected from HealthKit. (read-only) + */ +@property (nonatomic, readonly, copy) HKClinicalType *healthClinicalType; + +/** + The HKFHIRResourceType to used as predicate for HKQuery. (read-only) + */ +@property (nonatomic, readonly, copy) HKFHIRResourceType healthFHIRResourceType; + +@end + +#endif + +NS_ASSUME_NONNULL_END +#endif diff --git a/ResearchKit/ActiveTasks/ORKHealthClinicalTypeRecorder.m b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthClinicalTypeRecorder.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKHealthClinicalTypeRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Health/ORKHealthClinicalTypeRecorder.m index 58056227e6..6eb95e3a7d 100644 --- a/ResearchKit/ActiveTasks/ORKHealthClinicalTypeRecorder.m +++ b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthClinicalTypeRecorder.m @@ -32,14 +32,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #if defined(__IPHONE_12_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_12_0 +#import #import "ORKHealthClinicalTypeRecorder.h" #import "ORKHelpers_Internal.h" #import "ORKDataLogger.h" #import "ORKRecorder_Private.h" #import "ORKRecorder_Internal.h" -#import "HKSample+ORKJSONDictionary.h" - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @interface ORKHealthClinicalTypeRecorder () { ORKDataLogger *_logger; BOOL _isRecording; @@ -108,7 +108,7 @@ - (void)start { [sampleResults enumerateObjectsUsingBlock:^(HKClinicalRecord *clinicalRecord, NSUInteger idx, BOOL *stop) { NSError *logError = nil; - [_logger append:clinicalRecord.FHIRResource.data error:&logError]; + [self->_logger append:clinicalRecord.FHIRResource.data error:&logError]; if (logError) { ORK_Log_Error("Failed to add health records object to the logger with error: %@", logError); return; @@ -234,3 +234,4 @@ - (NSSet *)requestedHealthKitTypesForReading { @end #endif +#endif diff --git a/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthQuantityTypeRecorder.h b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthQuantityTypeRecorder.h new file mode 100644 index 0000000000..0218a3825d --- /dev/null +++ b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthQuantityTypeRecorder.h @@ -0,0 +1,134 @@ +/* + Copyright (c) 2015, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import +#import + + +NS_ASSUME_NONNULL_BEGIN + +@class ORKHealthQuantityTypeRecorder; + +@protocol ORKHealthQuantityTypeRecorderDelegate + +@optional +- (void)healthQuantityTypeRecorderDidUpdate:(ORKHealthQuantityTypeRecorder *)healthQuantityTypeRecorder; + +@end + + +/** + The `ORKHealthQuantityTypeRecorder` class represents a recorder for collecting real time sample data from HealthKit, such as heart rate, during + an active task. + */ +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +@class HKQuantityType; +@class HKUnit; + +ORK_CLASS_AVAILABLE +@interface ORKHealthQuantityTypeRecorder : ORKRecorder + +@property (nonatomic, copy, readonly) HKQuantityType *quantityType; + +@property (nonatomic, copy, readonly) HKUnit *unit; + +@property (nonatomic, copy, readonly, nullable) HKQuantitySample *lastSample; + +/** + Returns an initialized health quantity type recorder using the specified quantity type and unit. + + @param identifier The unique identifier of the recorder (assigned by the recorder configuration). + @param quantityType The quantity type that should be collected during the active task. + @param unit The unit for the data that should be collected and serialized. + @param step The step that requested this recorder. + @param outputDirectory The directory in which the HealthKit data should be stored. + + @return An initialized health quantity type recorder. +*/ +- (instancetype)initWithIdentifier:(NSString *)identifier + healthQuantityType:(HKQuantityType *)quantityType + unit:(HKUnit *)unit + step:(nullable ORKStep *)step + outputDirectory:(nullable NSURL *)outputDirectory NS_DESIGNATED_INITIALIZER; + +@end + +/** + A configuration object that records data from a HealthKit quantity type during an active step. + + Before you can use this configuration, you must use Xcode to enable the appropriate HealthKit entitlement + for your app. + + HealthKit quantity type data is serialized to JSON and returned as an `ORKFileResult` object. + For details on the format, see `HKSample+ORKJSONDictionary`. + + To use a recorder, include its configuration in the `recorderConfigurations` property + of an `ORKActiveStep` object, include that step in a task, and present it with + a task view controller. + */ +ORK_CLASS_AVAILABLE +@interface ORKHealthQuantityTypeRecorderConfiguration : ORKRecorderConfiguration + +/** + Returns an initialized health quantity type recorder configuration using the specified quantity type and unit designation. + + This method is the designated initializer. + + @param identifier The unique identifier of the recorder configuration. + @param quantityType The quantity type that should be collected during the active task. + @param unit The unit for the data that should be collected and serialized. + + @return An initialized health quantity type recorder configuration. + */ +- (instancetype)initWithIdentifier:(NSString *)identifier healthQuantityType:(HKQuantityType *)quantityType unit:(HKUnit *)unit NS_DESIGNATED_INITIALIZER; + +/** + Returns a new health quantity type recorder configuration initialized from data in the given unarchiver. + + @param aDecoder Coder from which to initialize the health quantity type recorder configuration. + + @return A new health quantity type recorder configuration. + */ +- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; + +/** + The quantity type to be collected from HealthKit. (read-only) + */ +@property (nonatomic, readonly, copy) HKQuantityType *quantityType; + +/** + The unit in which to serialize the data from HealthKit. (read-only) + */ +@property (nonatomic, readonly, copy) HKUnit *unit; + +@end +#endif +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKHealthQuantityTypeRecorder.m b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthQuantityTypeRecorder.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKHealthQuantityTypeRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Health/ORKHealthQuantityTypeRecorder.m index d005048a74..1803a0e56f 100644 --- a/ResearchKit/ActiveTasks/ORKHealthQuantityTypeRecorder.m +++ b/ResearchKitActiveTask/Common/Recorders/Health/ORKHealthQuantityTypeRecorder.m @@ -29,14 +29,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ +#import #import "ORKHealthQuantityTypeRecorder.h" #import "ORKHelpers_Internal.h" #import "ORKDataLogger.h" #import "ORKRecorder_Private.h" #import "ORKRecorder_Internal.h" -#import "HKSample+ORKJSONDictionary.h" - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION @interface ORKHealthQuantityTypeRecorder () { ORKDataLogger *_logger; BOOL _isRecording; @@ -124,14 +124,14 @@ - (void)query_logResults:(NSArray *)results withAnchor:(HKQueryAnchor*)newAnchor [self updateMostRecentSample:results.lastObject]; NSError *error = nil; - if (![_logger appendObjects:dictionaries error:&error]) { + if (![self->_logger appendObjects:dictionaries error:&error]) { // Logger writes are unrecoverable [self finishRecordingWithError:error]; return; } - _anchor = newAnchor; - _anchorValue = anchorValue; + self->_anchor = newAnchor; + self->_anchorValue = anchorValue; if (resultCount == _HealthAnchoredQueryLimit) { // Do another fetch immediately rather than wait for an observation @@ -368,3 +368,4 @@ - (NSSet *)requestedHealthKitTypesForReading { } @end +#endif diff --git a/ResearchKit/ActiveTasks/CLLocation+ORKJSONDictionary.h b/ResearchKitActiveTask/Common/Recorders/Location/CLLocation+ORKJSONDictionary.h similarity index 97% rename from ResearchKit/ActiveTasks/CLLocation+ORKJSONDictionary.h rename to ResearchKitActiveTask/Common/Recorders/Location/CLLocation+ORKJSONDictionary.h index 9dead51637..11ac4b2855 100644 --- a/ResearchKit/ActiveTasks/CLLocation+ORKJSONDictionary.h +++ b/ResearchKitActiveTask/Common/Recorders/Location/CLLocation+ORKJSONDictionary.h @@ -29,6 +29,7 @@ */ +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @import CoreLocation; @@ -41,3 +42,4 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END +#endif diff --git a/ResearchKit/ActiveTasks/CLLocation+ORKJSONDictionary.m b/ResearchKitActiveTask/Common/Recorders/Location/CLLocation+ORKJSONDictionary.m similarity index 98% rename from ResearchKit/ActiveTasks/CLLocation+ORKJSONDictionary.m rename to ResearchKitActiveTask/Common/Recorders/Location/CLLocation+ORKJSONDictionary.m index d0a4af26da..c301bff3f8 100644 --- a/ResearchKit/ActiveTasks/CLLocation+ORKJSONDictionary.m +++ b/ResearchKitActiveTask/Common/Recorders/Location/CLLocation+ORKJSONDictionary.m @@ -33,7 +33,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" - +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @implementation CLLocation (ORKJSONDictionary) - (NSDictionary *)ork_JSONDictionary { @@ -71,3 +71,4 @@ - (NSDictionary *)ork_JSONDictionary { } @end +#endif diff --git a/ResearchKit/ActiveTasks/ORKLocationRecorder.h b/ResearchKitActiveTask/Common/Recorders/Location/ORKLocationRecorder.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKLocationRecorder.h rename to ResearchKitActiveTask/Common/Recorders/Location/ORKLocationRecorder.h index 7f8e8e04d5..00da6a32b5 100644 --- a/ResearchKit/ActiveTasks/ORKLocationRecorder.h +++ b/ResearchKitActiveTask/Common/Recorders/Location/ORKLocationRecorder.h @@ -28,9 +28,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -@import UIKit; -@import CoreLocation; +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +#import +#import #import @@ -69,3 +69,4 @@ ORK_CLASS_AVAILABLE @end NS_ASSUME_NONNULL_END +#endif diff --git a/ResearchKit/ActiveTasks/ORKLocationRecorder.m b/ResearchKitActiveTask/Common/Recorders/Location/ORKLocationRecorder.m similarity index 85% rename from ResearchKit/ActiveTasks/ORKLocationRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Location/ORKLocationRecorder.m index b5f6b71e4d..6ba724a5ef 100644 --- a/ResearchKit/ActiveTasks/ORKLocationRecorder.m +++ b/ResearchKitActiveTask/Common/Recorders/Location/ORKLocationRecorder.m @@ -28,6 +28,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION #import "ORKLocationRecorder.h" @@ -37,7 +38,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "CLLocation+ORKJSONDictionary.h" -#import +#import + +@import CoreLocation; @interface ORKLocationRecorder () { @@ -93,25 +96,25 @@ - (void)start { } self.locationManager = [self createLocationManager]; - - CLAuthorizationStatus status = kCLAuthorizationStatusNotDetermined; - - if (@available(iOS 14.0, *)) { - status = self.locationManager.authorizationStatus; - } else { - status = [CLLocationManager authorizationStatus]; - } - - if (status == kCLAuthorizationStatusRestricted || status == kCLAuthorizationStatusNotDetermined) { - [self.locationManager requestWhenInUseAuthorization]; + self.locationManager.delegate = self; + + BOOL locationManagerAuthRequestsAllowed = YES; + if ([CLLocationManager authorizationStatus] <= kCLAuthorizationStatusDenied) { + locationManagerAuthRequestsAllowed = [self.locationManager ork_requestWhenInUseAuthorization]; } self.uptime = [NSProcessInfo processInfo].systemUptime; - [self.locationManager startUpdatingLocation]; + [self.locationManager ork_startUpdatingLocation]; + + if (locationManagerAuthRequestsAllowed == NO) { + // If we weren't able to perform auth requests, then ResearchKit was compiled with auth requests disabled + // We won't be getting any callbacks about location changes, so might as well stop recording + [self stop]; + } } - (void)doStopRecording { - [self.locationManager stopUpdatingLocation]; + [self.locationManager ork_stopUpdatingLocation]; self.locationManager.delegate = nil; self.locationManager = nil; } @@ -149,7 +152,7 @@ - (void)locationManager:(CLLocationManager *)manager } if (!success) { dispatch_async(dispatch_get_main_queue(), ^{ - _recordingError = error; + self->_recordingError = error; [self stop]; }); } @@ -161,15 +164,7 @@ - (void)finishRecordingWithError:(NSError *)error { } - (BOOL)isRecording { - CLAuthorizationStatus status = kCLAuthorizationStatusNotDetermined; - - if (@available(iOS 14.0, *)) { - status = self.locationManager.authorizationStatus; - } else { - status = [CLLocationManager authorizationStatus]; - } - - return [CLLocationManager locationServicesEnabled] && (self.locationManager != nil) && (status > kCLAuthorizationStatusDenied); + return [CLLocationManager locationServicesEnabled] && (self.locationManager != nil) && ([CLLocationManager authorizationStatus] > kCLAuthorizationStatusDenied); } - (void)reset { @@ -215,3 +210,4 @@ - (ORKPermissionMask)requestedPermissionMask { } @end +#endif diff --git a/ResearchKit/ActiveTasks/CMPedometerData+ORKJSONDictionary.h b/ResearchKitActiveTask/Common/Recorders/Pedometer/CMPedometerData+ORKJSONDictionary.h similarity index 100% rename from ResearchKit/ActiveTasks/CMPedometerData+ORKJSONDictionary.h rename to ResearchKitActiveTask/Common/Recorders/Pedometer/CMPedometerData+ORKJSONDictionary.h diff --git a/ResearchKit/ActiveTasks/CMPedometerData+ORKJSONDictionary.m b/ResearchKitActiveTask/Common/Recorders/Pedometer/CMPedometerData+ORKJSONDictionary.m similarity index 100% rename from ResearchKit/ActiveTasks/CMPedometerData+ORKJSONDictionary.m rename to ResearchKitActiveTask/Common/Recorders/Pedometer/CMPedometerData+ORKJSONDictionary.m diff --git a/ResearchKit/ActiveTasks/ORKPedometerRecorder.h b/ResearchKitActiveTask/Common/Recorders/Pedometer/ORKPedometerRecorder.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKPedometerRecorder.h rename to ResearchKitActiveTask/Common/Recorders/Pedometer/ORKPedometerRecorder.h index 1ff3334e3c..da2f73e506 100644 --- a/ResearchKit/ActiveTasks/ORKPedometerRecorder.h +++ b/ResearchKitActiveTask/Common/Recorders/Pedometer/ORKPedometerRecorder.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import diff --git a/ResearchKit/ActiveTasks/ORKPedometerRecorder.m b/ResearchKitActiveTask/Common/Recorders/Pedometer/ORKPedometerRecorder.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKPedometerRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Pedometer/ORKPedometerRecorder.m index 82579a235c..88913d1ee5 100644 --- a/ResearchKit/ActiveTasks/ORKPedometerRecorder.m +++ b/ResearchKitActiveTask/Common/Recorders/Pedometer/ORKPedometerRecorder.m @@ -70,7 +70,7 @@ - (void)dealloc { - (void)updateStatisticsWithData:(CMPedometerData *)pedometerData { _lastUpdateDate = pedometerData.endDate; _totalNumberOfSteps = pedometerData.numberOfSteps.integerValue; - if (pedometerData.distance) { + if (pedometerData.distance != nil) { _totalDistance = pedometerData.distance.doubleValue; } else { _totalDistance = -1; @@ -117,7 +117,7 @@ - (void)start { BOOL success = NO; if (pedometerData) { - success = [_logger append:[pedometerData ork_JSONDictionary] error:&error]; + success = [self->_logger append:[pedometerData ork_JSONDictionary] error:&error]; dispatch_async(dispatch_get_main_queue(), ^{ ORKStrongTypeOf(self) strongSelf = weakSelf; [strongSelf updateStatisticsWithData:pedometerData]; diff --git a/ResearchKitActiveTask/Common/Recorders/Touch/ORKTouchRecorder.h b/ResearchKitActiveTask/Common/Recorders/Touch/ORKTouchRecorder.h new file mode 100644 index 0000000000..d343a67b46 --- /dev/null +++ b/ResearchKitActiveTask/Common/Recorders/Touch/ORKTouchRecorder.h @@ -0,0 +1,88 @@ +/* + Copyright (c) 2015, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import +#import + + +NS_ASSUME_NONNULL_BEGIN + +/** + The `ORKTouchRecorder` class defines the attributes and behavior of touch events recorder. + + This class is considered private because its interface is not yet considered + stable. It is not currently used by any of the pre-defined active tasks. + */ +ORK_CLASS_AVAILABLE +@interface ORKTouchRecorder : ORKRecorder + +/** + The `ORKTouchRecorder` attaches a gesture recognizer to `touchView` to receive touch events. + + Use `-viewController:willStartStepWithView:` to set the `touchView` property before + the touch recorder starts. + */ +@property (nonatomic, strong, readonly, nullable) UIView *touchView; + +@end + +/** + The `ORKTouchRecorderConfiguration` is a recorder configuration class for + generating an `ORKTouchRecorder`. + + It is currently considered private, and is not used in any of the active tasks. + */ +ORK_CLASS_AVAILABLE +@interface ORKTouchRecorderConfiguration : ORKRecorderConfiguration + +/** + Returns an initialized touch recorder configuration. + + This method is the designated initializer. + + @param identifier The unique identifier of the recorder configuration. + + @return An initialized touch recorder configuration. + */ +- (instancetype)initWithIdentifier:(NSString *)identifier NS_DESIGNATED_INITIALIZER; + +/** + Returns a new touch recorder configuration initialized from data in the given unarchiver. + + @param aDecoder Coder from which to initialize the touch recorder configuration. + + @return A new touch recorder configuration. + */ +- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKTouchRecorder.m b/ResearchKitActiveTask/Common/Recorders/Touch/ORKTouchRecorder.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchRecorder.m rename to ResearchKitActiveTask/Common/Recorders/Touch/ORKTouchRecorder.m diff --git a/ResearchKit/ActiveTasks/UITouch+ORKJSONDictionary.h b/ResearchKitActiveTask/Common/Recorders/Touch/UITouch+ORKJSONDictionary.h similarity index 100% rename from ResearchKit/ActiveTasks/UITouch+ORKJSONDictionary.h rename to ResearchKitActiveTask/Common/Recorders/Touch/UITouch+ORKJSONDictionary.h diff --git a/ResearchKit/ActiveTasks/UITouch+ORKJSONDictionary.m b/ResearchKitActiveTask/Common/Recorders/Touch/UITouch+ORKJSONDictionary.m similarity index 100% rename from ResearchKit/ActiveTasks/UITouch+ORKJSONDictionary.m rename to ResearchKitActiveTask/Common/Recorders/Touch/UITouch+ORKJSONDictionary.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAnywhereStep.h b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAnywhereStep.h rename to ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStep.h index d240b8c941..44f16d7fba 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAnywhereStep.h +++ b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTouchAnywhereStep.m b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStep.m similarity index 93% rename from ResearchKit/ActiveTasks/ORKTouchAnywhereStep.m rename to ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStep.m index 1323f6b6e2..2263c482a1 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAnywhereStep.m +++ b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStep.m @@ -30,16 +30,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTouchAnywhereStep.h" -#import "ORKTouchAnywhereStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKTouchAnywhereStep -+ (Class)stepViewControllerClass { - return [ORKTouchAnywhereStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier instructionText:(NSString *)instructionText { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKTouchAnywhereStepViewController.h b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKTouchAnywhereStepViewController.h rename to ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStepViewController.h index b65a841db4..ba33086221 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAnywhereStepViewController.h +++ b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAnywhereStepViewController.m b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAnywhereStepViewController.m rename to ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStepViewController.m index 335bf8759b..003610f57a 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAnywhereStepViewController.m +++ b/ResearchKitActiveTask/Common/Touch Anywhere Step/ORKTouchAnywhereStepViewController.m @@ -32,7 +32,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTouchAnywhereStepViewController.h" #import "ORKActiveStepViewController_Internal.h" #import "ORKStepViewController_Internal.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKLabel.h" #import "ORKActiveStepView.h" #import "ORKProgressView.h" diff --git a/ResearchKit/ActiveTasks/ORKAudioFitnessStep.h b/ResearchKitActiveTask/Fitness/ORKAudioFitnessStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKAudioFitnessStep.h rename to ResearchKitActiveTask/Fitness/ORKAudioFitnessStep.h index 4e0934971a..1715c67310 100644 --- a/ResearchKit/ActiveTasks/ORKAudioFitnessStep.h +++ b/ResearchKitActiveTask/Fitness/ORKAudioFitnessStep.h @@ -29,7 +29,7 @@ */ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAudioFitnessStep.m b/ResearchKitActiveTask/Fitness/ORKAudioFitnessStep.m similarity index 93% rename from ResearchKit/ActiveTasks/ORKAudioFitnessStep.m rename to ResearchKitActiveTask/Fitness/ORKAudioFitnessStep.m index b4d76a4c5e..87c9b045db 100644 --- a/ResearchKit/ActiveTasks/ORKAudioFitnessStep.m +++ b/ResearchKitActiveTask/Fitness/ORKAudioFitnessStep.m @@ -29,7 +29,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKAudioFitnessStep.h" -#import "ORKAudioFitnessStepViewController.h" #import "ORKBundleAsset.h" #import "ORKHelpers_Internal.h" @@ -40,7 +39,7 @@ - (instancetype)initWithTime:(NSTimeInterval)time self = [super init]; if (self) { self.time = time; - self.spokenText = [spokenText copy]; + self.spokenText = spokenText; } return self; } @@ -83,10 +82,6 @@ - (BOOL)isEqual:(id)other @implementation ORKAudioFitnessStep -- (Class)stepViewControllerClass { - return [ORKAudioFitnessStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier audioAsset:(ORKBundleAsset *)audioAsset vocalCues:(nullable NSArray *)vocalCues { @@ -94,8 +89,8 @@ - (instancetype)initWithIdentifier:(NSString *)identifier if (self) { self.stepDuration = 180; self.shouldShowDefaultTimer = NO; - self.audioAsset = [audioAsset copy]; - self.vocalCues = vocalCues == nil ? [NSArray new] : [vocalCues copy]; + self.audioAsset = audioAsset; + self.vocalCues = vocalCues == nil ? [NSArray new] : vocalCues; } return self; } diff --git a/ResearchKit/ActiveTasks/ORKAudioFitnessStepViewController.h b/ResearchKitActiveTask/Fitness/ORKAudioFitnessStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKAudioFitnessStepViewController.h rename to ResearchKitActiveTask/Fitness/ORKAudioFitnessStepViewController.h index 4119bdf35f..972f5de6a4 100644 --- a/ResearchKit/ActiveTasks/ORKAudioFitnessStepViewController.h +++ b/ResearchKitActiveTask/Fitness/ORKAudioFitnessStepViewController.h @@ -29,7 +29,7 @@ */ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAudioFitnessStepViewController.m b/ResearchKitActiveTask/Fitness/ORKAudioFitnessStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioFitnessStepViewController.m rename to ResearchKitActiveTask/Fitness/ORKAudioFitnessStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKFitnessContentView.h b/ResearchKitActiveTask/Fitness/ORKFitnessContentView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKFitnessContentView.h rename to ResearchKitActiveTask/Fitness/ORKFitnessContentView.h index c6ac1a9dfe..5233348b3e 100644 --- a/ResearchKit/ActiveTasks/ORKFitnessContentView.h +++ b/ResearchKitActiveTask/Fitness/ORKFitnessContentView.h @@ -29,8 +29,8 @@ */ -#import "ORKCustomStepView_Internal.h" - +#import +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKFitnessContentView.m b/ResearchKitActiveTask/Fitness/ORKFitnessContentView.m similarity index 89% rename from ResearchKit/ActiveTasks/ORKFitnessContentView.m rename to ResearchKitActiveTask/Fitness/ORKFitnessContentView.m index 81f7a214d5..21a3025a6b 100644 --- a/ResearchKit/ActiveTasks/ORKFitnessContentView.m +++ b/ResearchKitActiveTask/Fitness/ORKFitnessContentView.m @@ -90,19 +90,16 @@ - (void)setLabelHidden:(BOOL)labelHidden { } - (UIFont*) labelFont { - UIFont* font = [UIFont preferredFontForTextStyle: UIFontTextStyleLargeTitle]; UIFontMetrics* metrics = [UIFontMetrics metricsForTextStyle:UIFontTextStyleLargeTitle]; - - if (@available(iOS 13, *)) { - UIFontDescriptor* round = [[font fontDescriptor] fontDescriptorWithDesign:UIFontDescriptorSystemDesignRounded]; - UIFontDescriptor* weighted = [round fontDescriptorByAddingAttributes:@{ - UIFontDescriptorTraitsAttribute: @{ - UIFontWeightTrait: @1.5 - } - }]; - font = [UIFont fontWithDescriptor:weighted size:44]; - } + + UIFontDescriptor* round = [[font fontDescriptor] fontDescriptorWithDesign:UIFontDescriptorSystemDesignRounded]; + UIFontDescriptor* weighted = [round fontDescriptorByAddingAttributes:@{ + UIFontDescriptorTraitsAttribute: @{ + UIFontWeightTrait: @1.5 + } + }]; + font = [UIFont fontWithDescriptor:weighted size:44]; UIFont* scaled = [metrics scaledFontForFont:font]; return scaled; @@ -139,11 +136,7 @@ - (void)drawRect:(CGRect)rect { CGContextSetLineCap(context, kCGLineCapRound); // Draw a circular track - if (@available(iOS 13.0, *)) { - [[UIColor systemGray5Color] setStroke]; - } else { - [[UIColor lightGrayColor] setStroke]; - } + [[UIColor systemGray5Color] setStroke]; CGContextAddArc(context, xCenter, yCenter, radius, 0, 2 * M_PI, clockwise ? 1 : 0); CGContextStrokePath(context); diff --git a/ResearchKit/ActiveTasks/ORKFitnessStep.h b/ResearchKitActiveTask/Fitness/ORKFitnessStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKFitnessStep.h rename to ResearchKitActiveTask/Fitness/ORKFitnessStep.h index 91ff406e41..3a26147171 100644 --- a/ResearchKit/ActiveTasks/ORKFitnessStep.h +++ b/ResearchKitActiveTask/Fitness/ORKFitnessStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKFitnessStep.m b/ResearchKitActiveTask/Fitness/ORKFitnessStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKFitnessStep.m rename to ResearchKitActiveTask/Fitness/ORKFitnessStep.m index 48e5012cac..62f7467ac0 100644 --- a/ResearchKit/ActiveTasks/ORKFitnessStep.m +++ b/ResearchKitActiveTask/Fitness/ORKFitnessStep.m @@ -32,15 +32,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKFitnessStep.h" #import "ORKHelpers_Internal.h" -#import "ORKFitnessStepViewController.h" - - @implementation ORKFitnessStep -+ (Class)stepViewControllerClass { - return [ORKFitnessStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { @@ -69,6 +62,7 @@ - (instancetype)initWithCoder:(NSCoder *)coder self = [super initWithCoder:coder]; if (self) { ORK_DECODE_OBJ_PLIST(coder, userInfo); + } return self; } diff --git a/ResearchKit/ActiveTasks/ORKFitnessStepViewController.h b/ResearchKitActiveTask/Fitness/ORKFitnessStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKFitnessStepViewController.h rename to ResearchKitActiveTask/Fitness/ORKFitnessStepViewController.h index 60fe201242..ea1adcb488 100644 --- a/ResearchKit/ActiveTasks/ORKFitnessStepViewController.h +++ b/ResearchKitActiveTask/Fitness/ORKFitnessStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKFitnessStepViewController.m b/ResearchKitActiveTask/Fitness/ORKFitnessStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKFitnessStepViewController.m rename to ResearchKitActiveTask/Fitness/ORKFitnessStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepContentView.h b/ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepContentView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStepContentView.h rename to ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepContentView.h diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepContentView.m b/ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepContentView.m similarity index 95% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStepContentView.m rename to ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepContentView.m index 737cea9f18..9282e75b1b 100644 --- a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepContentView.m +++ b/ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepContentView.m @@ -78,23 +78,13 @@ - (void)setupSubviews { _titleLabel.text = ORKLocalizedString(@"FRONT_FACING_CAMERA_REVIEW_OPTIONS_TITLE", nil); [self.contentView addSubview:_titleLabel]; - UIImage *reviewButtonIcon = nil; - - if (@available(iOS 13.0, *)) { - reviewButtonIcon = [UIImage systemImageNamed:@"video.fill"]; - } - + UIImage *reviewButtonIcon = [UIImage systemImageNamed:@"video.fill"]; _reviewVideoButton = [[ORKIconButton alloc] initWithButtonText:ORKLocalizedString(@"FRONT_FACING_CAMERA_REVIEW_VIDEO", nil) buttonIcon: reviewButtonIcon]; _reviewVideoButton.tag = 0; _reviewVideoButton.translatesAutoresizingMaskIntoConstraints = NO; [self.contentView addSubview:_reviewVideoButton]; - UIImage *deleteAndRetryButtonIcon = nil; - - if (@available(iOS 13.0, *)) { - deleteAndRetryButtonIcon = [UIImage systemImageNamed:@"trash.fill"]; - } - + UIImage *deleteAndRetryButtonIcon = [UIImage systemImageNamed:@"trash.fill"]; _deleteAndRetryVideoButton = [[ORKIconButton alloc] initWithButtonText:ORKLocalizedString(@"FRONT_FACING_CAMERA_RETRY_VIDEO", nil) buttonIcon: deleteAndRetryButtonIcon]; _deleteAndRetryVideoButton.tag = 1; _deleteAndRetryVideoButton.translatesAutoresizingMaskIntoConstraints = NO; @@ -109,6 +99,7 @@ - (void)setupSubviews { _submitVideoButton.titleLabel.font = [UIFont systemFontOfSize:20.0]; [_submitVideoButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal]; [_submitVideoButton setBackgroundColor:[UIColor systemBlueColor]]; + [_submitVideoButton setTitleEdgeInsets:UIEdgeInsetsMake(5.0, 8.0, 5.0, 8.0)]; [_submitVideoButton setTitle:ORKLocalizedString(@"FRONT_FACING_CAMERA_SUBMIT_VIDEO", nil) forState:UIControlStateNormal]; [self.contentView addSubview:_submitVideoButton]; } @@ -193,20 +184,12 @@ - (instancetype)initWithTitleText:(nullable NSString *)titleText detailText:(nul - (void)setupSubviews { _startStopButton = [UIButton new]; - - if (@available(iOS 15.0, *)) { - UIButtonConfiguration *buttonConfiguration = [UIButtonConfiguration plainButtonConfiguration]; - [buttonConfiguration setContentInsets:NSDirectionalEdgeInsetsMake(0, 6, 0, 6)]; - [_startStopButton setConfiguration:buttonConfiguration]; - } else { - _startStopButton.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; - } - _startStopButton.layer.cornerRadius = 14.0; _startStopButton.clipsToBounds = YES; - + _startStopButton.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; UIFontDescriptor *descriptorOne = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleHeadline]; _startStopButton.titleLabel.font = [UIFont boldSystemFontOfSize:[[descriptorOne objectForKey: UIFontDescriptorSizeAttribute] doubleValue] + 1.0]; + [self.contentView addSubview:_startStopButton]; _timerLabel = [UILabel new]; @@ -214,12 +197,6 @@ - (void)setupSubviews { _timerLabel.adjustsFontSizeToFitWidth = YES; [self.contentView addSubview:_timerLabel]; - UIImage *collapseButtonImage; - - if (@available(iOS 13.0, *)) { - collapseButtonImage = [UIImage systemImageNamed:@"chevron.down"]; - } - if (_titleText) { _titleLabel = [ORKTitleLabel new]; _titleLabel.textAlignment = NSTextAlignmentLeft; @@ -244,7 +221,7 @@ - (void)setupSubviews { _collapseButton = [UIButton new]; _collapseButton.translatesAutoresizingMaskIntoConstraints = NO; [_collapseButton setTintColor:[UIColor whiteColor]]; - [_collapseButton setBackgroundImage:collapseButtonImage forState:UIControlStateNormal]; + [_collapseButton setBackgroundImage:[UIImage systemImageNamed:@"chevron.down"] forState:UIControlStateNormal]; [_collapseButton addTarget:self action:@selector(collapseButtonPressed) forControlEvents:UIControlEventTouchUpInside]; @@ -323,8 +300,6 @@ - (void)setStartStopButtonState:(ORKStartStopButtonState)startStopButtonState } - (void)collapseButtonPressed { - UIImage *collapseButtonImage; - if (_isTextCollapsed) { [_blurViewTopConstraint setActive:NO]; _blurViewTopConstraint = [self.contentView.topAnchor constraintEqualToAnchor:_titleLabel.topAnchor constant:-20.0]; @@ -344,18 +319,17 @@ - (void)collapseButtonPressed { [NSLayoutConstraint activateConstraints:_heightConstraints]; } - if (@available(iOS 13.0, *)) { - collapseButtonImage = _isTextCollapsed ? [UIImage systemImageNamed:@"chevron.down"] : [UIImage systemImageNamed:@"chevron.up"]; - } + UIImage *collapseButtonImage = _isTextCollapsed ? [UIImage systemImageNamed:@"chevron.down"] : [UIImage systemImageNamed:@"chevron.up"]; [_collapseButton setBackgroundImage:collapseButtonImage forState:UIControlStateNormal]; _isTextCollapsed = !_isTextCollapsed; } - (void)didMoveToWindow { - self.tintColor = ORKViewTintColor(self); + self.tintColor = ORKWindowTintcolor(self.window) ? : [UIColor systemBlueColor]; [self setStartStopButtonState:_startStopButtonState]; } + @end @interface ORKFrontFacingCameraStepContentView () diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepViewController.h b/ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStepViewController.h rename to ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepViewController.h index be1a1a979c..e472dfa38e 100644 --- a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepViewController.h +++ b/ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepViewController.h @@ -29,7 +29,7 @@ */ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepViewController.m b/ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKFrontFacingCameraStepViewController.m rename to ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepViewController.m index 3d7c23762b..a85cb8ab7e 100644 --- a/ResearchKit/ActiveTasks/ORKFrontFacingCameraStepViewController.m +++ b/ResearchKitActiveTask/Front Facing Camera/ORKFrontFacingCameraStepViewController.m @@ -35,7 +35,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKActiveStepView.h" #import "ORKActiveStepViewController_Internal.h" -#import "ORKBorderedButton.h" #import "ORKCollectionResult_Private.h" #import "ORKFrontFacingCameraStep.h" #import "ORKFrontFacingCameraStepContentView.h" @@ -90,7 +89,7 @@ - (void)viewDidLoad { [self setupContentView]; [self setupConstraints]; [self startSession]; - + [self.taskViewController setNavigationBarColor:[self.view backgroundColor]]; } diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestResult.h b/ResearchKitActiveTask/Hole Peg Test/ORKHolePegTestResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestResult.h rename to ResearchKitActiveTask/Hole Peg Test/ORKHolePegTestResult.h diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestResult.m b/ResearchKitActiveTask/Hole Peg Test/ORKHolePegTestResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestResult.m rename to ResearchKitActiveTask/Hole Peg Test/ORKHolePegTestResult.m diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceContentView.h b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceContentView.h rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceContentView.h index cc025ca9e4..010db190bf 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceContentView.h +++ b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceContentView.h @@ -30,7 +30,7 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKTypes.h" diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceContentView.m b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceContentView.m rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceContentView.m diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceHoleView.h b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceHoleView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceHoleView.h rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceHoleView.h diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceHoleView.m b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceHoleView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceHoleView.m rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceHoleView.m diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlacePegView.h b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlacePegView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlacePegView.h rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlacePegView.h diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlacePegView.m b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlacePegView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlacePegView.m rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlacePegView.m diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceStep.h b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceStep.h rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStep.h index 5c34a10fcb..bfc449ef5a 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceStep.h +++ b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceStep.m b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStep.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceStep.m rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStep.m index e17654f778..712209d337 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceStep.m +++ b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStep.m @@ -30,16 +30,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHolePegTestPlaceStep.h" -#import "ORKHolePegTestPlaceStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKHolePegTestPlaceStep -+ (Class)stepViewControllerClass { - return [ORKHolePegTestPlaceStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceStepViewController.h b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceStepViewController.h rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStepViewController.h index 978640fcaf..9c0228f79e 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceStepViewController.h +++ b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestPlaceStepViewController.m b/ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestPlaceStepViewController.m rename to ResearchKitActiveTask/Hole Peg Test/Place Test/ORKHolePegTestPlaceStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveContentView.h b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemoveContentView.h rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveContentView.h index 71bb94c628..a8fb749b90 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveContentView.h +++ b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveContentView.h @@ -30,7 +30,7 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKTypes.h" diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveContentView.m b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemoveContentView.m rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveContentView.m diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemovePegView.h b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemovePegView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemovePegView.h rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemovePegView.h diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemovePegView.m b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemovePegView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemovePegView.m rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemovePegView.m diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveStep.h b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemoveStep.h rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStep.h index e6a8fd132b..b50b090ae3 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveStep.h +++ b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveStep.m b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStep.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemoveStep.m rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStep.m index e1b29c68c0..ed8a9ba9e3 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveStep.m +++ b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStep.m @@ -31,17 +31,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHolePegTestRemoveStep.h" -#import "ORKHolePegTestRemoveStepViewController.h" - #import "ORKHelpers_Internal.h" @implementation ORKHolePegTestRemoveStep -+ (Class)stepViewControllerClass { - return [ORKHolePegTestRemoveStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveStepViewController.h b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemoveStepViewController.h rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStepViewController.h index 32bfdc8849..2b3b2e3864 100644 --- a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveStepViewController.h +++ b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKHolePegTestRemoveStepViewController.m b/ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKHolePegTestRemoveStepViewController.m rename to ResearchKitActiveTask/Hole Peg Test/Remove Test/ORKHolePegTestRemoveStepViewController.m diff --git a/ResearchKitActiveTask/Info.plist b/ResearchKitActiveTask/Info.plist new file mode 100644 index 0000000000..291294aca1 --- /dev/null +++ b/ResearchKitActiveTask/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + ResearchKitActiveTask + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ResearchKitActiveTask + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(ORK_FRAMEWORK_BUILD_NUMBER) + + diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Noise.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Noise.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Noise.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Noise.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseContentView.h b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseContentView.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseContentView.h rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseContentView.h index 70491b6496..56af96114f 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseContentView.h +++ b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseContentView.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKCustomStepView_Internal.h" +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -53,6 +53,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)removeAllSamples; - (void)setGraphViewHidden:(BOOL)hidden; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseContentView.m b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseContentView.m similarity index 93% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseContentView.m rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseContentView.m index cf06817b78..a0c313d433 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseContentView.m +++ b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseContentView.m @@ -29,6 +29,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ + + #import "ORKSpeechInNoiseContentView.h" #import "ORKAudioMeteringView.h" @@ -97,12 +99,9 @@ - (void)setupGraphView { [self addSubview:_graphView]; } + - (void)setupPlayButton { - if (@available(iOS 13.0, *)) { - self.playButton = [[ORKPlaybackButton alloc] initWithText:ORKLocalizedString(@"SPEECH_IN_NOISE_START_AUDIO_LABEL", nil) image:[UIImage systemImageNamed:@"play.circle"]]; - } else { - self.playButton = [[ORKPlaybackButton alloc] initWithText:ORKLocalizedString(@"SPEECH_IN_NOISE_START_AUDIO_LABEL", nil) image:[UIImage imageNamed:@"play" inBundle:ORKBundle() compatibleWithTraitCollection:nil]]; - } + self.playButton = [[ORKPlaybackButton alloc] initWithText:ORKLocalizedString(@"SPEECH_IN_NOISE_START_AUDIO_LABEL", nil) image:[UIImage systemImageNamed:@"play.circle"]]; self.playButton.translatesAutoresizingMaskIntoConstraints = NO; self.playButton.enabled = YES; self.playButton.accessibilityTraits = UIAccessibilityTraitButton | UIAccessibilityTraitStartsMediaSession; diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseResult.h b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseResult.h rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseResult.h diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseResult.m b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseResult.m rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseResult.m diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStep.h b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStep.h rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStep.h index 4b457e602f..85ede5d581 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStep.h +++ b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStep.h @@ -29,7 +29,8 @@ */ -@import Foundation; +#import + #import #import diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStep.m b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStep.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStep.m rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStep.m index 4a9aefb650..7adc9fbf48 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStep.m +++ b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStep.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSpeechInNoiseStep.h" -#import "ORKSpeechInNoiseStepViewController.h" #import "ORKHelpers_Internal.h" @@ -40,10 +39,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKSpeechInNoiseStep -+ (Class)stepViewControllerClass { - return [ORKSpeechInNoiseStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.h b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.h rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.h index ea157dce26..8470ede5c1 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.h +++ b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.h @@ -30,7 +30,7 @@ #import -#import +#import @interface ORKSpeechInNoiseStepViewController : ORKActiveStepViewController diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.m b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.m similarity index 85% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.m rename to ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.m index 0a95b6d534..24119dc8fd 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.m +++ b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController.m @@ -34,6 +34,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKActiveStepView.h" #import "ORKActiveStepViewController_Internal.h" #import "ORKStepViewController_Internal.h" +#import "ORKSpeechInNoiseStepViewController_Private.h" #import "ORKStepContainerView_Private.h" #import "ORKSpeechInNoiseContentView.h" #import "ORKSpeechInNoiseStep.h" @@ -47,9 +48,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTaskViewController.h" #import "ORKTaskViewController_Internal.h" - - #import + @import Accelerate; @interface ORKSpeechInNoiseStepViewController () { @@ -66,8 +66,6 @@ @interface ORKSpeechInNoiseStepViewController () { BOOL _installedTap; } -@property (nonatomic, strong) ORKSpeechInNoiseContentView *speechInNoiseContentView; - @end @implementation ORKSpeechInNoiseStepViewController @@ -80,16 +78,26 @@ - (void)viewDidLoad { _filterAudioBuffer = [[AVAudioPCMBuffer alloc] init]; _installedTap = NO; + [self setupContentView]; + [self setupEngine]; +} + +- (void)setupContentView { self.speechInNoiseContentView = [[ORKSpeechInNoiseContentView alloc] init]; self.activeStepView.activeCustomView = self.speechInNoiseContentView; self.activeStepView.customContentFillsAvailableSpace = NO; _speechInNoiseContentView.alertColor = [UIColor blueColor]; [self.speechInNoiseContentView.playButton addTarget:self action:@selector(tapButtonPressed) forControlEvents:UIControlEventTouchDown]; [_speechInNoiseContentView setGraphViewHidden:[self speechInNoiseStep].hideGraphView]; - _audioEngine = [[AVAudioEngine alloc] init]; - _playerNode = [[AVAudioPlayerNode alloc] init]; - [_audioEngine attachNode:_playerNode]; - [self setupBuffers]; +} + +- (void)setupEngine { + if (!_audioEngine.isRunning) { + _audioEngine = [[AVAudioEngine alloc] init]; + _playerNode = [[AVAudioPlayerNode alloc] init]; + [_audioEngine attachNode:_playerNode]; + [self setupBuffers]; + } } - (void)viewWillDisappear:(BOOL)animated { @@ -173,6 +181,10 @@ - (void)loadFileName: (NSString *)file intoBuffer: (AVAudioPCMBuffer * __strong NSURL *fileURL = [[NSBundle bundleForClass:[self class]] URLForResource:fileName withExtension:fileExtension]; + if (fileURL == nil) { + fileURL = [[NSBundle mainBundle] URLForResource:fileName withExtension:fileExtension]; + } + [self loadFileAtURL:fileURL intoBuffer:buffer]; } @@ -188,11 +200,11 @@ - (void)installTap { vDSP_maxmgv(channelData[0], 1 , &avgValue, nFrames); float lvlLowPassTrig = 0.3; - _peakPower = lvlLowPassTrig * ((avgValue == 0)? -100 : 20* log10(avgValue)) + (1 - lvlLowPassTrig) * _peakPower; - float clampedValue = MAX(_peakPower / 60.0, -1) + 1; + self->_peakPower = lvlLowPassTrig * ((avgValue == 0)? -100 : 20* log10(avgValue)) + (1 - lvlLowPassTrig) * self->_peakPower; + float clampedValue = MAX(self->_peakPower / 60.0, -1) + 1; dispatch_async(dispatch_get_main_queue(), ^{ - [_speechInNoiseContentView addSample:@(clampedValue)]; + [self->_speechInNoiseContentView addSample:@(clampedValue)]; }); } }]; @@ -207,6 +219,10 @@ - (void)tapButtonPressed { } else { [self.navigationItem setHidesBackButton:YES animated:YES]; [self installTap]; + + // can crash if engine is not running + [self setupEngine]; + [_playerNode play]; if ([self speechInNoiseStep].willAudioLoop) { [_speechInNoiseContentView.playButton setTitle:ORKLocalizedString(@"SPEECH_IN_NOISE_STOP_AUDIO_LABEL", nil) @@ -217,9 +233,12 @@ - (void)tapButtonPressed { [_speechInNoiseContentView.playButton setEnabled:NO]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(_toneDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ ORKStrongTypeOf(weakSelf) strongSelf = weakSelf; - [_playerNode stop]; - [_mixerNode removeTapOnBus:0]; - [strongSelf finish]; + [self->_playerNode stop]; + [self->_mixerNode removeTapOnBus:0]; + + if (![self shouldBlockFinishOfStep]) { + [strongSelf finish]; + } }); } } @@ -229,30 +248,27 @@ - (ORKSpeechInNoiseStep *)speechInNoiseStep { return (ORKSpeechInNoiseStep *)self.step; } -- (NSString *)filename -{ +- (nullable NSString *)filename { NSString *filename = nil; - - BOOL (^validate)(NSString * _Nullable) = ^BOOL(NSString * _Nullable str) { return str && str.length > 0; }; - - NSString *path = [[self speechInNoiseStep] speechFilePath]; - NSString *file = [path lastPathComponent]; - - if (validate(file)) - { - filename = [file copy]; - } - + BOOL (^validate)(NSString * _Nullable) = ^BOOL(NSString * _Nullable str) { return str && str.length > 0; }; + + NSString *path = [[self speechInNoiseStep] speechFilePath]; + NSString *file = [path lastPathComponent]; + + if (validate(file)) { + filename = [file copy]; + } return filename; } - -- (ORKStepResult *)result -{ +- (ORKStepResult *)result { ORKStepResult *sResult = [super result]; + if ([self isPracticeTest]) { + return sResult; + } ORKSpeechInNoiseStep *currentStep = (ORKSpeechInNoiseStep *)self.step; @@ -274,12 +290,18 @@ - (ORKStepResult *)result return sResult; } -- (void)finish -{ +- (void)finish { [_speechInNoiseContentView removeAllSamples]; [super finish]; } +- (BOOL)isPracticeTest { + return NO; +} + +- (BOOL)shouldBlockFinishOfStep { + return NO; +} @end diff --git a/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController_Private.h b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController_Private.h new file mode 100644 index 0000000000..366b781e2b --- /dev/null +++ b/ResearchKitActiveTask/ORKSpeechInNoise/ORKSpeechInNoiseStepViewController_Private.h @@ -0,0 +1,49 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +@class ORKSpeechInNoiseContentView; + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKSpeechInNoiseStepViewController () + +- (void)tapButtonPressed; +- (nullable NSString *)filename; +- (BOOL)isPracticeTest; +- (BOOL)shouldBlockFinishOfStep; +- (void)setupContentView; + +@property (nonatomic, strong) ORKSpeechInNoiseContentView *speechInNoiseContentView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence1.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence1.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence1.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence1.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence2.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence2.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence2.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence2.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence3.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence3.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence3.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence3.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence4.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence4.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence4.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence4.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence5.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence5.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence5.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence5.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence6.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence6.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence6.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence6.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence7.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence7.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Sentence7.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/Sentence7.wav diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/SentencesList.txt b/ResearchKitActiveTask/ORKSpeechInNoise/Sentences/SentencesList.txt similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/SentencesList.txt rename to ResearchKitActiveTask/ORKSpeechInNoise/Sentences/SentencesList.txt diff --git a/ResearchKit/ActiveTasks/ORKSpeechInNoise/Window.wav b/ResearchKitActiveTask/ORKSpeechInNoise/Window.wav similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechInNoise/Window.wav rename to ResearchKitActiveTask/ORKSpeechInNoise/Window.wav diff --git a/ResearchKitActiveTask/ORKStep+ResearchKitActiveTask.m b/ResearchKitActiveTask/ORKStep+ResearchKitActiveTask.m new file mode 100644 index 0000000000..1b40b823ca --- /dev/null +++ b/ResearchKitActiveTask/ORKStep+ResearchKitActiveTask.m @@ -0,0 +1,273 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ResearchKitActiveTask.h" +#import "ResearchKitActiveTask_Private.h" + +@implementation ORK3DModelStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORK3DModelStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKAccuracyStroopStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKAccuracyStroopStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKActiveStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKActiveStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKAmslerGridStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKAmslerGridStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKAudioFitnessStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKAudioFitnessStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKAudioStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKAudioStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKCountdownStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKCountdownStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKEnvironmentSPLMeterStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKEnvironmentSPLMeterStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKFitnessStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKFitnessStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKFrontFacingCameraStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKFrontFacingCameraStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKHolePegTestPlaceStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKHolePegTestPlaceStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKHolePegTestRemoveStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKHolePegTestRemoveStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKPSATStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKPSATStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKRangeOfMotionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKRangeOfMotionStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKReactionTimeStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKReactionTimeViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKShoulderRangeOfMotionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKShoulderRangeOfMotionStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKSpatialSpanMemoryStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKSpatialSpanMemoryStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKSpeechInNoiseStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKSpeechInNoiseStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKSpeechRecognitionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKSpeechRecognitionStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKStroopStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKStroopStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKTappingIntervalStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKTappingIntervalStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKTimedWalkStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKTimedWalkStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKToneAudiometryStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKToneAudiometryStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKTouchAnywhereStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKTouchAnywhereStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKTowerOfHanoiStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKTowerOfHanoiViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKTrailmakingStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKTrailmakingStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKWalkingTaskStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKWalkingTaskStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKdBHLToneAudiometryOnboardingStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKdBHLToneAudiometryOnboardingStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKdBHLToneAudiometryStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKdBHLToneAudiometryStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKNormalizedReactionTimeStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKNormalizedReactionTimeViewController alloc] initWithStep:self result:result]; +} + +@end + diff --git a/ResearchKit/ActiveTasks/ORKPSATContentView.h b/ResearchKitActiveTask/PSAT/ORKPSATContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKPSATContentView.h rename to ResearchKitActiveTask/PSAT/ORKPSATContentView.h index a25e4278d4..099023cd26 100644 --- a/ResearchKit/ActiveTasks/ORKPSATContentView.h +++ b/ResearchKitActiveTask/PSAT/ORKPSATContentView.h @@ -31,7 +31,7 @@ @import UIKit; #import "ORKTypes.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKPSATContentView.m b/ResearchKitActiveTask/PSAT/ORKPSATContentView.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKPSATContentView.m rename to ResearchKitActiveTask/PSAT/ORKPSATContentView.m index d62628beab..7794fe8bc0 100644 --- a/ResearchKit/ActiveTasks/ORKPSATContentView.m +++ b/ResearchKitActiveTask/PSAT/ORKPSATContentView.m @@ -98,11 +98,7 @@ - (void)setEnabled:(BOOL)enabled { - (void)setAddition:(NSUInteger)additionIndex forTotal:(NSUInteger)totalAddition withDigit:(NSNumber *)digit { if (digit.integerValue == -1) { - if (@available(iOS 13.0, *)) { - self.digitLabel.textColor = [[UIColor labelColor] colorWithAlphaComponent:0.3f]; - } else { - self.digitLabel.textColor = [[UIColor blackColor] colorWithAlphaComponent:0.3f]; - } + self.digitLabel.textColor = [[UIColor labelColor] colorWithAlphaComponent:0.3f]; self.digitLabel.text = ORKLocalizedString(@"PSAT_NO_DIGIT", nil); } else { [self.keyboardView.selectedAnswerButton setSelected:NO]; diff --git a/ResearchKit/ActiveTasks/ORKPSATKeyboardView.h b/ResearchKitActiveTask/PSAT/ORKPSATKeyboardView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKPSATKeyboardView.h rename to ResearchKitActiveTask/PSAT/ORKPSATKeyboardView.h diff --git a/ResearchKit/ActiveTasks/ORKPSATKeyboardView.m b/ResearchKitActiveTask/PSAT/ORKPSATKeyboardView.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKPSATKeyboardView.m rename to ResearchKitActiveTask/PSAT/ORKPSATKeyboardView.m index 9a0ae0d946..3a78bfdd71 100644 --- a/ResearchKit/ActiveTasks/ORKPSATKeyboardView.m +++ b/ResearchKitActiveTask/PSAT/ORKPSATKeyboardView.m @@ -80,7 +80,7 @@ - (ORKBorderedButton *)answerButtonWithTitle:(NSString *)title { - (void)setEnabled:(BOOL)enabled { for (ORKBorderedButton *answerButton in self.answerButtons) { [answerButton setEnabled:enabled]; - [answerButton setBackgroundColor:ORKViewTintColor(self)]; + [answerButton setBackgroundColor:ORKWindowTintcolor(self.window) ? : [UIColor systemBlueColor]]; } } diff --git a/ResearchKit/ActiveTasks/ORKPSATResult.h b/ResearchKitActiveTask/PSAT/ORKPSATResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKPSATResult.h rename to ResearchKitActiveTask/PSAT/ORKPSATResult.h diff --git a/ResearchKit/ActiveTasks/ORKPSATResult.m b/ResearchKitActiveTask/PSAT/ORKPSATResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKPSATResult.m rename to ResearchKitActiveTask/PSAT/ORKPSATResult.m diff --git a/ResearchKit/ActiveTasks/ORKPSATStep.h b/ResearchKitActiveTask/PSAT/ORKPSATStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKPSATStep.h rename to ResearchKitActiveTask/PSAT/ORKPSATStep.h index 04c715053c..049818bcc2 100644 --- a/ResearchKit/ActiveTasks/ORKPSATStep.h +++ b/ResearchKitActiveTask/PSAT/ORKPSATStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKPSATStep.m b/ResearchKitActiveTask/PSAT/ORKPSATStep.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKPSATStep.m rename to ResearchKitActiveTask/PSAT/ORKPSATStep.m index 5365f0bdaa..e887c003b7 100644 --- a/ResearchKit/ActiveTasks/ORKPSATStep.m +++ b/ResearchKitActiveTask/PSAT/ORKPSATStep.m @@ -31,17 +31,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKPSATStep.h" -#import "ORKPSATStepViewController.h" - #import "ORKHelpers_Internal.h" @implementation ORKPSATStep -+ (Class)stepViewControllerClass { - return [ORKPSATStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKPSATStepViewController.h b/ResearchKitActiveTask/PSAT/ORKPSATStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKPSATStepViewController.h rename to ResearchKitActiveTask/PSAT/ORKPSATStepViewController.h index 23917bcd3d..e70f7c3b17 100644 --- a/ResearchKit/ActiveTasks/ORKPSATStepViewController.h +++ b/ResearchKitActiveTask/PSAT/ORKPSATStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKPSATStepViewController.m b/ResearchKitActiveTask/PSAT/ORKPSATStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKPSATStepViewController.m rename to ResearchKitActiveTask/PSAT/ORKPSATStepViewController.m diff --git a/ResearchKitActiveTask/PrivacyInfo.xcprivacy b/ResearchKitActiveTask/PrivacyInfo.xcprivacy new file mode 100644 index 0000000000..b181c500b6 --- /dev/null +++ b/ResearchKitActiveTask/PrivacyInfo.xcprivacy @@ -0,0 +1,84 @@ + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeAudioData + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePhotosorVideos + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeSensitiveInfo + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeHealth + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePreciseLocation + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + + diff --git a/ResearchKit/ActiveTasks/ORKRangeOfMotionResult.h b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKRangeOfMotionResult.h rename to ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionResult.h diff --git a/ResearchKit/ActiveTasks/ORKRangeOfMotionResult.m b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKRangeOfMotionResult.m rename to ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionResult.m diff --git a/ResearchKit/ActiveTasks/ORKRangeOfMotionStep.h b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKRangeOfMotionStep.h rename to ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStep.h index 4e247cd024..b4cbfa1565 100644 --- a/ResearchKit/ActiveTasks/ORKRangeOfMotionStep.h +++ b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import #import diff --git a/ResearchKit/ActiveTasks/ORKRangeOfMotionStep.m b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKRangeOfMotionStep.m rename to ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStep.m index feeb418256..2da79ad2cc 100644 --- a/ResearchKit/ActiveTasks/ORKRangeOfMotionStep.m +++ b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStep.m @@ -30,16 +30,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKRangeOfMotionStep.h" -#import "ORKRangeOfMotionStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKRangeOfMotionStep -+ (Class)stepViewControllerClass { - return [ORKRangeOfMotionStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier limbOption:(ORKPredefinedTaskLimbOption)limbOption { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKRangeOfMotionStepViewController.h b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStepViewController.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKRangeOfMotionStepViewController.h rename to ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStepViewController.h index d21b2995ff..9d0b60ff0d 100644 --- a/ResearchKit/ActiveTasks/ORKRangeOfMotionStepViewController.h +++ b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStepViewController.h @@ -29,7 +29,7 @@ */ -#import +#import #import diff --git a/ResearchKit/ActiveTasks/ORKRangeOfMotionStepViewController.m b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStepViewController.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKRangeOfMotionStepViewController.m rename to ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStepViewController.m index 5cd77fb281..fe6d6f83a6 100644 --- a/ResearchKit/ActiveTasks/ORKRangeOfMotionStepViewController.m +++ b/ResearchKitActiveTask/Range of Motion/ORKRangeOfMotionStepViewController.m @@ -31,7 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKRangeOfMotionStepViewController.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKHelpers_Internal.h" #import "ORKActiveStepViewController_Internal.h" #import "ORKStepViewController_Internal.h" @@ -41,6 +41,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKProgressView.h" #import "ORKRangeOfMotionResult.h" #import "ORKSkin.h" +#import +#import #define radiansToDegrees(radians) ((radians) * 180.0 / M_PI) diff --git a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStep.h b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStep.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStep.h rename to ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStep.h index 510d233643..7cdb2f289c 100644 --- a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStep.h +++ b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStep.h @@ -29,7 +29,7 @@ */ -#import +#import /** diff --git a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStep.m b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStep.m similarity index 91% rename from ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStep.m rename to ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStep.m index 567e492a43..04e8f51c01 100644 --- a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStep.m +++ b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStep.m @@ -30,14 +30,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKShoulderRangeOfMotionStep.h" -#import "ORKShoulderRangeOfMotionStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKShoulderRangeOfMotionStep -+ (Class)stepViewControllerClass { - return [ORKShoulderRangeOfMotionStepViewController class]; -} - @end diff --git a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStepViewController.h b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStepViewController.h rename to ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStepViewController.h index 1f6598f497..2ce087d763 100644 --- a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStepViewController.h +++ b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStepViewController.h @@ -29,7 +29,7 @@ */ -#import "ORKRangeOfMotionStepViewController.h" +#import /** diff --git a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStepViewController.m b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStepViewController.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStepViewController.m rename to ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStepViewController.m index 9f8742b825..46b79f2f6f 100644 --- a/ResearchKit/ActiveTasks/ORKShoulderRangeOfMotionStepViewController.m +++ b/ResearchKitActiveTask/Range of Motion/Shoulder/ORKShoulderRangeOfMotionStepViewController.m @@ -31,6 +31,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKShoulderRangeOfMotionStepViewController.h" +#import +#import #import "ORKRangeOfMotionResult.h" #import "ORKStepViewController_Internal.h" diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeContentView.h b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeContentView.h rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.h index a5dbd1a00b..a0ba38833a 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeContentView.h +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.h @@ -31,7 +31,7 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKNormalizedReactionTimeStimulusView.h" #import "ORKRoundTappingButton.h" diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeContentView.m b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeContentView.m rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.m index 2ac73ff578..4553fa9ee4 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeContentView.m +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeContentView.m @@ -50,7 +50,6 @@ - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.translatesAutoresizingMaskIntoConstraints = NO; - [self resizeConstraints]; [self addStimulusView]; [self addBackgroundView]; [self addButton]; @@ -68,21 +67,13 @@ - (void)startFailureAnimationWithDuration:(NSTimeInterval)duration completion:(v - (void)resetAfterDelay:(NSTimeInterval)delay completion:(nullable void (^)(void))completion { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - _stimulusView.hidden = YES; + self->_stimulusView.hidden = YES; if (completion) { completion(); } }); } --(void)resizeConstraints { - ORKScreenType screenType = ORKGetVerticalScreenTypeForWindow([[[UIApplication sharedApplication] delegate] window]); - if (screenType == ORKScreenTypeiPhone5 ) { - NormalizeButtonSize = 70.0; - BackgroundViewSpaceMultiplier = 1.75; - } -} - -(void)addButton { _button = [ORKRoundTappingButton new]; _button.translatesAutoresizingMaskIntoConstraints = NO; @@ -90,7 +81,6 @@ -(void)addButton { [_button setDiameter:NormalizeButtonSize]; - [self addSubview:_button]; [NSLayoutConstraint activateConstraints: @[ diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeResult.h b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeResult.h rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.h index 81af33e5e3..1fe2367d99 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeResult.h +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.h @@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN /** The `ORKReactionTimeResult` class represents the result of a single successful attempt within an ORKReactionTimeStep. - + The `timestamp` property is equal to the value of systemUptime (in NSProcessInfo) when the stimulus occurred. Each entry of motion data in this file contains a time interval which may be directly compared to timestamp in order to determine the elapsed time since the stimulus. @@ -58,6 +58,8 @@ ORK_CLASS_AVAILABLE @property (nonatomic, copy, nullable) NSDate * reactionDate; @property (nonatomic) double currentInterval; + + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeResult.m b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeResult.m rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.m index 4aeaaad232..f313d8b59c 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeResult.m +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeResult.m @@ -73,6 +73,7 @@ - (BOOL)isEqual:(id)object { ORKEqualObjects(self.stimulusStartDate, castObject.stimulusStartDate) && ORKEqualObjects(self.reactionDate, castObject.reactionDate) && (self.currentInterval == castObject.currentInterval)); + } - (NSUInteger)hash { diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStep.h b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStep.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStep.h rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStep.h index 971a162827..79e96205d2 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStep.h +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStep.h @@ -30,8 +30,8 @@ */ -@import Foundation; -@import AudioToolbox; +#import +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStep.m b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStep.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStep.m rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStep.m diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStimulusView.h b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStimulusView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStimulusView.h rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStimulusView.h index a738a500f4..8ca2edf051 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStimulusView.h +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStimulusView.h @@ -31,7 +31,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStimulusView.m b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStimulusView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeStimulusView.m rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeStimulusView.m diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeViewController.h b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.h similarity index 93% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeViewController.h rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.h index a1090ad521..eb2c7549ca 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeViewController.h +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.h @@ -30,9 +30,10 @@ */ -@import UIKit; -#import "ORKDefines.h" -#import "ORKActiveStepViewController.h" +#import + +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeViewController.m b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKNormalizedReactionTimeViewController.m rename to ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.m index 10a149131b..0f5b7df4a4 100644 --- a/ResearchKit/ActiveTasks/ORKNormalizedReactionTimeViewController.m +++ b/ResearchKitActiveTask/Reaction Time/Normalized/ORKNormalizedReactionTimeViewController.m @@ -176,13 +176,13 @@ - (ORKNormalizedReactionTimeStep *)reactionTimeStep { - (void)configureTitle { NSString *format = ORKLocalizedString(@"REACTION_TIME_TASK_ATTEMPTS_FORMAT", nil); - NSString *text = [[NSString stringWithFormat: @"%@\n",ORKLocalizedString(@"REACTION_TIME_NORMALIZED_TASK_ACTIVE_STEP_TITLE", nil)] stringByAppendingString: [NSString stringWithFormat:format, ORKLocalizedStringFromNumber(@(_results.count + 1)), ORKLocalizedStringFromNumber(@([self reactionTimeStep].numberOfAttempts))]]; + NSString *text = [[NSString stringWithFormat: @"%@\n",ORKLocalizedString(@"REACTION_TIME_NORMALIZED_TASK_ACTIVE_STEP_TITLE", nil)] stringByAppendingString: [NSString stringWithFormat:format, ORKLocalizedStringFromNumber(@(self->_results.count + 1)), ORKLocalizedStringFromNumber(@([self reactionTimeStep].numberOfAttempts))]]; [self.activeStepView updateTitle:nil text:text]; } - (void)attemptDidFinish { void (^completion)(void) = ^{ - if (_results.count == [self reactionTimeStep].numberOfAttempts) { + if (self->_results.count == [self reactionTimeStep].numberOfAttempts) { [self finish]; } else { [self resetAfterDelay:2]; @@ -255,7 +255,6 @@ - (NSTimeInterval)stimulusInterval { ORKNormalizedReactionTimeStep *step = [self reactionTimeStep]; NSNumber* interval = [self getRandomInterval]; step.currentInterval = interval.doubleValue; - return [interval doubleValue]; } diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeContentView.h b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKReactionTimeContentView.h rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeContentView.h index 64bf1eefee..d0f7622417 100644 --- a/ResearchKit/ActiveTasks/ORKReactionTimeContentView.h +++ b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeContentView.h @@ -30,7 +30,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeContentView.m b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeContentView.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKReactionTimeContentView.m rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeContentView.m index c9c2758985..b65a56e121 100644 --- a/ResearchKit/ActiveTasks/ORKReactionTimeContentView.m +++ b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeContentView.m @@ -58,7 +58,7 @@ - (void)startFailureAnimationWithDuration:(NSTimeInterval)duration completion:(v - (void)resetAfterDelay:(NSTimeInterval)delay completion:(nullable void (^)(void))completion { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - _stimulusView.hidden = YES; + self->_stimulusView.hidden = YES; if (completion) { completion(); } diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeResult.h b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKReactionTimeResult.h rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeResult.h diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeResult.m b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKReactionTimeResult.m rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeResult.m diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeStep.h b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeStep.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKReactionTimeStep.h rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeStep.h index 891d439992..b1927d06ba 100644 --- a/ResearchKit/ActiveTasks/ORKReactionTimeStep.h +++ b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeStep.h @@ -29,8 +29,8 @@ */ -@import Foundation; -@import AudioToolbox; +#import +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeStep.m b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeStep.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKReactionTimeStep.m rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeStep.m index ca15c1c32b..52bbc1f823 100644 --- a/ResearchKit/ActiveTasks/ORKReactionTimeStep.m +++ b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeStep.m @@ -31,17 +31,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKReactionTimeStep.h" -#import "ORKReactionTimeViewController.h" - #import "ORKHelpers_Internal.h" @implementation ORKReactionTimeStep -+ (Class)stepViewControllerClass { - return [ORKReactionTimeViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; self.shouldContinueOnFinish = YES; diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeStimulusView.h b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeStimulusView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKReactionTimeStimulusView.h rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeStimulusView.h index ac3b926dd7..8b616c5581 100644 --- a/ResearchKit/ActiveTasks/ORKReactionTimeStimulusView.h +++ b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeStimulusView.h @@ -30,7 +30,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeStimulusView.m b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeStimulusView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKReactionTimeStimulusView.m rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeStimulusView.m diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeViewController.h b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeViewController.h similarity index 93% rename from ResearchKit/ActiveTasks/ORKReactionTimeViewController.h rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeViewController.h index c60be91a7d..26ea1501ba 100644 --- a/ResearchKit/ActiveTasks/ORKReactionTimeViewController.h +++ b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; -#import "ORKDefines.h" -#import "ORKActiveStepViewController.h" +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKReactionTimeViewController.m b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeViewController.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKReactionTimeViewController.m rename to ResearchKitActiveTask/Reaction Time/ORKReactionTimeViewController.m index d0426e62f7..ff12fc1a5f 100644 --- a/ResearchKit/ActiveTasks/ORKReactionTimeViewController.m +++ b/ResearchKitActiveTask/Reaction Time/ORKReactionTimeViewController.m @@ -161,21 +161,21 @@ - (void)configureTitle { - (void)attemptDidFinish { dispatch_async(dispatch_get_main_queue(), ^(void) { void (^completion)(void) = ^{ - if (_results.count == [self reactionTimeStep].numberOfAttempts) { + if (self->_results.count == [self reactionTimeStep].numberOfAttempts) { [self finish]; } else { [self resetAfterDelay:2]; } }; - if (_validResult) { + if (self->_validResult) { [self indicateSuccess:completion]; } else { [self indicateFailure:completion]; } - _validResult = NO; - _timedOut = NO; - [_stimulusTimer invalidate]; - [_timeoutTimer invalidate]; + self->_validResult = NO; + self->_timedOut = NO; + [self->_stimulusTimer invalidate]; + [self->_timeoutTimer invalidate]; }); } diff --git a/ResearchKitActiveTask/ResearchKitActiveTask.docc/ResearchKitActiveTask.md b/ResearchKitActiveTask/ResearchKitActiveTask.docc/ResearchKitActiveTask.md new file mode 100644 index 0000000000..a8918ff35c --- /dev/null +++ b/ResearchKitActiveTask/ResearchKitActiveTask.docc/ResearchKitActiveTask.md @@ -0,0 +1,72 @@ +# ``ResearchKitActiveTask`` + +Use active tasks to capture sensor information. + +## Overview + +Active tasks invite users to perform activities under partially controlled conditions while iPhone sensors are used to collect data. + +## Topics + +### Steps + +- ``ORKAccuracyStroopStep`` +- ``ORKActiveStep`` +- ``ORKEnvironmentSPLMeterStep`` +- ``ORKTouchAnywhereStep`` +- ``ORK3DModelStep`` + +### Results + +- ``ORKAccuracyStroopResult`` +- ``ORKAmslerGridResult`` +- ``ORKdBHLToneAudiometryResult`` +- ``ORKEnvironmentSPLMeterResult`` +- ``ORKHolePegTestResult`` +- ``ORKNormalizedReactionTimeResult`` +- ``ORKPSATResult`` +- ``ORKRangeOfMotionResult`` +- ``ORKReactionTimeResult`` +- ``ORKSpatialSpanMemoryResult`` +- ``ORKSpeechInNoiseResult`` +- ``ORKSpeechRecognitionResult`` +- ``ORKStroopResult`` +- ``ORKTappingIntervalResult`` +- ``ORKTimedWalkResult`` +- ``ORKToneAudiometryResult`` +- ``ORKTowerOfHanoiResult`` +- ``ORKTrailmakingResult`` +- ``ORKUSDZModelManagerResult`` + +### View Controllers + +- ``ORKActiveStepViewController`` +- ``ORKTouchAnywhereStepViewController`` + +### Other + +- ``ORKAudioChannel`` +- ``ORKAudiometryProtocol`` +- ``ORKAudiometryStimulus`` +- ``ORKAudiometryTimestampProvider`` +- ``ORKBodySagittal`` +- ``ORKdBHLTaskContext`` +- ``ORKdBHLToneAudiometryFrequencySample`` +- ``ORKdBHLToneAudiometryUnit`` +- ``ORKHealthClinicalTypeRecorderConfiguration`` +- ``ORKHealthQuantityTypeRecorderConfiguration`` +- ``ORKHolePegTestSample`` +- ``ORKInvalidDBHLValue`` +- ``ORKPSATSample`` +- ``ORKSpatialSpanMemoryGameRecord`` +- ``ORKSpatialSpanMemoryGameStatus`` +- ``ORKSpatialSpanMemoryGameTouchSample`` +- ``ORKSpeechRecognizerLocale`` +- ``ORKTappingButtonIdentifier`` +- ``ORKTappingSample`` +- ``ORKToneAudiometrySample`` +- ``ORKTowerOfHanoiMove`` +- ``ORKTrailmakingTap`` +- ``ORKUSDZModelManager`` +- ``ORK3DModelManager`` +- ``ORK3DModelManagerProtocol`` diff --git a/ResearchKitActiveTask/ResearchKitActiveTask.h b/ResearchKitActiveTask/ResearchKitActiveTask.h new file mode 100644 index 0000000000..3c2457b07b --- /dev/null +++ b/ResearchKitActiveTask/ResearchKitActiveTask.h @@ -0,0 +1,112 @@ +// +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +//! Project version number for ResearchKitActiveTask. +FOUNDATION_EXPORT double ResearchKitActiveTaskVersionNumber; + +//! Project version string for ResearchKitActiveTask. +FOUNDATION_EXPORT const unsigned char ResearchKitActiveTaskVersionString[]; + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ResearchKitActiveTask/ResearchKitActiveTask.modulemap b/ResearchKitActiveTask/ResearchKitActiveTask.modulemap new file mode 100644 index 0000000000..d191f79660 --- /dev/null +++ b/ResearchKitActiveTask/ResearchKitActiveTask.modulemap @@ -0,0 +1,6 @@ +framework module ResearchKitActiveTask { + umbrella header "ResearchKitActiveTask.h" + + export * + module * { export * } +} diff --git a/ResearchKitActiveTask/ResearchKitActiveTask_Private.h b/ResearchKitActiveTask/ResearchKitActiveTask_Private.h new file mode 100644 index 0000000000..9aaf1feace --- /dev/null +++ b/ResearchKitActiveTask/ResearchKitActiveTask_Private.h @@ -0,0 +1,83 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ResearchKitActiveTask/ResearchKitActiveTask_Private.modulemap b/ResearchKitActiveTask/ResearchKitActiveTask_Private.modulemap new file mode 100644 index 0000000000..93531c9bfb --- /dev/null +++ b/ResearchKitActiveTask/ResearchKitActiveTask_Private.modulemap @@ -0,0 +1,36 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +framework module ResearchKitActiveTask_Private { + umbrella header "ResearchKitActiveTask_Private.h" + + export * + module * { export * } +} diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanGame.h b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGame.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpatialSpanGame.h rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGame.h diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanGame.m b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGame.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpatialSpanGame.m rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGame.m diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanGameState.h b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGameState.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpatialSpanGameState.h rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGameState.h diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanGameState.m b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGameState.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpatialSpanGameState.m rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanGameState.m diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.h b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.h rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryContentView.h index 0a0a2b94e3..49b77d62af 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.h +++ b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryContentView.h @@ -29,7 +29,7 @@ */ -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKSpatialSpanTargetView.h" #import "ORKBorderedButton.h" diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.m b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryContentView.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.m rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryContentView.m index 640ff377e0..e7cdb7653f 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryContentView.m +++ b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryContentView.m @@ -94,8 +94,8 @@ - (void)resetTilesAnimated:(BOOL)animated { } } - _tileViews = newViews; - for (ORKSpatialSpanTargetView *view in _tileViews) { + self->_tileViews = newViews; + for (ORKSpatialSpanTargetView *view in self->_tileViews) { [view setState:ORKSpatialSpanTargetStateQuiescent]; } @@ -260,7 +260,7 @@ - (void)setFooterHidden:(BOOL)footerHidden { - (void)setButtonItem:(ORKBorderedButton *)buttonItem { _buttonItem = buttonItem; if (buttonItem) { - [buttonItem updateContentInsets:NSDirectionalEdgeInsetsMake(2, 8, 2, 8)]; + buttonItem.contentEdgeInsets = (UIEdgeInsets){.top = 2, .bottom = 2, .left = 8, .right = 8}; buttonItem.translatesAutoresizingMaskIntoConstraints = NO; [_continueView addSubview:buttonItem]; [[NSLayoutConstraint constraintWithItem:_buttonItem diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryResult.h b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryResult.h rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryResult.h diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryResult.m b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryResult.m rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryResult.m diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStep.h b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStep.h rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStep.h index dbb4a3e260..af9e384fcd 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStep.h +++ b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStep.m b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStep.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStep.m rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStep.m index bbeec5f0d2..1708cb933a 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStep.m +++ b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSpatialSpanMemoryStep.h" -#import "ORKSpatialSpanMemoryStepViewController.h" - #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -40,10 +38,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKSpatialSpanMemoryStep -+ (Class)stepViewControllerClass { - return [ORKSpatialSpanMemoryStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStepViewController.h b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStepViewController.h rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStepViewController.h index 855f60e8bf..73be1f7736 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStepViewController.h +++ b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStepViewController.m b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStepViewController.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStepViewController.m rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStepViewController.m index 285e44869c..c89d3d2497 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanMemoryStepViewController.m +++ b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanMemoryStepViewController.m @@ -593,9 +593,9 @@ - (void)showSuccess { [self.activeStepView updateTitle:ORKLocalizedString(@"MEMORY_GAME_COMPLETE_TITLE", nil) text:ORKLocalizedString(@"MEMORY_GAME_COMPLETE_MESSAGE", nil)]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.75 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - _contentView.buttonItem = [ORKBorderedButton new]; - [_contentView.buttonItem setTitle:ORKLocalizedString(@"BUTTON_NEXT", nil) forState:UIControlStateNormal]; - [_contentView.buttonItem addTarget:self action:@selector(continueAction) forControlEvents:UIControlEventTouchUpInside]; + self->_contentView.buttonItem = [ORKBorderedButton new]; + [self->_contentView.buttonItem setTitle:ORKLocalizedString(@"BUTTON_NEXT", nil) forState:UIControlStateNormal]; + [self->_contentView.buttonItem addTarget:self action:@selector(continueAction) forControlEvents:UIControlEventTouchUpInside]; }); } @@ -653,9 +653,9 @@ - (void)showComplete { [self.activeStepView updateTitle:ORKLocalizedString(@"MEMORY_GAME_COMPLETE_TITLE", nil) text:nil]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.75 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - _contentView.buttonItem = [ORKBorderedButton new]; - [_contentView.buttonItem setTitle:ORKLocalizedString(@"BUTTON_NEXT", nil) forState:UIControlStateNormal]; - [_contentView.buttonItem addTarget:self action:@selector(continueAction) forControlEvents:UIControlEventTouchUpInside]; + self->_contentView.buttonItem = [ORKBorderedButton new]; + [self->_contentView.buttonItem setTitle:ORKLocalizedString(@"BUTTON_NEXT", nil) forState:UIControlStateNormal]; + [self->_contentView.buttonItem addTarget:self action:@selector(continueAction) forControlEvents:UIControlEventTouchUpInside]; }); } @@ -675,7 +675,7 @@ - (void)doRestart { [self resetForNewGame]; dispatch_async(dispatch_get_main_queue(), ^{ // Dispatch, so we don't do this in the middle of a state transition - if (_state.state == ORKSpatialSpanStepStateRestart) { + if (self->_state.state == ORKSpatialSpanStepStateRestart) { [self transitionToState:ORKSpatialSpanStepStatePlayback]; } }); diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanTargetView.h b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanTargetView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpatialSpanTargetView.h rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanTargetView.h diff --git a/ResearchKit/ActiveTasks/ORKSpatialSpanTargetView.m b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanTargetView.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKSpatialSpanTargetView.m rename to ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanTargetView.m index 37f104ee24..b2507ff3f7 100644 --- a/ResearchKit/ActiveTasks/ORKSpatialSpanTargetView.m +++ b/ResearchKitActiveTask/Spatial Span Memory/ORKSpatialSpanTargetView.m @@ -40,7 +40,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const UIEdgeInsets ORKFlowerMargins = (UIEdgeInsets){12,12,12,12}; static const CGSize ORKFlowerBezierPathSize = (CGSize){90,90}; -static UIBezierPath *ORKFlowerBezierPath() { +static UIBezierPath *ORKFlowerBezierPath(void) { UIBezierPath *bezierPath = UIBezierPath.bezierPath; [bezierPath moveToPoint: CGPointMake(58.8, 45)]; [bezierPath addCurveToPoint: CGPointMake(51.9, 33.2) controlPoint1: CGPointMake(107.8, 41.8) controlPoint2: CGPointMake(79.3, -7.2)]; @@ -62,7 +62,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE } static const CGSize ORKCheckBezierPathSize = (CGSize){28,28}; -static UIBezierPath *ORKCheckBezierPath() { +static UIBezierPath *ORKCheckBezierPath(void) { UIBezierPath *bezierPath = UIBezierPath.bezierPath; [bezierPath moveToPoint: CGPointMake(11.6, 19)]; [bezierPath addCurveToPoint: CGPointMake(11.1, 18.8) controlPoint1: CGPointMake(11.4, 19) controlPoint2: CGPointMake(11.2, 18.9)]; @@ -82,7 +82,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE } static const CGSize ORKErrorBezierPathSize = (CGSize){28,28}; -static UIBezierPath *ORKErrorBezierPath() { +static UIBezierPath *ORKErrorBezierPath(void) { UIBezierPath *bezier3Path = UIBezierPath.bezierPath; [bezier3Path moveToPoint: CGPointMake(15.1, 14)]; [bezier3Path addLineToPoint: CGPointMake(18.8, 10.3)]; @@ -319,12 +319,12 @@ - (void)setState:(ORKSpatialSpanTargetState)state animated:(BOOL)animated { _flowerView.transform = CGAffineTransformMakeScale(_flowerScaleFactor, _flowerScaleFactor); [UIView animateWithDuration:(animated ? duration : 0) delay:0 usingSpringWithDamping:useSpring ? 0.5 : 1 initialSpringVelocity:0 options:(UIViewAnimationOptions)UIViewAnimationOptionBeginFromCurrentState animations:^{ - _errorView.alpha = newCircleAlpha; - _checkView.alpha = newCircleAlpha; - _errorView.transform = newCircleTransform; - _checkView.transform = newCircleTransform; + self->_errorView.alpha = newCircleAlpha; + self->_checkView.alpha = newCircleAlpha; + self->_errorView.transform = newCircleTransform; + self->_checkView.transform = newCircleTransform; self.alpha = newAlpha; - _flowerView.transform = newTransform; + self->_flowerView.transform = newTransform; } completion:NULL]; } diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionContentView.h b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionContentView.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionContentView.h rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionContentView.h index 2c20c68193..3f37e0e8d2 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognitionContentView.h +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionContentView.h @@ -28,9 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -@import UIKit; -#import "ORKCustomStepView_Internal.h" +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -74,6 +73,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)updateButtonStates; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionContentView.m b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionContentView.m similarity index 95% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionContentView.m rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionContentView.m index 01b3828ad7..7dc134c5c5 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognitionContentView.m +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionContentView.m @@ -81,13 +81,11 @@ - (instancetype)initWithFrame:(CGRect)frame { return self; } -- (void)drawRect:(CGRect)rect -{ +- (void)drawRect:(CGRect)rect { [self setUpConstraints]; } -- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection -{ +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { [super traitCollectionDidChange:previousTraitCollection]; [self setUpConstraints]; @@ -132,6 +130,7 @@ - (void)setupGraphView { [self addSubview:_graphView]; } + - (void)setupTranscriptLabel { _transcriptLabel = [ORKSubheadlineLabel new]; _transcriptLabel.textAlignment = NSTextAlignmentCenter; @@ -143,10 +142,8 @@ - (void)setupTranscriptLabel { [self addSubview:_transcriptLabel]; } -- (void)setupRecordButton -{ - if (!_recordButton) - { +- (void)setupRecordButton { + if (!_recordButton) { self.recordButton = [[ORKRecordButton alloc] init]; self.recordButton.delegate = self; self.recordButton.translatesAutoresizingMaskIntoConstraints = NO; @@ -156,16 +153,13 @@ - (void)setupRecordButton } } -- (void)buttonPressed:(ORKRecordButton *)recordButton -{ +- (void)buttonPressed:(ORKRecordButton *)recordButton { if ([self.delegate conformsToProtocol:@protocol(ORKSpeechRecognitionContentViewDelegate)] && - [self.delegate respondsToSelector:@selector(didPressRecordButton:)]) - { + [self.delegate respondsToSelector:@selector(didPressRecordButton:)]) { [self.delegate didPressRecordButton:recordButton]; } - switch ([recordButton buttonType]) - { + switch ([recordButton buttonType]) { case ORKRecordButtonTypeRecord: [recordButton setButtonType:ORKRecordButtonTypeStop animated:YES]; @@ -179,10 +173,8 @@ - (void)buttonPressed:(ORKRecordButton *)recordButton } } -- (void)updateButtonStates -{ - switch ([_recordButton buttonType]) - { +- (void)updateButtonStates { + switch ([_recordButton buttonType]) { case ORKRecordButtonTypeRecord: [self setKeyboardButtonEnabled:YES]; @@ -194,13 +186,12 @@ - (void)updateButtonStates } } -- (void)setupUseKeyboardButton -{ +- (void)setupUseKeyboardButton { _useKeyboardButton = [[UIButton alloc] init]; - if (@available(iOS 13.0, *)) - { - [_useKeyboardButton setImage:[UIImage systemImageNamed:@"keyboard" compatibleWithTraitCollection:self.traitCollection] forState:UIControlStateNormal]; - } + [_useKeyboardButton setImage:[UIImage systemImageNamed:@"keyboard" + compatibleWithTraitCollection:self.traitCollection] + forState:UIControlStateNormal]; + _useKeyboardButton.adjustsImageWhenHighlighted = NO; NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:ORKLocalizedString(@"SPEECH_IN_NOISE_PREDEFINED_USE_KEYBOARD_INSTEAD", nil) attributes:@{NSFontAttributeName:[self buttonTextFont], @@ -218,14 +209,12 @@ - (void)setupUseKeyboardButton [_useKeyboardButton addTarget:self action:@selector(useKeyboardButtonPressed) forControlEvents:UIControlEventTouchUpInside]; } -- (void)setKeyboardButtonEnabled:(BOOL)enabled -{ +- (void)setKeyboardButtonEnabled:(BOOL)enabled { _useKeyboardButton.userInteractionEnabled = enabled; _useKeyboardButton.alpha = enabled ? 1.0 : 0.25; } -- (void)useKeyboardButtonPressed -{ +- (void)useKeyboardButtonPressed { if ([self.delegate conformsToProtocol:@protocol(ORKSpeechRecognitionContentViewDelegate)] && [self.delegate respondsToSelector:@selector(didPressUseKeyboardButton)]) { @@ -233,8 +222,7 @@ - (void)useKeyboardButtonPressed } } -- (UIFont *)buttonTextFont -{ +- (UIFont *)buttonTextFont { CGFloat fontSize = [[UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleCallout] pointSize]; return [UIFont systemFontOfSize:fontSize weight:UIFontWeightSemibold]; } diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionError.h b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionError.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionError.h rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionError.h index a236a6ea35..d258e5c461 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognitionError.h +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionError.h @@ -33,5 +33,6 @@ typedef NS_ENUM(NSInteger, ORKSpeechRecognitionErrorCode) { ORKSpeechRecognitionErrorLanguageNotAvailable = 1, ORKSpeechRecognitionErrorResumeNotSupported, + ORKSpeechRecognitionErrorRecognitionNotDetected, ORKSpeechRecognitionErrorRecognitionFailed } ORK_ENUM_AVAILABLE; diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionResult.h b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionResult.h rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionResult.h diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionResult.m b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionResult.m rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionResult.m diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStep.h b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionStep.h rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStep.h index 4903b99b7e..29b8a597db 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStep.h +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStep.h @@ -29,7 +29,8 @@ */ -@import Foundation; +#import + #import diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStep.m b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStep.m similarity index 95% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionStep.m rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStep.m index 99ad797434..ab531e2360 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStep.m +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSpeechRecognitionStep.h" -#import "ORKSpeechRecognitionStepViewController.h" - #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -43,10 +41,6 @@ @implementation ORKSpeechRecognitionStep { NSString *_text; } -+ (Class)stepViewControllerClass { - return [ORKSpeechRecognitionStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier image:(nullable UIImage *)image text:(nullable NSString *)text { self = [super initWithIdentifier:identifier]; _speechRecognitionImage = image; diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStepViewController.h b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionStepViewController.h rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController.h index 3c9e857f9a..fd7d271db3 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStepViewController.h +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStepViewController.m b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController.m similarity index 90% rename from ResearchKit/ActiveTasks/ORKSpeechRecognitionStepViewController.m rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController.m index d46d9708f2..9b2dcd5d43 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognitionStepViewController.m +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController.m @@ -33,6 +33,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import Accelerate; #import "ORKSpeechRecognitionStepViewController.h" +#import "ORKSpeechRecognitionStepViewController_Private.h" #import "ORKQuestionStep.h" #import "ORKAnswerFormat.h" @@ -50,7 +51,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSpeechRecognitionError.h" #import "ORKHelpers_Internal.h" -#import "ORKBorderedButton.h" #import "ORKRecordButton.h" #import "ORKSpeechRecognitionResult.h" #import "ORKResult_Private.h" @@ -61,13 +61,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKOrderedTask.h" - @interface ORKSpeechRecognitionStepViewController () @end @implementation ORKSpeechRecognitionStepViewController { - ORKSpeechRecognitionContentView *_speechRecognitionContentView; ORKAudioStreamer *_audioRecorder; ORKSpeechRecognizer *_speechRecognizer; @@ -89,7 +87,19 @@ - (instancetype)initWithStep:(ORKStep *)step { - (void)viewDidLoad { [super viewDidLoad]; [self setAllowUserToRecordInsteadOnNextStep:NO]; + [self setupContentView]; + + _errorState = NO; + + [self requestSpeechRecognizerAuthorizationIfNeeded]; + + _localResult = [[ORKSpeechRecognitionResult alloc] initWithIdentifier:self.step.identifier]; + _speechRecognitionQueue = dispatch_queue_create("SpeechRecognitionQueue", DISPATCH_QUEUE_SERIAL); +} + +- (void)setupContentView { ORKSpeechRecognitionStep *step = (ORKSpeechRecognitionStep *) self.step; + _speechRecognitionContentView = [ORKSpeechRecognitionContentView new]; _speechRecognitionContentView.shouldHideTranscript = step.shouldHideTranscript; self.activeStepView.customContentFillsAvailableSpace = YES; @@ -97,27 +107,19 @@ - (void)viewDidLoad { _speechRecognitionContentView.speechRecognitionImage = step.speechRecognitionImage; _speechRecognitionContentView.speechRecognitionText = step.speechRecognitionText; _speechRecognitionContentView.delegate = self; - - _errorState = NO; - - [self requestSpeechRecognizerAuthorizationIfNeeded]; - - _localResult = [[ORKSpeechRecognitionResult alloc] initWithIdentifier:self.step.identifier]; - _speechRecognitionQueue = dispatch_queue_create("SpeechRecognitionQueue", DISPATCH_QUEUE_SERIAL); } -- (void)requestSpeechRecognizerAuthorizationIfNeeded -{ +- (void)requestSpeechRecognizerAuthorizationIfNeeded { [self handleSpeechRecognizerAuthorizationStatus:[ORKSpeechRecognizer authorizationStatus]]; } -- (void)handleSpeechRecognizerAuthorizationStatus:(SFSpeechRecognizerAuthorizationStatus)status -{ +- (void)handleSpeechRecognizerAuthorizationStatus:(SFSpeechRecognizerAuthorizationStatus)status { switch (status) - { +{ case SFSpeechRecognizerAuthorizationStatusAuthorized: { [_speechRecognitionContentView.recordButton setButtonState:ORKRecordButtonStateEnabled]; + break; } case SFSpeechRecognizerAuthorizationStatusRestricted: @@ -166,7 +168,6 @@ - (void)didPressRecordButton:(ORKRecordButton *)recordButton switch ([recordButton buttonType]) { case ORKRecordButtonTypeRecord: - [self initializeRecognizer]; [self start]; break; @@ -184,7 +185,6 @@ - (void)didPressUseKeyboardButton [self goForward]; } - - (void)setAllowUserToRecordInsteadOnNextStep:(BOOL)allowUserToRecordInsteadOnNextStep { _allowUserToRecordInsteadOnNextStep = (allowUserToRecordInsteadOnNextStep && [SFSpeechRecognizer authorizationStatus] != SFSpeechRecognizerAuthorizationStatusDenied); @@ -225,10 +225,17 @@ - (void)recordersDidChange { _audioRecorder = audioRecorder; } +- (BOOL)isPracticeTest { + return NO; +} + - (ORKStepResult *)result { ORKStepResult *sResult = [super result]; + if (self.isPracticeTest) { + return sResult; + } if (_speechRecognitionQueue) { dispatch_sync(_speechRecognitionQueue, ^{ @@ -261,7 +268,14 @@ - (void)stopWithError:(NSError *)error { // Speech Recognition Failed, let the user try again. [_speechRecognitionContentView addRecognitionError:ORKLocalizedString(@"SPEECH_RECOGNITION_FAILED_TRY_AGAIN", nil)]; + [self didPressUseKeyboardButton]; return; + } else if (error.code == ORKSpeechRecognitionErrorRecognitionNotDetected) + { + // Speech Recognition not detected, let the user try again. + [_speechRecognitionContentView addRecognitionError:ORKLocalizedString(@"SPEECH_RECOGNITION_NOT_DETECTED_TRY_AGAIN", nil)]; + return; + } // Speech Recogntion Failed (Fatal) @@ -299,15 +313,12 @@ - (void)goForward - (void)setupNextStepForAllowingUserToRecordInstead:(BOOL)allowUserToRecordInsteadOnNextStep { - - - if ([[self nextStep] isKindOfClass:[ORKQuestionStep class]] && [[[self nextStep] answerFormat] isKindOfClass:[ORKTextAnswerFormat class]]) { - - NSString *substitutedTextAnswer = [self substitutedStringWithString:[_localResult.transcription formattedString]]; - - [((ORKTextAnswerFormat *)self.nextStep.answerFormat) setDefaultTextAnswer:substitutedTextAnswer]; - } - + if ([[self nextStep] isKindOfClass:[ORKQuestionStep class]] && [[[self nextStep] answerFormat] isKindOfClass:[ORKTextAnswerFormat class]]) { + + NSString *substitutedTextAnswer = [self substitutedStringWithString:[_localResult.transcription formattedString]]; + + [((ORKTextAnswerFormat *)self.nextStep.answerFormat) setDefaultTextAnswer:substitutedTextAnswer]; + } } - (nullable NSString *)substitutedStringWithString:(nullable NSString *)string @@ -403,7 +414,7 @@ - (void)audioAvailable:(AVAudioPCMBuffer *)buffer { float clampedValue = MAX(_peakPower / 60.0, -1) + 1; dispatch_async(dispatch_get_main_queue(), ^{ - [_speechRecognitionContentView addSample:@(clampedValue)]; + [self->_speechRecognitionContentView addSample:@(clampedValue)]; }); } } @@ -417,9 +428,10 @@ - (void)didFinishRecognitionWithError:(NSError *)error { dispatch_async(dispatch_get_main_queue(), ^{ if (error) { + ORKSpeechRecognitionErrorCode errorCode = error.code == 1110 ? ORKSpeechRecognitionErrorRecognitionNotDetected : ORKSpeechRecognitionErrorRecognitionFailed; ORK_Log_Error("Speech framework failed with error code: %ld, and error description: %@", (long)error.code, error.localizedDescription); NSError *recognitionError = [NSError errorWithDomain:ORKErrorDomain - code:ORKSpeechRecognitionErrorRecognitionFailed + code:errorCode userInfo:@{NSLocalizedDescriptionKey:ORKLocalizedString(@"SPEECH_RECOGNITION_FAILED", nil)}]; [self stopWithError:recognitionError]; } else { @@ -433,6 +445,11 @@ - (void)didFinishRecognition:(SFSpeechRecognitionResult *)recognitionResult { if (_errorState) { return; } + + if ([_localResult.transcription formattedString].length > 0 && ![recognitionResult.bestTranscription formattedString].length) { + return; + } + dispatch_sync(_speechRecognitionQueue, ^{ _localResult.transcription = recognitionResult.bestTranscription; #if defined(__IPHONE_14_5) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_5 @@ -443,7 +460,7 @@ - (void)didFinishRecognition:(SFSpeechRecognitionResult *)recognitionResult { }); dispatch_async(dispatch_get_main_queue(), ^{ - [_speechRecognitionContentView updateRecognitionText:[recognitionResult.bestTranscription formattedString]]; + [self->_speechRecognitionContentView updateRecognitionText:[recognitionResult.bestTranscription formattedString]]; }); } @@ -456,7 +473,7 @@ - (void)didHypothesizeTranscription:(SFTranscription *)transcription { }); dispatch_async(dispatch_get_main_queue(), ^{ - [_speechRecognitionContentView updateRecognitionText:[transcription formattedString]]; + [self->_speechRecognitionContentView updateRecognitionText:[transcription formattedString]]; }); } diff --git a/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController_Private.h b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController_Private.h new file mode 100644 index 0000000000..a1511272e6 --- /dev/null +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognitionStepViewController_Private.h @@ -0,0 +1,55 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +@class ORKQuestionStep; +@class ORKSpeechRecognitionResult; +@class ORKSpeechRecognitionContentView; + + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKSpeechRecognitionStepViewController () + +- (void)setAllowUserToRecordInsteadOnNextStep:(BOOL)allowUserToRecordInsteadOnNextStep; +- (void)setupNextStepForAllowingUserToRecordInstead:(BOOL)allowUserToRecordInsteadOnNextStep; +- (UIFont *)buttonTextFont; +- (nullable NSString *)substitutedStringWithString:(nullable NSString *)string; +- (nullable ORKQuestionStep *)nextStep; +- (void)setupContentView; + +@property (nonatomic, strong) ORKSpeechRecognitionContentView *speechRecognitionContentView; +@property (nonatomic, readonly) BOOL isPracticeTest; +@property (nonatomic) ORKSpeechRecognitionResult *localResult; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognizer.h b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognizer.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKSpeechRecognizer.h rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognizer.h index a77db1f608..ee6f802b22 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognizer.h +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognizer.h @@ -108,4 +108,5 @@ */ - (void)endAudio; + @end diff --git a/ResearchKit/ActiveTasks/ORKSpeechRecognizer.m b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognizer.m similarity index 80% rename from ResearchKit/ActiveTasks/ORKSpeechRecognizer.m rename to ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognizer.m index 24a1f328d1..67836bc0dc 100644 --- a/ResearchKit/ActiveTasks/ORKSpeechRecognizer.m +++ b/ResearchKitActiveTask/SpeechRecognition/ORKSpeechRecognizer.m @@ -111,6 +111,7 @@ - (void)startRecognitionWithLocale:(NSLocale *)locale reportPartialResults:(BOOL return; } + request.shouldReportPartialResults = reportPartialResults; request.taskHint = SFSpeechRecognitionTaskHintDictation; [recognizer recognitionTaskWithRequest:request delegate:self]; @@ -119,23 +120,24 @@ - (void)startRecognitionWithLocale:(NSLocale *)locale reportPartialResults:(BOOL - (void)addAudio:(AVAudioPCMBuffer *)audioBuffer { dispatch_async(_requestQueue, ^{ - [request appendAudioPCMBuffer:audioBuffer]; + [self->request appendAudioPCMBuffer:audioBuffer]; }); } - (void)endAudio { dispatch_async(_requestQueue, ^{ - [request endAudio]; + [self->request endAudio]; }); } + // MARK: SFSpeechRecognizerDelegate - (void)speechRecognizer:(SFSpeechRecognizer *)speechRecognizer availabilityDidChange:(BOOL)available { dispatch_async(_responseQueue, ^{ ORK_Log_Debug("Availability did change = %d", available); - if (_responseDelegate && [_responseDelegate respondsToSelector:@selector(availabilityDidChange:)]) { - [_responseDelegate availabilityDidChange:available]; + if (self->_responseDelegate && [self->_responseDelegate respondsToSelector:@selector(availabilityDidChange:)]) { + [self->_responseDelegate availabilityDidChange:available]; } }); } @@ -145,15 +147,14 @@ - (void)speechRecognizer:(SFSpeechRecognizer *)speechRecognizer availabilityDidC - (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didFinishRecognition:(SFSpeechRecognitionResult *)recognitionResult { dispatch_async(_responseQueue, ^{ ORK_Log_Debug("did produce final result %@", [[recognitionResult bestTranscription] formattedString]); - if (@available(iOS 14.5, *)) { - if (_responseDelegate && [_responseDelegate respondsToSelector:@selector(didFinishRecognition:)]) { - [_responseDelegate didFinishRecognition:recognitionResult]; - } else if (_responseDelegate && [_responseDelegate respondsToSelector:@selector(didHypothesizeTranscription:)]) { - [_responseDelegate didHypothesizeTranscription:recognitionResult.bestTranscription]; + if (self->_responseDelegate && [self->_responseDelegate respondsToSelector:@selector(didFinishRecognition:)]) { + [self->_responseDelegate didFinishRecognition:recognitionResult]; + } else if (self->_responseDelegate && [self->_responseDelegate respondsToSelector:@selector(didHypothesizeTranscription:)]) { + [self->_responseDelegate didHypothesizeTranscription:recognitionResult.bestTranscription]; } - } else if (_responseDelegate && [_responseDelegate respondsToSelector:@selector(didHypothesizeTranscription:)]) { - [_responseDelegate didHypothesizeTranscription:recognitionResult.bestTranscription]; + } else if (self->_responseDelegate && [self->_responseDelegate respondsToSelector:@selector(didHypothesizeTranscription:)]) { + [self->_responseDelegate didHypothesizeTranscription:recognitionResult.bestTranscription]; } }); } @@ -161,17 +162,16 @@ - (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didHypothesizeTran dispatch_async(_responseQueue, ^{ // Produces transcription if shouldReportPartialResults is true ORK_Log_Debug("did produce partial results %@", [transcription formattedString]); - - if (_responseDelegate && [_responseDelegate respondsToSelector:@selector(didHypothesizeTranscription:)]) { - [_responseDelegate didHypothesizeTranscription:transcription]; + if (self->_responseDelegate && [self->_responseDelegate respondsToSelector:@selector(didHypothesizeTranscription:)]) { + [self->_responseDelegate didHypothesizeTranscription:transcription]; } }); } - (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didFinishSuccessfully:(BOOL)successfully { dispatch_async(_responseQueue, ^{ - if (_responseDelegate && [_responseDelegate respondsToSelector:@selector(didFinishRecognitionWithError:)]) { - [_responseDelegate didFinishRecognitionWithError:successfully ? nil : task.error]; + if (self->_responseDelegate && [self->_responseDelegate respondsToSelector:@selector(didFinishRecognitionWithError:)]) { + [self->_responseDelegate didFinishRecognitionWithError:successfully ? nil : task.error]; } }); } @@ -179,9 +179,8 @@ - (void)speechRecognitionTask:(SFSpeechRecognitionTask *)task didFinishSuccessfu - (void)speechRecognitionTaskWasCancelled:(SFSpeechRecognitionTask *)task { dispatch_async(_responseQueue, ^{ ORK_Log_Debug("Request cancelled"); - - if (_responseDelegate && [_responseDelegate respondsToSelector:@selector(didFinishRecognitionWithError:)]) { - [_responseDelegate didFinishRecognitionWithError:nil]; + if (self->_responseDelegate && [self->_responseDelegate respondsToSelector:@selector(didFinishRecognitionWithError:)]) { + [self->_responseDelegate didFinishRecognitionWithError:nil]; } }); } diff --git a/ResearchKit/ActiveTasks/ORKAccuracyStroopResult.h b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopResult.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKAccuracyStroopResult.h rename to ResearchKitActiveTask/Stroop/ORKAccuracyStroopResult.h index 6ba4dd5940..6ca176cfde 100644 --- a/ResearchKit/ActiveTasks/ORKAccuracyStroopResult.h +++ b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopResult.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAccuracyStroopResult.m b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAccuracyStroopResult.m rename to ResearchKitActiveTask/Stroop/ORKAccuracyStroopResult.m diff --git a/ResearchKit/ActiveTasks/ORKAccuracyStroopStep.h b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopStep.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKAccuracyStroopStep.h rename to ResearchKitActiveTask/Stroop/ORKAccuracyStroopStep.h diff --git a/ResearchKit/ActiveTasks/ORKAccuracyStroopStep.m b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKAccuracyStroopStep.m rename to ResearchKitActiveTask/Stroop/ORKAccuracyStroopStep.m index 448f3f5777..4aed7d3f91 100644 --- a/ResearchKit/ActiveTasks/ORKAccuracyStroopStep.m +++ b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopStep.m @@ -29,15 +29,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKAccuracyStroopStep.h" -#import "ORKAccuracyStroopStepViewController.h" #import "ORKHelpers_Internal.h" @implementation ORKAccuracyStroopStep -+ (Class)stepViewControllerClass { - return ORKAccuracyStroopStepViewController.class; -} - + (BOOL)supportsSecureCoding { return YES; } diff --git a/ResearchKit/ActiveTasks/ORKAccuracyStroopStepViewController.h b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKAccuracyStroopStepViewController.h rename to ResearchKitActiveTask/Stroop/ORKAccuracyStroopStepViewController.h index 175ea7e22b..8a0406be69 100644 --- a/ResearchKit/ActiveTasks/ORKAccuracyStroopStepViewController.h +++ b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopStepViewController.h @@ -28,9 +28,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKAccuracyStroopStepViewController.m b/ResearchKitActiveTask/Stroop/ORKAccuracyStroopStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAccuracyStroopStepViewController.m rename to ResearchKitActiveTask/Stroop/ORKAccuracyStroopStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKStroopContentView.h b/ResearchKitActiveTask/Stroop/ORKStroopContentView.h similarity index 89% rename from ResearchKit/ActiveTasks/ORKStroopContentView.h rename to ResearchKitActiveTask/Stroop/ORKStroopContentView.h index ec4324f277..844cbfee38 100644 --- a/ResearchKit/ActiveTasks/ORKStroopContentView.h +++ b/ResearchKitActiveTask/Stroop/ORKStroopContentView.h @@ -31,7 +31,7 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN @@ -45,11 +45,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) ORKBorderedButton * GButton; @property (nonatomic) ORKBorderedButton * BButton; @property (nonatomic) ORKBorderedButton * YButton; -@property (nonatomic) BOOL useTextForStimuli; -@property (nonatomic) BOOL useGridLayoutForButtons; - -- (void)setUseGridLayoutForButtons:(bool)useGridLayoutForButtons; -- (void)setUseTextForStimuli:(bool)useTextForStimuli; @end NS_ASSUME_NONNULL_END diff --git a/ResearchKitActiveTask/Stroop/ORKStroopContentView.m b/ResearchKitActiveTask/Stroop/ORKStroopContentView.m new file mode 100644 index 0000000000..c73426c8f7 --- /dev/null +++ b/ResearchKitActiveTask/Stroop/ORKStroopContentView.m @@ -0,0 +1,149 @@ +/* + Copyright (c) 2017, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import "ORKStroopContentView.h" +#import "ORKUnitLabel.h" +#import "ORKHelpers_Internal.h" +#import "ORKSkin.h" +#import "ORKBorderedButton.h" + + +static const CGFloat minimumButtonHeight = 60; +static const CGFloat buttonStackViewSpacing = 20.0; + +@implementation ORKStroopContentView { + UILabel *_colorLabel; + UIStackView *_buttonStackView; +} + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + self.translatesAutoresizingMaskIntoConstraints = NO; + _colorLabel = [UILabel new]; + _colorLabel.numberOfLines = 1; + _colorLabel.textAlignment = NSTextAlignmentCenter; + _colorLabel.translatesAutoresizingMaskIntoConstraints = NO; + [_colorLabel setFont:[UIFont systemFontOfSize:60]]; + [_colorLabel setAdjustsFontSizeToFitWidth:YES]; + + + _RButton = [[ORKBorderedButton alloc] init]; + _RButton.translatesAutoresizingMaskIntoConstraints = NO; + [_RButton setTitle:ORKLocalizedString(@"STROOP_COLOR_RED_INITIAL", nil) forState:UIControlStateNormal]; + + _GButton = [[ORKBorderedButton alloc] init]; + _GButton.translatesAutoresizingMaskIntoConstraints = NO; + [_GButton setTitle:ORKLocalizedString(@"STROOP_COLOR_GREEN_INITIAL", nil) forState:UIControlStateNormal]; + + _BButton = [[ORKBorderedButton alloc] init]; + _BButton.translatesAutoresizingMaskIntoConstraints = NO; + [_BButton setTitle:ORKLocalizedString(@"STROOP_COLOR_BLUE_INITIAL", nil) forState:UIControlStateNormal]; + + _YButton = [[ORKBorderedButton alloc] init]; + _YButton.translatesAutoresizingMaskIntoConstraints = NO; + [_YButton setTitle:ORKLocalizedString(@"STROOP_COLOR_YELLOW_INITIAL", nil) forState:UIControlStateNormal]; + + if (!_buttonStackView) { + _buttonStackView = [[UIStackView alloc] initWithArrangedSubviews:@[_RButton, _GButton, _BButton, _YButton]]; + } + _buttonStackView.translatesAutoresizingMaskIntoConstraints = NO; + _buttonStackView.spacing = buttonStackViewSpacing; + _buttonStackView.axis = UILayoutConstraintAxisHorizontal; + + [self addSubview:_colorLabel]; + [self addSubview:_buttonStackView]; + + [self setUpConstraints]; + } + return self; +} + +- (void)setColorLabelText:(NSString *)colorLabelText { + [_colorLabel setText:colorLabelText]; + [self setNeedsDisplay]; +} + +- (void)setColorLabelColor:(UIColor *)colorLabelColor { + [_colorLabel setTextColor:colorLabelColor]; + [self setNeedsDisplay]; +} + +- (NSString *)colorLabelText { + return _colorLabel.text; +} + +- (UIColor *)colorLabelColor { + return _colorLabel.textColor; +} + +- (void)setUpConstraints { + + NSMutableArray *constraints = [[NSMutableArray alloc] init]; + NSDictionary *views = NSDictionaryOfVariableBindings(_colorLabel, _buttonStackView); + + [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-(==30)-[_colorLabel]-(>=10)-[_buttonStackView]-(==30)-|" + options:NSLayoutFormatAlignAllCenterX + metrics:nil + views:views]]; + + [constraints addObjectsFromArray:@[ + [NSLayoutConstraint constraintWithItem:_buttonStackView + attribute:NSLayoutAttributeHeight + relatedBy:NSLayoutRelationEqual + toItem:nil + attribute:NSLayoutAttributeNotAnAttribute + multiplier:1.0 + constant:minimumButtonHeight], + [NSLayoutConstraint constraintWithItem:_buttonStackView + attribute:NSLayoutAttributeCenterX + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeCenterX + multiplier:1.0 + constant:0.0] + ]]; + for (ORKBorderedButton *button in @[_RButton, _GButton, _BButton, _YButton]) { + [constraints addObject:[NSLayoutConstraint constraintWithItem:button + attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem:button + attribute:NSLayoutAttributeHeight + multiplier:1.0 + constant:0.0]]; + } + + [self addConstraints:constraints]; + [NSLayoutConstraint activateConstraints:constraints]; +} + +@end + diff --git a/ResearchKit/ActiveTasks/ORKStroopResult.h b/ResearchKitActiveTask/Stroop/ORKStroopResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKStroopResult.h rename to ResearchKitActiveTask/Stroop/ORKStroopResult.h diff --git a/ResearchKit/ActiveTasks/ORKStroopResult.m b/ResearchKitActiveTask/Stroop/ORKStroopResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKStroopResult.m rename to ResearchKitActiveTask/Stroop/ORKStroopResult.m diff --git a/ResearchKitActiveTask/Stroop/ORKStroopStep.h b/ResearchKitActiveTask/Stroop/ORKStroopStep.h new file mode 100644 index 0000000000..e99dd865c4 --- /dev/null +++ b/ResearchKitActiveTask/Stroop/ORKStroopStep.h @@ -0,0 +1,44 @@ +/* + Copyright (c) 2017, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +ORK_CLASS_AVAILABLE +@interface ORKStroopStep : ORKActiveStep + +@property (nonatomic, assign) NSInteger numberOfAttempts; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitActiveTask/Stroop/ORKStroopStep.m b/ResearchKitActiveTask/Stroop/ORKStroopStep.m new file mode 100644 index 0000000000..0ee07d97ad --- /dev/null +++ b/ResearchKitActiveTask/Stroop/ORKStroopStep.m @@ -0,0 +1,95 @@ +/* + Copyright (c) 2017, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import "ORKStroopStep.h" +#import "ORKHelpers_Internal.h" + + +@implementation ORKStroopStep + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithIdentifier:(NSString *)identifier { + self = [super initWithIdentifier:identifier]; + if (self) { + self.shouldVibrateOnStart = YES; + self.shouldShowDefaultTimer = NO; + self.shouldContinueOnFinish = YES; + self.stepDuration = NSIntegerMax; + } + return self; +} + +- (void)validateParameters { + [super validateParameters]; + NSInteger minimumAttempts = 10; + if (self.numberOfAttempts < minimumAttempts) { + @throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"number of attempts should be greater or equal to %ld.", (long)minimumAttempts] userInfo:nil]; + } +} + +- (BOOL)startsFinished { + return NO; +} + +- (BOOL)allowsBackNavigation { + return NO; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + ORKStroopStep *step = [super copyWithZone:zone]; + step.numberOfAttempts = self.numberOfAttempts; + return step; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self ) { + ORK_DECODE_INTEGER(aDecoder, numberOfAttempts); + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + [super encodeWithCoder:aCoder]; + ORK_ENCODE_INTEGER(aCoder, numberOfAttempts); +} + +- (BOOL)isEqual:(id)object { + BOOL isParentSame = [super isEqual:object]; + + __typeof(self) castObject = object; + return (isParentSame && (self.numberOfAttempts == castObject.numberOfAttempts)); +} + +@end diff --git a/ResearchKit/ActiveTasks/ORKStroopStepViewController.h b/ResearchKitActiveTask/Stroop/ORKStroopStepViewController.h similarity index 94% rename from ResearchKit/ActiveTasks/ORKStroopStepViewController.h rename to ResearchKitActiveTask/Stroop/ORKStroopStepViewController.h index 4b996b2721..0c7706ef90 100644 --- a/ResearchKit/ActiveTasks/ORKStroopStepViewController.h +++ b/ResearchKitActiveTask/Stroop/ORKStroopStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKStroopStepViewController.m b/ResearchKitActiveTask/Stroop/ORKStroopStepViewController.m similarity index 88% rename from ResearchKit/ActiveTasks/ORKStroopStepViewController.m rename to ResearchKitActiveTask/Stroop/ORKStroopStepViewController.m index 3194831f2d..34e5313d1b 100644 --- a/ResearchKit/ActiveTasks/ORKStroopStepViewController.m +++ b/ResearchKitActiveTask/Stroop/ORKStroopStepViewController.m @@ -39,11 +39,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKCollectionResult_Private.h" #import "ORKStroopStep.h" #import "ORKHelpers_Internal.h" -#import "ORKBorderedButton.h" -#import "ORKNavigationContainerView.h" -#import "ORKTaskViewController_Private.h" #import "ORKNavigationContainerView_Internal.h" + @interface ORKStroopStepViewController () @property (nonatomic, strong) ORKStroopContentView *stroopContentView; @@ -94,7 +92,7 @@ - (void)viewDidLoad { _red = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0]; _green = [UIColor colorWithRed:0.0 green:1.0 blue:0.0 alpha:1.0]; _blue = [UIColor colorWithRed:0.0 green:0.0 blue:1.0 alpha:1.0]; - _yellow = [UIColor colorWithRed:245.0/225.0 green:221.0/225.0 blue:66.0/255.0 alpha:1.0]; + _yellow = [UIColor colorWithRed:1.0 green:1.0 blue:0.0 alpha:1.0]; self.colors = @{ _redString: _red, @@ -207,36 +205,27 @@ - (void)startNextQuestionOrFinish { } - (void)startQuestion { - if ([self stroopStep].randomizeVisualAndColorAlignment) { - int pattern = arc4random() % 2; - if (pattern == 0) { - int index = arc4random() % [self.colors.allKeys count]; - NSString *text = [self.colors.allKeys objectAtIndex:index]; - self.stroopContentView.colorLabelText = text; - UIColor *color = [self.colors valueForKey:text]; - self.stroopContentView.colorLabelColor = color; - } - else { - int index = arc4random() % [self.differentColorLabels.allKeys count]; - NSString *text = [self.differentColorLabels.allKeys objectAtIndex:index]; - self.stroopContentView.colorLabelText = text; - NSArray *colorArray = [self.differentColorLabels valueForKey:text]; - int randomColor = arc4random() % colorArray.count; - UIColor *color = [colorArray objectAtIndex:randomColor]; - self.stroopContentView.colorLabelColor = color; - } - } else { + int pattern = arc4random() % 2; + if (pattern == 0) { int index = arc4random() % [self.colors.allKeys count]; NSString *text = [self.colors.allKeys objectAtIndex:index]; self.stroopContentView.colorLabelText = text; UIColor *color = [self.colors valueForKey:text]; self.stroopContentView.colorLabelColor = color; } + else { + int index = arc4random() % [self.differentColorLabels.allKeys count]; + NSString *text = [self.differentColorLabels.allKeys objectAtIndex:index]; + self.stroopContentView.colorLabelText = text; + NSArray *colorArray = [self.differentColorLabels valueForKey:text]; + int randomColor = arc4random() % colorArray.count; + UIColor *color = [colorArray objectAtIndex:randomColor]; + self.stroopContentView.colorLabelColor = color; + } [self setButtonsEnabled]; _startTime = [NSProcessInfo processInfo].systemUptime; } - - (void)setButtonsDisabled { [self.stroopContentView.RButton setEnabled: NO]; [self.stroopContentView.GButton setEnabled: NO]; diff --git a/ResearchKit/ActiveTasks/UIColor+String.h b/ResearchKitActiveTask/Stroop/UIColor+String.h similarity index 100% rename from ResearchKit/ActiveTasks/UIColor+String.h rename to ResearchKitActiveTask/Stroop/UIColor+String.h diff --git a/ResearchKit/ActiveTasks/UIColor+String.m b/ResearchKitActiveTask/Stroop/UIColor+String.m similarity index 100% rename from ResearchKit/ActiveTasks/UIColor+String.m rename to ResearchKitActiveTask/Stroop/UIColor+String.m diff --git a/ResearchKit/ActiveTasks/ORKTappingContentView.h b/ResearchKitActiveTask/Tapping/ORKTappingContentView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTappingContentView.h rename to ResearchKitActiveTask/Tapping/ORKTappingContentView.h index 1fbc813324..5443fb16af 100644 --- a/ResearchKit/ActiveTasks/ORKTappingContentView.h +++ b/ResearchKitActiveTask/Tapping/ORKTappingContentView.h @@ -30,7 +30,8 @@ @import UIKit; -#import + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTappingContentView.m b/ResearchKitActiveTask/Tapping/ORKTappingContentView.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTappingContentView.m rename to ResearchKitActiveTask/Tapping/ORKTappingContentView.m index db7ac18d39..9a364e9fef 100644 --- a/ResearchKit/ActiveTasks/ORKTappingContentView.m +++ b/ResearchKitActiveTask/Tapping/ORKTappingContentView.m @@ -144,7 +144,7 @@ - (void)setProgress:(CGFloat)progress animated:(BOOL)animated { CGFloat previousAlpha = _progressView.alpha; [UIView animateWithDuration:animated ? 0.2 : 0 animations:^{ - [_progressView setAlpha:(progress == 0) ? 0 : 1]; + [self->_progressView setAlpha:(progress == 0) ? 0 : 1]; }]; if (UIAccessibilityIsVoiceOverRunning() && previousAlpha != _progressView.alpha) { diff --git a/ResearchKit/ActiveTasks/ORKTappingIntervalResult.h b/ResearchKitActiveTask/Tapping/ORKTappingIntervalResult.h similarity index 99% rename from ResearchKit/ActiveTasks/ORKTappingIntervalResult.h rename to ResearchKitActiveTask/Tapping/ORKTappingIntervalResult.h index 21f6d7ba88..139fe5c824 100644 --- a/ResearchKit/ActiveTasks/ORKTappingIntervalResult.h +++ b/ResearchKitActiveTask/Tapping/ORKTappingIntervalResult.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import #import diff --git a/ResearchKit/ActiveTasks/ORKTappingIntervalResult.m b/ResearchKitActiveTask/Tapping/ORKTappingIntervalResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTappingIntervalResult.m rename to ResearchKitActiveTask/Tapping/ORKTappingIntervalResult.m diff --git a/ResearchKit/ActiveTasks/ORKTappingIntervalStep.h b/ResearchKitActiveTask/Tapping/ORKTappingIntervalStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTappingIntervalStep.h rename to ResearchKitActiveTask/Tapping/ORKTappingIntervalStep.h index c0b5a294e1..4ad39ab1c7 100644 --- a/ResearchKit/ActiveTasks/ORKTappingIntervalStep.h +++ b/ResearchKitActiveTask/Tapping/ORKTappingIntervalStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTappingIntervalStep.m b/ResearchKitActiveTask/Tapping/ORKTappingIntervalStep.m similarity index 94% rename from ResearchKit/ActiveTasks/ORKTappingIntervalStep.m rename to ResearchKitActiveTask/Tapping/ORKTappingIntervalStep.m index 926ead3f44..49ea145c9f 100644 --- a/ResearchKit/ActiveTasks/ORKTappingIntervalStep.m +++ b/ResearchKitActiveTask/Tapping/ORKTappingIntervalStep.m @@ -31,15 +31,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTappingIntervalStep.h" -#import "ORKTappingIntervalStepViewController.h" - - @implementation ORKTappingIntervalStep -+ (Class)stepViewControllerClass { - return [ORKTappingIntervalStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKTappingIntervalStepViewController.h b/ResearchKitActiveTask/Tapping/ORKTappingIntervalStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKTappingIntervalStepViewController.h rename to ResearchKitActiveTask/Tapping/ORKTappingIntervalStepViewController.h index 06133d9e4b..f01e99bc69 100644 --- a/ResearchKit/ActiveTasks/ORKTappingIntervalStepViewController.h +++ b/ResearchKitActiveTask/Tapping/ORKTappingIntervalStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTappingIntervalStepViewController.m b/ResearchKitActiveTask/Tapping/ORKTappingIntervalStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTappingIntervalStepViewController.m rename to ResearchKitActiveTask/Tapping/ORKTappingIntervalStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKAudioGenerator.h b/ResearchKitActiveTask/Tone Audiometry/ORKAudioGenerator.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioGenerator.h rename to ResearchKitActiveTask/Tone Audiometry/ORKAudioGenerator.h diff --git a/ResearchKit/ActiveTasks/ORKAudioGenerator.m b/ResearchKitActiveTask/Tone Audiometry/ORKAudioGenerator.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKAudioGenerator.m rename to ResearchKitActiveTask/Tone Audiometry/ORKAudioGenerator.m diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryContentView.h b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKToneAudiometryContentView.h rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryContentView.h index 60c09cd379..ee2be6cbda 100644 --- a/ResearchKit/ActiveTasks/ORKToneAudiometryContentView.h +++ b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryContentView.h @@ -30,7 +30,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryContentView.m b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKToneAudiometryContentView.m rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryContentView.m diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryResult.h b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKToneAudiometryResult.h rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryResult.h diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryResult.m b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKToneAudiometryResult.m rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryResult.m diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryStep.h b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKToneAudiometryStep.h rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStep.h index 1ebd771534..504635d0ee 100644 --- a/ResearchKit/ActiveTasks/ORKToneAudiometryStep.h +++ b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryStep.m b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStep.m similarity index 95% rename from ResearchKit/ActiveTasks/ORKToneAudiometryStep.m rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStep.m index ba233437f4..341f3a4d0c 100644 --- a/ResearchKit/ActiveTasks/ORKToneAudiometryStep.m +++ b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStep.m @@ -31,17 +31,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKToneAudiometryStep.h" -#import "ORKToneAudiometryStepViewController.h" - #import "ORKHelpers_Internal.h" @implementation ORKToneAudiometryStep -+ (Class)stepViewControllerClass { - return [ORKToneAudiometryStepViewController class]; -} - - (void)validateParameters { [super validateParameters]; diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryStepViewController.h b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKToneAudiometryStepViewController.h rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStepViewController.h index 058373a563..cd84528b56 100644 --- a/ResearchKit/ActiveTasks/ORKToneAudiometryStepViewController.h +++ b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKToneAudiometryStepViewController.m b/ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKToneAudiometryStepViewController.m rename to ResearchKitActiveTask/Tone Audiometry/ORKToneAudiometryStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityArrowView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityArrowView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityArrowView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityArrowView.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityArrowView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityArrowView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityArrowView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityArrowView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityContentView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityContentView.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKTouchAbilityContentView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityContentView.h index df9281a98a..5f75b4a3b0 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityContentView.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityContentView.h @@ -29,9 +29,10 @@ */ -@import UIKit; -#import "ORKCustomStepView_Internal.h" -#import "ORKTouchAbilityTouchTracker.h" +#import + +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityContentView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityContentView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityGestureRecoginzerEvent.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityGestureRecoginzerEvent.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityGestureRecoginzerEvent.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityGestureRecoginzerEvent.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityGestureRecoginzerEvent.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityGestureRecoginzerEvent.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityGestureRecoginzerEvent.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityGestureRecoginzerEvent.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressContentView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressContentView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressContentView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressContentView.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressContentView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressContentView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressResult.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressResult.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressResult.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressResult.h index 16fb776995..6ccbaa0219 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressResult.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressResult.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressResult.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressResult.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressResult.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStep.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStep.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStep.h index 32320535b8..8311aad567 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStep.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStep.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStep.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStep.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStep.m index df66df1054..03ccc9dbea 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStep.m +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStep.m @@ -51,7 +51,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { - (void)validateParameters { [super validateParameters]; - // TODO: } - (BOOL)startsFinished { diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStepViewController.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStepViewController.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStepViewController.h index 1dfc976f2b..0b61637c66 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStepViewController.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStepViewController.h @@ -31,8 +31,7 @@ @import UIKit; #import -#import - +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStepViewController.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressStepViewController.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressTrial.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressTrial.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressTrial.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressTrial.h index 44f1cd80b6..71d8d4ed03 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressTrial.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressTrial.h @@ -30,7 +30,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityLongPressTrial.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressTrial.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityLongPressTrial.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityLongPressTrial.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchContentView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchContentView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchContentView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchContentView.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchContentView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchContentView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchGuideView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchGuideView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchGuideView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchGuideView.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchGuideView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchGuideView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchGuideView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchGuideView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchResult.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchResult.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchResult.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchResult.h index f305bed147..d232b7af34 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchResult.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchResult.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchResult.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchResult.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchResult.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchStep.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchStep.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStep.h index 59be05529c..d02b8311c4 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchStep.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchStep.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStep.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchStep.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStep.m index 96bfb8d3d6..c9d23b838f 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchStep.m +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStep.m @@ -49,7 +49,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { - (void)validateParameters { [super validateParameters]; - // TODO: } - (BOOL)startsFinished { diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchStepViewController.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchStepViewController.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStepViewController.h index db8d3c77c0..1135baf338 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchStepViewController.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStepViewController.h @@ -31,7 +31,7 @@ @import UIKit; #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchStepViewController.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchStepViewController.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchTrial.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchTrial.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchTrial.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchTrial.h index d7a0161436..43e47ed113 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchTrial.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchTrial.h @@ -30,7 +30,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityPinchTrial.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchTrial.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityPinchTrial.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityPinchTrial.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationContentView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationContentView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationContentView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationContentView.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationContentView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationContentView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationResult.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationResult.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationResult.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationResult.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationResult.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationResult.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationStep.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationStep.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStep.h index 38b3561f1c..15bc1d2498 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationStep.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationStep.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStep.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationStep.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStep.m index 16b408584b..5c5a017a36 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationStep.m +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStep.m @@ -49,7 +49,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { - (void)validateParameters { [super validateParameters]; - // TODO: } - (BOOL)startsFinished { diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationStepViewController.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationStepViewController.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStepViewController.h index 8702a5f5dc..fe6c0bb7ed 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationStepViewController.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStepViewController.h @@ -31,7 +31,7 @@ @import UIKit; #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationStepViewController.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationStepViewController.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationTrial.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationTrial.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationTrial.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationTrial.h index 646f3d857c..e4c2c13cff 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationTrial.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationTrial.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityRotationTrial.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationTrial.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityRotationTrial.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityRotationTrial.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollContentView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollContentView.h similarity index 94% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollContentView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollContentView.h index 8274700791..4b220c0b85 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollContentView.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollContentView.h @@ -29,13 +29,15 @@ */ -@import UIKit; -#import "ORKTouchAbilityContentView.h" -#import "ORKTouchAbilityScrollTrial.h" +#import + +#import +#import NS_ASSUME_NONNULL_BEGIN @class ORKTouchAbilityScrollContentView; + @protocol ORKTouchAbilityScrollContentViewDataSource @required diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollContentView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollContentView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollResult.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollResult.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollResult.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollResult.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollResult.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollResult.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollStep.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollStep.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStep.h index 51953f1cc0..25c7ee366f 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollStep.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollStep.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStep.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollStep.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStep.m index 01c148d4c1..0859815ffd 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollStep.m +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStep.m @@ -50,7 +50,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { - (void)validateParameters { [super validateParameters]; - // TODO: } - (BOOL)startsFinished { diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollStepViewController.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollStepViewController.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStepViewController.h index 3f69bc2e0e..1ca780dc7e 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollStepViewController.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStepViewController.h @@ -31,7 +31,7 @@ @import UIKit; #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollStepViewController.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollStepViewController.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollTrial.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollTrial.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollTrial.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollTrial.h index 7bcf03d216..309612a341 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollTrial.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollTrial.h @@ -30,7 +30,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityScrollTrial.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollTrial.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityScrollTrial.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityScrollTrial.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeContentView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeContentView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeContentView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeContentView.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeContentView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeContentView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeResult.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeResult.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeResult.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeResult.h index e359bee6a0..0b680b21fc 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeResult.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeResult.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeResult.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeResult.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeResult.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStep.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStep.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStep.h index e43fe000b5..651525439f 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStep.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStep.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStep.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStep.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStep.m index 3113ab0e8c..2f0065fcd0 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStep.m +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStep.m @@ -51,7 +51,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { - (void)validateParameters { [super validateParameters]; - // TODO: } - (BOOL)startsFinished { diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStepViewController.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStepViewController.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStepViewController.h index e0e54f541e..7eedb1fab9 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStepViewController.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStepViewController.h @@ -31,7 +31,7 @@ @import UIKit; #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStepViewController.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeStepViewController.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeTrial.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeTrial.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeTrial.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeTrial.h index 03139cd9d2..9077c39a5a 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeTrial.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeTrial.h @@ -30,7 +30,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilitySwipeTrial.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeTrial.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilitySwipeTrial.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilitySwipeTrial.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapContentView.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapContentView.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapContentView.h index 551dd00e66..92ef281e3b 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityTapContentView.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapContentView.h @@ -30,7 +30,9 @@ @import UIKit; + #import "ORKTouchAbilityContentView.h" +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapContentView.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapContentView.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapResult.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapResult.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapResult.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapResult.h index 79ad7fb5b6..a74e7b8347 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityTapResult.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapResult.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import Foundation; +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapResult.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapResult.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapResult.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapStep.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapStep.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStep.h index eb2464915e..0def89dc07 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityTapStep.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapStep.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStep.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapStep.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStep.m index 0adadeed55..eb79421c38 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityTapStep.m +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStep.m @@ -51,7 +51,6 @@ - (instancetype)initWithIdentifier:(NSString *)identifier { - (void)validateParameters { [super validateParameters]; - // TODO: } - (BOOL)startsFinished { diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapStepViewController.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapStepViewController.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStepViewController.h index f5a994c29b..148c602a3a 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityTapStepViewController.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStepViewController.h @@ -31,7 +31,7 @@ @import UIKit; #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapStepViewController.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapStepViewController.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapTrial.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapTrial.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapTrial.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapTrial.h index 376915cba6..781a713ae9 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityTapTrial.h +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapTrial.h @@ -30,7 +30,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTapTrial.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapTrial.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTapTrial.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTapTrial.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTouch.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouch.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTouch.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouch.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTouch.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouch.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTouch.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouch.m index b8279f7761..39a35ed1a0 100644 --- a/ResearchKit/ActiveTasks/ORKTouchAbilityTouch.m +++ b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouch.m @@ -86,7 +86,7 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { ORK_ENCODE_DOUBLE(aCoder, altitudeAngle); - if (self.estimationUpdateIndex) { + if (self.estimationUpdateIndex != nil) { ORK_ENCODE_OBJ(aCoder, estimationUpdateIndex); } diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTouchTracker.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouchTracker.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTouchTracker.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouchTracker.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTouchTracker.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouchTracker.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTouchTracker.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTouchTracker.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTrack.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrack.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTrack.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrack.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTrack.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrack.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTrack.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrack.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTrack_Internal.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrack_Internal.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTrack_Internal.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrack_Internal.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTrial.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrial.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTrial.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrial.h diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTrial.m b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrial.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTrial.m rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrial.m diff --git a/ResearchKit/ActiveTasks/ORKTouchAbilityTrial_Internal.h b/ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrial_Internal.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTouchAbilityTrial_Internal.h rename to ResearchKitActiveTask/Touch Ability/ORKTouchAbilityTrial_Internal.h diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiResult.h b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiResult.h rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiResult.h diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiResult.m b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiResult.m rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiResult.m diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStep.h b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiStep.h rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStep.h index 21ddf6ff34..a3a4699e77 100644 --- a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStep.h +++ b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStep.m b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStep.m similarity index 95% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiStep.m rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStep.m index f072c6539e..c731815729 100644 --- a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStep.m +++ b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTowerOfHanoiStep.h" -#import "ORKTowerOfHanoiStepViewController.h" - #import "ORKHelpers_Internal.h" @@ -40,10 +38,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKTowerOfHanoiStep -+ (Class)stepViewControllerClass { - return [ORKTowerOfHanoiViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStepViewController.h b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStepViewController.h similarity index 93% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiStepViewController.h rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStepViewController.h index 9ef9e72d89..70214608e5 100644 --- a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStepViewController.h +++ b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; -#import "ORKDefines.h" -#import "ORKActiveStepViewController.h" +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStepViewController.m b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiStepViewController.m rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStepViewController.m index efe18487ce..8d4f2bb476 100644 --- a/ResearchKit/ActiveTasks/ORKTowerOfHanoiStepViewController.m +++ b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiStepViewController.m @@ -32,7 +32,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTowerOfHanoiStepViewController.h" #import "ORKActiveStepView.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKTowerOfHanoiTowerView.h" #import "ORKActiveStepViewController_Internal.h" diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiTower.h b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTower.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiTower.h rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTower.h diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiTower.m b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTower.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiTower.m rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTower.m diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiTowerView.h b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTowerView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiTowerView.h rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTowerView.h diff --git a/ResearchKit/ActiveTasks/ORKTowerOfHanoiTowerView.m b/ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTowerView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTowerOfHanoiTowerView.m rename to ResearchKitActiveTask/TowerOfHanoi/ORKTowerOfHanoiTowerView.m diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingContentView.h b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingContentView.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTrailmakingContentView.h rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingContentView.h index f49229b372..79d76ac3ba 100644 --- a/ResearchKit/ActiveTasks/ORKTrailmakingContentView.h +++ b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingContentView.h @@ -30,7 +30,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingContentView.m b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTrailmakingContentView.m rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingResult.h b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKTrailmakingResult.h rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingResult.h diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingResult.m b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTrailmakingResult.m rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingResult.m diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingStep.h b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTrailmakingStep.h rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingStep.h index b58570156b..6f89ed26a5 100644 --- a/ResearchKit/ActiveTasks/ORKTrailmakingStep.h +++ b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingStep.m b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKTrailmakingStep.m rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingStep.m index 09864da4bd..3fb974cc13 100644 --- a/ResearchKit/ActiveTasks/ORKTrailmakingStep.m +++ b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTrailmakingStep.h" -#import "ORKTrailmakingStepViewController.h" - #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -40,10 +38,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKTrailmakingStep -+ (Class)stepViewControllerClass { - return [ORKTrailmakingStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingStepViewController.h b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKTrailmakingStepViewController.h rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingStepViewController.h index 10fe38410f..3e772dffb9 100644 --- a/ResearchKit/ActiveTasks/ORKTrailmakingStepViewController.h +++ b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTrailmakingStepViewController.m b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStepViewController.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKTrailmakingStepViewController.m rename to ResearchKitActiveTask/Trailmaking/ORKTrailmakingStepViewController.m index 828104c82b..aa7482a5ee 100644 --- a/ResearchKit/ActiveTasks/ORKTrailmakingStepViewController.m +++ b/ResearchKitActiveTask/Trailmaking/ORKTrailmakingStepViewController.m @@ -34,7 +34,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKActiveStepTimer.h" #import "ORKActiveStepView.h" #import "ORKTrailmakingContentView.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKRoundTappingButton.h" #import "ORKActiveStepViewController_Internal.h" diff --git a/ResearchKit/ActiveTasks/ORKWalkingTaskStep.h b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKWalkingTaskStep.h rename to ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStep.h index 5a351a7d0f..cffe77143a 100644 --- a/ResearchKit/ActiveTasks/ORKWalkingTaskStep.h +++ b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKWalkingTaskStep.m b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStep.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKWalkingTaskStep.m rename to ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStep.m index e48c216371..a6330ce9e9 100644 --- a/ResearchKit/ActiveTasks/ORKWalkingTaskStep.m +++ b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStep.m @@ -31,8 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKWalkingTaskStep.h" -#import "ORKWalkingTaskStepViewController.h" - #import "ORKStep_Private.h" #import "ORKHelpers_Internal.h" @@ -40,10 +38,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKWalkingTaskStep -+ (Class)stepViewControllerClass { - return [ORKWalkingTaskStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKWalkingTaskStepViewController.h b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKWalkingTaskStepViewController.h rename to ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStepViewController.h index 59bb21fdae..0246f75c6c 100644 --- a/ResearchKit/ActiveTasks/ORKWalkingTaskStepViewController.h +++ b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKWalkingTaskStepViewController.m b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStepViewController.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKWalkingTaskStepViewController.m rename to ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStepViewController.m index b06df64a16..3c58d3a3b6 100644 --- a/ResearchKit/ActiveTasks/ORKWalkingTaskStepViewController.m +++ b/ResearchKitActiveTask/Walking/Short Walk/ORKWalkingTaskStepViewController.m @@ -32,12 +32,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKWalkingTaskStepViewController.h" #import "ORKActiveStepView.h" -#import "ORKCustomStepView_Internal.h" +#import "ORKActiveStepCustomView.h" #import "ORKProgressView.h" #import "ORKVerticalContainerView_Internal.h" #import "ORKActiveStepViewController_Internal.h" -#import "ORKStepViewController_Internal.h" +#import #import "ORKPedometerRecorder.h" #import "ORKStep_Private.h" diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkContentView.h b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkContentView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKTimedWalkContentView.h rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkContentView.h index 49f87676a4..bc6a922cc4 100644 --- a/ResearchKit/ActiveTasks/ORKTimedWalkContentView.h +++ b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkContentView.h @@ -30,7 +30,8 @@ @import UIKit; -#import "ORKCustomStepView_Internal.h" + +#import "ORKActiveStepCustomView.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkContentView.m b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkContentView.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTimedWalkContentView.m rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkContentView.m diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkResult.h b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkResult.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTimedWalkResult.h rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkResult.h index 977617ca1b..83fcaf628c 100644 --- a/ResearchKit/ActiveTasks/ORKTimedWalkResult.h +++ b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkResult.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkResult.m b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTimedWalkResult.m rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkResult.m diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkStep.h b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKTimedWalkStep.h rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStep.h index 3d79e9e776..4a1615c5cc 100644 --- a/ResearchKit/ActiveTasks/ORKTimedWalkStep.h +++ b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkStep.m b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStep.m similarity index 95% rename from ResearchKit/ActiveTasks/ORKTimedWalkStep.m rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStep.m index e367d16ab9..c4cc07a282 100644 --- a/ResearchKit/ActiveTasks/ORKTimedWalkStep.m +++ b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStep.m @@ -31,15 +31,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTimedWalkStep.h" -#import "ORKTimedWalkStepViewController.h" - - @implementation ORKTimedWalkStep -+ (Class)stepViewControllerClass { - return [ORKTimedWalkStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkStepViewController.h b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKTimedWalkStepViewController.h rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStepViewController.h index 9c2e27d250..4692cbb3e2 100644 --- a/ResearchKit/ActiveTasks/ORKTimedWalkStepViewController.h +++ b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKTimedWalkStepViewController.m b/ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKTimedWalkStepViewController.m rename to ResearchKitActiveTask/Walking/Timed Walk/ORKTimedWalkStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometry.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometry.h index fa8725d014..eede1d774d 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.h +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometry.h @@ -28,8 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometry.m similarity index 93% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometry.m index bd221e1138..1f8601a32c 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometry.m +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometry.m @@ -32,6 +32,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKdBHLToneAudiometryStep.h" #import "ORKdBHLToneAudiometryResult.h" #import "ORKAudiometryStimulus.h" +#import "ORKHelpers_Internal.h" @interface ORKAudiometryTransition: NSObject @@ -136,7 +137,7 @@ - (void)registerStimulusPlayback { _preStimulusResponse = NO; } -- (void)registerResponse:(BOOL)response { +- (void)registerResponse:(BOOL)response forUnit:(ORKdBHLToneAudiometryUnit *_Nullable)unit { if (response) { [self stimulusAcknowledged]; } else { @@ -201,8 +202,8 @@ - (void)estimatedBHLForFrequency:(NSNumber *)freq { _prevFreq = [freq doubleValue]; _resultSample = [ORKdBHLToneAudiometryFrequencySample new]; _resultSample.channel = _audioChannel; - _resultSample.frequency = [freq doubleValue]; - _resultSample.calculatedThreshold = ORKInvalidDBHLValue; + _resultSample.frequency = ORKForceDoubleToLimits([freq doubleValue]); + _resultSample.calculatedThreshold = ORKForceDoubleToLimits(ORKInvalidDBHLValue); [_arrayOfResultSamples addObject:_resultSample]; } else { _numberOfTransitionsPerFreq += 1; @@ -220,7 +221,7 @@ - (void)estimatedBHLForFrequency:(NSNumber *)freq { } _resultUnit = [ORKdBHLToneAudiometryUnit new]; - _resultUnit.dBHLValue = _currentdBHL; + _resultUnit.dBHLValue = ORKForceDoubleToLimits(_currentdBHL); _resultUnit.startOfUnitTimeStamp = _getTimestamp(); [_arrayOfResultUnits addObject:_resultUnit]; @@ -240,6 +241,9 @@ - (void)estimatedBHLForFrequency:(NSNumber *)freq { } - (void)stimulusMissed { + if (_indexOfFreqLoopList >= _freqLoopList.count) { + return; + } ORKAudiometryTransition *currentTransition = [_transitionsDictionary objectForKey:[NSNumber numberWithFloat:_currentdBHL]]; NSUInteger storedTestIndex = _currentTestIndex; if (_currentTestIndex == storedTestIndex) { @@ -261,6 +265,7 @@ - (void)stimulusMissed { } _resultUnit.timeoutTimeStamp = _getTimestamp(); _currentTestIndex += 1; + [self estimatedBHLForFrequency:_freqLoopList[_indexOfFreqLoopList]]; } } @@ -274,7 +279,7 @@ - (void)stimulusAcknowledged { ORKAudiometryTransition *currentTransitionObject = [_transitionsDictionary objectForKey:currentKey]; currentTransitionObject.userInitiated -= 1; } else if ([self validateResultFordBHL:_currentdBHL]) { - _resultSample.calculatedThreshold = _currentdBHL; + _resultSample.calculatedThreshold = ORKForceDoubleToLimits(_currentdBHL); _indexOfFreqLoopList += 1; if (_indexOfFreqLoopList >= _freqLoopList.count) { _resultSample.units = [_arrayOfResultUnits copy]; @@ -312,18 +317,18 @@ - (BOOL)validateResultFordBHL:(float)dBHL { if (((previousTransitionObject.userInitiated/previousTransitionObject.totalTransitions <= 0.5) && (previousTransitionObject.totalTransitions >= 2)) || dBHL == _dBHLMinimumThreshold) { if (currentTransitionObject.totalTransitions == 2) { if (currentTransitionObject.userInitiated/currentTransitionObject.totalTransitions == 1.0) { - _resultSample.calculatedThreshold = dBHL; + _resultSample.calculatedThreshold = ORKForceDoubleToLimits(dBHL); return YES; } else { return NO; } } else { - _resultSample.calculatedThreshold = dBHL; + _resultSample.calculatedThreshold = ORKForceDoubleToLimits(dBHL); return YES; } } } else if (_minimumThresholdCounter > 2) { - _resultSample.calculatedThreshold = dBHL; + _resultSample.calculatedThreshold = ORKForceDoubleToLimits(dBHL); return YES; } return NO; diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryProtocol.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometryProtocol.h similarity index 79% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryProtocol.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometryProtocol.h index 4f6bcd19fa..c2e74ec0ab 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryProtocol.h +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometryProtocol.h @@ -28,12 +28,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import +#import typedef NSTimeInterval(^ORKAudiometryTimestampProvider)(void); +typedef void(^ORKAudiometryStatusBlock)(BOOL, ORKAudiometryStimulus *_Nullable); @class ORKdBHLToneAudiometryFrequencySample; +NS_ASSUME_NONNULL_BEGIN + /** Defines the interface of an audiometry algorithm. */ @@ -55,21 +59,25 @@ typedef NSTimeInterval(^ORKAudiometryTimestampProvider)(void); @property (nonatomic, strong) ORKAudiometryTimestampProvider timestampProvider; /** - This method should return a `ORKAudiometryStimulus` providing the parameters of the tone that should presented next, if available. + Called just before presenting tone. */ -- (ORKAudiometryStimulus *)nextStimulus; +- (void)registerStimulusPlayback; /** - Called just before presenting tone. + Used by to create a new ORKdBHLToneAudiometryUnit that will register the timestamps of the tone being played + + @param double The value of the preStimulusDelay + @param NSTimeInterval The value of the startOfUnitTimeStamp */ -- (void)registerStimulusPlayback; +@optional +- (ORKdBHLToneAudiometryUnit *)createUnitWith:(double)preStimulusDelay startOfUnitTimeStamp:(NSTimeInterval)startOfUnitTimeStamp; /** Register the user response for the last presented tone. - @param BOOL A Boolean representing if the user acknowledged the last presented tone. + @param response A Boolean representing if the user acknowledged the last presented tone. */ -- (void)registerResponse:(BOOL)response; +- (void)registerResponse:(BOOL)response forUnit:(ORKdBHLToneAudiometryUnit *_Nullable)unit; /** Informs the audiometry algorithm that the last provided tone could not be reproduced due to signal clipping. Optional. @@ -85,6 +93,12 @@ typedef NSTimeInterval(^ORKAudiometryTimestampProvider)(void); @optional - (void)registerPreStimulusDelay:(double)preStimulusDelay; +/** + This method should return a `ORKAudiometryStimulus` providing the parameters of the tone that should presented next, if available. + */ +@optional +- (ORKAudiometryStimulus *)nextStimulus; + /** Returns an array of containing the results of the audiometry test. @@ -93,3 +107,5 @@ typedef NSTimeInterval(^ORKAudiometryTimestampProvider)(void); - (NSArray *)resultSamples; @end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryStimulus.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometryStimulus.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryStimulus.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometryStimulus.h diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryStimulus.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometryStimulus.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKAudiometry/ORKAudiometryStimulus.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKAudiometryStimulus.m diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryAudioGenerator.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryAudioGenerator.h index d5e08d241d..3e4a4ac399 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.h +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryAudioGenerator.h @@ -51,9 +51,9 @@ */ -@import UIKit; -@import AVFoundation; -#import "ORKTypes.h" +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryAudioGenerator.m similarity index 89% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryAudioGenerator.m index 5296b3ca25..c7e335646f 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryAudioGenerator.m +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryAudioGenerator.m @@ -75,7 +75,7 @@ @interface ORKdBHLToneAudiometryAudioGenerator () { AUNode _mixerNode; AudioUnit _mMixer; double _frequency; - unsigned long _thetaIndex; + double _theta; ORKAudioChannel _activeChannel; BOOL _playsStereo; BOOL _rampUp; @@ -93,6 +93,7 @@ - (NSNumber *)dbHLtoAmplitude: (double)dbHL atFrequency:(double)frequency; @end +const double DeviceVolumeMinimumValue = 0.0625; const double ORKdBHLSineWaveToneGeneratorSampleRateDefault = 44100.0f; static OSStatus ORKdBHLAudioGeneratorRenderTone(void *inRefCon, @@ -107,17 +108,32 @@ static OSStatus ORKdBHLAudioGeneratorRenderTone(void *inRefCon, amplitude = [audioGenerator->_amplitudeGain doubleValue]; - double theta_increment = audioGenerator->_frequency / ORKdBHLSineWaveToneGeneratorSampleRateDefault; - unsigned long theta_index = audioGenerator->_thetaIndex; - + double theta = audioGenerator->_theta; + double theta_increment = 2.0 * M_PI * audioGenerator->_frequency / ORKdBHLSineWaveToneGeneratorSampleRateDefault; + double fadeInFactor = audioGenerator->_fadeInFactor; // This is a mono tone generator so we only need the first buffer Float32 *bufferActive = (Float32 *)ioData->mBuffers[audioGenerator->_activeChannel].mData; Float32 *bufferNonActive = (Float32 *)ioData->mBuffers[1 - audioGenerator->_activeChannel].mData; - + // Generate the samples for (UInt32 frame = 0; frame < inNumberFrames; frame++) { + double bufferValue; + + bufferValue = sin(theta) * amplitude * pow(10, 2.0 * fadeInFactor - 2); + + bufferActive[frame] = bufferValue; + if (audioGenerator->_playsStereo) { + bufferNonActive[frame] = bufferValue; + } else { + bufferNonActive[frame] = 0; + } + + theta += theta_increment; + if (theta > 2.0 * M_PI) { + theta -= 2.0 * M_PI; + } if (audioGenerator->_rampUp) { fadeInFactor += 1.0 / (ORKdBHLSineWaveToneGeneratorSampleRateDefault * audioGenerator->_fadeInDuration); if (fadeInFactor >= 1) { @@ -129,21 +145,10 @@ static OSStatus ORKdBHLAudioGeneratorRenderTone(void *inRefCon, fadeInFactor = 0; } } - - double theta = theta_index * theta_increment; - double bufferValue = sin(theta * 2.0 * M_PI) * amplitude * pow(10, 2.0 * fadeInFactor - 2); - theta_index++; - - bufferActive[frame] = bufferValue; - if (audioGenerator->_playsStereo) { - bufferNonActive[frame] = bufferValue; - } else { - bufferNonActive[frame] = 0; - } } - // Store the thetaIndex back in the view controller - audioGenerator->_thetaIndex = theta_index; + // Store the theta back in the view controller + audioGenerator->_theta = theta; audioGenerator->_fadeInFactor = fadeInFactor; return noErr; @@ -206,11 +211,11 @@ - (instancetype)initForHeadphoneType:(ORKHeadphoneTypeIdentifier)headphoneType { @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"A valid headphone route identifier must be provided" userInfo:nil]; } - _sensitivityPerFrequency = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:[NSString stringWithFormat:frequencydBSPLBaseFilename, headphoneTypeIdentifier] ofType:filenameExtension]]; + _sensitivityPerFrequency = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[ORKdBHLToneAudiometryAudioGenerator class]] pathForResource:[NSString stringWithFormat:frequencydBSPLBaseFilename, headphoneTypeIdentifier] ofType:filenameExtension]]; - _retspl = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:[NSString stringWithFormat:retsplBaseFilename, headphoneTypeIdentifier] ofType:filenameExtension]]; + _retspl = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[ORKdBHLToneAudiometryAudioGenerator class]] pathForResource:[NSString stringWithFormat:retsplBaseFilename, headphoneTypeIdentifier] ofType:filenameExtension]]; - _volumeCurve = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[self class]] pathForResource:volumeCurveFilename ofType:filenameExtension]]; + _volumeCurve = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle bundleForClass:[ORKdBHLToneAudiometryAudioGenerator class]] pathForResource:volumeCurveFilename ofType:filenameExtension]]; [self setupGraph]; } @@ -239,7 +244,6 @@ - (void)playSoundAtFrequency:(double)playFrequency _fadeInDuration = 0.2; _rampUp = YES; _globaldBHL = dBHL; - _thetaIndex = 0; [self play]; @@ -372,10 +376,10 @@ - (void)stop { _rampUp = NO; int nodeInput = (_lastNodeInput % 2) + 1; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(_fadeInDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - if (_mGraph) { + if (self->_mGraph) { dispatch_async(dispatch_get_main_queue(), ^{ - AUGraphDisconnectNodeInput(_mGraph, _mixerNode, nodeInput); - AUGraphUpdate(_mGraph, NULL); + AUGraphDisconnectNodeInput(self->_mGraph, self->_mixerNode, nodeInput); + AUGraphUpdate(self->_mGraph, NULL); }); } }); @@ -390,14 +394,21 @@ - (float)getCurrentSystemVolume { return [[AVAudioSession sharedInstance] outputVolume]; } +- (NSDecimalNumber *)calculatedBSPLFromSensitivities:(NSDictionary *)sensitivityPerFrequency atFrequency:(double)frequency { + return [NSDecimalNumber decimalNumberWithString:sensitivityPerFrequency[[NSString stringWithFormat:@"%.0f", frequency]]]; +} -- (NSNumber *)dbHLtoAmplitude: (double)dbHL atFrequency:(double)frequency { - NSDecimalNumber *dBSPL = [NSDecimalNumber decimalNumberWithString:_sensitivityPerFrequency[[NSString stringWithFormat:@"%.0f",frequency]]]; +- (NSDecimalNumber *)calculateBaselinedBSPLFromSensitivities:(NSDictionary *)sensitivityPerFrequency retspls:(NSDictionary *)retspls frequency:(double)frequency { + return [NSDecimalNumber decimalNumberWithString:retspls[[NSString stringWithFormat:@"%.0f",frequency]]]; +} +- (NSNumber *)dbHLtoAmplitude: (double)dbHL atFrequency:(double)frequency { + NSDecimalNumber *dBSPL = [self calculatedBSPLFromSensitivities:_sensitivityPerFrequency atFrequency:frequency]; + // get current volume float currentVolume = [self getCurrentSystemVolume]; - currentVolume = (int)(currentVolume / 0.0625) * 0.0625; + currentVolume = ((int)(currentVolume / 0.0625) * 0.0625) >= DeviceVolumeMinimumValue ?: DeviceVolumeMinimumValue; // check in volume curve table for offset NSDecimalNumber *offsetDueToVolume = [NSDecimalNumber decimalNumberWithString:_volumeCurve[[NSString stringWithFormat:@"%.4f",currentVolume]]]; @@ -408,7 +419,7 @@ - (NSNumber *)dbHLtoAmplitude: (double)dbHL atFrequency:(double)frequency { NSDecimalNumber *updated_dBSPLFor_dBFS = [updated_dBSPLForVolumeCurve decimalNumberByAdding:dBFSCalibration]; - NSDecimalNumber *baselinedBSPL = [NSDecimalNumber decimalNumberWithString:_retspl[[NSString stringWithFormat:@"%.0f",frequency]]]; + NSDecimalNumber *baselinedBSPL = [self calculateBaselinedBSPLFromSensitivities:_sensitivityPerFrequency retspls:_retspl frequency:frequency]; NSDecimalNumber *tempdBHL = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%f", dbHL]]; NSDecimalNumber *attenuationOffset = [baselinedBSPL decimalNumberByAdding:tempdBHL]; diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryContentView.h similarity index 92% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryContentView.h index f78a3afac7..f80bd60cc5 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.h +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryContentView.h @@ -30,10 +30,10 @@ */ -@import UIKit; -#import "ORKCustomStepView_Internal.h" -#import "ORKUnitLabel.h" -#import "ORKRoundTappingButton.h" +#import +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryContentView.m similarity index 98% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryContentView.m index 2fbcaa548f..14ef414a39 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryContentView.m +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryContentView.m @@ -38,6 +38,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const CGFloat TopToProgressViewMinPadding = 10.0; +NSString * const ORKdBHLToneAudiometryTestInProgressLabelAccessibilityIdentifier = @"ORKdBHLToneAudiometryTestInProgressLabel"; + @interface TestingInProgressView : UIView @property (nonatomic, assign, getter=isActive) BOOL active; @@ -136,6 +138,7 @@ - (void)setupTextLabel compatibleWithTraitCollection:self.traitCollection]; _textLabel.font = [UIFont fontWithDescriptor:descriptor size:2 * TestingInProgressIndicatorRadius]; _textLabel.text = ORKLocalizedString(@"dBHL_TONE_AUDIOMETRY_TESTING_IN_PROGRESS", nil); + _textLabel.accessibilityIdentifier = ORKdBHLToneAudiometryTestInProgressLabelAccessibilityIdentifier; [self addSubview:_textLabel]; [NSLayoutConstraint activateConstraints:@[ diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.h index 370e14ea76..161bad9156 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.h +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.h @@ -30,6 +30,7 @@ #import +#import @interface ORKdBHLToneAudiometryOnboardingStepViewController : ORKFormStepViewController diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryOnboardingStepViewController.m diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryStepViewController.h index f447447f87..c2e2a1a7d3 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.h +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryStepViewController.h @@ -29,12 +29,9 @@ */ -@import Foundation; +#import #import -#import - - - +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryStepViewController.m similarity index 84% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryStepViewController.m index 813d1c2250..47e9088533 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStepViewController.m +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/ORKdBHLToneAudiometryStepViewController.m @@ -49,7 +49,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKdBHLToneAudiometryResult.h" #import "ORKdBHLToneAudiometryStep.h" - #import "ORKHelpers_Internal.h" #import "ORKTaskViewController_Private.h" #import "ORKTaskViewController_Internal.h" @@ -58,6 +57,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKNavigableOrderedTask.h" #import "ORKStepNavigationRule.h" +NSString * const ORKdBHLToneAudiometryStepViewAccessibilityIdentifier = @"ORKdBHLToneAudiometryStepView"; + + @interface ORKdBHLToneAudiometryStepViewController () { ORKdBHLToneAudiometryFrequencySample *_resultSample; ORKAudioChannel _audioChannel; @@ -68,7 +70,6 @@ @interface ORKdBHLToneAudiometryStepViewController () _audioGenerator playSoundAtFrequency:stimulus.frequency onChannel:stimulus.channel dBHL:stimulus.level]; }); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(preStimulusDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), _preStimulusDelayWorkBlock); _pulseDurationWorkBlock = dispatch_block_create(DISPATCH_BLOCK_INHERIT_QOS_CLASS, ^{ - [_audioGenerator stop]; + [self->_audioGenerator stop]; }); // adding 0.2 seconds to account for the fadeInDuration which is being set in ORKdBHLToneAudiometryAudioGenerator dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((preStimulusDelay + toneDuration + 0.2) * NSEC_PER_SEC)), dispatch_get_main_queue(), _pulseDurationWorkBlock); _postStimulusDelayWorkBlock = dispatch_block_create(DISPATCH_BLOCK_INHERIT_QOS_CLASS, ^{ - [self.audiometryEngine registerResponse:NO]; + [self.audiometryEngine registerResponse:NO forUnit:nil]; [self nextTrial]; }); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((preStimulusDelay + toneDuration + postStimulusDelay) * NSEC_PER_SEC)), dispatch_get_main_queue(), _postStimulusDelayWorkBlock); @@ -278,7 +297,7 @@ - (void)nextTrial { if (self.audiometryEngine.testEnded) { [self finish]; } else { - [self runTestTrial]; + [self _runTestTrial]; } } @@ -287,7 +306,7 @@ - (void)tapButtonPressed { [_hapticFeedback impactOccurred]; if (_preStimulusDelayWorkBlock && dispatch_block_testcancel(_preStimulusDelayWorkBlock) == 0) { - [self.audiometryEngine registerResponse:YES]; + [self.audiometryEngine registerResponse:YES forUnit:nil]; } [self nextTrial]; } @@ -299,5 +318,4 @@ - (void)toneWillStartClipping { [self nextTrial]; } - @end diff --git a/ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODS.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODS.plist similarity index 100% rename from ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODS.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODS.plist diff --git a/ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSMAX.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSMAX.plist similarity index 100% rename from ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSMAX.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSMAX.plist diff --git a/ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSPRO.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSPRO.plist similarity index 100% rename from ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSPRO.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSPRO.plist diff --git a/ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSPROV2.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSPROV2.plist similarity index 100% rename from ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSPROV2.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSPROV2.plist diff --git a/ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSV3.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSV3.plist similarity index 100% rename from ResearchKit/ActiveTasks/frequency_dBSPL_AIRPODSV3.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_AIRPODSV3.plist diff --git a/ResearchKit/ActiveTasks/frequency_dBSPL_EARPODS.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_EARPODS.plist similarity index 100% rename from ResearchKit/ActiveTasks/frequency_dBSPL_EARPODS.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/frequency_dBSPL_EARPODS.plist diff --git a/ResearchKit/ActiveTasks/retspl_AIRPODS.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODS.plist similarity index 100% rename from ResearchKit/ActiveTasks/retspl_AIRPODS.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODS.plist diff --git a/ResearchKit/ActiveTasks/retspl_AIRPODSMAX.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSMAX.plist similarity index 100% rename from ResearchKit/ActiveTasks/retspl_AIRPODSMAX.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSMAX.plist diff --git a/ResearchKit/ActiveTasks/retspl_AIRPODSPRO.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSPRO.plist similarity index 100% rename from ResearchKit/ActiveTasks/retspl_AIRPODSPRO.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSPRO.plist diff --git a/ResearchKit/ActiveTasks/retspl_AIRPODSPROV2.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSPROV2.plist similarity index 100% rename from ResearchKit/ActiveTasks/retspl_AIRPODSPROV2.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSPROV2.plist diff --git a/ResearchKit/ActiveTasks/retspl_AIRPODSV3.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSV3.plist similarity index 100% rename from ResearchKit/ActiveTasks/retspl_AIRPODSV3.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_AIRPODSV3.plist diff --git a/ResearchKit/ActiveTasks/retspl_EARPODS.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_EARPODS.plist similarity index 100% rename from ResearchKit/ActiveTasks/retspl_EARPODS.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_EARPODS.plist diff --git a/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_dBFS_AIRPODSPROV2.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_dBFS_AIRPODSPROV2.plist new file mode 100644 index 0000000000..901604faa2 --- /dev/null +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/retspl_dBFS_AIRPODSPROV2.plist @@ -0,0 +1,86 @@ + + + + + 250.0000 + -85.0000 + 306.0092 + -87.4644 + 364.2145 + -90.0254 + 425.0334 + -92.7014 + 488.9024 + -95.5117 + 500.0000 + -96.0000 + 556.2799 + -96.1125 + 627.6493 + -96.2552 + 703.5228 + -96.4070 + 784.4448 + -96.5688 + 870.9962 + -96.7419 + 963.7980 + -96.9275 + 1000.0000 + -97.0000 + 1063.5161 + -96.8729 + 1170.8662 + -96.6582 + 1286.6186 + -96.4267 + 1411.6040 + -96.1767 + 1546.7192 + -95.9065 + 1692.9339 + -95.6141 + 1851.2974 + -95.2974 + 2000.0000 + -95.0000 + 2022.9461 + -95.0688 + 2209.1117 + -95.6273 + 2411.1302 + -96.2333 + 2630.4514 + -96.8913 + 2868.6490 + -97.6059 + 3127.4325 + -97.6177 + 3408.6590 + -96.7740 + 3714.3464 + -95.8569 + 4000.0000 + -95.0000 + 4046.6886 + -94.9066 + 4408.0704 + -94.1838 + 4801.0852 + -93.3978 + 5228.5533 + -92.5428 + 5693.5422 + -91.6129 + 6000.0000 + -91.0000 + 6199.3889 + -90.8006 + 6749.7233 + -90.2502 + 7348.4947 + -89.6515 + 8000.0000 + -89.0000 + + diff --git a/ResearchKit/ActiveTasks/volume_curve_AIRPODS.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODS.plist similarity index 100% rename from ResearchKit/ActiveTasks/volume_curve_AIRPODS.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODS.plist diff --git a/ResearchKit/ActiveTasks/volume_curve_AIRPODSMAX.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSMAX.plist similarity index 100% rename from ResearchKit/ActiveTasks/volume_curve_AIRPODSMAX.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSMAX.plist diff --git a/ResearchKit/ActiveTasks/volume_curve_AIRPODSPRO.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSPRO.plist similarity index 100% rename from ResearchKit/ActiveTasks/volume_curve_AIRPODSPRO.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSPRO.plist diff --git a/ResearchKit/ActiveTasks/volume_curve_AIRPODSPROV2.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSPROV2.plist similarity index 100% rename from ResearchKit/ActiveTasks/volume_curve_AIRPODSPROV2.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSPROV2.plist diff --git a/ResearchKit/ActiveTasks/volume_curve_AIRPODSV3.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSV3.plist similarity index 100% rename from ResearchKit/ActiveTasks/volume_curve_AIRPODSV3.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_AIRPODSV3.plist diff --git a/ResearchKit/ActiveTasks/volume_curve_WIRED.plist b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_WIRED.plist similarity index 100% rename from ResearchKit/ActiveTasks/volume_curve_WIRED.plist rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKAudiometry/volume_curve_WIRED.plist diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStep.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryOnboardingStep.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStep.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryOnboardingStep.h diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStep.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryOnboardingStep.m similarity index 91% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStep.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryOnboardingStep.m index 3c495fdcd2..1e601ea213 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryOnboardingStep.m +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryOnboardingStep.m @@ -30,12 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKdBHLToneAudiometryOnboardingStep.h" -#import "ORKdBHLToneAudiometryOnboardingStepViewController.h" @implementation ORKdBHLToneAudiometryOnboardingStep -+ (Class)stepViewControllerClass { - return [ORKdBHLToneAudiometryOnboardingStepViewController class]; -} - @end diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryResult.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryResult.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryResult.h diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryResult.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryResult.m similarity index 99% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryResult.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryResult.m index 845425fc24..8a3c1ae917 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryResult.m +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryResult.m @@ -72,14 +72,11 @@ - (BOOL)isEqual:(id)object { && self.tonePlaybackDuration == castObject.tonePlaybackDuration && self.postStimulusDelay == castObject.postStimulusDelay && ORKEqualObjects(self.headphoneType, castObject.headphoneType) - && ORKEqualObjects(self.samples, castObject.samples) - ); + && ORKEqualObjects(self.samples, castObject.samples)); } - (NSUInteger)hash { NSUInteger resultsHash = self.samples.hash ^ self.headphoneType.hash; - - return super.hash ^ resultsHash; } @@ -90,7 +87,7 @@ - (instancetype)copyWithZone:(NSZone *)zone { result.tonePlaybackDuration = self.tonePlaybackDuration; result.postStimulusDelay = self.postStimulusDelay; result.samples = [self.samples copy]; - + return result; } diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.h b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryStep.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.h rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryStep.h index c0919c53a0..3f1ed76cb6 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.h +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryStep.h @@ -29,11 +29,12 @@ */ -@import Foundation; +#import + #import #import #import -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -70,8 +71,8 @@ ORK_CLASS_AVAILABLE @property (nonatomic, copy, nullable) NSArray *frequencyList; - - (id)audiometryEngine; +- (void)resetAudiometryEngine; @end diff --git a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.m b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryStep.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.m rename to ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryStep.m index 4a75efb3e5..ca8b6a89b9 100644 --- a/ResearchKit/ActiveTasks/ORKdBHLToneAudiometry/ORKdBHLToneAudiometryStep.m +++ b/ResearchKitActiveTask/dBHL Tone Audiometry/ORKdBHLToneAudiometryStep.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKdBHLToneAudiometryStep.h" -#import "ORKdBHLToneAudiometryStepViewController.h" #import "ORKAudiometry.h" #import "ORKHelpers_Internal.h" @@ -47,15 +46,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #define ORKdBHLToneAudiometryTaskdBHLStepDownSize 10.0 #define ORKdBHLToneAudiometryTaskdBHLMinimumThreshold -10.0 - @implementation ORKdBHLToneAudiometryStep { id _audiometry; } -+ (Class)stepViewControllerClass { - return [ORKdBHLToneAudiometryStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { return [self initWithIdentifier:identifier audiometryEngine:nil]; } @@ -187,16 +181,23 @@ - (BOOL)isEqual:(id)object { && (self.dBHLMinimumThreshold == castObject.dBHLMinimumThreshold) && (self.earPreference == castObject.earPreference) && ORKEqualObjects(self.headphoneType, castObject.headphoneType) - && ORKEqualObjects(self.frequencyList, castObject.frequencyList) - ); + && ORKEqualObjects(self.frequencyList, castObject.frequencyList)); +} + +- (id)createAudiometryEngine { + return [[ORKAudiometry alloc] initWithStep:self]; } - (id)audiometryEngine { if (!_audiometry) { - _audiometry = [[ORKAudiometry alloc] initWithStep:self]; + _audiometry = [self createAudiometryEngine]; } return _audiometry; } +- (void)resetAudiometryEngine { + _audiometry = nil; +} + @end diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterBarView.h b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterBarView.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterBarView.h rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterBarView.h diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterBarView.m b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterBarView.m similarity index 94% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterBarView.m rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterBarView.m index 6bf32593b8..2bbbbe987a 100644 --- a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterBarView.m +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterBarView.m @@ -29,8 +29,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKEnvironmentSPLMeterBarView.h" - - +#import "ORKSkin.h" #import static const CGFloat ORKEnvironmentSPLMeterSquareSize = 8.0; @@ -74,9 +73,8 @@ - (void)initRows { _squareSize, _squareSize); [dot setPath:[UIBezierPath bezierPathWithRoundedRect:dotRect cornerRadius:_cornerRadius].CGPath]; - if (@available(iOS 13.0, *)) { - dot.fillColor = [UIColor systemGray6Color].CGColor; - } + + dot.fillColor = [UIColor systemGray6Color].CGColor; [[self layer] addSublayer:dot]; [dots addObject:dot]; @@ -227,18 +225,10 @@ - (void)updateViewForIndex:(int)index { ORKEnvironmentSPLMeterColumnView *columnView = _columnViews[i]; NSInteger distanceToIndex = i - index; CGFloat opacityFactor = 0.1 * distanceToIndex; - UIColor *grayColor; - UIColor *greenColor; - UIColor *orangeColor; - if (@available(iOS 13.0, *)) { + UIColor *grayColor = [UIColor ork_splGrayColor]; + UIColor *greenColor = [UIColor systemGreenColor];; + UIColor *orangeColor = [UIColor systemOrangeColor];; - greenColor = [UIColor systemGreenColor]; - orangeColor = [UIColor systemOrangeColor]; - } else { - grayColor = [UIColor grayColor]; - greenColor = [UIColor greenColor]; - orangeColor = [UIColor orangeColor]; - } if (i <= _greenIndexLimit) { if (i < index) { [columnView setColor:greenColor]; diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterContentView.h b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterContentView.h similarity index 97% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterContentView.h rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterContentView.h index 44095d8811..bc75033b6c 100644 --- a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterContentView.h +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterContentView.h @@ -29,7 +29,7 @@ */ @import UIKit; -#import "ORKCustomStepView_Internal.h" +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterContentView.m b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterContentView.m similarity index 87% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterContentView.m rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterContentView.m index 876779341b..af4cffa024 100644 --- a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterContentView.m +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterContentView.m @@ -31,6 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKEnvironmentSPLMeterContentView.h" #import "ORKEnvironmentSPLMeterBarView.h" + #import "ORKRoundTappingButton.h" #import "ORKUnitLabel.h" #import "ORKHelpers_Internal.h" @@ -39,12 +40,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKProgressView.h" #import "ORKCompletionCheckmarkView.h" - static const CGFloat RingViewPadding = 18.0; static const CGFloat InstructionLabelPadding = 8.0; static const CGFloat HalfCircleSize = 14.0; static const CGFloat BarViewHeight = 50.0; +NSString * const ORKEnvironmentSPLMeterOptimumNoiseLevelLabelAccessibilityIdentifier = @"ORKEnvironmentSPLMeterOptimumNoiseLevelLabel"; + @interface ORKEnvironmentSPLMeterContentView () @property(nonatomic, strong) ORKRingView *ringView; @property(nonatomic, strong) ORKEnvironmentSPLMeterBarView *barView; @@ -65,7 +67,6 @@ - (instancetype)init { if (self) { preValue = -M_PI_2; currentValue = 0.0; - self.translatesAutoresizingMaskIntoConstraints = NO; [self setupContainerView]; [self setupDBInstructionLabel]; @@ -105,11 +106,10 @@ - (void)setupContainerView { - (void)setupXmarkView { if (!_xmarkView) { - if (@available(iOS 13.0, *)) { - UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithPointSize:HalfCircleSize weight:UIImageSymbolWeightBold scale:UIImageSymbolScaleDefault]; - _xmarkImage = [[UIImage systemImageNamed:@"xmark" withConfiguration:configuration] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - _checkmarkImage = [[UIImage systemImageNamed:@"checkmark" withConfiguration:configuration] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - } + UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithPointSize:HalfCircleSize weight:UIImageSymbolWeightBold scale:UIImageSymbolScaleDefault]; + _xmarkImage = [[UIImage systemImageNamed:@"xmark" withConfiguration:configuration] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + _checkmarkImage = [[UIImage systemImageNamed:@"checkmark" withConfiguration:configuration] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + _xmarkView = [[UIImageView alloc] initWithImage: _xmarkImage]; _xmarkView.tintColor = UIColor.systemOrangeColor; } @@ -128,7 +128,7 @@ - (void)setupBarView { _barView.translatesAutoresizingMaskIntoConstraints = NO; [_containerView addSubview:_barView]; - + [[_barView.leadingAnchor constraintEqualToAnchor:_containerView.leadingAnchor] setActive:YES]; [[_barView.trailingAnchor constraintEqualToAnchor:_containerView.trailingAnchor] setActive:YES]; @@ -148,10 +148,7 @@ - (void)setupRingView { [[_ringView.leadingAnchor constraintEqualToAnchor:_containerView.leadingAnchor] setActive:YES]; [[_ringView.centerYAnchor constraintEqualToAnchor:_DBInstructionLabel.centerYAnchor] setActive:YES]; [[_ringView.trailingAnchor constraintEqualToAnchor:_DBInstructionLabel.leadingAnchor constant:-InstructionLabelPadding] setActive:YES]; - - if (@available(iOS 13.0, *)) { - [_ringView setColor:UIColor.systemGray6Color]; - } + [_ringView setColor:UIColor.systemGray6Color]; } - (void)setupDBInstructionLabel { @@ -159,9 +156,7 @@ - (void)setupDBInstructionLabel { _DBInstructionLabel = [ORKLabel new]; _DBInstructionLabel.numberOfLines = 0; _DBInstructionLabel.font = [self title3TextFont]; - if (@available(iOS 13.0, *)) { - _DBInstructionLabel.textColor = UIColor.labelColor; - } + _DBInstructionLabel.textColor = UIColor.labelColor; _DBInstructionLabel.text = ORKLocalizedString(@"ENVIRONMENTSPL_CALCULATING", nil); } _DBInstructionLabel.translatesAutoresizingMaskIntoConstraints = NO; @@ -177,6 +172,7 @@ - (void)setProgressBar:(CGFloat)progress { - (void)setProgressCircle:(CGFloat)progress { if (progress >= ORKRingViewMaximumValue) { + [_ringView setBackgroundLayerStrokeColor:UIColor.systemOrangeColor circleStrokeColor:[UIColor ork_splGrayColor] withAnimationDuration:0.8]; } else { [_ringView resetLayerColors]; } @@ -195,15 +191,15 @@ - (void)setProgress:(CGFloat)progress { - (void)updateInstructionForValue:(CGFloat)progress { dispatch_async(dispatch_get_main_queue(), ^{ - NSString *currentInstruction = [_DBInstructionLabel.text copy]; + NSString *currentInstruction = [self->_DBInstructionLabel.text copy]; BOOL isNoise = (progress >= ORKRingViewMaximumValue); NSString *newInstruction = isNoise ? ORKLocalizedString(@"ENVIRONMENTSPL_NOISE", nil) : ORKLocalizedString(@"ENVIRONMENTSPL_CALCULATING", nil); - _xmarkView.hidden = !isNoise; + self->_xmarkView.hidden = !isNoise; if (![newInstruction isEqualToString:currentInstruction]) { - _DBInstructionLabel.text = newInstruction; + self->_DBInstructionLabel.text = newInstruction; if (UIAccessibilityIsVoiceOverRunning() && [self.voiceOverDelegate respondsToSelector:@selector(contentView:shouldAnnounce:)]) { - [self.voiceOverDelegate contentView:self shouldAnnounce:_DBInstructionLabel.text]; + [self.voiceOverDelegate contentView:self shouldAnnounce:self->_DBInstructionLabel.text]; } } }); @@ -220,6 +216,8 @@ - (void)reachedOptimumNoiseLevel { _DBInstructionLabel.text = ORKLocalizedString(@"ENVIRONMENTSPL_OK", nil); + _DBInstructionLabel.accessibilityIdentifier = ORKEnvironmentSPLMeterOptimumNoiseLevelLabelAccessibilityIdentifier; + if (UIAccessibilityIsVoiceOverRunning() && [self.voiceOverDelegate respondsToSelector:@selector(contentView:shouldAnnounce:)]) { [self.voiceOverDelegate contentView:self shouldAnnounce:_DBInstructionLabel.text]; } diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterResult.h b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterResult.h similarity index 100% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterResult.h rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterResult.h diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterResult.m b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterResult.m similarity index 100% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterResult.m rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterResult.m diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStep.h b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStep.h similarity index 98% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStep.h rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStep.h index 1581b95a6e..728a15a978 100644 --- a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStep.h +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStep.h @@ -29,7 +29,7 @@ */ -@import Foundation; +#import #import #import diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStep.m b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStep.m similarity index 97% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStep.m rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStep.m index 4f253fc55b..06b84d8d75 100644 --- a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStep.m +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStep.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKEnvironmentSPLMeterStep.h" -#import "ORKEnvironmentSPLMeterStepViewController.h" #import "ORKRecorder_Private.h" #import "ORKHelpers_Internal.h" @@ -40,10 +39,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKEnvironmentSPLMeterStep -+ (Class)stepViewControllerClass { - return [ORKEnvironmentSPLMeterStepViewController class]; -} - - (instancetype)initWithIdentifier:(NSString *)identifier { self = [super initWithIdentifier:identifier]; if (self) { @@ -58,9 +53,9 @@ - (void)commonInit { self.requiredContiguousSamples = ORKEnvironmentSPLMeterTaskDefaultRequiredContiguousSamples; self.stepDuration = CGFLOAT_MAX; self.shouldShowDefaultTimer = NO; - // This is inserted here because it is required for any task that requires the SPL Meter step ORKAudioStreamerConfiguration *config = [[ORKAudioStreamerConfiguration alloc] initWithIdentifier:[NSString stringWithFormat:@"%@_streamerConfiguration",self.identifier]]; + config.bypassAudioEngineStart = YES; self.recorderConfigurations = @[config]; } diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStepViewController.h b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController.h similarity index 95% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStepViewController.h rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController.h index 14856babdc..7b7796aef9 100644 --- a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStepViewController.h +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStepViewController.m b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController.m similarity index 88% rename from ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStepViewController.m rename to ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController.m index 3eb216a929..9090fc55e4 100644 --- a/ResearchKit/ActiveTasks/ORKEnvironmentSPLMeterStepViewController.m +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController.m @@ -31,7 +31,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKEnvironmentSPLMeterStepViewController.h" - #import "ORKActiveStepView.h" #import "ORKStepView.h" #import "ORKStepContainerView_Private.h" @@ -39,6 +38,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKEnvironmentSPLMeterContentView.h" #import "ORKRingView.h" +#import "ORKEnvironmentSPLMeterStepViewController_Private.h" #import "ORKActiveStepViewController_Internal.h" #import "ORKStepViewController_Internal.h" #import "ORKTaskViewController_Internal.h" @@ -55,8 +55,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const NSTimeInterval SPL_METER_PLAY_DELAY_VOICEOVER = 3.0; +NSString * const ORKEnvironmentSPLMeterStepViewAccessibilityIdentifier = @"ORKEnvironmentSPLMeterStepView"; + @interface ORKEnvironmentSPLMeterStepViewController () { - AVAudioEngine *_audioEngine; AVAudioInputNode *_inputNode; AVAudioUnitEQ *_eqUnit; AVAudioFrameCount _bufferSize; @@ -77,8 +78,6 @@ @interface ORKEnvironmentSPLMeterStepViewController ()_bufferSize) { + self->_bufferSize = buffer.frameLength; } - int sampleCount = _samplingInterval * _countToFetch; + int sampleCount = self->_samplingInterval * self->_countToFetch; float rms = 0.0; for (int i = 0; i < buffer.frameLength; i++) { float value = [@(buffer.floatChannelData[0][i]) floatValue]; rms += value * value; } dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [_rmsBuffer addObject:@(rms)]; + [self->_rmsBuffer addObject:@(rms)]; // perform averaging based on capture interval - if (_rmsBuffer.count >= sampleCount + 1) { + if (self->_rmsBuffer.count >= sampleCount + 1) { float rmsSum = 0.0; int i = sampleCount; - NSUInteger j = _rmsBuffer.count - 1; + NSUInteger j = self->_rmsBuffer.count - 1; while (i>0) { - rmsSum += [_rmsBuffer[j] floatValue]; + rmsSum += [self->_rmsBuffer[j] floatValue]; i --; j --; } - _rmsData = rmsSum/_samplingInterval; - float calValue = _sensitivityOffset; - _spl = (20 * log10f(sqrtf(_rmsData/(float)_sampleRate))) - calValue + 94; - [_recordedSamples addObject:[NSNumber numberWithFloat:_spl]]; + self->_rmsData = rmsSum/self->_samplingInterval; + float calValue = self->_sensitivityOffset; + self->_spl = (20 * log10f(sqrtf(self->_rmsData/(float)self->_sampleRate))) - calValue + 94; + [self->_recordedSamples addObject:[NSNumber numberWithFloat:self->_spl]]; dispatch_async(dispatch_get_main_queue(), ^{ - [self.environmentSPLMeterContentView setProgressCircle:(_spl/_thresholdValue)]; + [self.environmentSPLMeterContentView setProgressCircle:(self->_spl/self->_thresholdValue)]; }); - [self evaluateThreshold:_spl]; - [_rmsBuffer removeAllObjects]; + [self evaluateThreshold:self->_spl]; + [self->_rmsBuffer removeAllObjects]; } else { - if (rms > 0.0 && _sampleRate > 0.0) { - float spl = (20 * log10f(sqrtf(rms/(float)_sampleRate))) - _sensitivityOffset + 96; + if (rms > 0.0 && self->_sampleRate > 0.0) { + float spl = (20 * log10f(sqrtf(rms/(float)self->_sampleRate))) - self->_sensitivityOffset + 96; dispatch_async(dispatch_get_main_queue(), ^{ - [self.environmentSPLMeterContentView setProgressBar:(spl/_thresholdValue)]; + [self.environmentSPLMeterContentView setProgressBar:(spl/self->_thresholdValue)]; }); } else { dispatch_async(dispatch_get_main_queue(), ^{ - [self.environmentSPLMeterContentView setProgressBar:(_spl/_thresholdValue)]; + [self.environmentSPLMeterContentView setProgressBar:(self->_spl/self->_thresholdValue)]; }); } } - dispatch_semaphore_signal(_semaphoreRms); + dispatch_semaphore_signal(self->_semaphoreRms); }); - dispatch_semaphore_wait(_semaphoreRms, DISPATCH_TIME_FOREVER); + dispatch_semaphore_wait(self->_semaphoreRms, DISPATCH_TIME_FOREVER); } else if ([AVAudioSession sharedInstance].recordPermission == AVAudioSessionRecordPermissionDenied) { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [_eqUnit removeTapOnBus:0]; - [_audioEngine stop]; - [_rmsBuffer removeAllObjects]; + [self->_eqUnit removeTapOnBus:0]; + [self->_audioEngine stop]; + [self->_rmsBuffer removeAllObjects]; }); } }]; @@ -422,13 +410,6 @@ - (void)evaluateThreshold:(float)spl _counter += 1; [self.environmentSPLMeterContentView.ringView fillRingWithDuration:(double)_requiredContiguousSamples*_samplingInterval]; - - if (_counter >= _requiredContiguousSamples) - { - [self reachedOptimumNoiseLevel]; - - [self sendHapticEvent:UINotificationFeedbackTypeSuccess]; - } } else { @@ -457,14 +438,16 @@ - (void)stopAudioEngine { if ([_audioEngine isRunning]) { dispatch_semaphore_signal(_semaphoreRms); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [_eqUnit removeTapOnBus:0]; - [_audioEngine stop]; - [_rmsBuffer removeAllObjects]; + [self->_eqUnit removeTapOnBus:0]; + [self->_audioEngine stop]; + [self->_rmsBuffer removeAllObjects]; }); } } - (void)reachedOptimumNoiseLevel { + [self stopAudioEngine]; + [self sendHapticEvent:UINotificationFeedbackTypeSuccess]; [self resetAudioSession]; } @@ -501,8 +484,8 @@ - (void)setupFeedbackGenerator - (void)sendHapticEvent:(UINotificationFeedbackType)eventType { dispatch_async(dispatch_get_main_queue(), ^{ - [_notificationFeedbackGenerator notificationOccurred:eventType]; - [_notificationFeedbackGenerator prepare]; + [self->_notificationFeedbackGenerator notificationOccurred:eventType]; + [self->_notificationFeedbackGenerator prepare]; }); } diff --git a/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController_Private.h b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController_Private.h new file mode 100644 index 0000000000..80277db1fc --- /dev/null +++ b/ResearchKitActiveTask/environmentSPLMeter/ORKEnvironmentSPLMeterStepViewController_Private.h @@ -0,0 +1,49 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +@class AVAudioEngine; + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKEnvironmentSPLMeterStepViewController () + +- (void)setNavigationFooterView; +- (void)reachedOptimumNoiseLevel; +- (void)resetAudioSession; +- (void)stopAudioEngine; +- (void)sendHapticEvent:(UINotificationFeedbackType)eventType; + +@property (nonatomic, strong) AVAudioEngine *audioEngine; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/splMeter_sensitivity_offset.plist b/ResearchKitActiveTask/environmentSPLMeter/splMeter_sensitivity_offset.plist similarity index 100% rename from ResearchKit/ActiveTasks/splMeter_sensitivity_offset.plist rename to ResearchKitActiveTask/environmentSPLMeter/splMeter_sensitivity_offset.plist diff --git a/ResearchKitTests/NSObject+TestingSupport.h b/ResearchKitTests/NSObject+TestingSupport.h new file mode 100644 index 0000000000..6602fd1927 --- /dev/null +++ b/ResearchKitTests/NSObject+TestingSupport.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSObject (TestingSupport) + ++ (BOOL)executeUsingObjCExceptionHandling:(void (^)(void))tryBlock error:(NSError **)error NS_SWIFT_NAME(executeUsingObjCExceptionHandling(_:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitTests/NSObject+TestingSupport.m b/ResearchKitTests/NSObject+TestingSupport.m new file mode 100644 index 0000000000..e754ddafb4 --- /dev/null +++ b/ResearchKitTests/NSObject+TestingSupport.m @@ -0,0 +1,48 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "NSObject+TestingSupport.h" +#import "ORKErrors.h" + +@implementation NSObject (TestingSupport) + ++ (BOOL)executeUsingObjCExceptionHandling:(void (^)(void))tryBlock error:(NSError **)error { + @try { + tryBlock(); + return YES; + } @catch (NSException *exception) { + if (error != NULL) { + *error = [NSError errorWithDomain:ORKErrorDomain code:ORKErrorException userInfo:@{ORKUnderlyingExceptionKey: exception}]; + } + return NO; + } +} + +@end diff --git a/ResearchKitTests/ORKActiveStepTests.swift b/ResearchKitTests/ORKActiveStepTests.swift index 84dc5397cd..c062a56d66 100644 --- a/ResearchKitTests/ORKActiveStepTests.swift +++ b/ResearchKitTests/ORKActiveStepTests.swift @@ -27,7 +27,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - import XCTest @testable import ResearchKit diff --git a/ResearchKitTests/ORKActiveTaskResultTests.swift b/ResearchKitTests/ORKActiveTaskResultTests.swift index 0f6d39bfc1..068c2c8725 100644 --- a/ResearchKitTests/ORKActiveTaskResultTests.swift +++ b/ResearchKitTests/ORKActiveTaskResultTests.swift @@ -30,6 +30,7 @@ import XCTest @testable import ResearchKit +@testable import ResearchKitActiveTask class ORKAmslerGridResultTests: XCTestCase { var result: ORKAmslerGridResult! diff --git a/ResearchKitTests/ORKAnswerFormatTests.m b/ResearchKitTests/ORKAnswerFormatTests.m index a28721656e..859d44245c 100644 --- a/ResearchKitTests/ORKAnswerFormatTests.m +++ b/ResearchKitTests/ORKAnswerFormatTests.m @@ -30,7 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit; +@import ResearchKit_Private; #import "ORKAnswerFormat_Internal.h" #import "ORKPicker.h" #import "ORKPickerTestDelegate.h" @@ -958,6 +959,7 @@ - (void)testOptionalMaxMetricHeightPickerAnswerFormat { expectedSecondRow:ORKDoubleInvalidValue]); } + - (void)testContinuousScaleAnswerFormat { XCTAssertThrowsSpecificNamed([ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 @@ -1107,7 +1109,7 @@ - (void)testMaxFractionDigitsClamping { { NSUInteger maxFractionDigits = 5; ORKContinuousScaleAnswerFormat* scaleAnswer = [[ORKContinuousScaleAnswerFormat alloc] initWithMaximumValue:10 minimumValue:1 defaultValue:0.0 maximumFractionDigits:maxFractionDigits]; - XCTAssertEqualObjects([scaleAnswer.numberFormatter stringFromNumber:@99.12345], @"99.1235"); + XCTAssertEqualObjects([scaleAnswer.numberFormatter stringFromNumber:@99.12345], @"99.1234"); } { NSUInteger maxFractionDigits = -1; @@ -1326,6 +1328,9 @@ - (void)testTimeOfDayAnswerFormat { XCTAssertEqual([[answerFormat defaultComponents] month], 01); XCTAssertEqual([[answerFormat defaultComponents] day], 24); XCTAssertEqual([[answerFormat defaultComponents] year], 1984); + + //check that `hideUnitWhenAnswerIsEmpty` only works on `ORKNumericAnswerFormat` + XCTAssertThrows([(ORKNumericAnswerFormat*)answerFormat hideUnitWhenAnswerIsEmpty]); } - (void)testNumericAnswerFormat { @@ -1342,6 +1347,7 @@ - (void)testNumericAnswerFormat { XCTAssertEqual([answerFormatWithIntegerStyle maximum], [NSNumber numberWithInteger:100]); XCTAssertEqual([answerFormatWithIntegerStyle maximumFractionDigits], @(0)); + XCTAssertTrue([answerFormatWithIntegerStyle hideUnitWhenAnswerIsEmpty]); ORKNumericAnswerFormat *answerFormatWithDecimalStyle = [[ORKNumericAnswerFormat alloc] initWithStyle:ORKNumericAnswerStyleDecimal]; XCTAssertEqual([answerFormatWithDecimalStyle style ], ORKNumericAnswerStyleDecimal); @@ -1505,6 +1511,7 @@ - (void)testValuePickerAnswerFormat { XCTAssertEqual([[[answerFormat textChoices] objectAtIndex:1] value], [NSNumber numberWithInteger:2]); } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (void)testHealthKitCharacteristicTypeAnswerFormat { HKCharacteristicType *biologicalSex = [HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex]; @@ -1592,6 +1599,7 @@ - (void)testHealthKitQuantityTypeAnswerFormat { XCTAssertEqual([answerFormat numericAnswerStyle], ORKNumericAnswerStyleInteger); XCTAssertEqual([answerFormat quantityType], calories); } +#endif - (void)testDateAnswerFormat { diff --git a/ResearchKitTests/ORKAudioStepViewControllerTests.m b/ResearchKitTests/ORKAudioStepViewControllerTests.m index f2d403abbf..3a0c49167a 100644 --- a/ResearchKitTests/ORKAudioStepViewControllerTests.m +++ b/ResearchKitTests/ORKAudioStepViewControllerTests.m @@ -29,7 +29,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import -#import +#import @import XCTest; diff --git a/ResearchKitTests/ORKAudiometryTests.m b/ResearchKitTests/ORKAudiometryTests.m index b664515ea7..f8b7c3fc14 100644 --- a/ResearchKitTests/ORKAudiometryTests.m +++ b/ResearchKitTests/ORKAudiometryTests.m @@ -30,7 +30,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import -@import ResearchKit.Private; +@import ResearchKit_Private; +@import ResearchKitActiveTask; +@import ResearchKitActiveTask_Private; @interface ORKAudiometryTests : XCTestCase @@ -74,6 +76,7 @@ - (ORKdBHLToneAudiometryStep *)stepForCurrentKeys { - (void)runTestForAudiometryClass:(id (^_Nonnull)(void))audiometryConstructor { [self.audiogramPool enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull audiogramDict, NSUInteger idx, BOOL * _Nonnull stop) { + [self runTestForAudiogram:audiogramDict onAudiometryEngine:audiometryConstructor()]; }]; } @@ -87,7 +90,7 @@ - (void)runTestForAudiogram:(NSDictionary *)audiogramDict onAudiometryEngine:(id if ([audiometry respondsToSelector:@selector(registerStimulusPlayback)]) { [audiometry registerStimulusPlayback]; } - [audiometry registerResponse:stimulus.level >= referenceLevel.doubleValue]; + [audiometry registerResponse:stimulus.level >= referenceLevel.doubleValue forUnit:nil]; } NSArray *result = [audiometry resultSamples]; diff --git a/ResearchKitTests/ORKBorderedButtonTests.swift b/ResearchKitTests/ORKBorderedButtonTests.swift index 2ec9edb31b..0886dcd38b 100644 --- a/ResearchKitTests/ORKBorderedButtonTests.swift +++ b/ResearchKitTests/ORKBorderedButtonTests.swift @@ -30,6 +30,7 @@ import XCTest @testable import ResearchKit +@testable import ResearchKitUI class ORKBorderedButtonTests: XCTestCase { diff --git a/ResearchKitTests/ORKChoiceAnswerFormatHelperTests.m b/ResearchKitTests/ORKChoiceAnswerFormatHelperTests.m index 67255921b0..7d26fc5ecb 100644 --- a/ResearchKitTests/ORKChoiceAnswerFormatHelperTests.m +++ b/ResearchKitTests/ORKChoiceAnswerFormatHelperTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; #import "ORKChoiceAnswerFormatHelper.h" diff --git a/ResearchKitTests/ORKCompletionStepViewControllerTests.swift b/ResearchKitTests/ORKCompletionStepViewControllerTests.swift index c4d5d44e1c..fc838fd509 100644 --- a/ResearchKitTests/ORKCompletionStepViewControllerTests.swift +++ b/ResearchKitTests/ORKCompletionStepViewControllerTests.swift @@ -29,7 +29,8 @@ */ import XCTest -import ResearchKit.Private +import ResearchKit_Private +@testable import ResearchKitUI class ORKCompletionStepViewControllerTests: XCTestCase { var completionController: ORKCompletionStepViewController! diff --git a/ResearchKitTests/ORKConsentDocumentTests.m b/ResearchKitTests/ORKConsentDocumentTests.m index a2242252b8..6f597ca678 100644 --- a/ResearchKitTests/ORKConsentDocumentTests.m +++ b/ResearchKitTests/ORKConsentDocumentTests.m @@ -30,7 +30,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit; +@import ResearchKit_Private; #import "ORKConsentSectionFormatter.h" #import "ORKConsentSignatureFormatter.h" diff --git a/ResearchKitTests/ORKConsentSectionFormatterTests.m b/ResearchKitTests/ORKConsentSectionFormatterTests.m index 6f4476edaf..52a6a88640 100644 --- a/ResearchKitTests/ORKConsentSectionFormatterTests.m +++ b/ResearchKitTests/ORKConsentSectionFormatterTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; #import "ORKConsentSectionFormatter.h" diff --git a/ResearchKitTests/ORKConsentSignatureFormatterTests.m b/ResearchKitTests/ORKConsentSignatureFormatterTests.m index 675c66972f..3a00915432 100644 --- a/ResearchKitTests/ORKConsentSignatureFormatterTests.m +++ b/ResearchKitTests/ORKConsentSignatureFormatterTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit; #import "ORKConsentSignatureFormatter.h" diff --git a/ResearchKitTests/ORKConsentTests.m b/ResearchKitTests/ORKConsentTests.m index d1cf6a4f11..40e2f2d5bd 100644 --- a/ResearchKitTests/ORKConsentTests.m +++ b/ResearchKitTests/ORKConsentTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; @interface ORKConsentTests : XCTestCase diff --git a/ResearchKitTests/ORKContinueButtonTests.swift b/ResearchKitTests/ORKContinueButtonTests.swift index 7f12cb6053..19333174bf 100644 --- a/ResearchKitTests/ORKContinueButtonTests.swift +++ b/ResearchKitTests/ORKContinueButtonTests.swift @@ -32,7 +32,7 @@ import XCTest import UIKit class ORKContinueButtonTests: XCTestCase { - + var button: ORKContinueButton! override func setUp() { @@ -41,7 +41,7 @@ class ORKContinueButtonTests: XCTestCase { } func testAttributes() { - XCTAssertEqual(button.currentTitle, "BUTTON") + XCTAssertEqual(button.titleLabel?.text, "BUTTON") XCTAssertEqual(button.isDoneButton, true) } } diff --git a/Testing/ORKTest/ORKTestTests/ORKDataCollectionTests.m b/ResearchKitTests/ORKDataCollectionTests.m similarity index 93% rename from Testing/ORKTest/ORKTestTests/ORKDataCollectionTests.m rename to ResearchKitTests/ORKDataCollectionTests.m index 3089beba19..26df4151cc 100644 --- a/Testing/ORKTest/ORKTestTests/ORKDataCollectionTests.m +++ b/ResearchKitTests/ORKDataCollectionTests.m @@ -392,36 +392,6 @@ - (void)testDataCollectionDelegateDeliveryRejection { XCTAssertEqual(_errorCount, 2); } -- (void)testDataCollectorSerialization { - - ORKMotionActivityCollector *motionCollector; - ORKHealthCollector *healthCollector; - ORKHealthCorrelationCollector *healthCorrelationCollector; - NSError *error; - // Create - ORKDataCollectionManager *manager = createManagerWithCollectors([NSURL fileURLWithPath:[self cleanStorePath]], - [NSDate date], - &motionCollector, - &healthCollector, - &healthCorrelationCollector, - &error); - - XCTAssertNil(error); - XCTAssertEqual(manager.collectors.count, 3); - - ORKDataCollectionState *state = [[ORKDataCollectionState alloc] init]; - [state setCollectors:manager.collectors]; - - id data = [NSKeyedArchiver archivedDataWithRootObject:state requiringSecureCoding:YES error:&error]; - - XCTAssertNil(error); - - id decodedState = [NSKeyedUnarchiver unarchivedObjectOfClass:[ORKDataCollectionState self] fromData:data error:nil]; - - XCTAssertNotNil(decodedState); - XCTAssertTrue([decodedState isKindOfClass:[ORKDataCollectionState self]]); -} - #pragma mark - delegate - (BOOL)healthCollector:(ORKHealthCollector *)collector diff --git a/ResearchKitTests/ORKDataLoggerManagerTests.m b/ResearchKitTests/ORKDataLoggerManagerTests.m index 95987eab35..1d5c3a1a98 100644 --- a/ResearchKitTests/ORKDataLoggerManagerTests.m +++ b/ResearchKitTests/ORKDataLoggerManagerTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; @interface ORKDataLoggerManagerTests : XCTestCase { diff --git a/ResearchKitTests/ORKDataLoggerTests.m b/ResearchKitTests/ORKDataLoggerTests.m index 853b1f6cc4..b24e7680e6 100644 --- a/ResearchKitTests/ORKDataLoggerTests.m +++ b/ResearchKitTests/ORKDataLoggerTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; #import "ORKHelpers_Internal.h" diff --git a/Testing/ORKTest/ORKTestTests/ORKESerialization.h b/ResearchKitTests/ORKESerialization.h similarity index 99% rename from Testing/ORKTest/ORKTestTests/ORKESerialization.h rename to ResearchKitTests/ORKESerialization.h index 0c0f5040e3..2377419fd8 100644 --- a/Testing/ORKTest/ORKTestTests/ORKESerialization.h +++ b/ResearchKitTests/ORKESerialization.h @@ -28,9 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -@import Foundation; -@import UIKit; +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -124,6 +123,7 @@ typedef _Nullable id (^ORKESerializationJSONToObjectBlock)(id jsonObject, ORKESe @end + @interface ORKESerializer : NSObject + (nullable NSDictionary *)JSONObjectForObject:(id)object error:(NSError **)error; diff --git a/Testing/ORKTest/ORKTestTests/ORKESerialization.m b/ResearchKitTests/ORKESerialization.m similarity index 92% rename from Testing/ORKTest/ORKTestTests/ORKESerialization.m rename to ResearchKitTests/ORKESerialization.m index d2b8b49865..d2ae538ab3 100644 --- a/Testing/ORKTest/ORKTestTests/ORKESerialization.m +++ b/ResearchKitTests/ORKESerialization.m @@ -33,11 +33,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKESerialization.h" -@import ResearchKit; -@import ResearchKit.Private; +#import +#import +#import +#import -@import MapKit; -@import Speech; + +#import +#import ORKESerializationKey const ORKESerializationKeyImageName = @"imageName"; @@ -65,7 +68,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE return [formatter dateFromString:string]; } -static NSArray *ORKNumericAnswerStyleTable() { +static NSArray *ORKNumericAnswerStyleTable(void) { static NSArray *table = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -74,7 +77,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE return table; } -static NSArray *ORKImageChoiceAnswerStyleTable() { +static NSArray *ORKImageChoiceAnswerStyleTable(void) { static NSArray *table = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -83,7 +86,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE return table; } -static NSArray *ORKMeasurementSystemTable() { +static NSArray *ORKMeasurementSystemTable(void) { static NSArray *table = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -145,7 +148,7 @@ static NSInteger tableMapReverse(id value, NSArray *table) { [dict setObject:segment.alternativeSubstrings.copy forKey:@"alternativeSubstrings"]; if (@available(iOS 14.5, *)) { } - else if (@available(iOS 13.0, *)) { + else { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" [dict setObject:dictionaryFromSFVoiceAnalytics(segment.voiceAnalytics) forKey:@"voiceAnalytics"]; @@ -227,14 +230,6 @@ static UIEdgeInsets edgeInsetsFromDictionary(NSDictionary *dict) { return (UIEdgeInsets){.top = ((NSNumber *)dict[@"top"]).doubleValue, .left = ((NSNumber *)dict[@"left"]).doubleValue, .bottom = ((NSNumber *)dict[@"bottom"]).doubleValue, .right = ((NSNumber *)dict[@"right"]).doubleValue}; } -static NSDictionary *dictionaryFromCoordinate (CLLocationCoordinate2D coordinate) { - return @{ @"latitude": @(coordinate.latitude), @"longitude": @(coordinate.longitude) }; -} - -static CLLocationCoordinate2D coordinateFromDictionary(NSDictionary *dict) { - return (CLLocationCoordinate2D){.latitude = ((NSNumber *)dict[@"latitude"]).doubleValue, .longitude = ((NSNumber *)dict[@"longitude"]).doubleValue }; -} - static ORKNumericAnswerStyle ORKNumericAnswerStyleFromString(NSString *s) { return tableMapReverse(s, ORKNumericAnswerStyleTable()); } @@ -259,6 +254,15 @@ static ORKMeasurementSystem ORKMeasurementSystemFromString(NSString *s) { return tableMapForward(measurementSystem, ORKMeasurementSystemTable()); } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +static NSDictionary *dictionaryFromCoordinate (CLLocationCoordinate2D coordinate) { + return @{ @"latitude": @(coordinate.latitude), @"longitude": @(coordinate.longitude) }; +} + +static CLLocationCoordinate2D coordinateFromDictionary(NSDictionary *dict) { + return (CLLocationCoordinate2D){.latitude = ((NSNumber *)dict[@"latitude"]).doubleValue, .longitude = ((NSNumber *)dict[@"longitude"]).doubleValue }; +} + static NSDictionary *dictionaryFromCircularRegion(CLCircularRegion *region) { NSDictionary *dictionary = region ? @{ @@ -273,11 +277,13 @@ static ORKMeasurementSystem ORKMeasurementSystemFromString(NSString *s) { static NSDictionary *dictionaryFromPostalAddress(CNPostalAddress *address) { return @{ @"city": address.city, @"street": address.street }; } +#endif static NSString *identifierFromClinicalType(HKClinicalType *type) { return type.identifier; } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION static CLCircularRegion *circularRegionFromDictionary(NSDictionary *dict) { CLCircularRegion *circularRegion; if (dict.count == 3) { @@ -287,6 +293,7 @@ static ORKMeasurementSystem ORKMeasurementSystemFromString(NSString *s) { } return circularRegion; } +#endif static NSArray *arrayFromRegularExpressionOptions(NSRegularExpressionOptions regularExpressionOptions) { NSMutableArray *optionsArray = [NSMutableArray new]; @@ -379,12 +386,14 @@ static NSRegularExpressionOptions regularExpressionOptionsFromArray(NSArray *arr return passwordRules; } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION static CNPostalAddress *postalAddressFromDictionary(NSDictionary *dict) { CNMutablePostalAddress *postalAddress = [[CNMutablePostalAddress alloc] init]; postalAddress.city = dict[@"city"]; postalAddress.street = dict[@"street"]; return [postalAddress copy]; } +#endif static HKClinicalType *typeFromIdentifier(NSString *identifier) { return [HKClinicalType clinicalTypeForIdentifier:identifier]; @@ -640,7 +649,9 @@ - (instancetype)initWithLocalizer:(nullable id)local @end static id propFromDict(NSDictionary *dict, NSString *propName, ORKESerializationContext *context) { - NSArray *classEncodings = classEncodingsForClass(NSClassFromString(dict[_ClassKey])); + Class class = NSClassFromString(dict[_ClassKey]); + + NSArray *classEncodings = classEncodingsForClass(class); ORKESerializableProperty *propertyEntry = nil; for (ORKESerializableTableEntry *classEncoding in classEncodings) { @@ -733,7 +744,7 @@ - (NSString *)localizedStringForKey:(NSString *)string @implementation ORKESerializer -static NSArray *ORKChoiceAnswerStyleTable() { +static NSArray *ORKChoiceAnswerStyleTable(void) { static NSArray *table; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -743,7 +754,7 @@ @implementation ORKESerializer return table; } -static NSArray *ORKDateAnswerStyleTable() { +static NSArray *ORKDateAnswerStyleTable(void) { static NSArray *table = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -752,7 +763,7 @@ @implementation ORKESerializer return table; } -static NSArray *buttonIdentifierTable() { +static NSArray *buttonIdentifierTable(void) { static NSArray *table = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -761,7 +772,7 @@ @implementation ORKESerializer return table; } -static NSArray *memoryGameStatusTable() { +static NSArray *memoryGameStatusTable(void) { static NSArray *table = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -770,7 +781,7 @@ @implementation ORKESerializer return table; } -static NSArray *numberFormattingStyleTable() { +static NSArray *numberFormattingStyleTable(void) { static NSArray *table = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ @@ -799,7 +810,7 @@ @implementation ORKESerializer } #define GETPROP(d,x) getter(d, @ESTRINGIFY(x)) -static NSMutableDictionary *ORKESerializationEncodingTable() { +static NSMutableDictionary *ORKESerializationEncodingTable(void) { static dispatch_once_t onceToken; static NSMutableDictionary *internalEncodingTable = nil; dispatch_once(&onceToken, ^{ @@ -839,6 +850,15 @@ @implementation ORKESerializer (@{ PROPERTY(destinationStepIdentifier, NSString, NSObject, NO, nil, nil), })), + ENTRY(ORKPredicateFormItemVisibilityRule, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + NSString* predicateFormat = GETPROP(dict, predicateFormat); + ORKPredicateFormItemVisibilityRule *rule = [[ORKPredicateFormItemVisibilityRule alloc] initWithPredicateFormat:predicateFormat]; + return rule; + }, + (@{ + PROPERTY(predicateFormat, NSString, NSObject, NO, nil, nil), + })), ENTRY(ORKAudioLevelNavigationRule, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { ORKAudioLevelNavigationRule *rule = [[ORKAudioLevelNavigationRule alloc] initWithAudioLevelStepIdentifier:GETPROP(dict, audioLevelStepIdentifier) destinationStepIdentifier:GETPROP(dict, destinationStepIdentifier) @@ -896,6 +916,7 @@ @implementation ORKESerializer PROPERTY(buildInBodyItems, NSNumber, NSObject, YES, nil, nil), PROPERTY(useExtendedPadding, NSNumber, NSObject, YES, nil, nil), PROPERTY(earlyTerminationConfiguration, ORKEarlyTerminationConfiguration, NSObject, YES, nil, nil), + PROPERTY(shouldAutomaticallyAdjustImageTintColor, NSNumber, NSObject, YES, nil, nil), })), ENTRY(ORKBodyItem, ^id(__unused NSDictionary *dict, __unused ORKESerializationPropertyGetter getter) { @@ -904,7 +925,8 @@ @implementation ORKESerializer image:nil learnMoreItem:GETPROP(dict, learnMoreItem) bodyItemStyle:[GETPROP(dict, bodyItemStyle) intValue] - useCardStyle:GETPROP(dict, useCardStyle)]; + useCardStyle:GETPROP(dict, useCardStyle) + alignImageToTop:GETPROP(dict, alignImageToTop)]; return bodyItem; }, (@{ @@ -915,6 +937,7 @@ @implementation ORKESerializer PROPERTY(learnMoreItem, ORKLearnMoreItem, NSObject, YES, nil, nil), PROPERTY(useCardStyle, NSNumber, NSObject, YES, nil, nil), PROPERTY(useSecondaryColor, NSNumber, NSObject, YES, nil, nil), + PROPERTY(alignImageToTop, NSNumber, NSObject, YES, nil, nil), })), ENTRY(ORKLearnMoreItem, ^id(__unused NSDictionary *dict, __unused ORKESerializationPropertyGetter getter) { @@ -983,18 +1006,18 @@ @implementation ORKESerializer PROPERTY(identifier, NSString, NSObject, NO, nil, nil), })), ENTRY(ORKQuestionStep, - ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { - return [[ORKQuestionStep alloc] initWithIdentifier:GETPROP(dict, identifier)]; - }, - (@{ - PROPERTY(answerFormat, ORKAnswerFormat, NSObject, YES, nil, nil), - PROPERTY(placeholder, NSString, NSObject, YES, nil, nil), - PROPERTY(question, NSString, NSObject, YES, nil, nil), - PROPERTY(useCardView, NSNumber, NSObject, YES, nil, nil), - PROPERTY(learnMoreItem, ORKLearnMoreItem, NSObject, YES, nil, nil), - PROPERTY(tagText, NSString, NSObject, YES, nil, nil), - PROPERTY(presentationStyle, NSString, NSObject, YES, nil, nil) - })), + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKQuestionStep alloc] initWithIdentifier:GETPROP(dict, identifier)]; + }, + (@{ + PROPERTY(answerFormat, ORKAnswerFormat, NSObject, YES, nil, nil), + PROPERTY(placeholder, NSString, NSObject, YES, nil, nil), + PROPERTY(question, NSString, NSObject, YES, nil, nil), + PROPERTY(useCardView, NSNumber, NSObject, YES, nil, nil), + PROPERTY(learnMoreItem, ORKLearnMoreItem, NSObject, YES, nil, nil), + PROPERTY(tagText, NSString, NSObject, YES, nil, nil), + PROPERTY(presentationStyle, NSString, NSObject, YES, nil, nil) + })), ENTRY(ORKInstructionStep, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { return [[ORKInstructionStep alloc] initWithIdentifier:GETPROP(dict, identifier)]; @@ -1057,6 +1080,7 @@ @implementation ORKESerializer }, (@{ PROPERTY(html, NSString, NSObject, YES, nil, nil), + PROPERTY(instructionSteps, ORKInstructionStep, NSArray, YES, nil, nil), PROPERTY(customCSS, NSString, NSObject, YES, nil, nil), PROPERTY(showSignatureAfterContent, NSNumber, NSObject, YES, nil, nil) })), @@ -1224,6 +1248,7 @@ @implementation ORKESerializer PROPERTY(allowsSelection, NSNumber, NSObject, YES, nil, nil), PROPERTY(bulletType, NSNumber, NSObject, YES, nil, nil), PROPERTY(pinNavigationContainer, NSNumber, NSObject, YES, nil, nil), + PROPERTY(bottomPadding, NSNumber, NSObject, YES, nil, nil) }))), ENTRY(ORKTimedWalkStep, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { @@ -1279,34 +1304,28 @@ @implementation ORKESerializer PROPERTY(currentInterval, NSNumber, NSObject, YES, nil, nil), })), ENTRY(ORKNormalizedReactionTimeResult, - ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { - return [[ORKNormalizedReactionTimeResult alloc] initWithIdentifier:GETPROP(dict, identifier)]; - }, + nil, (@{ PROPERTY(timerStartDate, NSDate, NSObject, YES, - ^id(id date, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() stringFromDate:date]; }, - ^id(id string, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() dateFromString:string]; }), + ^id(id date, __unused ORKESerializationContext *context) { return ORKEStringFromDateISO8601(date); }, + ^id(id string, __unused ORKESerializationContext *context) { return ORKEDateFromStringISO8601(string); }), PROPERTY(timerEndDate, NSDate, NSObject, YES, - ^id(id date, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() stringFromDate:date]; }, - ^id(id string, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() dateFromString:string]; }), + ^id(id date, __unused ORKESerializationContext *context) { return ORKEStringFromDateISO8601(date); }, + ^id(id string, __unused ORKESerializationContext *context) { return ORKEDateFromStringISO8601(string); }), PROPERTY(stimulusStartDate, NSDate, NSObject, YES, - ^id(id date, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() stringFromDate:date]; }, - ^id(id string, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() dateFromString:string]; }), + ^id(id date, __unused ORKESerializationContext *context) { return ORKEStringFromDateISO8601(date); }, + ^id(id string, __unused ORKESerializationContext *context) { return ORKEDateFromStringISO8601(string); }), PROPERTY(reactionDate, NSDate, NSObject, YES, - ^id(id date, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() stringFromDate:date]; }, - ^id(id string, __unused ORKESerializationContext *context) { return [ORKResultDateTimeFormatter() dateFromString:string]; }), - PROPERTY(currentInterval, NSNumber, NSObject, YES, nil, nil) + ^id(id date, __unused ORKESerializationContext *context) { return ORKEStringFromDateISO8601(date); }, + ^id(id string, __unused ORKESerializationContext *context) { return ORKEDateFromStringISO8601(string); }), + PROPERTY(currentInterval, NSNumber, NSObject, NO, nil, nil), })), ENTRY(ORKStroopStep, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { return [[ORKStroopStep alloc] initWithIdentifier:GETPROP(dict, identifier)]; }, (@{ - PROPERTY(numberOfAttempts, NSNumber, NSObject, YES, nil, nil), - PROPERTY(useTextForStimuli, NSNumber, NSObject, YES, nil, nil), - PROPERTY(useGridLayoutForButtons, NSNumber, NSObject, YES, nil, nil), - PROPERTY(randomizeVisualAndColorAlignment, NSNumber, NSObject, YES, nil, nil), - })), + PROPERTY(numberOfAttempts, NSNumber, NSObject, YES, nil, nil)})), ENTRY(ORKAccuracyStroopStep, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { return [[ORKAccuracyStroopStep alloc] initWithIdentifier:GETPROP(dict, identifier)]; @@ -1569,12 +1588,14 @@ @implementation ORKESerializer PROPERTY(formItems, ORKFormItem, NSArray, YES, nil, nil), PROPERTY(footnote, NSString, NSObject, YES, nil, nil), PROPERTY(useCardView, NSNumber, NSObject, YES, nil, nil), + PROPERTY(autoScrollEnabled, NSNumber, NSObject, YES, nil, nil), PROPERTY(footerText, NSString, NSObject, YES, nil, nil), PROPERTY(cardViewStyle, NSNumber, NSObject, YES, nil, nil), })), ENTRY(ORKFormItem, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { - return [[ORKFormItem alloc] initWithIdentifier:GETPROP(dict, identifier) text:GETPROP(dict, text) answerFormat:GETPROP(dict, answerFormat)]; + ORKFormItem* formItem = [[ORKFormItem alloc] initWithIdentifier:GETPROP(dict, identifier) text:GETPROP(dict, text) answerFormat:GETPROP(dict, answerFormat)]; + return formItem; }, (@{ PROPERTY(identifier, NSString, NSObject, NO, nil, nil), @@ -1879,7 +1900,7 @@ @implementation ORKESerializer PROPERTY(passwordRules, UITextInputPasswordRules, NSObject, YES, ^id(id value, __unused ORKESerializationContext *context) { return dictionaryFromPasswordRules((UITextInputPasswordRules *)value); }, ^id(id dict, __unused ORKESerializationContext *context) { return passwordRulesFromDictionary(dict); } ), - PROPERTY(placeholder, NSString, NSObject, YES, nil, nil) + PROPERTY(placeholder, NSString, NSObject, YES, nil, nil), })), ENTRY(ORKEmailAnswerFormat, nil, @@ -1937,14 +1958,6 @@ @implementation ORKESerializer PROPERTY(maximumValue, NSNumber, NSObject, NO, nil, nil), PROPERTY(defaultValue, NSNumber, NSObject, NO, nil, nil), })), - ENTRY(ORKLocationAnswerFormat, - ^id(__unused NSDictionary *dict, __unused ORKESerializationPropertyGetter getter) { - return [[ORKLocationAnswerFormat alloc] init]; - }, - (@{ - PROPERTY(useCurrentLocation, NSNumber, NSObject, YES, nil, nil), - PROPERTY(placeholder, NSString, NSObject, YES, nil, nil) - })), ENTRY(ORKSESAnswerFormat, ^id(__unused NSDictionary *dict, __unused ORKESerializationPropertyGetter getter) { return [[ORKSESAnswerFormat alloc] init]; @@ -1953,12 +1966,23 @@ @implementation ORKESerializer PROPERTY(topRungText, NSString, NSObject, YES, nil, nil), PROPERTY(bottomRungText, NSString, NSObject, YES, nil, nil) })), + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + ENTRY(ORKLocationAnswerFormat, + ^id(__unused NSDictionary *dict, __unused ORKESerializationPropertyGetter getter) { + return [[ORKLocationAnswerFormat alloc] init]; + }, + (@{ + PROPERTY(useCurrentLocation, NSNumber, NSObject, YES, nil, nil), + PROPERTY(placeholder, NSString, NSObject, YES, nil, nil) + })), ENTRY(ORKLocationRecorderConfiguration, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { return [[ORKLocationRecorderConfiguration alloc] initWithIdentifier:GETPROP(dict,identifier)]; }, (@{ })), +#endif ENTRY(ORKPedometerRecorderConfiguration, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { return [[ORKPedometerRecorderConfiguration alloc] initWithIdentifier:GETPROP(dict,identifier)]; @@ -2099,7 +2123,7 @@ @implementation ORKESerializer PROPERTY(tonePlaybackDuration, NSNumber, NSObject, NO, nil, nil), PROPERTY(postStimulusDelay, NSNumber, NSObject, NO, nil, nil), PROPERTY(headphoneType, NSString, NSObject, NO, nil, nil), - PROPERTY(samples, ORKdBHLToneAudiometryFrequencySample, NSArray, NO, nil, nil), + PROPERTY(samples, ORKdBHLToneAudiometryFrequencySample, NSArray, NO, nil, nil) })), ENTRY(ORKReactionTimeResult, nil, @@ -2272,6 +2296,7 @@ @implementation ORKESerializer ^id(id timeZone, __unused ORKESerializationContext *context) { return @([timeZone secondsFromGMT]); }, ^id(id number, __unused ORKESerializationContext *context) { return [NSTimeZone timeZoneForSecondsFromGMT:(NSInteger)((NSNumber *)number).doubleValue]; }) })), +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION ENTRY(ORKLocation, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { CLLocationCoordinate2D coordinate = coordinateFromDictionary(dict[@ESTRINGIFY(coordinate)]); @@ -2297,6 +2322,7 @@ @implementation ORKESerializer (@{ PROPERTY(locationAnswer, ORKLocation, NSObject, NO, nil, nil) })), +#endif ENTRY(ORKSESQuestionResult, nil, (@{ @@ -2375,6 +2401,7 @@ @implementation ORKESerializer (@{ PROPERTY(modelManager, ORK3DModelManager, NSObject, YES, nil, nil), })), + ENTRY(ORKFrontFacingCameraStep, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { return [[ORKFrontFacingCameraStep alloc] initWithIdentifier:GETPROP(dict, identifier)]; @@ -2389,6 +2416,119 @@ @implementation ORKESerializer (@{ PROPERTY(retryCount, NSNumber, NSObject, NO, nil, nil) })), + ENTRY(ORKAgeAnswerFormat, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKAgeAnswerFormat alloc] initWithMinimumAge:((NSNumber *)GETPROP(dict, minimumAge)).integerValue + maximumAge:((NSNumber *)GETPROP(dict, maximumAge)).integerValue + minimumAgeCustomText:GETPROP(dict, minimumAgeCustomText) + maximumAgeCustomText:GETPROP(dict, maximumAgeCustomText) + showYear:((NSNumber *)GETPROP(dict, showYear)).boolValue + useYearForResult:((NSNumber *)GETPROP(dict, useYearForResult)).boolValue + treatMinAgeAsRange:((NSNumber *)GETPROP(dict, treatMinAgeAsRange)).boolValue + treatMaxAgeAsRange:((NSNumber *)GETPROP(dict, treatMaxAgeAsRange)).boolValue + defaultValue:((NSNumber *)GETPROP(dict, defaultValue)).integerValue]; + }, + (@{ + PROPERTY(minimumAge, NSNumber, NSObject, NO, nil, nil), + PROPERTY(maximumAge, NSNumber, NSObject, NO, nil, nil), + PROPERTY(minimumAgeCustomText, NSString, NSObject, YES, nil, nil), + PROPERTY(maximumAgeCustomText, NSString, NSObject, YES, nil, nil), + PROPERTY(showYear, NSNumber, NSObject, NO, nil, nil), + PROPERTY(useYearForResult, NSNumber, NSObject, NO, nil, nil), + PROPERTY(treatMinAgeAsRange, NSNumber, NSObject, NO, nil, nil), + PROPERTY(treatMaxAgeAsRange, NSNumber, NSObject, NO, nil, nil), + PROPERTY(relativeYear, NSNumber, NSObject, YES, nil, nil), + PROPERTY(defaultValue, NSNumber, NSObject, NO, nil, nil), + })), + ENTRY(ORKColorChoiceAnswerFormat, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKColorChoiceAnswerFormat alloc] initWithStyle:((NSNumber *)GETPROP(dict, style)).integerValue colorChoices:GETPROP(dict, colorChoices)]; + }, + (@{ + PROPERTY(style, NSNumber, NSObject, NO, NUMTOSTRINGBLOCK(ORKChoiceAnswerStyleTable()), STRINGTONUMBLOCK(ORKChoiceAnswerStyleTable())), + PROPERTY(colorChoices, ORKColorChoice, NSArray, NO, nil, nil), + })), + ENTRY(ORKColorChoice, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKColorChoice alloc] initWithColor:GETPROP(dict, color) + text:GETPROP(dict, text) + detailText:GETPROP(dict, detailText) + value:GETPROP(dict, value) + exclusive:((NSNumber *)GETPROP(dict, exclusive)).boolValue]; + }, + (@{ + PROPERTY(text, NSString, NSObject, NO, nil, nil), + PROPERTY(detailText, NSString, NSObject, NO, nil, nil), + PROPERTY(value, NSObject, NSObject, NO, nil, nil), + PROPERTY(exclusive, NSNumber, NSObject, NO, nil, nil), + PROPERTY(color, UIColor, NSObject, YES, + ^id(id color, __unused ORKESerializationContext *context) { return dictionaryFromColor(color); }, + ^id(id dict, __unused ORKESerializationContext *context) { return colorFromDictionary(dict); }) + })), + ENTRY(ORKRelativeGroup, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKRelativeGroup alloc] initWithIdentifier:GETPROP(dict, identifier) + name:GETPROP(dict, name) + sectionTitle:GETPROP(dict, sectionTitle) + sectionDetailText:GETPROP(dict, sectionDetailText) + identifierForCellTitle:GETPROP(dict, identifierForCellTitle) + maxAllowed:[GETPROP(dict, maxAllowed) unsignedIntegerValue] + formSteps:GETPROP(dict, formSteps) + detailTextIdentifiers:GETPROP(dict, detailTextIdentifiers)]; + }, + (@{ + PROPERTY(identifier, NSString, NSObject, YES, nil, nil), + PROPERTY(name, NSString, NSObject, YES, nil, nil), + PROPERTY(sectionTitle, NSString, NSObject, YES, nil, nil), + PROPERTY(sectionDetailText, NSString, NSObject, YES, nil, nil), + PROPERTY(identifierForCellTitle, NSString, NSObject, YES, nil, nil), + PROPERTY(maxAllowed, NSNumber, NSObject, YES, nil, nil), + PROPERTY(formSteps, ORKFormStep, NSArray, YES, nil, nil), + PROPERTY(detailTextIdentifiers, NSString, NSArray, YES, nil, nil), + })), + ENTRY(ORKHealthCondition, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKHealthCondition alloc] initWithIdentifier:GETPROP(dict, identifier) displayName:GETPROP(dict, displayName) value:GETPROP(dict, value)]; + }, + (@{ + PROPERTY(identifier, NSString, NSObject, YES, nil, nil), + PROPERTY(displayName, NSString, NSObject, YES, nil, nil), + PROPERTY(value, NSObject, NSObject, YES, nil, nil) + })), + ENTRY(ORKRelatedPerson, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKRelatedPerson alloc] initWithIdentifier:GETPROP(dict, identifier) groupIdentifier:GETPROP(dict, groupIdentifier) identifierForCellTitle:GETPROP(dict, identifierForCellTitle) taskResult:GETPROP(dict, taskResult)]; + }, + (@{ + PROPERTY(identifier, NSString, NSObject, YES, nil, nil), + PROPERTY(groupIdentifier, NSString, NSObject, YES, nil, nil), + PROPERTY(identifierForCellTitle, NSString, NSObject, YES, nil, nil), + PROPERTY(taskResult, ORKTaskResult, NSObject, YES, nil, nil) + })), + ENTRY(ORKFamilyHistoryResult, + nil, + (@{ + PROPERTY(relatedPersons, ORKRelatedPerson, NSArray, YES, nil, nil), + PROPERTY(displayedConditions, NSString, NSArray, YES, nil, nil) + })), + ENTRY(ORKConditionStepConfiguration, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKConditionStepConfiguration alloc] initWithStepIdentifier:GETPROP(dict, stepIdentifier) conditionsFormItemIdentifier:GETPROP(dict, conditionsFormItemIdentifier) conditions:GETPROP(dict, conditions) formItems:GETPROP(dict, formItems)]; + }, + (@{ + PROPERTY(stepIdentifier, NSString, NSObject, YES, nil, nil), + PROPERTY(conditionsFormItemIdentifier, NSString, NSObject, YES, nil, nil), + PROPERTY(conditions, ORKHealthCondition, NSArray, YES, nil, nil), + PROPERTY(formItems, ORKFormItem, NSArray, YES, nil, nil) + })), + ENTRY(ORKFamilyHistoryStep, + ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { + return [[ORKFamilyHistoryStep alloc] initWithIdentifier:GETPROP(dict, identifier)]; + }, + (@{ + PROPERTY(conditionStepConfiguration, ORKConditionStepConfiguration, NSObject, YES, nil, nil), + PROPERTY(relativeGroups, ORKRelativeGroup, NSArray, YES, nil, nil), + })), ENTRY(ORKDevice, ^id(NSDictionary *dict, ORKESerializationPropertyGetter getter) { return [[ORKDevice alloc] initWithProduct:GETPROP(dict, product) osVersion:GETPROP(dict, osVersion) @@ -2450,13 +2590,15 @@ static id objectForJsonObject(id input, id localizer = context.localizer; id stringInterpolator = context.stringInterpolator; - + + if (expectedClass != nil && [input isKindOfClass:expectedClass]) { // Input is already of the expected class, do nothing output = input; } else if ([input isKindOfClass:[NSDictionary class]]) { NSDictionary *dict = (NSDictionary *)input; - NSString *className = input[_ClassKey]; + NSString *className = input[_ClassKey]; // todo: might be a spot to convert class + ORKESerializationPropertyInjector *propertyInjector = context.propertyInjector; if (propertyInjector != nil) { @@ -2483,7 +2625,7 @@ static id objectForJsonObject(id input, output = [[class alloc] init]; } - for (__strong NSString *key in [dict allKeys]) { + for (NSString *key in [dict allKeys]) { if ([key isEqualToString:_ClassKey]) { continue; } @@ -2553,10 +2695,6 @@ static id jsonObjectForObject(id object, ORKESerializationContext *context) { ORKESerializationObjectToJSONBlock converter = propertyEntry.objectToJSONBlock; Class containerClass = propertyEntry.containerClass; id valueForKey = [object valueForKey:propertyName]; - BOOL valueIsDontKnowAnswer = [valueForKey isKindOfClass:[ORKDontKnowAnswer class]]; - if (valueIsDontKnowAnswer) { - converter = nil; - } if (valueForKey != nil) { if ([containerClass isSubclassOfClass:[NSArray class]]) { NSMutableArray *a = [NSMutableArray array]; @@ -2650,9 +2788,6 @@ + (NSArray *)serializableClasses { NSMutableArray *a = [NSMutableArray array]; NSDictionary *table = ORKESerializationEncodingTable(); for (NSString *key in [table allKeys]) { - if ([key containsString:@"SwiftStroop"] || [key containsString:@"DataCollectionState"]) { - continue; - } [a addObject:NSClassFromString(key)]; } return a; diff --git a/ResearchKitTests/ORKEnvironmentSPLMeterResultTests.swift b/ResearchKitTests/ORKEnvironmentSPLMeterResultTests.swift index 11ccebdcb4..7bb2c41bd3 100644 --- a/ResearchKitTests/ORKEnvironmentSPLMeterResultTests.swift +++ b/ResearchKitTests/ORKEnvironmentSPLMeterResultTests.swift @@ -29,6 +29,7 @@ */ import XCTest +import ResearchKitActiveTask class ORKEnvironmentSPLMeterResultTests: XCTestCase { diff --git a/ResearchKitTests/ORKFamilyHistoryResultTests.swift b/ResearchKitTests/ORKFamilyHistoryResultTests.swift new file mode 100644 index 0000000000..cecada1f62 --- /dev/null +++ b/ResearchKitTests/ORKFamilyHistoryResultTests.swift @@ -0,0 +1,104 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import XCTest +@testable import ResearchKit + +class ORKFamilyHistoryResultTests: XCTestCase { + + func testCopiesAreEqual() { + let result = simpleFamilyHistoryResultWithIdentifier() + let copy = result.copy() as! ORKFamilyHistoryResult + + XCTAssertEqual(copy, result) + + // relatedPerson references are deep copied when copying the family history result. + // The properties of each relatedPerson should be equal, but the relatedPerson objects should not be pointer equal + XCTAssertNotIdentical(copy.relatedPersons?.first, result.relatedPersons?.first) + XCTAssertEqual(copy.relatedPersons?.first, result.relatedPersons?.first) + XCTAssertNotIdentical(copy.relatedPersons?.last, result.relatedPersons?.last) + XCTAssertEqual(copy.relatedPersons?.last, result.relatedPersons?.last) + + XCTAssertEqual(copy.displayedConditions, result.displayedConditions) + } + + func testIsEqual() { + let result = simpleFamilyHistoryResultWithIdentifier() + + do { // confirm changing the conditions breaks equality + let copy = result.copy() as! ORKFamilyHistoryResult + XCTAssertEqual(copy, result) + + copy.displayedConditions = ["none"] + XCTAssertNotEqual(result, copy) + } + + do { // confirm changing the relatedPersons array breaks equality + let copy = result.copy() as! ORKFamilyHistoryResult + XCTAssertEqual(copy, result) + + copy.relatedPersons = [] + XCTAssertNotEqual(result, copy) + } + + do { // confirm changing the identifier breaks equality + let copy = simpleFamilyHistoryResultWithIdentifier("xyz") + copy.relatedPersons = result.relatedPersons + copy.displayedConditions = result.displayedConditions + + XCTAssertNotEqual(copy, result) + } + } + + func simpleFamilyHistoryResultWithIdentifier(_ identifier: String = "abc") -> ORKFamilyHistoryResult { + let result = ORKFamilyHistoryResult(identifier: identifier) + result.displayedConditions = [ + "gout", + "heart disease", + "hypertension" + ] + result.relatedPersons = [ + ORKRelatedPerson( + identifier: "aaa", + groupIdentifier: "parents", + identifierForCellTitle: "title", + taskResult: ORKTaskResult(taskIdentifier: "1", taskRun: UUID(), outputDirectory: nil) + ), + ORKRelatedPerson( + identifier: "lil", + groupIdentifier: "children", + identifierForCellTitle: "title", + taskResult: ORKTaskResult(taskIdentifier: "2", taskRun: UUID(), outputDirectory: nil) + ), + ] + return result + } +} + diff --git a/ResearchKitTests/ORKFormItemVisibilityRuleTests.swift b/ResearchKitTests/ORKFormItemVisibilityRuleTests.swift new file mode 100644 index 0000000000..23eb6b1ee2 --- /dev/null +++ b/ResearchKitTests/ORKFormItemVisibilityRuleTests.swift @@ -0,0 +1,381 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import XCTest + +import ResearchKit + +final class ORKFormItemVisibilityRuleTests: XCTestCase { + + func testAbstractRuleRestrictions() throws { + let abstractBaseClass = ORKFormItemVisibilityRule.self + XCTAssertThrowsError(try NSObject.executeUsingObjCExceptionHandling { + _ = abstractBaseClass.init() + }) { error in + let exception = (error as NSError).userInfo[ORKUnderlyingExceptionKey] as! NSException + XCTAssertEqual(exception.name, NSExceptionName.internalInconsistencyException) + } + } + + func testSubclassInitCanCallSuper() throws { + let subclassInstance = ExampleFormItemVisibilityRule(evaluationLogic: "expression") + XCTAssertTrue(subclassInstance.classForCoder == ExampleFormItemVisibilityRule.self) + XCTAssertFalse(subclassInstance.classForCoder == ORKFormItemVisibilityRule.self) + } + + func testSubclassCopyCanCallSuper() throws { + let example = ExampleFormItemVisibilityRule(evaluationLogic: "expression") + let copy = example.copy() + XCTAssertTrue(object_getClass(copy) == ExampleFormItemVisibilityRule.self) + + if let copy = copy as? ExampleFormItemVisibilityRule { + XCTAssertEqual(example, copy) + } else { + XCTFail("copy of ExampleFormItemVisibilityRule was not of type ExampleFormItemVisibilityRule") + } + } + + func testSubclassDecodingWorks() throws { + // verify that a subclass can be be encoded and then decoded + // verify that the decoded instance is the concrete subclass not the abstract class + let example = ExampleFormItemVisibilityRule(evaluationLogic: "expression") + + let encoder = NSKeyedArchiver(requiringSecureCoding: true) + let ArchiveKey = "formItemVisibilityRule" + encoder.encode(example, forKey: ArchiveKey) + encoder.finishEncoding() + let data = encoder.encodedData + + let unarchiver = try! NSKeyedUnarchiver(forReadingFrom: data) + let decodedObject = unarchiver.decodeObject(of: [ORKFormItemVisibilityRule.self], forKey: ArchiveKey) + XCTAssertNotNil(decodedObject) + + guard let decodedRule = decodedObject as? ORKFormItemVisibilityRule else { + XCTFail("decoded rule was not of type ORKFormItemVisibilityRule") + return + } + XCTAssertTrue(decodedRule.classForKeyedArchiver == ExampleFormItemVisibilityRule.self) + } + + func testSubclassIsEqualWorks() throws { + + // test that when they should be equal that they are equal + let subclass = ExampleFormItemVisibilityRule(evaluationLogic: "expression") + let copy = subclass.copy() as? ExampleFormItemVisibilityRule + XCTAssertEqual(subclass, copy) + + // test that when when the should NOT be equal, that they in fact are not equal + let secondSubclass = ExampleFormItemVisibilityRule(evaluationLogic: "another expression") + XCTAssertNotEqual(subclass, secondSubclass) + + // In bogus example subclass, test that two otherwise equal objects are not equal since they differ by class + let bogusSubclass = BogusFormItemVisibilityRule(evaluationLogic: subclass.evaluationLogic) + XCTAssertNotEqual(subclass, bogusSubclass) + } + + func testSubclassMissingImplementationThrows() throws { + // test that a subclass that doesn't implement formItemVisibilityForTaskResult throws + + let taskResult = ORKTaskResult(taskIdentifier: "", taskRun: UUID(), outputDirectory: nil) + let rule = ExampleFormItemVisibilityRule() + let bogusRule = BogusFormItemVisibilityRule() + + // regular rule should work + _ = rule.formItemVisibility(for: taskResult) + + // bogus rule class doesn't implement formItemVisibility(for: ORKTaskResult) + + XCTAssertThrowsError(try NSObject.executeUsingObjCExceptionHandling { + bogusRule.formItemVisibility(for: taskResult) + }) { error in + let exception = (error as NSError).userInfo[ORKUnderlyingExceptionKey] as! NSException + XCTAssertEqual(exception.name, NSExceptionName.genericException) + } + } + + func testAssigningRuleToFormItem() throws { + let formItemWithRule = createFormItemWithVisibilityRule() + XCTAssertNotNil(formItemWithRule) + XCTAssertNotNil(formItemWithRule.visibilityRule) + } + + func testFormItemWithRuleArchives() throws { + let formItemWithRule = createFormItemWithVisibilityRule() + + // archive the ORKFormItem with an attached Rule + let encoder = NSKeyedArchiver(requiringSecureCoding: true) + let ArchiveKey = "formItemWithVisibilityRule" + encoder.encode(formItemWithRule, forKey: ArchiveKey) + encoder.finishEncoding() + let data = encoder.encodedData + + let unarchiver = try! NSKeyedUnarchiver(forReadingFrom: data) + let decodedObject = unarchiver.decodeObject(of: [ORKFormItem.self], forKey: ArchiveKey) + XCTAssertNotNil(decodedObject) + + // decode and ensure is not nil + guard let decodedObject = decodedObject as? ORKFormItem else { + XCTFail("decoded rule was not of type ORKFormItemVisibilityRule") + return + } + XCTAssertTrue(decodedObject.classForKeyedArchiver == ORKFormItem.self) + + // ensure decoded item has a rule and ensure is not nil + guard let decodedRule = decodedObject.visibilityRule as? ExampleFormItemVisibilityRule else { + XCTFail("decoded rule was not of type ORKFormItemVisibilityRule") + return + } + XCTAssertTrue(decodedRule.classForKeyedArchiver == ExampleFormItemVisibilityRule.self) + } + + func testFormItemWithOutRuleArchives() throws { + let formItemWithOutRule = createFormItem() + + // encode and decode a formItem without a rule + let encoder = NSKeyedArchiver(requiringSecureCoding: true) + let ArchiveKey = "formItemWithOutVisibilityRule" + encoder.encode(formItemWithOutRule, forKey: ArchiveKey) + encoder.finishEncoding() + let data = encoder.encodedData + + let unarchiver = try! NSKeyedUnarchiver(forReadingFrom: data) + let decodedObject = unarchiver.decodeObject(of: [ORKFormItem.self], forKey: ArchiveKey) + XCTAssertNotNil(decodedObject) + + guard let decodedObject = decodedObject as? ORKFormItem else { + XCTFail("decoded rule was not of type ORKFormItemVisibilityRule") + return + } + // ensure we are still an ORKFormItem and visibilityRule is nil + XCTAssertTrue(decodedObject.classForKeyedArchiver == ORKFormItem.self) + XCTAssertNil(decodedObject.visibilityRule) + } + + func testAssigningAndMutatingVisibilityRule() throws { + let formItem = createFormItem() + let visibilityRule = BogusFormItemVisibilityRuleWithMutableProperties() + formItem.visibilityRule = visibilityRule + + visibilityRule.evaluationLogic = "SOME_VAR == TRUE" + + // we expect our mutated rule to be mutated not the assigned rule + XCTAssertNotEqual(visibilityRule.evaluationLogic, (formItem.visibilityRule as! BogusFormItemVisibilityRuleWithMutableProperties).evaluationLogic) + } + + func createFormItem() -> ORKFormItem { + let formItem = ORKFormItem(identifier: "formItemIdentifier", text: "Hello", answerFormat: ORKBooleanAnswerFormat()) + return formItem + } + + func createFormItemWithVisibilityRule() -> ORKFormItem { + let formItem = createFormItem() + let visibilityRule = ExampleFormItemVisibilityRule() + formItem.visibilityRule = visibilityRule + return formItem + } +} + +final class ExampleFormItemVisibilityRule: ORKFormItemVisibilityRule { + + public private(set) var evaluationLogic: String? + + init(evaluationLogic: String?) { + super.init() + self.evaluationLogic = evaluationLogic + } + + override init() { + super.init() + } + + enum CodingKeys: CodingKey { + case evaluationLogic + } + + public override func copy(with zone: NSZone? = nil) -> Any { + let result = super.copy(with: zone) as! Self + result.evaluationLogic = self.evaluationLogic + return result + } + + /* + It's a runtime error if a superclass supports secure coding and this class overrides -initWithCoder:, but does + not also override +supportsSecureCoding. The class must implement +supportsSecureCoding and return YES to verify + that its implementation of -initWithCoder: is secure coding compliant, otherwise you get NSInvalidUnarchiveOperationException + */ + class override var supportsSecureCoding: Bool { + return true + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + let key = CodingKeys.evaluationLogic.stringValue + evaluationLogic = coder.decodeObject(of: [NSString.self], forKey: key) as? String + } + + override func encode(with coder: NSCoder) { + super.encode(with: coder) + coder.encode(self.evaluationLogic, forKey: CodingKeys.evaluationLogic.stringValue) + } + + override public func isEqual(_ object: Any?) -> Bool { + guard + let object = object as? ExampleFormItemVisibilityRule, + super.isEqual(object), + evaluationLogic == object.evaluationLogic + else { + return false + } + return true + } + + override func formItemVisibility(for taskResult: ORKTaskResult?) -> Bool { + return true + } + +} + +final class BogusFormItemVisibilityRule: ORKFormItemVisibilityRule { + + public private(set) var evaluationLogic: String? + + init(evaluationLogic: String?) { + super.init() + self.evaluationLogic = evaluationLogic + } + + override init() { + super.init() + } + + enum CodingKeys: CodingKey { + case evaluationLogic + } + + public override func copy(with zone: NSZone? = nil) -> Any { + let result = super.copy(with: zone) as! Self + result.evaluationLogic = self.evaluationLogic + return result + } + + /* + It's a runtime error if a superclass supports secure coding and this class overrides -initWithCoder:, but does + not also override +supportsSecureCoding. The class must implement +supportsSecureCoding and return YES to verify + that its implementation of -initWithCoder: is secure coding compliant, otherwise you get NSInvalidUnarchiveOperationException + */ + class override var supportsSecureCoding: Bool { + return true + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + + let container = try! (coder as! Decoder).container(keyedBy: CodingKeys.self) + evaluationLogic = try! container.decode( + String.self, + forKey: .evaluationLogic + ) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(evaluationLogic, forKey: .evaluationLogic) + } + + override public func isEqual(_ object: Any?) -> Bool { + guard + let object = object as? BogusFormItemVisibilityRule, + super.isEqual(object), + evaluationLogic == object.evaluationLogic + else { + return false + } + return true + } +} + +final class BogusFormItemVisibilityRuleWithMutableProperties: ORKFormItemVisibilityRule { + + public var evaluationLogic: String? + + init(evaluationLogic: String?) { + super.init() + self.evaluationLogic = evaluationLogic + } + + override init() { + super.init() + } + + enum CodingKeys: CodingKey { + case evaluationLogic + } + + public override func copy(with zone: NSZone? = nil) -> Any { + let result = super.copy(with: zone) as! Self + result.evaluationLogic = self.evaluationLogic + return result + } + + /* + It's a runtime error if a superclass supports secure coding and this class overrides -initWithCoder:, but does + not also override +supportsSecureCoding. The class must implement +supportsSecureCoding and return YES to verify + that its implementation of -initWithCoder: is secure coding compliant, otherwise you get NSInvalidUnarchiveOperationException + */ + class override var supportsSecureCoding: Bool { + return true + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + + let container = try! (coder as! Decoder).container(keyedBy: CodingKeys.self) + evaluationLogic = try! container.decode( + String.self, + forKey: .evaluationLogic + ) + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.container(keyedBy: CodingKeys.self) + try container.encode(evaluationLogic, forKey: .evaluationLogic) + } + + override public func isEqual(_ object: Any?) -> Bool { + guard + let object = object as? BogusFormItemVisibilityRule, + super.isEqual(object), + evaluationLogic == object.evaluationLogic + else { + return false + } + return true + } +} diff --git a/ResearchKitTests/ORKFormStepViewController+TestingSupport.h b/ResearchKitTests/ORKFormStepViewController+TestingSupport.h new file mode 100644 index 0000000000..dcff75e384 --- /dev/null +++ b/ResearchKitTests/ORKFormStepViewController+TestingSupport.h @@ -0,0 +1,80 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ORKTableCellItemIdentifier; + +@interface ORKFormStepViewController (TestingSupport) + +@property (nonatomic, strong) UITableView *tableView; + +@property (nonatomic, strong) NSMutableDictionary *savedAnswers; +- (void)decodeRestorableStateWithCoder:(NSCoder *)coder; +- (void)removeInvalidSavedAnswers; + + +/** +returns a list of all the formItems + */ +- (nonnull NSArray *)allFormItems; + +/** +returns a list of all the visible formItems + */ +- (nonnull NSArray *)visibleFormItems; + +/** +returns a list of all the answerable formItems + */ +- (nonnull NSArray *)answerableFormItems; + +/** + returns delegate_ongoingTaskResult from the ORKTaskViewController Delegate + */ +- (nonnull ORKTaskResult *)_ongoingTaskResult; + +- (void)buildDataSource:(UITableViewDiffableDataSource *)dataSource withCompletion:(void (^ _Nullable)(void))completion; + +/** + fetches the associated ORKFormItem from an indexPath which calls _formItemForFormItemIdentifier (potential performance hit) + */ +- (nullable ORKFormItem *)_formItemForIndexPath:(NSIndexPath *)indexPath; + +/** + fetches the associated ORKFormItem from a formItemIdentifier (potential performance hit) + */ +- (nullable ORKFormItem *)_formItemForFormItemIdentifier:(NSString *)formItemIdentifier; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitTests/ORKFormStepViewControllerConditionalFormItemsTests.swift b/ResearchKitTests/ORKFormStepViewControllerConditionalFormItemsTests.swift new file mode 100644 index 0000000000..526acecd97 --- /dev/null +++ b/ResearchKitTests/ORKFormStepViewControllerConditionalFormItemsTests.swift @@ -0,0 +1,548 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import XCTest + +final class ORKFormStepViewControllerConditionalFormItemsTests: XCTestCase { + + func testBasicFormItemsAccessors() throws { + let formStepViewController = ORKFormStepViewController(step: FormStepTestUtilities.simpleFormStep()) + + let allFormItems = formStepViewController.allFormItems() + let visibleFormItems = formStepViewController.visibleFormItems() + let answerableFormItems = formStepViewController.answerableFormItems() + + XCTAssertEqual(allFormItems, visibleFormItems, "all formItems should be visible") + XCTAssertEqual(answerableFormItems.count, visibleFormItems.count - 1, "there's one formItem that shouldn't be answerable") + XCTAssertEqual(visibleFormItems[0].text, FormStepTestUtilities.SectionTitle, "Expected the first visible formItem to be an unanswerable section formItem with text") + + // confirm the allFormItems identifiers + do { + let identifiers = allFormItems.map({ eachFormItem -> String in + return eachFormItem.identifier + }) + XCTAssertEqual(identifiers, [allFormItems[0].identifier, "item1", "item2", "item3"]) + } + + // confirm the visibleFormItems identifiers + do { + let identifiers = visibleFormItems.map({ eachFormItem -> String in + return eachFormItem.identifier + }) + XCTAssertEqual(identifiers, [allFormItems[0].identifier, "item1", "item2", "item3"]) + } + + // confirm the answerableFormItems identifiers + do { + let identifiers = answerableFormItems.map({ eachFormItem -> String in + return eachFormItem.identifier + }) + XCTAssertEqual(identifiers, ["item1", "item2", "item3"]) + } + } + + + + func testConditionalFormItemsAccessors() throws { + let formStepViewController = ORKFormStepViewController(step: FormStepTestUtilities.conditionalFormStep()) + + let allFormItems = formStepViewController.allFormItems() + let visibleFormItems = formStepViewController.visibleFormItems() + let answerableFormItems = formStepViewController.answerableFormItems() + + XCTAssertEqual(answerableFormItems.count, visibleFormItems.count - 1, "there's one formItem that shouldn't be answerable") + XCTAssertEqual(visibleFormItems[0].text, FormStepTestUtilities.SectionTitle, "Expected the first visible formItem to be an unanswerable section formItem with text") + + // confirm the allFormItems identifiers + do { + let identifiers = allFormItems.map({ eachFormItem -> String in + return eachFormItem.identifier + }) + XCTAssertEqual(identifiers, [allFormItems[0].identifier, "item1", "item2", "item3"]) + } + + // confirm the visibleFormItems identifiers + do { + let identifiers = visibleFormItems.map({ eachFormItem -> String in + return eachFormItem.identifier + }) + XCTAssertEqual(identifiers, [allFormItems[0].identifier, "item1", "item2"]) + } + + // confirm the answerableFormItems identifiers + do { + let identifiers = answerableFormItems.map({ eachFormItem -> String in + return eachFormItem.identifier + }) + XCTAssertEqual(identifiers, ["item1", "item2"]) + } + } + + func testEmptyTaskResult() throws { + + let mainTask = ORKOrderedTask(identifier: "mainTaskIdentifier", steps: [ + FormStepTestUtilities.simpleBooleanFormStep(), + FormStepTestUtilities.simpleFormStep() + ]) + let mainTaskVC = ORKTaskViewController(task: mainTask, taskRun: nil) + + // go to the first step to generate results + mainTaskVC.flipToPage(withIdentifier: FormStepTestUtilities.QuestionStepIdentifier, forward: true, animated: false) + + // generate results for the formStep + mainTaskVC.flipToPage(withIdentifier: FormStepTestUtilities.FormStepIdentifier, forward: true, animated: false) + + // test that the taskViewController.result contains everything, including formStep results + do { + let result = mainTaskVC.result + XCTAssertEqual(result.results?.count, 2) + + let simpleQuestionResult = result.results?[0] as? ORKStepResult + XCTAssertEqual(simpleQuestionResult?.identifier, FormStepTestUtilities.QuestionStepIdentifier) + + let formStepResult = result.results?[1] as? ORKStepResult + XCTAssertEqual(formStepResult?.identifier, FormStepTestUtilities.FormStepIdentifier) + XCTAssertEqual(formStepResult?.results?.count, 3, "expected to have 3 results in the formStep stepResult") + + // because we forcibly skipped to the viewController without answering, all the answers should be nil + do { + let formItemResult = formStepResult?.results?[0] as? ORKBooleanQuestionResult + XCTAssertEqual(formItemResult?.booleanAnswer, nil) + } + + do { + let formItemResult = formStepResult?.results?[1] as? ORKTextQuestionResult + XCTAssertEqual(formItemResult?.textAnswer, nil) + } + + do { + let formItemResult = formStepResult?.results?[2] as? ORKTextQuestionResult + XCTAssertEqual(formItemResult?.textAnswer, nil) + } + } + + // formStepViewController's _ongoingTaskResult provide results for *both* the + // preceding question step and the current form step + do { + let formStepViewController = mainTaskVC.currentStepViewController as? ORKFormStepViewController + let result = formStepViewController?._ongoingTaskResult() + XCTAssertEqual(result?.results?.count, 2) + XCTAssertEqual(result?.results?[0].identifier, FormStepTestUtilities.QuestionStepIdentifier) + XCTAssertEqual(result?.results?[1].identifier, FormStepTestUtilities.FormStepIdentifier) + } + } + + func testEvaluatingTaskResultPreviousQuestionStep() throws { + let mainTask = ORKOrderedTask(identifier: "mainTaskIdentifier", steps: [ + FormStepTestUtilities.simpleBooleanFormStep(), + FormStepTestUtilities.conditionalFormStep() + ]) + let mainTaskVC = ORKTaskViewController(task: mainTask, taskRun: nil) + + func simulateAnsweringQuestion(with yesOrNo: Bool) { + let formStepViewController = mainTaskVC.currentStepViewController as! ORKFormStepViewController + let index = (yesOrNo == true) ? 0 : 1 // index 0 == YES, index 1 == NO + formStepViewController.simulateSelectingAnswerAtIndex(index) + } + + func questionStepAnswer(in taskResult: ORKTaskResult) -> Bool? { + let questionStep = taskResult.result(forIdentifier: FormStepTestUtilities.QuestionStepIdentifier) as? ORKStepResult + let questionResult = questionStep?.firstResult as? ORKQuestionResult + let result = (questionResult?.answer as? NSNumber)?.boolValue + return result + } + + // go to the first step so we can drive the UI to simulate a user responding + mainTaskVC.flipToPage(withIdentifier: mainTask.steps[0].identifier, forward: true, animated: false) + + do { + simulateAnsweringQuestion(with: true) // our visibilityRule evaluates to true when questionStep's answer is true + + // now move to the formStepViewController to have it generate results. + // Those results come from visibilityRules on the formItems that can use the + // questionStep's result in the ongoing task result + mainTaskVC.flipToPage(withIdentifier: mainTask.steps[1].identifier, forward: true, animated: false) + + // test that the taskViewController.result contains everything, including formStep + // results, even for the conditional one + let taskResult = mainTaskVC.result + + // make sure answering the question worked + XCTAssertEqual(questionStepAnswer(in: taskResult), true, "We tried to set the answer to true, but the result wasn't true") + + let stepResult = taskResult.stepResult(forStepIdentifier: FormStepTestUtilities.ConditionalFormStepIdentifier) + XCTAssertNotNil(stepResult?.result(forIdentifier: "item1")) + XCTAssertNotNil(stepResult?.result(forIdentifier: "item2")) + XCTAssertNotNil( + stepResult?.result(forIdentifier: "item3"), + "If the answer to the question step was yes, item3 should be in the result" + ) + } + + // go back to the first step so we can change the answer + mainTaskVC.flipToPage(withIdentifier: mainTask.steps[0].identifier, forward: false, animated: false) + + do { + simulateAnsweringQuestion(with: false) // our visibilityRule evaluates to false when questionStep's answer is false + + mainTaskVC.flipToPage(withIdentifier: mainTask.steps[1].identifier, forward: true, animated: false) + + // test that the taskViewController.result contains everything, including formStep + // results *except* for the conditional ones that should evaluate to NO + let taskResult = mainTaskVC.result + + // make sure answering the question worked + XCTAssertEqual(questionStepAnswer(in: taskResult), false, "We tried to set the answer to false, but the result wasn't false") + + let stepResult = taskResult.stepResult(forStepIdentifier: FormStepTestUtilities.ConditionalFormStepIdentifier) + XCTAssertNotNil(stepResult?.result(forIdentifier: "item1")) + XCTAssertNotNil(stepResult?.result(forIdentifier: "item2")) + XCTAssertNil(stepResult?.result(forIdentifier: "item3"), "formItems with failing conditions shouldn't be in the result") + } + } + + func testEvaluatingTaskResultCurrentStep() throws { + let mainTask = ORKOrderedTask(identifier: "mainTaskIdentifier", steps: [ + FormStepTestUtilities.selfReferentialConditionalFormStep() + ]) + let mainTaskVC = ORKTaskViewController(task: mainTask, taskRun: nil) + + // go to the first step so we can simulate a user responding + mainTaskVC.flipToPage(withIdentifier: mainTask.steps[0].identifier, forward: true, animated: false) + let formStepViewController = mainTaskVC.currentStepViewController as! ORKFormStepViewController + + // make a simulated result + do { + // get the current result from the stepViewController, should be nil + let stepResult = mainTaskVC.currentStepViewController?.result + let questionResult = stepResult?.result(forIdentifier: "item1") as! ORKQuestionResult + XCTAssertNil(questionResult.answer) + + // update the question result to unlock the conditional formItem + formStepViewController.setAnswer(NSNumber(booleanLiteral: true), forIdentifier: questionResult.identifier) + mainTaskVC.stepViewControllerResultDidChange(formStepViewController) + } + + // now see that the conditional form item is present + do { + let stepResult = mainTaskVC.result.stepResult(forStepIdentifier: FormStepTestUtilities.SelfConditionalFormStepIdentifier) + + XCTAssertNotNil(stepResult?.result(forIdentifier: "item1")) + XCTAssertNil((stepResult?.result(forIdentifier: "item2") as? ORKQuestionResult)?.answer) + XCTAssertNotNil(stepResult?.result(forIdentifier: "item3"), "conditional formItem 'item3' should be unlocked by true answer for 'item1'") + } + + // turn the conditional formItem off again by setting the answer to false + do { + // update the question result to unlock the conditional formItem + formStepViewController.setAnswer(NSNumber(booleanLiteral: false), forIdentifier: "item1") + mainTaskVC.stepViewControllerResultDidChange(formStepViewController) + + let stepResult = mainTaskVC.result.stepResult(forStepIdentifier: FormStepTestUtilities.SelfConditionalFormStepIdentifier) + XCTAssertNil(stepResult?.result(forIdentifier: "item3"), "conditional formItem 'item3' should not be visible if item1 is false") + } + } + + func testEvaluationLogic() throws { + let formStep = ORKFormStep(identifier: String(describing: "eligibilityFormStep")) + formStep.title = NSLocalizedString("Conditional Form Items", comment: "") + formStep.isOptional = false + + // Form items + let yesNoAnswerFormat = ORKTextChoiceAnswerFormat( + style: ORKChoiceAnswerStyle.singleChoice, + textChoices: [ + ORKTextChoice(text: "Yup", value: "Yes" as NSString), + ORKTextChoice(text: "Nope", value: "No" as NSString), + ORKTextChoice(text: "hmm", value: "N/A" as NSString) + ] + ) + + let dogsFormItem = ORKFormItem( + identifier: String(describing: "dogsFormItem"), + text: "Do you like dogs?", + answerFormat: ORKTextChoiceAnswerFormat( + style: ORKChoiceAnswerStyle.singleChoice, + textChoices: [ + ORKTextChoice(text: "Yes", value: "Yes" as NSString), + ORKTextChoice(text: "No", value: "No" as NSString), + ORKTextChoice(text: "N/A", value: "N/A" as NSString) + ] + ) + ).optionality(isOptional: false) + + let dogsYesFollowupFormItem = ORKFormItem( + identifier: String(describing: "dogsYesFollowupFormItem"), + text: "Do you like small dogs?", + answerFormat: yesNoAnswerFormat + ).optionality(isOptional: false) + + let dogsNoFollowupFormItem = ORKFormItem( + identifier: String(describing: "dogsNoFollowupFormItem"), + text: "Do you like cats?", + answerFormat: yesNoAnswerFormat + ).optionality(isOptional: false) + + let catsFollowupFormItem = ORKFormItem( + identifier: String(describing: "catsFollowupFormItem"), + text: "Do you like small cats?", + answerFormat: yesNoAnswerFormat + ).optionality(isOptional: false) + + let dogsFormItemResultSelector = ORKResultSelector( + stepIdentifier: String(describing: "eligibilityFormStep"), + resultIdentifier: String(describing: "dogsFormItem") + ) + + let dogsYesPredicate = ORKResultPredicate.predicateForChoiceQuestionResult( + with: dogsFormItemResultSelector, + expectedAnswerValue: "Yes" as NSString + ) + let dogsNoPredicate = ORKResultPredicate.predicateForChoiceQuestionResult( + with: dogsFormItemResultSelector, + expectedAnswerValue: "No" as NSString + ) + + let catsItemResultSelector = ORKResultSelector(stepIdentifier: String(describing: "eligibilityFormStep"), resultIdentifier: String(describing: "dogsNoFollowupFormItem")) + + let catYesPredicate = ORKResultPredicate.predicateForChoiceQuestionResult(with: catsItemResultSelector, expectedAnswerValue: "Yes" as NSString) + + dogsYesFollowupFormItem.visibilityRule = ORKPredicateFormItemVisibilityRule(predicateFormat: dogsYesPredicate.predicateFormat) + dogsNoFollowupFormItem.visibilityRule = ORKPredicateFormItemVisibilityRule(predicateFormat: dogsNoPredicate.predicateFormat) + catsFollowupFormItem.visibilityRule = ORKPredicateFormItemVisibilityRule(predicate: catYesPredicate) + + let taskResult = ORKTaskResult(taskIdentifier: "TaskIdentifier", taskRun: UUID(), outputDirectory: nil) + + formStep.formItems = [ + dogsFormItem, + dogsYesFollowupFormItem, + dogsNoFollowupFormItem, + catsFollowupFormItem, + ] + + for formItem in formStep.formItems! { + if let visibilityRule = formItem.visibilityRule { + XCTAssert(visibilityRule.formItemVisibility(for:taskResult) == false) + } + } + + checkResult(questionId: "dogsFormItem", answer: ["Yes" as NSString] as NSCopying & NSSecureCoding & NSObjectProtocol, formStep: formStep, formItem: dogsYesFollowupFormItem) + + checkResult(questionId: "dogsFormItem", answer: ["No" as NSString] as NSCopying & NSSecureCoding & NSObjectProtocol, formStep: formStep, formItem: dogsNoFollowupFormItem) + + checkResult(questionId: "dogsNoFollowupFormItem", answer: ["Yes" as NSString] as NSCopying & NSSecureCoding & NSObjectProtocol, formStep: formStep, formItem: catsFollowupFormItem) + + } + + func testFormItemForIndexPathSearchPerformance() throws { + let mainTask = ORKOrderedTask(identifier: "mainTaskIdentifier", steps: [ + FormStepTestUtilities.longFormStep() + ]) + let mainTaskVC = ORKTaskViewController(task: mainTask, taskRun: nil) + + // go to the first step so we can simulate a user responding + mainTaskVC.flipToPage(withIdentifier: mainTask.steps[0].identifier, forward: true, animated: false) + let formStepViewController = mainTaskVC.currentStepViewController as! ORKFormStepViewController + + self.measure { + for i in 0...50 { + formStepViewController._formItem(for: IndexPath(row: 0, section: i)) + } + } + } + + // MARK: Utilities - + + func checkResult(questionId: String, answer: NSCopying & NSSecureCoding & NSObjectProtocol, formStep: ORKFormStep, formItem: ORKFormItem) { + let result = ORKTaskResult(taskIdentifier: "TaskIdentifier", taskRun: UUID(), outputDirectory: nil) + + let choiceResult = ORKChoiceQuestionResult(identifier: questionId) + choiceResult.answer = answer as any NSCopying & NSSecureCoding & NSObjectProtocol + + result.results = [ORKStepResult(stepIdentifier: formStep.identifier, results: [choiceResult])] + + XCTAssertTrue(formItem.visibilityRule!.formItemVisibility(for: result)) + } + + func checkTextResult(questionId: String, answer: NSCopying & NSSecureCoding & NSObjectProtocol, formStep: ORKFormStep, formItem: ORKFormItem) { + let result = ORKTaskResult(taskIdentifier: "TaskIdentifier", taskRun: UUID(), outputDirectory: nil) + + let choiceResult = ORKTextQuestionResult(identifier: questionId) + choiceResult.answer = answer as any NSCopying & NSSecureCoding & NSObjectProtocol + + result.results = [ORKStepResult(stepIdentifier: formStep.identifier, results: [choiceResult])] + + XCTAssertTrue(formItem.visibilityRule!.formItemVisibility(for: result)) + } + +} + +extension ORKFormStep { + convenience init(identifier: String, formItems: [ORKFormItem]) { + self.init(identifier: identifier) + self.formItems = formItems + } +} + +extension ORKFormItem { + func formItemSettingVisibilityRule(_ predicate: NSPredicate) -> ORKFormItem { + self.visibilityRule = ORKPredicateFormItemVisibilityRule(predicate: predicate) + return self + } + + func optionality(isOptional: Bool) -> Self { + self.isOptional = isOptional + return self + } +} + +extension ORKFormStepViewController { + func simulateSelectingAnswerAtIndex(_ index: Int) { + let answerIndexPath = IndexPath(row: index, section: 0) + + _manuallyLoadView() + _buildDataSourceAndApplySnapshot() + _manuallyScrollToRow(at: answerIndexPath) + _manuallySelectCell(at: answerIndexPath) + } + + func _manuallyLoadView() { + self.loadView() + self.viewDidLoad() + } + + func _buildDataSourceAndApplySnapshot() { + let dataSource = tableView.dataSource as! UITableViewDiffableDataSourceReference + self.build(dataSource) + dataSource.applySnapshot(dataSource.snapshot(), animatingDifferences: false) + } + + func _manuallyScrollToRow(at indexPath: IndexPath) { + self.tableView.scrollToRow(at: indexPath, at: .top, animated: false) + } + + func _manuallySelectCell(at indexPath: IndexPath) { + let tableViewDelegate = self as! UITableViewDelegate + tableViewDelegate.tableView?(tableView, didSelectRowAt: indexPath) + } +} + +fileprivate struct FormStepTestUtilities { + + static let FormStepIdentifier = "Identifier: Plain old FormStep" + static let ConditionalFormStepIdentifier = "Identifier: FormStep with conditional form items" + static let SelfConditionalFormStepIdentifier = "Identifier: FormStep with self-referential conditional form items" + static let QuestionStepIdentifier = "Identifier: This is a simple question step" + + static let SectionTitle = "Title: This is a Section" + + static func simpleFormStep() -> ORKFormStep { + let step = ORKFormStep(identifier: FormStepIdentifier, formItems: [ + ORKFormItem(sectionTitle: SectionTitle), // section should not be answerable + ORKFormItem(identifier: "item1", text:"none", answerFormat: .booleanAnswerFormat(), optional: true), + ORKFormItem(identifier: "item2", text: "text", answerFormat: ORKTextAnswerFormat()), + ORKFormItem(identifier: "item3", text: "more text", answerFormat: ORKTextAnswerFormat()) + ]) + return step + } + + // formStep with 50 formItems + static func longFormStep() -> ORKFormStep { + let formItems: [ORKFormItem] = [1...50] + .flatMap({ $0 }) + .compactMap({ index in + ORKFormItem(identifier: "Item \(index)", text: "Option \(index)", answerFormat: ORKTextAnswerFormat()) + }) + let step = ORKFormStep(identifier: SelfConditionalFormStepIdentifier, formItems: formItems) + return step + } + + static func simpleFormStepWithTextChoices() -> ORKFormStep { + let step = ORKFormStep(identifier: FormStepIdentifier, formItems: [ + ORKFormItem(sectionTitle: SectionTitle), // section should not be answerable + ORKFormItem(identifier: "item1", text:"none", answerFormat: ORKTextChoiceAnswerFormat( + style: .singleChoice, + textChoices: [ORKTextChoice(text: "option 1", value: "option 1" as NSString), + ORKTextChoiceOther.choice(withText: "choice 7", detailText: "detail 7", value: "choice 7" as NSString, exclusive: true, textViewPlaceholderText: "enter additional information") + ]), + optional: true), + ]) + return step + } + + // this formStep has a formItem that's conditional on a previous step's results + static func conditionalFormStep() -> ORKFormStep { + let step = ORKFormStep(identifier: ConditionalFormStepIdentifier, formItems: [ + ORKFormItem(sectionTitle: SectionTitle), // section should not be answerable + ORKFormItem(identifier: "item1", text:"none", answerFormat: .booleanAnswerFormat(), optional: true), + ORKFormItem(identifier: "item2", text: "text", answerFormat: ORKTextAnswerFormat()), + ORKFormItem(identifier: "item3", text: "more text", answerFormat: ORKTextAnswerFormat()) + .formItemSettingVisibilityRule( + ORKResultPredicate.predicateForBooleanQuestionResult( + with: ORKResultSelector( + stepIdentifier: QuestionStepIdentifier, + resultIdentifier: QuestionStepIdentifier + ), + expectedAnswer: true + ) + ) + ]) + return step + } + + // this formStep has a formItem that's conditional on its own step's results + static func selfReferentialConditionalFormStep() -> ORKFormStep { + let step = ORKFormStep(identifier: SelfConditionalFormStepIdentifier, formItems: [ + ORKFormItem(sectionTitle: SectionTitle), // section should not be answerable + ORKFormItem(identifier: "item1", text:"none", answerFormat: .booleanAnswerFormat(), optional: true), + ORKFormItem(identifier: "item2", text: "text", answerFormat: ORKTextAnswerFormat()), + ORKFormItem(identifier: "item3", text: "more text", answerFormat: ORKTextAnswerFormat()) + .formItemSettingVisibilityRule( + ORKResultPredicate.predicateForBooleanQuestionResult( + with: ORKResultSelector( + stepIdentifier: SelfConditionalFormStepIdentifier, + resultIdentifier: "item1" + ), + expectedAnswer: true + ) + ) + ]) + return step + } + + static func simpleBooleanFormStep() -> ORKFormStep { + let booleanFormItem = ORKFormItem(identifier: QuestionStepIdentifier, text: "none", answerFormat: .booleanAnswerFormat()) + let formStep = ORKFormStep(identifier: QuestionStepIdentifier, formItems: [booleanFormItem]) + + return formStep + + } + +} diff --git a/ResearchKitTests/ORKHKSampleTests.m b/ResearchKitTests/ORKHKSampleTests.m index 40b9331797..78386885f0 100644 --- a/ResearchKitTests/ORKHKSampleTests.m +++ b/ResearchKitTests/ORKHKSampleTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; #import "HKSample+ORKJSONDictionary.h" @@ -42,6 +42,7 @@ @interface ORKHKSampleTests : XCTestCase @implementation ORKHKSampleTests +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION - (void)testHKSampleSerialization { NSDate *d1 = [NSDate dateWithTimeIntervalSinceReferenceDate:0]; NSDate *d2 = [NSDate dateWithTimeInterval:10 sinceDate:d1]; @@ -107,5 +108,5 @@ - (void)testHKCorrelationSerialization { XCTAssertTrue([dict[@"objects"] containsObject:dd], @""); XCTAssertTrue([dict[@"objects"] containsObject:ds], @""); } - +#endif @end diff --git a/ResearchKitTests/ORKHealthKitQuestionStepViewControllerTests.swift b/ResearchKitTests/ORKHealthKitQuestionStepViewControllerTests.swift new file mode 100644 index 0000000000..6768e6aa30 --- /dev/null +++ b/ResearchKitTests/ORKHealthKitQuestionStepViewControllerTests.swift @@ -0,0 +1,134 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import XCTest +import ResearchKit_Private + +final class ORKHealthKitQuestionStepViewControllerTests: XCTestCase { + var testController: ORKStepViewController! + var step: ORKStep! + var result: ORKResult! + var negativeTest: Bool! + var forwardExpectation: XCTestExpectation! + var reverseExpectation: XCTestExpectation! + var appearExpectation: XCTestExpectation! + var failExpectation: XCTestExpectation! + var recorderExpectation: XCTestExpectation! + var testingWillExpectation: Bool! + var utilities: TopLevelUIUtilities! + private let weight = HKObjectType.quantityType(forIdentifier: .bodyMass)! + + override func setUp() { + super.setUp() + negativeTest = false + testingWillExpectation = false + + step = ORKStep(identifier: "STEP") + result = ORKResult(identifier: "RESULT") + testController = ORKStepViewController(step: step, result: result) + testController.delegate = self + + utilities = TopLevelUIUtilities() + utilities.setupTopLevelUI(withViewController: testController) + } + + func testHealthKitAnswerFormats() { + let healthAnswerFormats = [ + ORKHealthKitQuantityTypeAnswerFormat(quantityType: HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)!, unit: HKUnit.gramUnit(with: .kilo), style: .decimal), + ORKHealthKitQuantityTypeAnswerFormat(quantityType: HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.height)!, unit: HKUnit.meterUnit(with: .centi), style: .integer) + ] + + for answerFormat in healthAnswerFormats { + let healthKitStep = ORKQuestionStep(identifier: String(describing: "HealthKitStep"), title: NSLocalizedString("Some Title", comment: ""), question: "Some Question", answer: answerFormat) + helperTestHealthKit(healthKitStep: healthKitStep) + } + } + + func helperTestHealthKit(healthKitStep: ORKQuestionStep) { + testController = ORKQuestionStepViewController(step: healthKitStep) + testController.delegate = self + + utilities = TopLevelUIUtilities() + utilities.setupTopLevelUI(withViewController: testController) + + testController.stepDidChange() + // Test that [self hasAnswer] && self.hasChangedAnswer are false + XCTAssertNil((testController as! ORKQuestionStepViewController).answer()) + XCTAssertFalse((testController as! ORKQuestionStepViewController).hasChangedAnswer()) + + // Simulating picker update to a value of 50 + (testController as! ORKQuestionStepViewController).testAnswerDidChange(to: 50.0) + + // Test that [self hasAnswer] has a value + XCTAssertEqual((testController as! ORKQuestionStepViewController).answer() as! Double, 50.0) + // && self.hasChangedAnswer is true + XCTAssertTrue((testController as! ORKQuestionStepViewController).hasChangedAnswer()) + } + +} + +extension ORKHealthKitQuestionStepViewControllerTests: ORKStepViewControllerDelegate { + func stepViewController(_ stepViewController: ORKStepViewController, didFinishWith direction: ORKStepViewControllerNavigationDirection) { + if direction == .forward { + forwardExpectation.fulfill() + } else { + reverseExpectation.fulfill() + } + } + + func stepViewControllerWillAppear(_ stepViewController: ORKStepViewController) { + if testingWillExpectation { + appearExpectation.fulfill() + } + } + + func stepViewControllerResultDidChange(_ stepViewController: ORKStepViewController) { + // pass + } + + func stepViewControllerDidFail(_ stepViewController: ORKStepViewController, withError error: Error?) { + failExpectation.fulfill() + } + + func stepViewController(_ stepViewController: ORKStepViewController, recorder: ORKRecorder, didFailWithError error: Error) { + recorderExpectation.fulfill() + } + + func stepViewControllerHasNextStep(_ stepViewController: ORKStepViewController) -> Bool { + if negativeTest { return false } + return true + } + + func stepViewControllerHasPreviousStep(_ stepViewController: ORKStepViewController) -> Bool { + if negativeTest { return false } + return true + } +} + diff --git a/ResearchKitTests/ORKInstructionStepHTMLFormatterTests.m b/ResearchKitTests/ORKInstructionStepHTMLFormatterTests.m new file mode 100644 index 0000000000..b01835ef39 --- /dev/null +++ b/ResearchKitTests/ORKInstructionStepHTMLFormatterTests.m @@ -0,0 +1,109 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +@import XCTest; +@import ResearchKit; + +#import "ORKInstructionStepHTMLFormatter.h" + +@interface ORKInstructionStepHTMLFormatterTests : XCTestCase + +@property (nonatomic, strong) ORKInstructionStep *instructionStep; +@property (nonatomic, strong) ORKInstructionStepHTMLFormatter *formatter; + +@end + +@implementation ORKInstructionStepHTMLFormatterTests + +- (void)setUp { + [super setUp]; + + _instructionStep = [[ORKInstructionStep alloc] initWithIdentifier:@"InstructionStepIdentifier"]; + _formatter = [ORKInstructionStepHTMLFormatter new]; +} + +- (void)testInstructionStepTitle { + NSString *instructionStepTitle = @"Welcome to our study!"; + _instructionStep.title = instructionStepTitle; + NSString *html = [_formatter HTMLForInstructionSteps:@[_instructionStep]]; + + XCTAssert([html containsString:instructionStepTitle]); +} + +- (void)testInstructionStepDetailText { + NSString *instructionStepDetailText = @"Learn more by clicking viewing the information below."; + _instructionStep.detailText = instructionStepDetailText; + NSString *html = [_formatter HTMLForInstructionSteps:@[_instructionStep]]; + + XCTAssert([html containsString:instructionStepDetailText]); +} + +- (void)testInstructionStepIconImage { + _instructionStep.iconImage = [UIImage systemImageNamed:@"hand.wave"]; + NSString *html = [_formatter HTMLForInstructionSteps:@[_instructionStep]]; + + XCTAssert([html containsString:@"
"]); +} + +- (void)testInstructionStepImage { + _instructionStep.image = [UIImage systemImageNamed:@"hand.wave"]; + NSString *html = [_formatter HTMLForInstructionSteps:@[_instructionStep]]; + + XCTAssert([html containsString:@" +#import +#import +#import +#import +#import #import "ORKESerialization.h" - #import +static BOOL ORKIsResearchKitClass(Class class) { + NSString *name = NSStringFromClass(class); + return [name hasPrefix:@"ORK"]; +} + + @interface TestCompilerFlagHelper : NSObject + (NSArray *)_fetchExclusionList; @@ -46,7 +55,17 @@ @implementation TestCompilerFlagHelper + (NSArray *)_fetchExclusionList { NSArray *classesToExclude = @[]; - + +#if !ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + NSArray *locationClasses = @[ + @"ORKLocation", + @"ORKLocationQuestionResult", + @"ORKLocationAnswerFormat", + @"ORKLocationRecorderConfiguration" + ]; + + classesToExclude = [classesToExclude arrayByAddingObjectsFromArray:locationClasses]; +#endif return classesToExclude; @@ -76,6 +95,12 @@ - (instancetype)initWithObjcProperty:(objc_property_t)property; @end +@interface ORKDateAnswerFormat () + +- (void)_setCurrentDateOverride:(NSDate *)currentDateOverride; + +@end + @implementation ClassProperty @@ -247,6 +272,7 @@ - (instancetype)orktest_init_alt { \ ORK_MAKE_TEST_INIT(ORKTaskResult, ^{return [self initWithTaskIdentifier:[NSUUID UUID].UUIDString taskRunUUID:[NSUUID UUID] outputDirectory:nil];}); ORK_MAKE_TEST_INIT(ORKStepNavigationRule, ^{return [super init];}); ORK_MAKE_TEST_INIT(ORKSkipStepNavigationRule, ^{return [super init];}); +ORK_MAKE_TEST_INIT(ORKFormItemVisibilityRule, ^{return [super init];}); ORK_MAKE_TEST_INIT(ORKStepModifier, ^{return [super init];}); ORK_MAKE_TEST_INIT(ORKKeyValueStepModifier, ^{return [super init];}); ORK_MAKE_TEST_INIT(ORKAnswerFormat, ^{return [super init];}); @@ -256,12 +282,23 @@ - (instancetype)orktest_init_alt { \ ORK_MAKE_TEST_INIT(ORKStep, ^{return [self initWithIdentifier:[NSUUID UUID].UUIDString];}); ORK_MAKE_TEST_INIT(ORKReviewStep, ^{return [[self class] standaloneReviewStepWithIdentifier:[NSUUID UUID].UUIDString steps:@[] resultSource:[[ORKTaskResult alloc] orktest_init]];}); ORK_MAKE_TEST_INIT(ORKOrderedTask, ^{return [self initWithIdentifier:@"test1" steps:nil];}); +ORK_MAKE_TEST_INIT(ORKWebViewStep, ^{ + ORKWebViewStep *webViewStep = [ORKWebViewStep webViewStepWithIdentifier:@"test1" html:@""]; + return webViewStep; +}); +ORK_MAKE_TEST_INIT(ORK3DModelStep, ^{return [[self.class alloc] initWithIdentifier:NSUUID.UUID.UUIDString modelManager: [[ORK3DModelManager alloc] init]]; }); +ORK_MAKE_TEST_INIT(ORKAgeAnswerFormat, ^{return [self initWithMinimumAge:0 maximumAge:80 minimumAgeCustomText:nil maximumAgeCustomText:nil showYear:NO useYearForResult:NO treatMinAgeAsRange:false treatMaxAgeAsRange:false defaultValue:0];}); ORK_MAKE_TEST_INIT(ORKImageChoice, ^{return [super init];}); +ORK_MAKE_TEST_INIT(ORKColorChoice, ^{return [super init];}); ORK_MAKE_TEST_INIT(ORKTextChoice, ^{return [super init];}); ORK_MAKE_TEST_INIT(ORKTextChoiceOther, ^{return [self initWithText:@"test" primaryTextAttributedString:nil detailText:@"test1" detailTextAttributedString:nil value:@"value" exclusive:YES textViewPlaceholderText:@"test2" textViewInputOptional:NO textViewStartsHidden:YES];}); ORK_MAKE_TEST_INIT(ORKPredicateStepNavigationRule, ^{return [self initWithResultPredicates:@[[ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:[ORKResultSelector selectorWithResultIdentifier:@"test"] expectedAnswer:YES]] destinationStepIdentifiers:@[@"test2"]];}); +ORK_MAKE_TEST_INIT(ORKPredicateFormItemVisibilityRule, ^{ NSPredicate* predicate = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:[ORKResultSelector selectorWithResultIdentifier:@"test"] expectedAnswer:YES]; + ORKPredicateFormItemVisibilityRule* predicateRule = [self initWithPredicate:predicate]; + return predicateRule; +}); ORK_MAKE_TEST_INIT(ORKResultSelector, ^{return [self initWithResultIdentifier:@"resultIdentifier"];}); ORK_MAKE_TEST_INIT(ORKRecorderConfiguration, ^{return [self initWithIdentifier:@"testRecorder"];}); ORK_MAKE_TEST_INIT(ORKAccelerometerRecorderConfiguration, ^{return [super initWithIdentifier:@"testRecorder"];}); @@ -275,6 +312,8 @@ - (instancetype)orktest_init_alt { \ ORK_MAKE_TEST_INIT_ALT(CLCircularRegion, (^{ return [self initWithCenter:CLLocationCoordinate2DMake(3.0, 4.0) radius:150.0 identifier:@"identifier"]; })); + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION ORK_MAKE_TEST_INIT(ORKLocation, (^{ CNMutablePostalAddress *postalAddress = [[CNMutablePostalAddress alloc] init]; postalAddress.city = @"cityA"; @@ -289,6 +328,8 @@ - (instancetype)orktest_init_alt { \ ORKLocation *location = [self initWithCoordinate:CLLocationCoordinate2DMake(4.0, 5.0) region:[[CLCircularRegion alloc] orktest_init_alt] userInput:@"addressStringB" postalAddress:postalAddress]; return location; })); +#endif + ORK_MAKE_TEST_INIT(HKSampleType, (^{ return [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass]; })); @@ -335,6 +376,7 @@ - (void)reset; @end + @implementation ORKJSONTestImageSerialization { NSMutableDictionary *_imageTable; NSMutableDictionary *_reverseImageTable; @@ -383,6 +425,7 @@ - (nullable NSDictionary *)referenceBySavingImage:(UIImage *)image { @end + @interface _ORKTestNoAnswer : ORKNoAnswer + (instancetype)answer; @@ -429,6 +472,7 @@ - (id)init { _classesExcludedForORKESerialization = @[ [ORKStepNavigationRule class], // abstract base class [ORKSkipStepNavigationRule class], // abstract base class + [ORKFormItemVisibilityRule class], // abstract base class [ORKStepModifier class], // abstract base class [ORKPredicateSkipStepNavigationRule class], // NSPredicate doesn't yet support JSON serialization [ORKKeyValueStepModifier class], // NSPredicate doesn't yet support JSON serialization @@ -437,11 +481,11 @@ - (id)init { [ORKHealthCorrelationCollector class], [ORKMotionActivityCollector class], [ORKShoulderRangeOfMotionStep class], + [ORKCustomStep class], [ORKTouchAbilityPinchStep class], [ORKTouchAbilitySwipeStep class], [ORKTouchAbilityTapResult class], - [ORKCustomStep class], - [ORKDataCollectionState class], + [ORKTouchAbilityTouchTracker class], [ORKTouchAbilityRotationStep class], [ORKTouchAbilityLongPressStep class], [ORKTouchAbilityScrollStep class], @@ -450,8 +494,7 @@ - (id)init { [ORKTouchAbilityLongPressResult class], [ORKTouchAbilitySwipeResult class], [ORKTouchAbilityScrollResult class] - - ]; + ]; _propertyExclusionList = @[ @"superclass", @@ -467,6 +510,8 @@ - (id)init { @"textViewText", @"ORKBodyItem.customButtonConfigurationHandler", @"ORKConsentSection.image", + @"ORKConsentDocument.instructionSteps", + @"ORKFormItem.visibilityRule", @"ORKNavigablePageStep.steps", @"ORKPageStep.steps", @"ORKRegistrationStep.passcodeValidationRegex", @@ -477,16 +522,19 @@ - (id)init { @"ORKFrontFacingCameraTask.fileURL", @"ORKTaskResult.outputDirectory", @"ORKPageResult.outputDirectory", + @"ORKPredicateFormItemVisibilityRule.predicateFormat", // Prevent trying to assign a bogus empty string as predicateFormat during testing @"ORKAccuracyStroopStep.actualDisplayColor", @"ORKAccuracyStroopResult.didSelectCorrectColor", @"ORKAccuracyStroopResult.timeTakenToSelect", - @"ORKDataCollectionState.archiveVersion", + @"ORKWebViewStepResult.html", + @"ORKWebViewStepResult.htmlWithSignature" ]; _knownNotSerializedProperties = @[ @"ORKActiveStep.image", @"ORKAmslerGridResult.image", + @"ORKAnswerFormat.formStepViewControllerCellClass", @"ORKAnswerFormat.healthKitUnit", @"ORKAnswerFormat.healthKitUserUnit", @"ORKAnswerFormat.questionType", @@ -502,12 +550,12 @@ - (id)init { @"ORKConsentSection.escapedContent", @"ORKConsentSection.image", @"ORKConsentSignature.signatureImage", + @"ORKConsentDocument.instructionSteps", @"ORKContinuousScaleAnswerFormat.maximumImage", @"ORKContinuousScaleAnswerFormat.minimumImage", @"ORKContinuousScaleAnswerFormat.numberFormatter", @"ORKCustomStep.contentView", // UIView is not able to be serialized @"ORKDataResult.data", - @"ORKDataCollectionState.archiveVersion", @"ORKFormItem.step", // weak ref - object will be nil @"ORKHealthClinicalTypeRecorderConfiguration.healthClinicalType", @"ORKHealthClinicalTypeRecorderConfiguration.healthFHIRResourceType", @@ -520,6 +568,7 @@ - (id)init { @"ORKInstructionStep.auxiliaryImage", @"ORKInstructionStep.iconImage", @"ORKInstructionStep.image", + @"ORKInstructionStep.type", @"ORKLoginStep.loginViewControllerClass", @"ORKNavigablePageStep.steps", @"ORKNumericAnswerFormat.defaultNumericAnswer", @@ -527,6 +576,7 @@ - (id)init { @"ORKOrderedTask.providesBackgroundAudioPrompts", @"ORKOrderedTask.requestedPermissions", @"ORKPageStep.steps", + @"ORKPredicateFormItemVisibilityRule.predicate", // roundtripping format->predicate->format is unsupported in NSPredicate, so no point in serializing the predicate as text. @"ORKQuestionResult.answer", @"ORKQuestionStep.question", @"ORKQuestionStep.questionType", @@ -559,6 +609,9 @@ - (id)init { @"ORKTextAnswerFormat.passwordRules", @"ORKTextAnswerFormat.spellCheckingType", @"ORKTextAnswerFormat.textContentType", + @"ORKColorChoice.value", + @"ORKColorChoice.value", + @"ORKHealthCondition.value", @"ORKTextChoice.detailTextAttributedString", @"ORKTextChoice.primaryTextAttributedString", @"ORKTextChoice.value", @@ -567,13 +620,15 @@ - (id)init { @"ORKTimeIntervalAnswerFormat.defaultInterval", @"ORKTimeIntervalAnswerFormat.maximumInterval", @"ORKTimeIntervalAnswerFormat.step", + @"ORKTouchAbilityTouchTracker.delegate", @"ORKVerificationStep.verificationViewControllerClass", @"ORKVideoCaptureStep.templateImage", @"ORKWeightAnswerFormat.useMetricSystem", @"ORKWebViewStep.customViewProvider", @"ORKLearnMoreItem.delegate", @"ORKSpeechRecognitionResult.recognitionMetadata", - @"ORKAccuracyStroopStep.actualDisplayColor" + @"ORKAccuracyStroopStep.actualDisplayColor", + @"ORKAudioStreamerConfiguration.bypassAudioEngineStart" ]; @@ -601,47 +656,46 @@ - (id)init { } + (NSArray *)_classesWithSecureCoding { - // classes not intended to be serialized standalone - NSMutableArray *stringsForClassesExcluded = [NSMutableArray array]; - - [stringsForClassesExcluded addObject:@"ORKFreehandDrawingGestureRecognizer"]; - [stringsForClassesExcluded addObject:@"ORKSignatureGestureRecognizer"]; - [stringsForClassesExcluded addObject:@"ORKTouchGestureRecognizer"]; - [stringsForClassesExcluded addObject:@"ORKHealthClinicalTypeRecorderConfiguration"]; - [stringsForClassesExcluded addObject:@"ORKUSDZModelManagerScene"]; - [stringsForClassesExcluded addObject:@"ORKBlurFooterView"]; - [stringsForClassesExcluded addObject:@"ORKFrontFacingCameraStepOptionsView"]; - [stringsForClassesExcluded addObject:@"ORKNoAnswer"]; - [stringsForClassesExcluded addObject:@"ORKDataCollectionState"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTouch"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTouch"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTrack"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTrial"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTapStep"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTapTrial"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityPinchStep"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilitySwipeStep"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTapResult"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityPinchTrial"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityLongPressTrial"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityScrollTrial"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityRotationTrial"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilitySwipeTrial"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityGestureRecoginzerEvent"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityRotationGestureRecoginzerEvent"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityPinchGestureRecoginzerEvent"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilitySwipeGestureRecoginzerEvent"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityPanGestureRecoginzerEvent"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityLongPressGestureRecoginzerEvent"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityTapGestureRecoginzerEvent"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityRotationStep"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityLongPressStep"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityScrollStep"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityPinchResult"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityRotationResult"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityLongPressResult"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilitySwipeResult"]; - [stringsForClassesExcluded addObject:@"ORKTouchAbilityScrollResult"]; + // Classes not intended to be serialized standalone + NSArray *excludedClassNames = @[ + @"ORKFreehandDrawingGestureRecognizer", + @"ORKSignatureGestureRecognizer", + @"ORKTouchGestureRecognizer", + @"ORKHealthClinicalTypeRecorderConfiguration", + @"ORKUSDZModelManagerScene", + @"ORKBlurFooterView", + @"ORKFrontFacingCameraStepOptionsView", + @"ORKNoAnswer", + @"ORKTouchAbilityTouch", + @"ORKTouchAbilityTouch", + @"ORKTouchAbilityTrack", + @"ORKTouchAbilityTrial", + @"ORKTouchAbilityTapStep", + @"ORKTouchAbilityTapTrial", + @"ORKTouchAbilityPinchStep", + @"ORKTouchAbilitySwipeStep", + @"ORKTouchAbilityTapResult", + @"ORKTouchAbilityPinchTrial", + @"ORKTouchAbilityLongPressTrial", + @"ORKTouchAbilityScrollTrial", + @"ORKTouchAbilityRotationTrial", + @"ORKTouchAbilitySwipeTrial", + @"ORKTouchAbilityGestureRecoginzerEvent", + @"ORKTouchAbilityRotationGestureRecoginzerEvent", + @"ORKTouchAbilityPinchGestureRecoginzerEvent", + @"ORKTouchAbilitySwipeGestureRecoginzerEvent", + @"ORKTouchAbilityPanGestureRecoginzerEvent", + @"ORKTouchAbilityLongPressGestureRecoginzerEvent", + @"ORKTouchAbilityTapGestureRecoginzerEvent", + @"ORKTouchAbilityRotationStep", + @"ORKTouchAbilityLongPressStep", + @"ORKTouchAbilityScrollStep", + @"ORKTouchAbilityPinchResult", + @"ORKTouchAbilityRotationResult", + @"ORKTouchAbilityLongPressResult", + @"ORKTouchAbilitySwipeResult", + @"ORKTouchAbilityScrollResult" + ]; // Find all classes that conform to NSSecureCoding @@ -651,12 +705,10 @@ - (id)init { numClasses = objc_getClassList(classes, numClasses); for (int index = 0; index < numClasses; index++) { Class aClass = classes[index]; - - if ([stringsForClassesExcluded containsObject:NSStringFromClass(aClass)]) { + if ([excludedClassNames containsObject:NSStringFromClass(aClass)]) { continue; } - - if ([NSStringFromClass(aClass) hasPrefix:@"ORK"] && + if (ORKIsResearchKitClass(aClass) && [aClass conformsToProtocol:@protocol(NSSecureCoding)]) { [classesWithSecureCoding addObject:aClass]; } @@ -735,7 +787,7 @@ - (void)testTaskModel { ORKESerializationPropertyInjector *ORKSerializationTestPropertyInjector(void); -ORKESerializationPropertyInjector *ORKSerializationTestPropertyInjector() { +ORKESerializationPropertyInjector *ORKSerializationTestPropertyInjector(void) { NSString *bundlePath = [[NSBundle bundleForClass:[ORKJSONSerializationTests class]] pathForResource:@"samples" ofType:@"bundle"]; NSBundle *bundle = [NSBundle bundleWithPath:bundlePath]; @@ -820,7 +872,7 @@ - (void)testORKSampleDeserialization { XCTAssertNotNil(instance); XCTAssertEqualObjects(NSStringFromClass([instance class]), className); } - + context.imageProvider = nil; // Decode with image decoding failing and returning nil instead of an image: silently suppress the failure @@ -857,7 +909,6 @@ - (void)testORKSampleDeserialization { // JSON Serialization - (void)testORKSerialization { ORKJSONTestImageSerialization *testImageSerialization = [[ORKJSONTestImageSerialization alloc] init]; - ORKESerializationContext *context = [[ORKESerializationContext alloc] initWithLocalizer:nil imageProvider:testImageSerialization stringInterpolator:nil propertyInjector:ORKSerializationTestPropertyInjector()]; ORKJSONSerializationTestConfiguration *testConfiguration = [[ORKJSONSerializationTestConfiguration alloc] init]; @@ -866,15 +917,17 @@ - (void)testORKSerialization { // All classes that conform to NSSecureCoding should also support ORKESerialization NSArray *classesWithSecureCoding = testConfiguration.classesWithSecureCoding; + classesWithSecureCoding = [classesWithSecureCoding filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { + NSString *classString = NSStringFromClass(evaluatedObject); + return ![classString containsString:@"ORKMock"]; + }]]; NSArray *classesExcludedForORKESerialization = testConfiguration.classesExcludedForORKESerialization; - if ((classesExcludedForORKESerialization.count + classesWithORKSerialization.count) != classesWithSecureCoding.count) { - NSMutableArray *unregisteredList = [classesWithSecureCoding mutableCopy]; - [unregisteredList removeObjectsInArray:classesWithORKSerialization]; - [unregisteredList removeObjectsInArray:classesExcludedForORKESerialization]; - XCTAssertEqual(unregisteredList.count, 0, @"Classes didn't implement ORKSerialization %@", unregisteredList); - } + NSMutableArray *unregisteredList = [classesWithSecureCoding mutableCopy]; + [unregisteredList removeObjectsInArray:classesWithORKSerialization]; + [unregisteredList removeObjectsInArray:classesExcludedForORKESerialization]; + XCTAssertEqual(unregisteredList.count, 0, @"Classes didn't implement ORKSerialization %@", unregisteredList); // Predefined exception NSArray *propertyExclusionList = testConfiguration.propertyExclusionList; @@ -882,11 +935,14 @@ - (void)testORKSerialization { NSArray *allowedUnTouchedKeys = testConfiguration.allowedUnTouchedKeys; NSDictionary *mutallyExclusiveProperties = testConfiguration.mutuallyExclusiveProperties; + // Override date for date format testing + NSDate *dateFormatOverrideDate = [NSDate dateWithTimeIntervalSinceReferenceDate:6000]; + // Test Each class for (Class aClass in classesWithORKSerialization) { NSString *className = NSStringFromClass(aClass); NSArray *classMutuallyExclusiveProperties = mutallyExclusiveProperties[className]; - + id instance = [self instanceForClass:aClass]; // Find all properties of this class @@ -959,6 +1015,25 @@ - (void)testORKSerialization { [instance setValue:NSStringFromClass([ORKVerificationStepViewController class]) forKey:@"verificationViewControllerString"]; } else if ([aClass isSubclassOfClass:[ORKReviewStep class]]) { [instance setValue:[[ORKTaskResult alloc] orktest_init] forKey:@"resultSource"]; // Manually add here because it's a protocol and hence property doesn't have a class + } else if ([aClass isSubclassOfClass:ORK3DModelStep.class]) { + // as above, also a protocol + [instance setValue:[[ORK3DModelManager alloc] init] forKey:@"modelManager"]; + } else if ([aClass isSubclassOfClass:[ORKPredicateFormItemVisibilityRule class]]) { + // predicateFormat cannot be an empty sring for deserialization to work + [instance setValue:@"$title == 'testSerialization' && $className == 'ORKPredicateFormItemVisibilityRule'" forKey:@"predicateFormat"]; + } else if ([aClass isSubclassOfClass:[ORKDateAnswerFormat class]]) { + // Seems to be unstable for some input timestamps + [instance setValue:dateFormatOverrideDate forKey:@"defaultDate"]; + [(ORKDateAnswerFormat *)instance _setCurrentDateOverride:dateFormatOverrideDate]; + [(ORKDateAnswerFormat *)instance setDaysAfterCurrentDateToSetMinimumDate:1]; + [(ORKDateAnswerFormat *)instance setDaysBeforeCurrentDateToSetMinimumDate:1]; + } else if ([aClass isSubclassOfClass:[ORKAgeAnswerFormat class]]) { + [instance setValue:@(0) forKey:@"minimumAge"]; + [instance setValue:@(80) forKey:@"maximumAge"]; + [instance setValue:@(0) forKey:@"defaultValue"]; + [instance setValue:@(2023) forKey:@"relativeYear"]; + } else if ([aClass isSubclassOfClass:[ORKColorChoice class]]) { + [instance setValue:@"blah" forKey:@"value"]; } // Serialization @@ -994,6 +1069,14 @@ - (void)testORKSerialization { id instance2 = [ORKESerializer objectFromJSONObject:mockDictionary context:context error:NULL]; + if ([instance2 isKindOfClass:[ORKDateAnswerFormat class]]) { + ORKDateAnswerFormat *dateAnswerFormatInstance = (ORKDateAnswerFormat *)instance2; + [dateAnswerFormatInstance _setCurrentDateOverride:dateFormatOverrideDate]; + [dateAnswerFormatInstance setDaysAfterCurrentDateToSetMinimumDate:dateAnswerFormatInstance.daysAfterCurrentDateToSetMinimumDate]; + [dateAnswerFormatInstance setDaysBeforeCurrentDateToSetMinimumDate:dateAnswerFormatInstance.daysBeforeCurrentDateToSetMinimumDate]; + } + + NSArray *untouchedKeys = [mockDictionary untouchedKeys]; // Make sure all keys are touched by initializer @@ -1006,7 +1089,13 @@ - (void)testORKSerialization { // Serialize again, the output ought to be equal NSDictionary *dictionary2 = [ORKESerializer JSONObjectForObject:instance2 context:context error:NULL]; BOOL isMatch = [mockDictionary isEqualToDictionary:dictionary2]; + if ([aClass isSubclassOfClass:[ORKDateAnswerFormat class]]) { + NSLog(@"%@: Initial dictionary: %@", NSStringFromClass(aClass), instanceDictionary); + NSLog(@"%@: Dict after deserializing and reserializing: %@", NSStringFromClass(aClass), dictionary2); + } if (!isMatch) { + NSLog(@"Initial dictionary: %@", instanceDictionary); + NSLog(@"Does not match dictionary after deserializing and reserializing: %@", dictionary2); XCTAssertTrue(isMatch, @"Should be equal for class: %@", NSStringFromClass(aClass)); } @@ -1065,9 +1154,13 @@ - (BOOL)applySomeValueToClassProperty:(ClassProperty *)p forObject:(id)instance [instance setValue:index?[NSCalendar calendarWithIdentifier:NSCalendarIdentifierChinese]:[NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian] forKey:p.propertyName]; } else if (p.propertyClass == [NSTimeZone class]) { [instance setValue:index?[NSTimeZone timeZoneWithName:[NSTimeZone knownTimeZoneNames][0]]:[NSTimeZone timeZoneForSecondsFromGMT:1000] forKey:p.propertyName]; - } else if (p.propertyClass == [ORKLocation class]) { + } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + else if (p.propertyClass == [ORKLocation class]) { [instance setValue:(index ? [[ORKLocation alloc] orktest_init] : [[ORKLocation alloc] orktest_init_alt]) forKey:p.propertyName]; - } else if (p.propertyClass == [CLCircularRegion class]) { + } +#endif + else if (p.propertyClass == [CLCircularRegion class]) { [instance setValue:index?[[CLCircularRegion alloc] orktest_init_alt]:[[CLCircularRegion alloc] orktest_init] forKey:p.propertyName]; } else if (p.propertyClass == [NSPredicate class]) { [instance setValue:[NSPredicate predicateWithFormat:index?@"1 == 1":@"1 == 2"] forKey:p.propertyName]; @@ -1090,6 +1183,8 @@ - (BOOL)applySomeValueToClassProperty:(ClassProperty *)p forObject:(id)instance [instance setValue:@{@"prop": index?@"value":@"value1"} forKey:p.propertyName]; } else if (aClass == [ORKTableStep class] && [p.propertyName isEqual:@"items"]) { [instance setValue:@[index?@"item":@"item2"] forKey:p.propertyName]; + } else if ([aClass isSubclassOfClass:ORK3DModelStep.class] && [p.propertyName isEqualToString:@"modelManager"]) { + return NO; } else { id instanceForChild = [self instanceForClass:p.propertyClass]; [instance setValue:instanceForChild forKey:p.propertyName]; @@ -1104,6 +1199,11 @@ - (void)testSecureCoding { NSArray *propertyExclusionList = testConfiguration.propertyExclusionList; NSArray *knownNotSerializedProperties = testConfiguration.knownNotSerializedProperties; + classesWithSecureCoding = [classesWithSecureCoding filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary * _Nullable bindings) { + NSString *classString = NSStringFromClass(evaluatedObject); + return ![classString containsString:@"ORKMock"]; + }]]; + // Test Each class for (Class aClass in classesWithSecureCoding) { @@ -1133,6 +1233,7 @@ - (void)testSecureCoding { NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:nil]; unarchiver.requiresSecureCoding = YES; unarchiver.delegate = self; + NSMutableSet *decodingClasses = [NSMutableSet setWithArray:classesWithSecureCoding]; [decodingClasses addObject:[NSDate class]]; [decodingClasses addObject:[HKQueryAnchor class]]; @@ -1141,6 +1242,7 @@ - (void)testSecureCoding { // Set of classes we can check for equality. Would like to get rid of this once we implement NSSet *checkableClasses = [NSSet setWithObjects:[NSNumber class], [NSString class], [NSDictionary class], [NSURL class], nil]; + // All properties should have matching fields in dictionary (allow predefined exceptions) for (NSString *pName in propertyNames) { id newValue = [newInstance valueForKey:pName]; @@ -1153,6 +1255,7 @@ - (void)testSecureCoding { XCTAssertTrue(success, "Unexpected notSerializedProperty = %@", notSerializedProperty); } } + for (Class c in checkableClasses) { if ([oldValue isKindOfClass:c]) { if ([newValue isKindOfClass:[NSURL class]] || [oldValue isKindOfClass:[NSURL class]]) { @@ -1181,7 +1284,9 @@ - (void)testSecureCoding { NSKeyedUnarchiver *unarchiver2 = [[NSKeyedUnarchiver alloc] initForReadingFromData:data2 error:nil]; unarchiver2.requiresSecureCoding = YES; unarchiver2.delegate = self; + id newInstance2 = [unarchiver2 decodeObjectOfClasses:decodingClasses forKey:NSKeyedArchiveRootObjectKey]; + NSData *data3 = [NSKeyedArchiver archivedDataWithRootObject:newInstance2 requiringSecureCoding:YES error:nil]; if (![data isEqualToData:data2]) { // allow breakpointing @@ -1198,12 +1303,14 @@ - (void)testSecureCoding { XCTAssertEqualObjects(data, data2, @"data mismatch for %@", NSStringFromClass(aClass)); } } + if (![data2 isEqualToData:data3]) { // allow breakpointing XCTAssertEqualObjects(data2, data3, @"data mismatch for %@", NSStringFromClass(aClass)); } if (![newInstance isEqual:instance]) { XCTAssertEqualObjects(newInstance, instance, @"equality mismatch for %@", NSStringFromClass(aClass)); } + if (![newInstance2 isEqual:instance]) { XCTAssertEqualObjects(newInstance2, instance, @"equality mismatch for %@", NSStringFromClass(aClass)); } @@ -1230,6 +1337,7 @@ - (void)testEquality { [ORKNoAnswer class], // abstract base class [ORKStepNavigationRule class], // abstract base class [ORKSkipStepNavigationRule class], // abstract base class + [ORKFormItemVisibilityRule class], // abstract base class [ORKStepModifier class], // abstract base class [ORKVideoCaptureStep class], [ORKImageCaptureStep class] @@ -1238,6 +1346,7 @@ - (void)testEquality { // Each time ORKRegistrationStep returns a new date in its answer fromat, cannot be tested. NSMutableArray *stringsForClassesExcluded = [NSMutableArray arrayWithObjects:NSStringFromClass([ORKRegistrationStep class]), nil]; + for (Class c in classesExcluded) { [stringsForClassesExcluded addObject:NSStringFromClass(c)]; } @@ -1253,7 +1362,11 @@ - (void)testEquality { continue; } - if ([NSStringFromClass(aClass) hasPrefix:@"ORK"] && + if ([NSStringFromClass(aClass) containsString:@"ORKMock"]) { + continue; + } + + if (ORKIsResearchKitClass(aClass) && [aClass conformsToProtocol:@protocol(NSSecureCoding)] && [aClass conformsToProtocol:@protocol(NSCopying)]) { @@ -1280,6 +1393,7 @@ - (void)testEquality { @"shouldReportProgress", // For a specific class + @"ORKFormItem.visibilityRule", @"ORKHeightAnswerFormat.useMetricSystem", @"ORKWeightAnswerFormat.useMetricSystem", @"ORKNavigablePageStep.steps", @@ -1290,19 +1404,27 @@ - (void)testEquality { @"ORKStep.restorable", @"ORKStep.showsProgress", @"ORKStepResult.isPreviousResult", + @"ORKInstructionStep.type", @"ORKTextAnswerFormat.validationRegex", @"ORKVideoCaptureStep.duration", @"ORKQuestionStep.useCardView", + @"ORKConsentDocument.instructionSteps", @"ORKFormStep.useCardView", @"ORKSpeechRecognitionStep.shouldHideTranscript", + @"ORKWebViewStepResult.html", + @"ORKWebViewStepResult.htmlWithSignature", + @"ORKAgeAnswerFormat.minimumAge", + @"ORKAgeAnswerFormat.maximumAge", + @"ORKAgeAnswerFormat.relativeYear", + @"ORKAgeAnswerFormat.defaultValue", @"ORKTableStep.isBulleted", @"ORKTableStep.allowsSelection", @"ORKPDFViewerStep.actionBarOption", + @"ORKPredicateFormItemVisibilityRule.predicate", // when testing equality, test_init instance of this rule has nonnull predicate which breaks assumptions about instance and copiedInstance in our test. So exclude this property for equality testing. @"ORKBodyItem.customButtonConfigurationHandler", @"ORKAccuracyStroopStep.actualDisplayColor", @"ORKAccuracyStroopResult.didSelectCorrectColor", - @"ORKAccuracyStroopResult.timeTakenToSelect", - @"ORKDataCollectionState.archiveVersion" + @"ORKAccuracyStroopResult.timeTakenToSelect" ]; NSArray *hashExclusionList = @[ @@ -1329,7 +1451,6 @@ - (void)testEquality { id instance = [self instanceForClass:aClass]; // Find all properties of this class - NSMutableArray *propertyNames = [NSMutableArray array]; unsigned int count; objc_property_t *props = class_copyPropertyList(aClass, &count); for (uint i = 0; i < count; i++) { @@ -1342,7 +1463,6 @@ - (void)testEquality { if (p.isPrimitiveType || [instance valueForKey:p.propertyName] == nil) { [self applySomeValueToClassProperty:p forObject:instance index:0 forEqualityCheck:YES]; } - [propertyNames addObject:p.propertyName]; } } @@ -1377,6 +1497,7 @@ - (void)testEquality { } [self applySomeValueToClassProperty:p forObject:copiedInstance index:0 forEqualityCheck:YES]; + XCTAssertEqualObjects(copiedInstance, instance, @"%@", dottedPropertyName); if (p.isPrimitiveType == NO) { @@ -1407,7 +1528,8 @@ - (void)testAddResult { // Classes for which tests are not currently implemented NSArray *excludedClassNames = @[ @"ORKVisualConsentStepViewController", // Requires step with scenes - @"ORKImageCaptureStepViewController" + @"ORKImageCaptureStepViewController", + @"ORKTypingStepViewController" ]; // Classes that do not allow adding a result should throw an exception @@ -1424,7 +1546,6 @@ - (void)testAddResult { @"ORKHolePegTestRemoveStepViewController" : @"ORKHolePegTestRemoveStep", @"ORKImageCaptureStepViewController" : @"ORKImageCaptureStep", @"ORKPSATStepViewController" : @"ORKPSATStep", - @"ORKQuestionStepViewController" : @"ORKQuestionStep", @"ORKSpatialSpanMemoryStepViewController" : @"ORKSpatialSpanMemoryStep", @"ORKStroopStepViewController" : @"ORKStroopStep", @"ORKTimedWalkStepViewController" : @"ORKTimedWalkStep", @@ -1484,7 +1605,7 @@ - (void)testAddResult { continue; } - if ([NSStringFromClass(aClass) hasPrefix:@"ORK"] && + if (ORKIsResearchKitClass(aClass) && [aClass isSubclassOfClass:[ORKStepViewController class]]) { [stepViewControllerClassses addObject:aClass]; @@ -1512,7 +1633,16 @@ - (void)testAddResult { if (stepClassName && (kv = kvMapForStep[stepClassName])) { [step setValuesForKeysWithDictionary:kv]; } - ORKStepViewController *stepViewController = [[aClass alloc] initWithStep:step]; + + ORKStepViewController *stepViewController; + + if ([aClass isSubclassOfClass:[ORKQuestionStepViewController class]]) { + Class questionStepClass = [ORKQuestionStep class]; + ORKQuestionStep *questionStep = [self instanceForClass:questionStepClass]; + stepViewController = [(ORKStepViewController *)[aClass alloc] initWithStep:questionStep]; + } else { + stepViewController = [(ORKStepViewController *)[aClass alloc] initWithStep:step]; + } // Create a result ORKBooleanQuestionResult *result = [[ORKBooleanQuestionResult alloc] initWithIdentifier:@"test"]; diff --git a/ResearchKitTests/ORKPasscodeViewControllerTests.swift b/ResearchKitTests/ORKPasscodeViewControllerTests.swift index fe049f02fa..2c9401a2d9 100644 --- a/ResearchKitTests/ORKPasscodeViewControllerTests.swift +++ b/ResearchKitTests/ORKPasscodeViewControllerTests.swift @@ -30,7 +30,9 @@ import XCTest @testable import ResearchKit -import ResearchKit.Private +import ResearchKit_Private +@testable import ResearchKitUI +import ResearchKitUI_Private class ORKPasscodeViewControllerTests: XCTestCase { diff --git a/ResearchKitTests/ORKPickerTestDelegate.h b/ResearchKitTests/ORKPickerTestDelegate.h index ac0c8469a8..bf3558fafd 100644 --- a/ResearchKitTests/ORKPickerTestDelegate.h +++ b/ResearchKitTests/ORKPickerTestDelegate.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2020, Apple Inc. All rights reserved. + Copyright (c) 2022, Apple Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -29,7 +29,7 @@ */ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKitTests/ORKPredicateFormItemVisibilityRuleTests.swift b/ResearchKitTests/ORKPredicateFormItemVisibilityRuleTests.swift new file mode 100644 index 0000000000..38e52eb88a --- /dev/null +++ b/ResearchKitTests/ORKPredicateFormItemVisibilityRuleTests.swift @@ -0,0 +1,264 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import XCTest + +import ResearchKit + +extension NSPredicate { + class var truePredicate: NSPredicate { + return NSPredicate(value: true) + } + + class var falsePredicate: NSPredicate { + return NSPredicate(value: false) + } +} + +final class ORKPredicateFormItemVisibilityRuleTests: XCTestCase { + func testRuleCreation() throws { + do { + let rule = ORKPredicateFormItemVisibilityRule(predicate: .truePredicate); + XCTAssertNotNil(rule) + XCTAssertNotNil(rule.predicate) + XCTAssertEqual(rule.predicate, .truePredicate) + } + + do { + let predicate = NSPredicate(format: "$has_dogs == YES") + let rule = ORKPredicateFormItemVisibilityRule(predicate: predicate); + XCTAssertNotNil(rule) + XCTAssertNotNil(rule.predicate) + XCTAssertEqual(predicate, rule.predicate) + } + } + + func testRuleCopying() throws { + do { + let rule = ORKPredicateFormItemVisibilityRule(predicate: .truePredicate); + let copy = rule.copy() as? ORKPredicateFormItemVisibilityRule + XCTAssertNotNil(copy) + XCTAssertEqual(copy, rule) + } + + do { + let predicate = NSPredicate(format: "$has_dogs == YES") + let rule = ORKPredicateFormItemVisibilityRule(predicate: predicate); + let copy = rule.copy() as? ORKPredicateFormItemVisibilityRule + XCTAssertNotNil(copy) + XCTAssertNotNil(copy?.predicate) + XCTAssertEqual(copy, rule) + } + } + + func testIsEqual() throws { + do { + let rule = ORKPredicateFormItemVisibilityRule(predicate: .truePredicate); + let bogusRule = BogusFormItemVisibilityRule() + XCTAssertNotEqual(rule, bogusRule) + } + + do { + let predicate = NSPredicate(format: "$has_dogs == YES") + let rule1 = ORKPredicateFormItemVisibilityRule(predicate: .truePredicate); + let rule2 = ORKPredicateFormItemVisibilityRule(predicate: predicate); + XCTAssertNotEqual(rule1, rule2) + } + + do { + let predicate = NSPredicate(value: true) + let rule1 = ORKPredicateFormItemVisibilityRule(predicate: .truePredicate); + let rule2 = ORKPredicateFormItemVisibilityRule(predicate: predicate); + XCTAssertEqual(rule1, rule2) + } + } + + func testHashing() throws { + let predicate = NSPredicate(format: "$has_dogs == YES") + let rule1 = ORKPredicateFormItemVisibilityRule(predicate: .truePredicate); + let rule2 = ORKPredicateFormItemVisibilityRule(predicate: predicate); + let rule3 = ORKPredicateFormItemVisibilityRule(predicate: predicate); + + do { + let set = NSSet(array: [rule2, rule3]) + XCTAssertEqual(set.count, 1, "equal rules should replace hash to one object in a set") + } + do { + let set = NSSet(array: [rule1, rule3]) + XCTAssertEqual(set.count, 2, "unequal rules should coexist in a set") + } + do { + let set = NSSet(array: [rule1, NSPredicate.truePredicate]) + XCTAssertEqual(set.count, 2, "Even though rule.hash is just _predicate.hash, the two types should occypy two slots in a set") + } + do { + let set = Set([rule1, rule2, rule3]) + XCTAssertEqual(set.count, 2) + } + do { + let set = Set([rule1, NSPredicate.truePredicate]) + XCTAssertEqual(set.count, 2) + } + } + + func testAllowEvaluationOnRule() throws { + let formItems = [ORKFormItem(identifier: "item1", text: "text1", answerFormat: ORKTextAnswerFormat()), ORKFormItem(identifier: "item2", text: "text2", answerFormat: ORKTextAnswerFormat()), ORKFormItem(identifier: "item3", text: "text3", answerFormat: ORKTextAnswerFormat())] as NSArray + let predicate = NSPredicate(format: "identifier = 'item1'") + let rule = ORKPredicateFormItemVisibilityRule(predicate: predicate) + + // archive the ORKPredicateFormItemVisibilityRule + let encoder = NSKeyedArchiver(requiringSecureCoding: true) + let ArchiveKey = "formItemWithVisibilityRule" + encoder.encode(rule, forKey: ArchiveKey) + encoder.finishEncoding() + let data = encoder.encodedData + + let unarchiver = try! NSKeyedUnarchiver(forReadingFrom: data) + let decodedObject = unarchiver.decodeObject(of: ORKPredicateFormItemVisibilityRule.self, forKey: ArchiveKey) + XCTAssertNotNil(decodedObject) + + // allowEvaluation() is called under the hood when decoding + + let filteredItems = formItems.filtered(using: decodedObject!.predicate) + + XCTAssertTrue(filteredItems.count == 1) + XCTAssertEqual((filteredItems.first! as! ORKFormItem).identifier, "item1") + } + + func testAllowEvaluationOnCustomRule() throws { + let result = ORKTaskResult(taskIdentifier: "TaskIdentifier", taskRun: UUID(), outputDirectory: nil) + + let choiceResult = ORKChoiceQuestionResult(identifier: "dogsFormItem") + choiceResult.answer = ["Yes" as NSString] as any NSCopying & NSSecureCoding & NSObjectProtocol + + result.results = [ORKStepResult(stepIdentifier:"formStepIdentifier", results: [choiceResult])] + + let selector = ORKResultSelector( + stepIdentifier: String(describing: "formStepIdentifier"), + resultIdentifier: String(describing: "dogsFormItem") + ) + + let predicate = ORKResultPredicate.predicateForChoiceQuestionResult( + with: selector, + expectedAnswerValue: "Yes" as NSString + ) + + let rule = ORKPredicateFormItemVisibilityRule(predicate: predicate) + + XCTAssertTrue( + rule.formItemVisibility(for: result) + ) + + // archive the ORKPredicateFormItemVisibilityRule + let encoder = NSKeyedArchiver(requiringSecureCoding: true) + let ArchiveKey = "formItemWithVisibilityRule" + encoder.encode(rule, forKey: ArchiveKey) + encoder.finishEncoding() + let data = encoder.encodedData + + let unarchiver = try! NSKeyedUnarchiver(forReadingFrom: data) + let decodedRule = unarchiver.decodeObject(of: ORKPredicateFormItemVisibilityRule.self, forKey: ArchiveKey) + XCTAssertNotNil(decodedRule) + + // allowEvaluation() is called under the hood when decoding + + XCTAssertTrue( + decodedRule!.formItemVisibility(for: result) + ) + } + + func testDecodedPredicateEvaluationOutsideRulesThrows() throws { + let formItems = [ORKFormItem(identifier: "item1", text: "text1", answerFormat: ORKTextAnswerFormat()), ORKFormItem(identifier: "item2", text: "text2", answerFormat: ORKTextAnswerFormat()), ORKFormItem(identifier: "item3", text: "text3", answerFormat: ORKTextAnswerFormat())] as NSArray + let predicate = NSPredicate(format: "identifier = 'item1'") + + // archive the NSPredicate + let encoder = NSKeyedArchiver(requiringSecureCoding: true) + let ArchiveKey = "formItemWithVisibilityRule" + encoder.encode(predicate, forKey: ArchiveKey) + encoder.finishEncoding() + let data = encoder.encodedData + + let unarchiver = try! NSKeyedUnarchiver(forReadingFrom: data) + let decodedPredicate = unarchiver.decodeObject(of: NSPredicate.self, forKey: ArchiveKey) + XCTAssertNotNil(decodedPredicate) + + XCTAssertThrowsError(try NSObject.executeUsingObjCExceptionHandling { + formItems.filtered(using: decodedPredicate!) + }) { error in + let exception = (error as NSError).userInfo[ORKUnderlyingExceptionKey] as! NSException + XCTAssertEqual(exception.name, NSExceptionName.internalInconsistencyException) + } + } + + func testDecodedORKResultPredicateEvaluationOutsideRulesThrows() throws { + let result = ORKTaskResult(taskIdentifier: "TaskIdentifier", taskRun: UUID(), outputDirectory: nil) + + let choiceResult = ORKChoiceQuestionResult(identifier: "dogsFormItem") + choiceResult.answer = ["Yes" as NSString] as any NSCopying & NSSecureCoding & NSObjectProtocol + + result.results = [ORKStepResult(stepIdentifier:"formStepIdentifier", results: [choiceResult])] + + let selector = ORKResultSelector( + stepIdentifier: String(describing: "formStepIdentifier"), + resultIdentifier: String(describing: "dogsFormItem") + ) + + let predicate = ORKResultPredicate.predicateForChoiceQuestionResult( + with: selector, + expectedAnswerValue: "Yes" as NSString + ) + + XCTAssertTrue( + predicate.evaluate(with: [result], substitutionVariables: [ + ORKResultPredicateTaskIdentifierVariableName: result.identifier + ]) + ) + + // archive the NSPredicate + let encoder = NSKeyedArchiver(requiringSecureCoding: true) + let ArchiveKey = "formItemWithVisibilityRule" + encoder.encode(predicate, forKey: ArchiveKey) + encoder.finishEncoding() + let data = encoder.encodedData + + let unarchiver = try! NSKeyedUnarchiver(forReadingFrom: data) + let decodedPredicate = unarchiver.decodeObject(of: NSPredicate.self, forKey: ArchiveKey) + XCTAssertNotNil(decodedPredicate) + + XCTAssertThrowsError(try NSObject.executeUsingObjCExceptionHandling { + decodedPredicate!.evaluate(with: [result], substitutionVariables: [ + ORKResultPredicateTaskIdentifierVariableName: result.identifier + ]) + }) { error in + let exception = (error as NSError).userInfo[ORKUnderlyingExceptionKey] as! NSException + XCTAssertEqual(exception.name, NSExceptionName.internalInconsistencyException) + } + } +} diff --git a/ResearchKitTests/ORKRecorderTests.m b/ResearchKitTests/ORKRecorderTests.m index f7d3ffe051..7cc46a5abe 100644 --- a/ResearchKitTests/ORKRecorderTests.m +++ b/ResearchKitTests/ORKRecorderTests.m @@ -30,12 +30,16 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; +@import ResearchKitActiveTask; +@import ResearchKitActiveTask_Private; -@import CoreLocation; @import CoreMotion; +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +@import CoreLocation; + @interface ORKMockLocationManager : CLLocationManager @end @@ -62,6 +66,7 @@ - (CLLocationManager *)createLocationManager { } @end +#endif @interface ORKMockTouch : UITouch @@ -394,6 +399,7 @@ - (void)checkResult { _items = items; } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION - (void)testLocationRecorder { ORKLocationRecorder *recorder = (ORKLocationRecorder *)[self createRecorder:[[ORKLocationRecorderConfiguration alloc] initWithIdentifier:@"location"]]; @@ -431,8 +437,26 @@ - (void)testLocationRecorder { } [recorder stop]; - [self checkResult]; + // when location features are compiled out, make sure that the "ork_" wrapper functions are + // returning false, but don't bother doing the checkResult step +#if !ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + // when location auth is 0, the [recorder start] earlier immediately stops, which zeros + // the locationManager property. So we would expect currentLocationManager == nil + XCTAssertNil(currentLocationManager, @"ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=0: expected recorder's location manager to be nil"); + + // make a one-time-use locationManager that we test ork_ wrappers with + { + CLLocationManager *locationManager = [(ORKMockLocationRecorder *)recorder createLocationManager]; + XCTAssertNotNil(locationManager); + XCTAssertFalse([locationManager ork_requestWhenInUseAuthorization]); + XCTAssertFalse([locationManager ork_requestAlwaysAuthorization]); + } + +#else + [self checkResult]; +#endif // ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + for (NSDictionary *sample in _items) { XCTAssertTrue(ork_doubleEqual(altitude, ((NSNumber *)sample[@"altitude"]).doubleValue), @""); @@ -445,6 +469,7 @@ - (void)testLocationRecorder { XCTAssertTrue(ork_doubleEqual(longitude, ((NSNumber *)sample[@"coordinate"][@"longitude"]).doubleValue), @""); } } +#endif - (void)testAccelerometerRecorder { @@ -621,7 +646,7 @@ - (void)testAudioRecorder { } - (void)testHealthQuantityTypeRecorder { - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION HKUnit *bpmUnit = [[HKUnit countUnit] unitDividedByUnit:[HKUnit minuteUnit]]; HKQuantityType *hbQuantityType = [HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]; ORKHealthQuantityTypeRecorderConfiguration *recorderConfiguration = [[ORKHealthQuantityTypeRecorderConfiguration alloc] initWithIdentifier:@"healtQuantityTypeRecorder" healthQuantityType:hbQuantityType unit:bpmUnit]; @@ -629,6 +654,7 @@ - (void)testHealthQuantityTypeRecorder { ORKHealthQuantityTypeRecorder *recorder = (ORKHealthQuantityTypeRecorder *)[self createRecorder:recorderConfiguration]; XCTAssertTrue([recorder isKindOfClass:recorderClass], @""); +#endif } @end diff --git a/ResearchKitTests/ORKResultTests.m b/ResearchKitTests/ORKResultTests.m index b41ecd2e4c..05e2de682d 100644 --- a/ResearchKitTests/ORKResultTests.m +++ b/ResearchKitTests/ORKResultTests.m @@ -30,7 +30,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit; +@import ResearchKitUI; +@import ResearchKitUI_Private; +@import ResearchKit_Private; +#import "ORKFormStepViewController+TestingSupport.h" @interface ORKResultTestsHelper: NSObject @end @@ -50,7 +54,6 @@ @interface ORKResultTests : XCTestCase @end - @implementation ORKResultTests - (ORKTaskResult *)createTaskResultTree { @@ -133,6 +136,126 @@ - (void)compareTaskResult1:(ORKTaskResult *)taskResult1 andTaskResult2:(ORKTaskR }]; } +- (void)testTaskViewControllerPrematureViewLoading { + ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:@"test" steps:@[ + [[ORKInstructionStep alloc] initWithIdentifier:@"test"] + ]]; + ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; + ORKStepViewController *viewController = [((ORKOrderedTask *)ORKDynamicCast(taskViewController.task, ORKOrderedTask)).steps.firstObject makeViewControllerWithResult:nil]; + + XCTAssertFalse(viewController.isViewLoaded, "TaskViewController's viewControllerForStep should return a viewController *without* its view loaded"); +} + +- (void)testResultSecureCoding { + ORKTaskResult *taskResult1 = [self createTaskResultTree]; + + // Archive + id data = [NSKeyedArchiver archivedDataWithRootObject:taskResult1 requiringSecureCoding:YES error:nil];; + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:nil]; + unarchiver.requiresSecureCoding = YES; + ORKTaskResult *taskResult2 = [unarchiver decodeObjectOfClass:[ORKTaskResult class] forKey:NSKeyedArchiveRootObjectKey]; + + [self compareTaskResult1:taskResult1 andTaskResult2:taskResult2]; + XCTAssertEqualObjects(taskResult1, taskResult2); +} + +- (void)testResultCopy { + ORKTaskResult *taskResult1 = [self createTaskResultTree]; + + ORKTaskResult *taskResult2 = [taskResult1 copy]; + + [self compareTaskResult1:taskResult1 andTaskResult2:taskResult2]; + + XCTAssertEqualObjects(taskResult1, taskResult2); +} + +- (void)testCollectionResult { + ORKCollectionResult *result = [[ORKCollectionResult alloc] initWithIdentifier:@"001"]; + [result setResults:@[ [[ORKResult alloc]initWithIdentifier: @"101"], [[ORKResult alloc]initWithIdentifier: @"007"] ]]; + + ORKResult *childResult = [result resultForIdentifier:@"005"]; + XCTAssertNil(childResult, @"%@", childResult.identifier); + + childResult = [result resultForIdentifier:@"007"]; + XCTAssertEqual(childResult.identifier, @"007", @"%@", childResult.identifier); + + childResult = [result resultForIdentifier: @"101"]; + XCTAssertEqual(childResult.identifier, @"101", @"%@", childResult.identifier); +} + +- (void)testPageResult { + + NSArray *steps = @[[[ORKStep alloc] initWithIdentifier:@"step1"], + [[ORKStep alloc] initWithIdentifier:@"step2"], + [[ORKStep alloc] initWithIdentifier:@"step3"], + ]; + ORKPageStep *pageStep = [[ORKPageStep alloc] initWithIdentifier:@"pageStep" steps:steps]; + + ORKChoiceQuestionResult *step1Result1 = [[ORKChoiceQuestionResult alloc] initWithIdentifier:@"step1.result1"]; + step1Result1.choiceAnswers = @[ @(1) ]; + ORKChoiceQuestionResult *step1Result2 = [[ORKChoiceQuestionResult alloc] initWithIdentifier:@"step1.result2"]; + step1Result2.choiceAnswers = @[ @(2) ]; + ORKChoiceQuestionResult *step2Result1 = [[ORKChoiceQuestionResult alloc] initWithIdentifier:@"step2.result1"]; + step2Result1.choiceAnswers = @[ @(3) ]; + + ORKStepResult *inputResult = [[ORKStepResult alloc] initWithStepIdentifier:@"pageStep" + results:@[step1Result1, step1Result2, step2Result1]]; + + // Test that the page result creates ORKStepResults for each result that matches the prefix test + ORKPageResult *pageResult = [[ORKPageResult alloc] initWithPageStep:pageStep stepResult:inputResult]; + XCTAssertEqual(pageResult.results.count, 2); + + ORKStepResult *stepResult1 = [pageResult stepResultForStepIdentifier:@"step1"]; + XCTAssertNotNil(stepResult1); + XCTAssertEqual(stepResult1.results.count, 2); + + ORKStepResult *stepResult2 = [pageResult stepResultForStepIdentifier:@"step2"]; + XCTAssertNotNil(stepResult2); + XCTAssertEqual(stepResult2.results.count, 1); + + ORKStepResult *stepResult3 = [pageResult stepResultForStepIdentifier:@"step3"]; + XCTAssertNil(stepResult3); + + // Check that the flattened results match the input results + NSArray *flattedResults = [pageResult flattenResults]; + XCTAssertEqualObjects(inputResult.results, flattedResults); +} + +- (void)testStepResultForStepIdentifierWithMatchingStepExpectEquals { + NSString *stepIdentifier = @"StepIdentifier"; + ORKStepResult *stepResult = [[ORKStepResult alloc] initWithIdentifier:stepIdentifier]; + ORKTaskResult *taskResult = [self createTaskResultTree]; + [taskResult setResults:@[stepResult]]; + + ORKStepResult *result = [taskResult stepResultForStepIdentifier:stepIdentifier]; + + XCTAssertNoThrow(result.results); + XCTAssertEqualObjects(result, stepResult); +} + +- (void)testStepResultForStepIdentifierWithNoStepExpectNil { + NSString *stepIdentifier = @"StepIdentifier"; + ORKStepResult *stepResult = [[ORKStepResult alloc] initWithIdentifier:@"OtherIdentifier"]; + ORKTaskResult *taskResult = [self createTaskResultTree]; + [taskResult setResults:@[stepResult]]; + + ORKStepResult *result = [taskResult stepResultForStepIdentifier:stepIdentifier]; + + XCTAssertNil(result); +} + +- (void)testStepResultForStepIdentifierWithIdentifierMatchingORKResultExpectNil { + NSString *identifier = @"ResultIdentifier"; + ORKResult *orkResult = [[ORKResult alloc] initWithIdentifier:identifier]; + ORKTaskResult *taskResult = [self createTaskResultTree]; + [taskResult setResults:@[orkResult]]; + + ORKStepResult *result = [taskResult stepResultForStepIdentifier:identifier]; + + XCTAssertNoThrow(result.results); + XCTAssertNil(result); +} + - (void)testTaskViewControllerNullDataRestorationThrows { NSData *taskData = [NSData data]; ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:@"test" steps:@[]]; @@ -149,23 +272,13 @@ - (void)testTaskViewControllerNullDataRestorationThrows { } } -- (void)testTaskViewControllerPrematureViewLoading { - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:@"test" steps:@[ - [[ORKInstructionStep alloc] initWithIdentifier:@"test"] - ]]; - ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; - ORKStepViewController *viewController = [taskViewController viewControllerForStep:task.steps.firstObject]; - - XCTAssertFalse(viewController.isViewLoaded, "TaskViewController's viewControllerForStep should return a viewController *without* its view loaded"); -} - - (void)testMutableDecoding { NSMutableArray *things = [[NSMutableArray alloc] initWithObjects:@"hello", @"world", nil]; __auto_type keyedArchiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES]; [keyedArchiver encodeObject:things forKey:@"mutableThings"]; [keyedArchiver encodeObject:@[@"farewell"] forKey:@"immutableThings"]; [keyedArchiver finishEncoding]; - + NSData *data = [keyedArchiver encodedData]; __auto_type keyedUnarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:nil]; NSSet *decodableTypes = [NSSet setWithObjects:NSMutableArray.self, NSString.self, nil]; @@ -174,12 +287,12 @@ - (void)testMutableDecoding { // decoding an mutable array actually returns a mutable array NSMutableArray *decodedArray = [keyedUnarchiver decodeObjectOfClasses:decodableTypes forKey:@"mutableThings"]; XCTAssertTrue([decodedArray isKindOfClass:NSMutableArray.self], "decoding a mutable array should return a mutable array"); - + [decodedArray addObject:@"test"]; XCTAssertEqual(decodedArray.count, 3); XCTAssertEqualObjects(decodedArray.lastObject, @"test"); } - + { // decoding an immutable array as if it were mutable works, but should fail when using it as mutable NSMutableArray *decodedArray = [keyedUnarchiver decodeObjectOfClasses:decodableTypes forKey:@"immutableThings"]; @@ -187,11 +300,12 @@ - (void)testMutableDecoding { XCTAssertTrue([decodedArray isKindOfClass:NSArray.self]); XCTAssertThrows([decodedArray addObject:@"test"]); } + } - (void)testTaskViewControllerRestorationWorks { ORKFormStep *formItemStep = [[ORKFormStep alloc] initWithIdentifier:@"step"]; - + formItemStep.formItems = @[ [[ORKFormItem alloc] initWithIdentifier:@"item1" text:nil answerFormat:ORKAnswerFormat.booleanAnswerFormat], [[ORKFormItem alloc] initWithIdentifier:@"item2" text:nil answerFormat:ORKAnswerFormat.textAnswerFormat], @@ -203,17 +317,17 @@ - (void)testTaskViewControllerRestorationWorks { { // create the task as if we were to present it ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; - + // Trigger requestHealth access to fill in the read/write types ivars NSSet *readTypes = [NSSet setWithObjects:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate], nil]; - NSSet *writeTypes = [NSSet setWithObjects:[HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierBloating], nil]; + NSSet *writeTypes = [NSSet setWithObjects:[HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierMenstrualFlow], nil]; [taskViewController requestHealthStoreAccessWithReadTypes:readTypes writeTypes:writeTypes handler:^(){ // intentionally left empty }]; // viewWillAppear fills in the _managedStepIdentifiers in the taskViewController [taskViewController viewWillAppear:false]; - + // make a few answers to test with, simulating answers entered by a user __auto_type booleanAnswer = [[ORKBooleanQuestionResult alloc] initWithIdentifier:@"item1"]; booleanAnswer.booleanAnswer = @(YES); @@ -227,27 +341,26 @@ - (void)testTaskViewControllerRestorationWorks { ORKStepResult *stepResult = [[ORKStepResult alloc] initWithStepIdentifier:@"step" results:@[ booleanAnswer, textAnswer, integerAnswer ]]; - // set the answers using taskViewController-internal method, to simulate user data entry [taskViewController setManagedResult:stepResult forKey:@"step"]; - + // archive it __auto_type keyedArchiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES]; [taskViewController encodeRestorableStateWithCoder:keyedArchiver]; encodedTaskViewControllerData = [keyedArchiver encodedData]; } XCTAssertNotNil(encodedTaskViewControllerData); - + // init a new taskViewController with the restoration data { // important to start with the same task so the identifiers match ORKResultTestsHelper *taskDelegate = [[ORKResultTestsHelper alloc] init]; ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task restorationData:encodedTaskViewControllerData delegate:taskDelegate error:nil]; - + // confirm the read/write HK type info made it across the encode/decode bridge XCTAssertEqualObjects([taskViewController requestedHealthTypesForRead], [NSSet setWithObject:[HKObjectType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate]]); - XCTAssertEqualObjects([taskViewController requestedHealthTypesForWrite], [NSSet setWithObject:[HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierBloating]]); - + XCTAssertEqualObjects([taskViewController requestedHealthTypesForWrite], [NSSet setWithObject:[HKObjectType categoryTypeForIdentifier:HKCategoryTypeIdentifierMenstrualFlow]]); + ORKStepResult *stepResult = (ORKStepResult *)[[[taskViewController result] results] firstObject]; NSArray *questionResults = (NSArray *)[stepResult results]; XCTAssertEqual([questionResults count], 3); @@ -259,20 +372,119 @@ - (void)testTaskViewControllerRestorationWorks { XCTAssertEqualObjects(questionResults[2].answer, @(42)); XCTAssertEqual(questionResults[2].identifier, @"item3"); } - + } -- (void)testResultSecureCoding { - ORKTaskResult *taskResult1 = [self createTaskResultTree]; - - // Archive - id data = [NSKeyedArchiver archivedDataWithRootObject:taskResult1 requiringSecureCoding:YES error:nil]; - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:nil]; - unarchiver.requiresSecureCoding = YES; - ORKTaskResult *taskResult2 = [unarchiver decodeObjectOfClass:[ORKTaskResult class] forKey:NSKeyedArchiveRootObjectKey]; - - [self compareTaskResult1:taskResult1 andTaskResult2:taskResult2]; - XCTAssertEqualObjects(taskResult1, taskResult2); +/* + We are testing if an ORKFormStepViewController that is saved with results + is restored from an ORKTaskViewController, with a new bundle, or form, + that has removed or modified one of the ORKAnswerFormats, then the + savedResults should remove the invalid answer. + */ +- (void)testTaskViewControllerRestorationWorksAfterTaskChanges { + ORKFormStep *formItemStep = [[ORKFormStep alloc] initWithIdentifier:@"step"]; + + formItemStep.formItems = @[ + [[ORKFormItem alloc] initWithIdentifier:@"item1" text:nil answerFormat:ORKAnswerFormat.booleanAnswerFormat], + [[ORKFormItem alloc] initWithIdentifier:@"item2" text:nil answerFormat:ORKAnswerFormat.textAnswerFormat], + [[ORKFormItem alloc] initWithIdentifier:@"item3" text:nil answerFormat: + [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:@[ + [[ORKTextChoice alloc] initWithText:@"text1" detailText:@"text1" value:@"text1" exclusive:true], + [[ORKTextChoice alloc] initWithText:@"text2" detailText:@"text2" value:@"text2" exclusive:true], + [[ORKTextChoice alloc] initWithText:@"text3" detailText:@"text3" value:@"text3" exclusive:true], + ]]] + ]; + ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:@"test" steps:@[formItemStep]]; + + NSData *encodedTaskViewControllerData; + { + // create the task as if we were to present it + ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; + + // viewWillAppear fills in the _managedStepIdentifiers in the taskViewController + [taskViewController viewWillAppear:false]; + + // make a few answers to test with, simulating answers entered by a user + __auto_type booleanAnswer = [[ORKBooleanQuestionResult alloc] initWithIdentifier:@"item1"]; + booleanAnswer.booleanAnswer = @(YES); + + __auto_type textAnswer = [[ORKTextQuestionResult alloc] initWithIdentifier:@"item2"]; + textAnswer.textAnswer = @"there is no answer, only questions"; + + __auto_type choiceAnswerResult = [[ORKChoiceQuestionResult alloc] initWithIdentifier:@"item3"]; + choiceAnswerResult.choiceAnswers = @[@"text3"]; + + ORKStepResult *stepResult = [[ORKStepResult alloc] initWithStepIdentifier:@"step" results:@[ + booleanAnswer, textAnswer, choiceAnswerResult + ]]; + // set the answers using taskViewController-internal method, to simulate user data entry + [taskViewController setManagedResult:stepResult forKey:@"step"]; + + // archive it + __auto_type keyedArchiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES]; + [taskViewController encodeRestorableStateWithCoder:keyedArchiver]; + encodedTaskViewControllerData = [keyedArchiver encodedData]; + } + XCTAssertNotNil(encodedTaskViewControllerData); + + // init a new taskViewController with the restoration data + { + // important to start with the same task so the identifiers match + ORKResultTestsHelper *taskDelegate = [[ORKResultTestsHelper alloc] init]; + + ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task restorationData:encodedTaskViewControllerData delegate:taskDelegate error:nil]; + + [taskViewController viewWillAppear:true]; + + ORKFormStepViewController *formVc = (ORKFormStepViewController *)taskViewController.currentStepViewController; + + // encode the VC with encodedData of a task that supports the [[ORKTextChoice alloc] initWithText:@"text3" detailText:@"text3" value:@"text3" exclusive:true], + __auto_type keyedArchiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES]; + [formVc encodeRestorableStateWithCoder:keyedArchiver]; + encodedTaskViewControllerData = [keyedArchiver encodedData]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + __auto_type keyedUnarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:encodedTaskViewControllerData]; +#pragma clang diagnostic pop + + ORKFormStep *formItemStep = [[ORKFormStep alloc] initWithIdentifier:@"step"]; + + formItemStep.formItems = @[ + [[ORKFormItem alloc] initWithIdentifier:@"item1" text:nil answerFormat:ORKAnswerFormat.booleanAnswerFormat], + [[ORKFormItem alloc] initWithIdentifier:@"item2" text:nil answerFormat:ORKAnswerFormat.textAnswerFormat], + [[ORKFormItem alloc] initWithIdentifier:@"item3" text:nil answerFormat: + [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:@[ + [[ORKTextChoice alloc] initWithText:@"text1" detailText:@"text1" value:@"text1" exclusive:true], + [[ORKTextChoice alloc] initWithText:@"text2" detailText:@"text2" value:@"text2" exclusive:true], + ]]] + ]; + ORKFormStepViewController *formVc2 = [[ORKFormStepViewController alloc] initWithStep:formItemStep]; + XCTAssertNotNil(formVc2); + + // expect savedAnswers to be empty, because nothing has been restored + XCTAssertEqual(formVc2.savedAnswers.count, 0); + // expect the unarchiver to decode 3 saved answers, but the invalid one will be removed + // so we should expect 2 saved anwers + [formVc2 decodeRestorableStateWithCoder:keyedUnarchiver]; + XCTAssertEqual(formVc2.savedAnswers.count, 2); + + // test restoration logic directly + NSSet *decodableAnswerTypes = [NSSet setWithObjects:NSMutableDictionary.self, NSString.self, NSNumber.self, NSDate.self, nil]; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + __auto_type keyedUnarchiver2 = [[NSKeyedUnarchiver alloc] initForReadingWithData:encodedTaskViewControllerData]; +#pragma clang diagnostic pop + + NSMutableDictionary *savedAnswers = [keyedUnarchiver2 decodeObjectOfClasses:decodableAnswerTypes forKey:@"savedAnswers"]; + // we expect 3 saved answers from the unarchiver + XCTAssertEqual(savedAnswers.count, 3); + formVc2.savedAnswers = savedAnswers; + [formVc2 removeInvalidSavedAnswers]; + // after removing 1 invalid answer, we expect 2 saved answers + XCTAssertEqual(savedAnswers.count, 2); + } + } - (void)testConsentDocumentDecoding { @@ -282,88 +494,23 @@ - (void)testConsentDocumentDecoding { [[ORKConsentSignature alloc] init], [[ORKConsentSignature alloc] init] ]; - + NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initRequiringSecureCoding:YES]; [archiver encodeObject:document forKey:@"rootDocumet"]; NSData *data = archiver.encodedData; - + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:nil]; unarchiver.requiresSecureCoding = true; ORKConsentDocument *decodedDocument = [unarchiver decodeObjectOfClass:ORKConsentDocument.self forKey:@"rootDocumet"]; XCTAssertEqual(decodedDocument.signatures.count, 3); } -- (void)testResultCopy { - ORKTaskResult *taskResult1 = [self createTaskResultTree]; - - ORKTaskResult *taskResult2 = [taskResult1 copy]; - - [self compareTaskResult1:taskResult1 andTaskResult2:taskResult2]; - - XCTAssertEqualObjects(taskResult1, taskResult2); -} - -- (void)testCollectionResult { - ORKCollectionResult *result = [[ORKCollectionResult alloc] initWithIdentifier:@"001"]; - [result setResults:@[ [[ORKResult alloc]initWithIdentifier: @"101"], [[ORKResult alloc]initWithIdentifier: @"007"] ]]; - - ORKResult *childResult = [result resultForIdentifier:@"005"]; - XCTAssertNil(childResult, @"%@", childResult.identifier); - - childResult = [result resultForIdentifier:@"007"]; - XCTAssertEqual(childResult.identifier, @"007", @"%@", childResult.identifier); - - childResult = [result resultForIdentifier: @"101"]; - XCTAssertEqual(childResult.identifier, @"101", @"%@", childResult.identifier); -} - -- (void)testPageResult { - - NSArray *steps = @[[[ORKStep alloc] initWithIdentifier:@"step1"], - [[ORKStep alloc] initWithIdentifier:@"step2"], - [[ORKStep alloc] initWithIdentifier:@"step3"], - ]; - ORKPageStep *pageStep = [[ORKPageStep alloc] initWithIdentifier:@"pageStep" steps:steps]; - - ORKChoiceQuestionResult *step1Result1 = [[ORKChoiceQuestionResult alloc] initWithIdentifier:@"step1.result1"]; - step1Result1.choiceAnswers = @[ @(1) ]; - ORKChoiceQuestionResult *step1Result2 = [[ORKChoiceQuestionResult alloc] initWithIdentifier:@"step1.result2"]; - step1Result2.choiceAnswers = @[ @(2) ]; - ORKChoiceQuestionResult *step2Result1 = [[ORKChoiceQuestionResult alloc] initWithIdentifier:@"step2.result1"]; - step2Result1.choiceAnswers = @[ @(3) ]; - - ORKStepResult *inputResult = [[ORKStepResult alloc] initWithStepIdentifier:@"pageStep" - results:@[step1Result1, step1Result2, step2Result1]]; - - // Test that the page result creates ORKStepResults for each result that matches the prefix test - ORKPageResult *pageResult = [[ORKPageResult alloc] initWithPageStep:pageStep stepResult:inputResult]; - XCTAssertEqual(pageResult.results.count, 2); - - ORKStepResult *stepResult1 = [pageResult stepResultForStepIdentifier:@"step1"]; - XCTAssertNotNil(stepResult1); - XCTAssertEqual(stepResult1.results.count, 2); - - ORKStepResult *stepResult2 = [pageResult stepResultForStepIdentifier:@"step2"]; - XCTAssertNotNil(stepResult2); - XCTAssertEqual(stepResult2.results.count, 1); - - ORKStepResult *stepResult3 = [pageResult stepResultForStepIdentifier:@"step3"]; - XCTAssertNil(stepResult3); - - // Check that the flattened results match the input results - NSArray *flattedResults = [pageResult flattenResults]; - XCTAssertEqualObjects(inputResult.results, flattedResults); -} - @end @implementation ORKResultTestsHelper -- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskViewControllerFinishReason)reason error:(nullable NSError *)error { +- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskFinishReason)reason error:(nullable NSError *)error { // intentionally left empty } @end - - - diff --git a/ResearchKitTests/ORKSecureCodingTests.swift b/ResearchKitTests/ORKSecureCodingTests.swift new file mode 100644 index 0000000000..031cdf6541 --- /dev/null +++ b/ResearchKitTests/ORKSecureCodingTests.swift @@ -0,0 +1,38 @@ +// +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import XCTest +@testable import ResearchKit + +class ORKSecureCodingTests: XCTestCase { + + +} diff --git a/ResearchKitTests/ORKStepTests.m b/ResearchKitTests/ORKStepTests.m index 1e1d2e6a25..0b37f08339 100644 --- a/ResearchKitTests/ORKStepTests.m +++ b/ResearchKitTests/ORKStepTests.m @@ -31,8 +31,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; @import ResearchKit; -@import ResearchKit.Private; +@import ResearchKit_Private; +@import ResearchKitActiveTask; +@import ResearchKitActiveTask_Private; +@import ResearchKitUI; +@import ResearchKitUI_Private; @import UIKit; +#import "ORKReviewStep_Internal.h" @interface ORKStepTests : XCTestCase @@ -60,15 +65,13 @@ - (void)testAttributes { [step setAuxiliaryImage:imageTwo]; [step setIconImage:imageThree]; - ORKStepViewController *controller = [step instantiateStepViewControllerWithResult:result]; + ORKStepViewController *controller = [step makeViewControllerWithResult:result]; XCTAssertEqual([step title], @"Title"); XCTAssertEqual([step text], @"Text"); XCTAssertEqual([step task], task); XCTAssertEqual([controller restorationIdentifier], [step identifier]); - XCTAssertEqual([controller restorationClass], [step stepViewControllerClass]); XCTAssertEqual([controller step], step); - XCTAssertEqual([step stepViewControllerClass], [ORKStepViewController class]); XCTAssertEqual([step isRestorable], YES); XCTAssertEqual([step showsProgress], NO); XCTAssert([step.identifier isEqualToString:@"STEP"]); @@ -323,7 +326,6 @@ - (void)testAttributes { result.booleanAnswer = @(YES); ORKStepResult *stepResult = [[ORKStepResult alloc] initWithStepIdentifier:@"stepOne" results:@[result]]; - ORKTaskResult *taskResult = [[ORKTaskResult alloc] initWithTaskIdentifier:@"task" taskRunUUID:[NSUUID UUID] outputDirectory:nil]; taskResult.results = @[stepResult]; @@ -407,7 +409,6 @@ - (void)testAttributes { XCTAssertEqual([step isOptional], NO); XCTAssertNoThrowSpecificNamed([step validateParameters], NSException, NSInvalidArgumentException, @"Should not throw exception"); XCTAssertEqual([step requestedHealthKitTypesForReading], nil); - XCTAssertEqual([step stepViewControllerClass], [ORKQuestionStepViewController class], @"Should return ORKQuestionStepViewController"); XCTAssert([step isEqual:step]); XCTAssertEqual([step questionType], ORKQuestionTypeText, @"Should return ORKQuestionTypeText"); @@ -484,7 +485,6 @@ - (void)testAttributes { XCTAssertEqual([step identifier], identifier); XCTAssertEqual([step html], html); - XCTAssertEqual([step stepViewControllerClass], [ORKWebViewStepViewController class]); XCTAssert([step isEqual:step]); [step setHtml:nil]; @@ -502,7 +502,8 @@ @implementation ORKLearnMoreInstructionStepTests - (void)testAttributes { NSString *identifier = @"STEP"; ORKLearnMoreInstructionStep *step = [[ORKLearnMoreInstructionStep alloc] initWithIdentifier:identifier]; - + + //TODO: update per specs XCTAssertEqual([step identifier], identifier); } @@ -571,3 +572,33 @@ - (void)testAttributes { } @end + +@interface ORKReviewStepTests : XCTestCase + +@end + +@implementation ORKReviewStepTests + +// ORKReviewStep's implementation of `isStandalone` is +// return _steps != nil; + +- (void)testEmbeddedReviewStep { + // test that embeddedReviewStep always has isStandalone set to false + ORKReviewStep* embeddedReviewStep = [ORKReviewStep embeddedReviewStepWithIdentifier:@"embeddedReviewStep"]; + XCTAssertFalse(embeddedReviewStep.isStandalone); + + // test that standaloneReviewStep with nil steps has isStandalone set to false + ORKReviewStep* standAloneReviewStepWithNilSteps = [ORKReviewStep standaloneReviewStepWithIdentifier:@"standAloneReviewStepWithNilSteps" steps:nil resultSource:nil]; + XCTAssertFalse(standAloneReviewStepWithNilSteps.isStandalone); +} + +- (void)testStandAloneReviewStep { + // test that standaloneReviewStep with non nil steps always has isStandalone set to true + ORKReviewStep* standAloneReviewStep = [ORKReviewStep standaloneReviewStepWithIdentifier:@"standAloneReviewStep" steps:@[] resultSource:nil]; + XCTAssertTrue(standAloneReviewStep.isStandalone); + + // test that standaloneReviewStep with defined steps always has isStandalone set to true + ORKReviewStep* standAloneReviewStepWithSteps = [ORKReviewStep standaloneReviewStepWithIdentifier:@"standAloneReviewStep" steps:@[[[ORKInstructionStep alloc] initWithIdentifier:@"instructionStep"]] resultSource:nil]; + XCTAssertTrue(standAloneReviewStepWithSteps.isStandalone); +} +@end diff --git a/ResearchKitTests/ORKStepViewControllerHelpers.swift b/ResearchKitTests/ORKStepViewControllerHelpers.swift index 003119912b..a6a2032d10 100644 --- a/ResearchKitTests/ORKStepViewControllerHelpers.swift +++ b/ResearchKitTests/ORKStepViewControllerHelpers.swift @@ -1,6 +1,6 @@ /* Copyright (c) 2019, Apple Inc. All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -28,7 +28,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - import XCTest import UIKit @@ -51,7 +50,6 @@ class TopLevelUIUtilities { XCTFail("tearDownTopLevelUI() was called without setupTopLevelUI() being called first") return } - rootViewController.viewWillDisappear(false) rootViewController.viewDidDisappear(false) rootWindow.rootViewController = nil diff --git a/ResearchKitTests/ORKStepViewControllerTests.swift b/ResearchKitTests/ORKStepViewControllerTests.swift index 44eb500a71..93ee12c6f1 100644 --- a/ResearchKitTests/ORKStepViewControllerTests.swift +++ b/ResearchKitTests/ORKStepViewControllerTests.swift @@ -30,6 +30,9 @@ import XCTest import ResearchKit +@testable import ResearchKitUI +@testable import ResearchKitUI_Private +import ResearchKitActiveTask class ORKStepViewControllerTests: XCTestCase { diff --git a/ResearchKitTests/ORKSwiftStroopTests.swift b/ResearchKitTests/ORKSwiftStroopTests.swift deleted file mode 100644 index 7a7f39708c..0000000000 --- a/ResearchKitTests/ORKSwiftStroopTests.swift +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (c) 2019, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -import XCTest -@testable import ResearchKit -import Foundation - -class ORKSwiftStroopStepTests: XCTestCase { - - var stroopStep: ORKSwiftStroopStep! - let identifier = "stroopStep" - let numberOfAttempts = 20 - - override func setUp() { - super.setUp() - stroopStep = ORKSwiftStroopStep(identifier: identifier) - stroopStep.numberOfAttempts = numberOfAttempts - } - - func testIdentifier() { - XCTAssertEqual(stroopStep.identifier, identifier) - } - - func testProperties() { - XCTAssertEqual(stroopStep.numberOfAttempts, numberOfAttempts) - } - - func testMethods() { - - XCTAssertTrue(stroopStep.stepViewControllerClass() === ORKSwiftStroopStepViewController.self) - } -} - -class ORKSStroopStepViewControllerTests: XCTestCase { - - var stroopStep: ORKSwiftStroopStep! - var stroopStepViewController: ORKSwiftStroopStepViewController! - let identifier = "stroopStep" - let numberOfAttempts = 20 - - override func setUp() { - super.setUp() - stroopStep = ORKSwiftStroopStep(identifier: identifier) - stroopStep.numberOfAttempts = numberOfAttempts - stroopStepViewController = ORKSwiftStroopStepViewController(step: stroopStep) - stroopStepViewController.viewDidLoad() - stroopStepViewController.start() - } - - func testProperties() { - XCTAssertEqual(stroopStepViewController.step, stroopStep) - } -} diff --git a/ResearchKitTests/ORKTaskTests.m b/ResearchKitTests/ORKTaskTests.m index f23b9534da..845feb4473 100644 --- a/ResearchKitTests/ORKTaskTests.m +++ b/ResearchKitTests/ORKTaskTests.m @@ -30,8 +30,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; - +@import ResearchKit_Private; +@import ResearchKitUI; +@import ResearchKitActiveTask; @interface ORKTaskTests : XCTestCase @@ -53,7 +54,7 @@ @interface MockTaskViewController : ORKTaskViewController @interface ORKTaskViewController (Testing) - (BOOL)hasSaveableResults; -- (BOOL)canDiscardResults; +- (BOOL)isSafeToSkipConfirmation; @end @interface ORKReviewStep (Testing) @@ -1455,13 +1456,7 @@ - (void)testTaskViewControllerCanDiscardLogic { // if currentStep == instructionStep and not saveable -> canDiscardResults XCTAssertEqual(taskViewController.currentStepViewController.step.identifier , @"instuction-0"); - XCTAssertTrue([taskViewController canDiscardResults]); - - // if currentStep is standalone review step and not saveable => canDiscardResults - [taskViewController goForward]; - ORKReviewStep *reviewStep = ORKDynamicCast(taskViewController.currentStepViewController.step, ORKReviewStep); - XCTAssertTrue([reviewStep isStandalone]); - XCTAssertTrue([taskViewController canDiscardResults]); + XCTAssertTrue([taskViewController isSafeToSkipConfirmation]); } // test cases where hasSaveableResults == YES @@ -1476,13 +1471,7 @@ - (void)testTaskViewControllerCanDiscardLogic { // if currentStep == instructionStep and saveable -> CANNOT discardResults XCTAssertEqual(taskViewController.currentStepViewController.step.identifier , @"instuction-0"); - XCTAssertFalse([taskViewController canDiscardResults]); - - // if currentStep is standalone review step and saveable => canDiscardResults - [taskViewController goForward]; - ORKReviewStep *reviewStep = ORKDynamicCast(taskViewController.currentStepViewController.step, ORKReviewStep); - XCTAssertTrue([reviewStep isStandalone]); - XCTAssertTrue([taskViewController canDiscardResults]); + XCTAssertFalse([taskViewController isSafeToSkipConfirmation]); } { @@ -1503,20 +1492,6 @@ - (void)testTaskViewControllerCanDiscardLogic { ORKReviewStepViewController *reviewViewController = ORKDynamicCast(taskViewController.currentStepViewController, ORKReviewStepViewController); XCTAssertNotNil(reviewViewController, "taskViewController.currentStepViewController should be of type ORKReviewStepViewController at this point"); - - - // [TODO]:Test if currentStep is reviewStep but not standalone -> CANNOT discardResults - - - // before reviewStepViewController:willReviewStep, currentStepViewController should not be in readOnlyMode - XCTAssertFalse(taskViewController.currentStepViewController.readOnlyMode); - - // call reviewStepViewController:willReviewStep: to prepare the stepViewController for review - [taskViewController reviewStepViewController:reviewViewController willReviewStep:testStep]; - - // if current viewController.readOnly -> canDiscardResults - XCTAssertTrue(taskViewController.currentStepViewController.readOnlyMode); - XCTAssertTrue([taskViewController canDiscardResults]); } { @@ -1531,8 +1506,7 @@ - (void)testTaskViewControllerCanDiscardLogic { XCTAssertEqual(taskViewController.currentStepViewController.step.identifier, @"Who's there?"); // if current viewController.readOnly is FALSE -> CANNOT discardResults - XCTAssertFalse(taskViewController.currentStepViewController.readOnlyMode); - XCTAssertFalse([taskViewController canDiscardResults]); + XCTAssertFalse([taskViewController isSafeToSkipConfirmation]); } } @@ -1871,7 +1845,7 @@ - (instancetype)init return self; } -- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskViewControllerFinishReason)reason error:(NSError *)error { +- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskFinishReason)reason error:(NSError *)error { // Add results of method call MethodObject *obj = [[MethodObject alloc] init]; diff --git a/ResearchKitTests/ORKTaskViewControllerTests.swift b/ResearchKitTests/ORKTaskViewControllerTests.swift new file mode 100644 index 0000000000..95cf5d1f34 --- /dev/null +++ b/ResearchKitTests/ORKTaskViewControllerTests.swift @@ -0,0 +1,322 @@ +// +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import ResearchKit +import ResearchKitUI +import XCTest + +enum ORKIdentifier: String { + case instructionStep1, + questionStep1, + questionStep2, + questionStep3, + questionStep4, + completionStep1, + orderedTask1 +} + +class FauxTaskViewController: NSObject, ORKTaskViewControllerDelegate { + + var expectation: XCTestExpectation? + + func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskFinishReason, error: Error?) { + if reason == .completed { + expectation?.fulfill() + } + } + + func taskViewControllerSupportsSaveAndRestore(_ taskViewController: ORKTaskViewController) -> Bool { + return true + } +} + +final class ORKTaskViewControllerTests: XCTestCase { + + var taskCompletionExpectation: XCTestExpectation? + + var options = [ + ORKTextChoice( + text: "Banana", + value: 1 as NSCopying & NSSecureCoding & NSObjectProtocol + ), + ORKTextChoice( + text: "Lychee", + value: 2 as NSCopying & NSSecureCoding & NSObjectProtocol + ), + ORKTextChoice( + text: "Kiwi", + value: 3 as NSCopying & NSSecureCoding & NSObjectProtocol + ), + ORKTextChoice( + text: "Orange", + value: 4 as NSCopying & NSSecureCoding & NSObjectProtocol + ), + ] + + override func setUpWithError() throws { + try super.setUpWithError() + + taskCompletionExpectation = nil + + taskCompletionExpectation = XCTestExpectation(description: "TaskCompletion") + + } + + func createTask() -> ORKOrderedTask { + // Step 1 + let instructionStep1 = ORKInstructionStep(identifier: ORKIdentifier.instructionStep1.rawValue) + + // Step 2 + let q1AnswerFormat = ORKNumericAnswerFormat(style: .integer) + + let questionStep1 = ORKQuestionStep( + identifier: ORKIdentifier.questionStep1.rawValue, + title: "First Question Title", + question: "What is your age?", + answer: q1AnswerFormat + ) + + // Step 3 + let q2AnswerFormat = ORKTextAnswerFormat() + + let questionStep2 = ORKQuestionStep( + identifier: ORKIdentifier.questionStep2.rawValue, + title: "Title for Second Question", + question: "What is your name?", + answer: q2AnswerFormat + ) + + // Step 4 + let q3AnswerFormat = ORKTextChoiceAnswerFormat( + style: .singleChoice, + textChoices: options + ) + + let questionStep3 = ORKQuestionStep( + identifier: ORKIdentifier.questionStep3.rawValue, + title: "Question 3", + question: "What is your favorite fruit?", + answer: q3AnswerFormat + ) + + // Step 5 + let q4AnswerFormat = ORKScaleAnswerFormat( + maximumValue: 10, + minimumValue: 1, + defaultValue: 5, + step: 1 + ) + + let questionStep4 = ORKQuestionStep( + identifier: ORKIdentifier.questionStep4.rawValue, + title: "Question 4", + question: "How many fingers do you have?", + answer: q4AnswerFormat + ) + + // Step 6 + let completionStep1 = ORKCompletionStep( + identifier: ORKIdentifier.completionStep1.rawValue + ) + + let task = ORKOrderedTask( + identifier: ORKIdentifier.orderedTask1.rawValue, + steps: [ + instructionStep1, + questionStep1, + questionStep2, + questionStep3, + questionStep4, + completionStep1, + ] + ) + return task + } + + func testTaskSerialization() { + + let task = createTask() + let taskRunUUID = UUID() + let initialTaskViewController = ORKTaskViewController( + task: task, + taskRun: taskRunUUID + ) + let delegate = FauxTaskViewController() + delegate.expectation = taskCompletionExpectation + initialTaskViewController.delegate = delegate + + mockPresentTaskViewController(taskViewController: initialTaskViewController) + + wait(for: [taskCompletionExpectation!], timeout: 2.0) + + guard let restoredData = initialTaskViewController.restorationData else { + XCTFail("Unable to get restoration data for task") + return + } + + let restoredTaskViewController = ORKTaskViewController( + task: task, + restorationData: restoredData, + delegate: FauxTaskViewController(), + error: nil + ) + + let initialResult = initialTaskViewController.result + let restoredResult = restoredTaskViewController.result + + XCTAssertEqual(initialTaskViewController.task?.identifier, restoredTaskViewController.task?.identifier) + XCTAssertEqual(initialResult.results?.count, restoredResult.results?.count) + + initialResult.results?.enumerated().forEach({ index, stepResult in + guard + let resCount = restoredResult.results?.count, + index < resCount, + let stepResult = stepResult as? ORKStepResult, + let restoredStepResult = restoredResult.results?[index] as? ORKStepResult + else { + XCTFail("Unable to get same result after restoring with data") + return + } + + XCTAssertEqual(stepResult.identifier, restoredStepResult.identifier) + + switch stepResult.identifier { + + case ORKIdentifier.instructionStep1.rawValue, ORKIdentifier.completionStep1.rawValue: + break + case ORKIdentifier.questionStep1.rawValue: + guard + let numericResult = stepResult.results?.first as? ORKNumericQuestionResult, + let restoredNumericResult = restoredStepResult.results?.first as? ORKNumericQuestionResult + else { + XCTFail("Incorrect step result format") + return + } + XCTAssertEqual(numericResult.numericAnswer, restoredNumericResult.numericAnswer) + + case ORKIdentifier.questionStep2.rawValue: + guard + let textResult = stepResult.results?.first as? ORKTextQuestionResult, + let restoredTextResult = restoredStepResult.results?.first as? ORKTextQuestionResult + else { + XCTFail("Incorrect step result format") + return + } + XCTAssertEqual(textResult.textAnswer, restoredTextResult.textAnswer) + + case ORKIdentifier.questionStep3.rawValue: + guard + let choiceResult = stepResult.results?.first as? ORKChoiceQuestionResult, + let restoredChoiceResult = restoredStepResult.results?.first as? ORKChoiceQuestionResult + else { + XCTFail("Incorrect step result format") + return + } + XCTAssertEqual(choiceResult.answer as? Int, restoredChoiceResult.answer as? Int) + + case ORKIdentifier.questionStep4.rawValue: + guard + let scaleResult = stepResult.results?.first as? ORKScaleQuestionResult, + let restoredScaleResult = restoredStepResult.results?.first as? ORKScaleQuestionResult + else { + XCTFail("Incorrect step result format") + return + } + XCTAssertEqual(scaleResult.scaleAnswer, restoredScaleResult.scaleAnswer) + default: + XCTFail("Unidentifiable step identifier") + } + }) + } + + func mockPresentTaskViewController(taskViewController: ORKTaskViewController) { + guard + let orderedTask = taskViewController.task as? ORKOrderedTask, + orderedTask.steps.isEmpty == false + else { + XCTFail("Incorrect number of steps in task") + return + } + + for step in orderedTask.steps { + taskViewController.flipToPage(withIdentifier: step.identifier, forward: true, animated: false) + + guard + let currentStepViewController = taskViewController.currentStepViewController + else { + XCTFail("Unable to find next StepViewController") + return + } + + switch step.identifier { + case ORKIdentifier.instructionStep1.rawValue, ORKIdentifier.completionStep1.rawValue: + break + case ORKIdentifier.questionStep1.rawValue: + let result = ORKNumericQuestionResult(identifier: step.identifier) + result.questionType = .integer + let answer = 31 as NSNumber + result.numericAnswer = answer + currentStepViewController.addResult(result) + + case ORKIdentifier.questionStep2.rawValue: + let result = ORKTextQuestionResult(identifier: step.identifier) + result.questionType = .text + let answer = "SAMPLETEXT" + result.textAnswer = answer + currentStepViewController.addResult(result) + + case ORKIdentifier.questionStep3.rawValue: + + let result = ORKChoiceQuestionResult(identifier: step.identifier) + result.questionType = .singleChoice + guard + let answer = options.last?.value + else { + return + } + result.choiceAnswers = [answer] + currentStepViewController.addResult(result) + + case ORKIdentifier.questionStep4.rawValue: + let result = ORKScaleQuestionResult(identifier: step.identifier) + result.questionType = .scale + let answer = 6 as NSNumber + result.scaleAnswer = answer + currentStepViewController.addResult(result) + + default: + XCTFail("Unidentifiable step identifier") + } + + taskViewController.stepViewController(currentStepViewController, didFinishWith: .forward) + } + } +} diff --git a/ResearchKitTests/ORKTextButtonTests.swift b/ResearchKitTests/ORKTextButtonTests.swift deleted file mode 100644 index 09c4a10111..0000000000 --- a/ResearchKitTests/ORKTextButtonTests.swift +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (c) 2022, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import XCTest -@testable import ResearchKit - -class ORKTextButtonTests: XCTestCase { - - let button = ORKTextButton(type: .custom) - - override func setUp() { - super.setUp() - - button.updateContentInsets(NSDirectionalEdgeInsets(top: 10, leading: 0, bottom: 10, trailing: 10)) - } - - func testProperties() { - XCTAssertNotNil(button.configuration) - XCTAssertEqual(button.configuration!.contentInsets.top, 10); - XCTAssertEqual(button.configuration!.contentInsets.leading, 0); - XCTAssertEqual(button.configuration!.contentInsets.bottom, 10); - XCTAssertEqual(button.configuration!.contentInsets.trailing, 10); - } -} diff --git a/ResearchKitTests/ORKTextChoiceCellGroupTests.m b/ResearchKitTests/ORKTextChoiceCellGroupTests.m index 59b84347c5..4dd5da5f53 100644 --- a/ResearchKitTests/ORKTextChoiceCellGroupTests.m +++ b/ResearchKitTests/ORKTextChoiceCellGroupTests.m @@ -31,7 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; #import "ORKChoiceViewCell.h" #import "ORKTextChoiceCellGroup.h" @@ -620,7 +620,6 @@ - (void)testTextChoiceOthers { XCTAssertNotNil(cell, @""); XCTAssertEqualObjects(cell.reuseIdentifier, @"abc", @""); XCTAssertEqual(cell.immediateNavigation, YES, @""); - if (choice.textViewStartsHidden) { XCTAssertTrue(cell.textView.isHidden); } diff --git a/ResearchKitTests/ORKUIViewAccessibilityTests.m b/ResearchKitTests/ORKUIViewAccessibilityTests.m index 1e287395e8..1ef56c78e7 100644 --- a/ResearchKitTests/ORKUIViewAccessibilityTests.m +++ b/ResearchKitTests/ORKUIViewAccessibilityTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; #import "UIView+ORKAccessibility.h" diff --git a/ResearchKitTests/ORKVoiceEngineTests.m b/ResearchKitTests/ORKVoiceEngineTests.m index e9900761ef..92955b9289 100644 --- a/ResearchKitTests/ORKVoiceEngineTests.m +++ b/ResearchKitTests/ORKVoiceEngineTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit_Private; #import "ORKVoiceEngine_Internal.h" diff --git a/ResearchKitTests/ResearchKitTests-Bridging-Header.h b/ResearchKitTests/ResearchKitTests-Bridging-Header.h index 4ab14623e0..c724943bf0 100644 --- a/ResearchKitTests/ResearchKitTests-Bridging-Header.h +++ b/ResearchKitTests/ResearchKitTests-Bridging-Header.h @@ -4,3 +4,7 @@ #import "ResearchKit.h" #import "ResearchKit_Private.h" +#import "ResearchKitUI.h" +#import "ResearchKitUI_Private.h" +#import "ORKFormStepViewController+TestingSupport.h" +#import "NSObject+TestingSupport.h" diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/Info.plist b/ResearchKitTests/samples.bundle/Info.plist similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/Info.plist rename to ResearchKitTests/samples.bundle/Info.plist diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORK3DModelManager.json b/ResearchKitTests/samples.bundle/ORK3DModelManager.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORK3DModelManager.json rename to ResearchKitTests/samples.bundle/ORK3DModelManager.json diff --git a/ResearchKitTests/samples.bundle/ORK3DModelStep.json b/ResearchKitTests/samples.bundle/ORK3DModelStep.json new file mode 100644 index 0000000000..e4829de4a7 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORK3DModelStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"50DE67FB-AE5A-4C1A-97E6-038BAB9A346F"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"23DBF489-731A-446A-A5ED-3D3E737C5E12"},"title":"","image":{"imageName":"A39F0D25-B88E-446C-BC34-614AE0405E73"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment":0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORK3DModelStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0, "modelManager": {"_class":"ORK3DModelManager", "allowsSelection":false, "identifiersOfObjectsToHighlight":[], "highlightColor": {"r":1, "g":1, "b":1, "a":1 }},"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAccelerometerRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKAccelerometerRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKAccelerometerRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKAccelerometerRecorderConfiguration.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAccuracyStroopResult.json b/ResearchKitTests/samples.bundle/ORKAccuracyStroopResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKAccuracyStroopResult.json rename to ResearchKitTests/samples.bundle/ORKAccuracyStroopResult.json diff --git a/ResearchKitTests/samples.bundle/ORKAccuracyStroopStep.json b/ResearchKitTests/samples.bundle/ORKAccuracyStroopStep.json new file mode 100644 index 0000000000..58f6594405 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKAccuracyStroopStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"62E9D4CF-3E7B-49B8-A295-7D2EB1ECC00B"},"auxiliaryImage":{"imageName":"8C25AB92-00C9-4E13-B55F-711658F53D48"},"title":"","image":{"imageName":"4930AC43-8AAA-4563-8C8F-6E7E25E550C3"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":9.2233720368547758e+18,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":true,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAccuracyStroopStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}, "baseDisplayColor":{"r":1,"g":1,"b":1,"a":1}, "isColorMatching":false} diff --git a/ResearchKitTests/samples.bundle/ORKActiveStep.json b/ResearchKitTests/samples.bundle/ORKActiveStep.json new file mode 100644 index 0000000000..ea561571c0 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKActiveStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"50DE67FB-AE5A-4C1A-97E6-038BAB9A346F"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"23DBF489-731A-446A-A5ED-3D3E737C5E12"},"title":"","image":{"imageName":"A39F0D25-B88E-446C-BC34-614AE0405E73"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment":0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKActiveStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKAgeAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKAgeAnswerFormat.json new file mode 100644 index 0000000000..88d62819eb --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKAgeAnswerFormat.json @@ -0,0 +1,2 @@ +{"defaultValue":0,"relativeYear":2023,"_class":"ORKAgeAnswerFormat","minimumAge":0,"maximumAge":80,"minimumAgeCustomText":"","maximumAgeCustomText":"","showYear":false,"useYearForResult":false ,"treatMinAgeAsRange":false,"treatMaxAgeAsRange":false, "showDontKnowButton":false,"customDontKnowButtonText":"","dontKnowButtonStyle":0} + diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAmslerGridResult.json b/ResearchKitTests/samples.bundle/ORKAmslerGridResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKAmslerGridResult.json rename to ResearchKitTests/samples.bundle/ORKAmslerGridResult.json diff --git a/ResearchKitTests/samples.bundle/ORKAmslerGridStep.json b/ResearchKitTests/samples.bundle/ORKAmslerGridStep.json new file mode 100644 index 0000000000..fad37e75c8 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKAmslerGridStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"DFC4815F-FB55-4365-9D10-FF2BA83879A1"},"auxiliaryImage":{"imageName":"3E076C04-09E0-4055-8FBE-5309DC4A5348"},"title":"","image":{"imageName":"0905D188-3CBD-4DEE-82C7-11165BA8352B"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0,"stepDuration":9.2233720368547758e+18,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","eyeSide":0,"optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":true,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAmslerGridStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKAnswerFormat.json diff --git a/ResearchKitTests/samples.bundle/ORKAudioFitnessStep.json b/ResearchKitTests/samples.bundle/ORKAudioFitnessStep.json new file mode 100644 index 0000000000..9f91ed8376 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKAudioFitnessStep.json @@ -0,0 +1 @@ +{"vocalCues":[{"_class":"ORKVocalCue","time": 12,"spokenText":"words"}, {"_class":"ORKVocalCue","time": 13,"spokenText":"more words"}],"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"3F5C9800-6A7A-4158-8ECF-0832B44DF6C1"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"988B687D-F50F-4B89-B6B7-20F11AE6AC8E"},"title":"","image":{"imageName":"B7400237-AD21-4AA3-8E4C-60F06E05EA39"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAudioFitnessStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"userInfo":{},"audioAsset":{"_class":"ORKBundleAsset","name":"filename","bundleIdentifier":"com.bundle.identifier","fileExtension":"mp4"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioLevelNavigationRule.json b/ResearchKitTests/samples.bundle/ORKAudioLevelNavigationRule.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioLevelNavigationRule.json rename to ResearchKitTests/samples.bundle/ORKAudioLevelNavigationRule.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKAudioRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKAudioRecorderConfiguration.json diff --git a/ResearchKitTests/samples.bundle/ORKAudioStep.json b/ResearchKitTests/samples.bundle/ORKAudioStep.json new file mode 100644 index 0000000000..0f2b549dc6 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKAudioStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"244AD43E-7785-4BF5-829C-A3B5C771E9F2"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"A35CAC85-9557-4ED5-9807-DCFDAC04C81D"},"title":"","image":{"imageName":"5E598B50-21DC-400E-8D80-75BB26BDCD65"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0,"stepDuration":0,"useRecordButton":false,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAudioStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioStreamerConfiguration.json b/ResearchKitTests/samples.bundle/ORKAudioStreamerConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioStreamerConfiguration.json rename to ResearchKitTests/samples.bundle/ORKAudioStreamerConfiguration.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKBodyItem.json b/ResearchKitTests/samples.bundle/ORKBodyItem.json similarity index 81% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKBodyItem.json rename to ResearchKitTests/samples.bundle/ORKBodyItem.json index 2deaa98573..be8606de3f 100644 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKBodyItem.json +++ b/ResearchKitTests/samples.bundle/ORKBodyItem.json @@ -1 +1 @@ -{"text":"","learnMoreItem":{"_class":"ORKLearnMoreItem"},"bodyItemStyle":0,"_class":"ORKBodyItem","detailText":"","image":{"imageName":"55324853-4B02-4BC2-B295-C42B8D9D814D"},"useCardStyle":0, "useSecondaryColor":0} +{"text":"","learnMoreItem":{"_class":"ORKLearnMoreItem"},"bodyItemStyle":0,"_class":"ORKBodyItem","detailText":"","image":{"imageName":"55324853-4B02-4BC2-B295-C42B8D9D814D"},"useCardStyle":0, "useSecondaryColor":0, "alignImageToTop":0} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKBooleanAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKBooleanAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKBooleanAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKBooleanAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKBooleanQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKBooleanQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKBooleanQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKBooleanQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKBooleanQuestionResult.json b/ResearchKitTests/samples.bundle/ORKBooleanQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKBooleanQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKBooleanQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKBundleAsset.json b/ResearchKitTests/samples.bundle/ORKBundleAsset.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKBundleAsset.json rename to ResearchKitTests/samples.bundle/ORKBundleAsset.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKChoiceQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKChoiceQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKChoiceQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKChoiceQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKChoiceQuestionResult.json b/ResearchKitTests/samples.bundle/ORKChoiceQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKChoiceQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKChoiceQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKCollectionResult.json b/ResearchKitTests/samples.bundle/ORKCollectionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKCollectionResult.json rename to ResearchKitTests/samples.bundle/ORKCollectionResult.json diff --git a/ResearchKitTests/samples.bundle/ORKColorChoice.json b/ResearchKitTests/samples.bundle/ORKColorChoice.json new file mode 100644 index 0000000000..89b3deb199 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKColorChoice.json @@ -0,0 +1,3 @@ +{"_class":"ORKColorChoice","value":"foo","text":"","detailText":"","color": {"r":1, "g":1, "b":1, "a":1 }, "exclusive":false} + + diff --git a/ResearchKitTests/samples.bundle/ORKColorChoiceAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKColorChoiceAnswerFormat.json new file mode 100644 index 0000000000..8e782be953 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKColorChoiceAnswerFormat.json @@ -0,0 +1,2 @@ +{"style":"singleChoice","_class":"ORKColorChoiceAnswerFormat","colorChoices":[],"showDontKnowButton":false,"customDontKnowButtonText":"","dontKnowButtonStyle":0} + diff --git a/ResearchKitTests/samples.bundle/ORKCompletionStep.json b/ResearchKitTests/samples.bundle/ORKCompletionStep.json new file mode 100644 index 0000000000..df416ef787 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKCompletionStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKCompletionStep","iconImage":{"imageName":"2A7001B3-FE8B-4628-B9A3-848BBEF58B1F"},"auxiliaryImage":{"imageName":"685A4968-7933-4BCE-A646-9EBE32A63514"},"title":"","identifier":"","image":{"imageName":"7469F374-6BCA-4716-8BF1-AFF1761E6DE2"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"text":"","detailText":"", "headerTextAlignment": 0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0, "reasonForCompletion":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKConditionStepConfiguration.json b/ResearchKitTests/samples.bundle/ORKConditionStepConfiguration.json new file mode 100644 index 0000000000..a6692947e2 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKConditionStepConfiguration.json @@ -0,0 +1,4 @@ +{"_class":"ORKConditionStepConfiguration","stepIdentifier":"","conditionsFormItemIdentifier":"", "formItems":[{"placeholder":"","answerFormat":{"_class":"ORKAnswerFormat"},"_class":"ORKFormItem","optional":false,"learnMoreItem":{"_class":"ORKLearnMoreItem"},"text":"","identifier":"","detailText":"","showsProgress":false, "tagText": ""} +], "conditions":[{"_class":"ORKHealthCondition","identifier":"","displayName":"","value":"lorem"}]} + + diff --git a/ResearchKitTests/samples.bundle/ORKConfirmTextAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKConfirmTextAnswerFormat.json new file mode 100644 index 0000000000..4d055ac69c --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKConfirmTextAnswerFormat.json @@ -0,0 +1 @@ +{"multipleLines": false, "hideClearButton": false, "hideCharacterCountLabel": false, "secureTextEntry": false, "keyboardType": 0, "validationRegularExpression": {"pattern": ".", "options": []}, "_class": "ORKConfirmTextAnswerFormat", "spellCheckingType": 0, "invalidMessage": "", "errorMessage": "", "maximumLength": 0, "textContentType": "", "passwordRules": {"rules": ""}, "originalItemIdentifier": "", "autocorrectionType": 0, "autocapitalizationType": 0, "defaultTextAnswer": "", "showDontKnowButton": false, "customDontKnowButtonText": "", "dontKnowButtonStyle": 0, "placeholder": ""} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentDocument.json b/ResearchKitTests/samples.bundle/ORKConsentDocument.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentDocument.json rename to ResearchKitTests/samples.bundle/ORKConsentDocument.json diff --git a/ResearchKitTests/samples.bundle/ORKConsentReviewStep.json b/ResearchKitTests/samples.bundle/ORKConsentReviewStep.json new file mode 100644 index 0000000000..0bbf0136f1 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKConsentReviewStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "consentDocument":{"_class":"ORKConsentDocument"},"optional":false,"shouldTintImages":true,"requiresScrollToBottom":false,"_class":"ORKConsentReviewStep","useSurveyMode":false,"iconImage":{"imageName":"7259A545-C1AF-4696-B0A5-E4DADBB7172F"},"title":"","auxiliaryImage":{"imageName":"0336A673-281A-47C4-BB1E-2428BFBFA947"},"signature":{"requiresName":true,"requiresSignatureImage":true,"_class":"ORKConsentSignature","identifier":"5739826D-2DEA-4CB9-AB4E-10047140EC66"},"identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"76F181D1-005C-43C2-B429-AE931FE7371E"},"text":"","reasonForConsent":"","imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSection.json b/ResearchKitTests/samples.bundle/ORKConsentSection.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSection.json rename to ResearchKitTests/samples.bundle/ORKConsentSection.json diff --git a/ResearchKitTests/samples.bundle/ORKConsentSharingStep.json b/ResearchKitTests/samples.bundle/ORKConsentSharingStep.json new file mode 100644 index 0000000000..1a01ec1aaa --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKConsentSharingStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"answerFormat":{"_class":"ORKAnswerFormat"},"detailText":"", "headerTextAlignment": 0, "optional":true,"shouldTintImages":true,"useSurveyMode":false,"_class":"ORKConsentSharingStep","presentationStyle":"default","iconImage":{"imageName":"648F7701-58AE-4D8E-9BF4-7CEB2544CE26"},"auxiliaryImage":{"imageName":"47CCEC1A-365D-4A7B-AE45-381EDD7B1F32"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"E0C3A64C-50AA-4499-8CF6-41EBEA752510"},"text":"","placeholder":"","question":"","localizedLearnMoreHTMLContent":"","useCardView":true,"imageContentMode": 0, "learnMoreItem":{"_class":"ORKLearnMoreItem"},"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0, "tagText": "","earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSignature.json b/ResearchKitTests/samples.bundle/ORKConsentSignature.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSignature.json rename to ResearchKitTests/samples.bundle/ORKConsentSignature.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSignatureResult.json b/ResearchKitTests/samples.bundle/ORKConsentSignatureResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSignatureResult.json rename to ResearchKitTests/samples.bundle/ORKConsentSignatureResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKContinuousScaleAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKContinuousScaleAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKContinuousScaleAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKContinuousScaleAnswerFormat.json diff --git a/ResearchKitTests/samples.bundle/ORKCountdownStep.json b/ResearchKitTests/samples.bundle/ORKCountdownStep.json new file mode 100644 index 0000000000..d1ae761ecd --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKCountdownStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"B6F92FB7-5395-4AE2-9360-066CA37A418E"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"C7C218A3-69F7-4C4E-9501-BAD38CC4260F"},"title":"","image":{"imageName":"55019522-82E5-4D89-86D3-0ACD6A220E9E"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0, "stepDuration":5,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKCountdownStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKDateAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKDateAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKDateAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKDateAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKDateQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKDateQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKDateQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKDateQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKDateQuestionResult.json b/ResearchKitTests/samples.bundle/ORKDateQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKDateQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKDateQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKDevice.json b/ResearchKitTests/samples.bundle/ORKDevice.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKDevice.json rename to ResearchKitTests/samples.bundle/ORKDevice.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKDeviceMotionRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKDeviceMotionRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKDeviceMotionRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKDeviceMotionRecorderConfiguration.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKDirectStepNavigationRule.json b/ResearchKitTests/samples.bundle/ORKDirectStepNavigationRule.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKDirectStepNavigationRule.json rename to ResearchKitTests/samples.bundle/ORKDirectStepNavigationRule.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKEarlyTerminationConfiguration.json b/ResearchKitTests/samples.bundle/ORKEarlyTerminationConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKEarlyTerminationConfiguration.json rename to ResearchKitTests/samples.bundle/ORKEarlyTerminationConfiguration.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKEmailAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKEmailAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKEmailAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKEmailAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKEnvironmentSPLMeterResult.json b/ResearchKitTests/samples.bundle/ORKEnvironmentSPLMeterResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKEnvironmentSPLMeterResult.json rename to ResearchKitTests/samples.bundle/ORKEnvironmentSPLMeterResult.json diff --git a/ResearchKitTests/samples.bundle/ORKEnvironmentSPLMeterStep.json b/ResearchKitTests/samples.bundle/ORKEnvironmentSPLMeterStep.json new file mode 100644 index 0000000000..07bdff3298 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKEnvironmentSPLMeterStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"883D1208-F5D7-438F-96E2-BDCADF944A00"},"auxiliaryImage":{"imageName":"314A97C4-3FC7-42E3-BA7F-318B7584547E"},"thresholdValue":35,"title":"","shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"image":{"imageName":"B6828B3C-AE63-4DDC-A099-CA8898DBD6CA"},"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":true,"requiredContiguousSamples":5,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"samplingInterval":1,"finishedSpokenInstruction":"","_class":"ORKEnvironmentSPLMeterStep","text":"","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKFamilyHistoryResult.json b/ResearchKitTests/samples.bundle/ORKFamilyHistoryResult.json new file mode 100644 index 0000000000..2623c04501 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKFamilyHistoryResult.json @@ -0,0 +1,3 @@ +{"_class":"ORKFamilyHistoryResult","relatedPersons":[], "displayedConditions":[],"endDate":"2019-05-27T00:35:06-0700","startDate":"2019-05-27T00:35:06-0700","identifier":"","userInfo":{}} + + diff --git a/ResearchKitTests/samples.bundle/ORKFamilyHistoryStep.json b/ResearchKitTests/samples.bundle/ORKFamilyHistoryStep.json new file mode 100644 index 0000000000..3fa542e03d --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKFamilyHistoryStep.json @@ -0,0 +1,2 @@ +{"_class":"ORKFamilyHistoryStep","relativeGroups":[], "conditionStepConfiguration":{"_class":"ORKConditionStepConfiguration","stepIdentifier":"","formItems":[{"placeholder":"","answerFormat":{"_class":"ORKAnswerFormat"},"_class":"ORKFormItem","optional":false,"learnMoreItem":{"_class":"ORKLearnMoreItem"},"text":"","identifier":"","detailText":"","showsProgress":false, "tagText": ""} +], "conditions":[{"_class":"ORKHealthCondition","identifier":"","displayName":"","value":"lorem"}]}, "bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"iconImage":{"imageName":"1425D9D4-DB67-4B5D-93B0-FE3125E67262"},"auxiliaryImage":{"imageName":"5DEF32D5-D23E-4E8F-8C05-4B1D24E6257D"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"DB613E0C-4491-457B-B958-C7FBE6232101"},"text":"","detailText":"","headerTextAlignment": 0,"imageContentMode": 0, "headerTextAlignment": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFileResult.json b/ResearchKitTests/samples.bundle/ORKFileResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKFileResult.json rename to ResearchKitTests/samples.bundle/ORKFileResult.json diff --git a/ResearchKitTests/samples.bundle/ORKFitnessStep.json b/ResearchKitTests/samples.bundle/ORKFitnessStep.json new file mode 100644 index 0000000000..a7f6b2f5ae --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKFitnessStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"3F5C9800-6A7A-4158-8ECF-0832B44DF6C1"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"988B687D-F50F-4B89-B6B7-20F11AE6AC8E"},"title":"","image":{"imageName":"B7400237-AD21-4AA3-8E4C-60F06E05EA39"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKFitnessStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"userInfo":{}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFormItem.json b/ResearchKitTests/samples.bundle/ORKFormItem.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKFormItem.json rename to ResearchKitTests/samples.bundle/ORKFormItem.json diff --git a/ResearchKitTests/samples.bundle/ORKFormStep.json b/ResearchKitTests/samples.bundle/ORKFormStep.json new file mode 100644 index 0000000000..4a1ed41e6f --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKFormStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":true,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKFormStep","auxiliaryImage":{"imageName":"747C6BFD-53E7-47EE-95B6-D4ABDC6270CF"},"iconImage":{"imageName":"A9782DB7-4168-4967-8E34-F75A62A7106E"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"0BBE4F43-391F-4B33-9770-740363779CBD"},"text":"","formItems":[],"useCardView":true,"autoScrollEnabled":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKFrontFacingCameraStep.json b/ResearchKitTests/samples.bundle/ORKFrontFacingCameraStep.json new file mode 100644 index 0000000000..0abb4e2334 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKFrontFacingCameraStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"50DE67FB-AE5A-4C1A-97E6-038BAB9A346F"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"23DBF489-731A-446A-A5ED-3D3E737C5E12"},"title":"","image":{"imageName":"A39F0D25-B88E-446C-BC34-614AE0405E73"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment":0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKFrontFacingCameraStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"maximumRecordingLimit":60, "allowsReview":true, "allowsRetry":true,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFrontFacingCameraStepResult.json b/ResearchKitTests/samples.bundle/ORKFrontFacingCameraStepResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKFrontFacingCameraStepResult.json rename to ResearchKitTests/samples.bundle/ORKFrontFacingCameraStepResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthClinicalTypeRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKHealthClinicalTypeRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthClinicalTypeRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKHealthClinicalTypeRecorderConfiguration.json diff --git a/ResearchKitTests/samples.bundle/ORKHealthCondition.json b/ResearchKitTests/samples.bundle/ORKHealthCondition.json new file mode 100644 index 0000000000..d18a91ce5c --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKHealthCondition.json @@ -0,0 +1,2 @@ +{"_class":"ORKHealthCondition","identifier":"","displayName":"","value":"lorem"} + diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthKitCharacteristicTypeAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKHealthKitCharacteristicTypeAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthKitCharacteristicTypeAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKHealthKitCharacteristicTypeAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthKitQuantityTypeAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKHealthKitQuantityTypeAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthKitQuantityTypeAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKHealthKitQuantityTypeAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthQuantityTypeRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKHealthQuantityTypeRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKHealthQuantityTypeRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKHealthQuantityTypeRecorderConfiguration.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHeightAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKHeightAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKHeightAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKHeightAnswerFormat.json diff --git a/ResearchKitTests/samples.bundle/ORKHolePegTestPlaceStep.json b/ResearchKitTests/samples.bundle/ORKHolePegTestPlaceStep.json new file mode 100644 index 0000000000..d999ef06ed --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKHolePegTestPlaceStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"C4304649-4220-45B0-95C8-07219157A460"},"auxiliaryImage":{"imageName":"CD0C6044-D7E4-4970-9E24-D4907A9CCF85"},"movingDirection":0,"title":"","shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"image":{"imageName":"48957C0F-22A8-419C-A372-9DB9B4CFE41B"},"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"dominantHandTested":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"numberOfPegs":0,"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"bodyItems":[],"text":"","finishedSpokenInstruction":"","_class":"ORKHolePegTestPlaceStep","rotated":false,"threshold":0,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKHolePegTestRemoveStep.json b/ResearchKitTests/samples.bundle/ORKHolePegTestRemoveStep.json new file mode 100644 index 0000000000..0ed0278f37 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKHolePegTestRemoveStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"BE486BA2-4BF4-4B55-A13C-823460C271F9"},"auxiliaryImage":{"imageName":"CC4FA554-A433-46CB-948E-35F2B01177BB"},"movingDirection":0,"title":"","shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"image":{"imageName":"0D2B43F6-8030-40F3-B7D5-6D3848EAEB83"},"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"dominantHandTested":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"numberOfPegs":0,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKHolePegTestRemoveStep","threshold":0,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestResult.json b/ResearchKitTests/samples.bundle/ORKHolePegTestResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestResult.json rename to ResearchKitTests/samples.bundle/ORKHolePegTestResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestSample.json b/ResearchKitTests/samples.bundle/ORKHolePegTestSample.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestSample.json rename to ResearchKitTests/samples.bundle/ORKHolePegTestSample.json diff --git a/ResearchKitTests/samples.bundle/ORKImageCaptureStep.json b/ResearchKitTests/samples.bundle/ORKImageCaptureStep.json new file mode 100644 index 0000000000..e559f85f2b --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKImageCaptureStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":true,"useSurveyMode":false,"templateImageInsets":{"right":1,"top":1,"left":1,"bottom":1},"_class":"ORKImageCaptureStep","shouldTintImages":true,"iconImage":{"imageName":"B540C098-2AC8-47DC-AA92-C5D12711DE58"},"auxiliaryImage":{"imageName":"E8D4C452-E28D-4F04-9681-FCFE512B578D"},"captureRaw":false,"title":"","identifier":"","templateImage":{"imageName":"DFC768AB-9173-4574-A981-53298C0F9155"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"D1E13489-E3D2-4248-9260-2F7A750DA1A3"},"text":"","accessibilityInstructions":"","accessibilityHint":"","imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKImageChoice.json b/ResearchKitTests/samples.bundle/ORKImageChoice.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKImageChoice.json rename to ResearchKitTests/samples.bundle/ORKImageChoice.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKImageChoiceAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKImageChoiceAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKImageChoiceAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKImageChoiceAnswerFormat.json diff --git a/ResearchKitTests/samples.bundle/ORKInstructionStep.json b/ResearchKitTests/samples.bundle/ORKInstructionStep.json new file mode 100644 index 0000000000..98ebb219df --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKInstructionStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKInstructionStep","iconImage":{"imageName":"009AF45B-7E20-494E-A16C-88C6BDC15016"},"auxiliaryImage":{"imageName":"63D79505-966B-4AB6-BD80-0B4CADF45EAA"},"title":"","identifier":"","image":{"imageName":"97759B9C-39F2-4BE2-AD0A-FBCC3571DC5C"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKLearnMoreInstructionStep.json b/ResearchKitTests/samples.bundle/ORKLearnMoreInstructionStep.json new file mode 100644 index 0000000000..2a6b14250f --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKLearnMoreInstructionStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKLearnMoreInstructionStep","iconImage":{"imageName":"AA4B1340-91CA-43F8-8DFF-65D8072F47E0"},"auxiliaryImage":{"imageName":"51F527BE-5B1E-465A-9260-B79664443AC2"},"title":"","identifier":"","image":{"imageName":"EE23D70C-83EB-41CE-83FC-4D3D632322DE"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLearnMoreItem.json b/ResearchKitTests/samples.bundle/ORKLearnMoreItem.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKLearnMoreItem.json rename to ResearchKitTests/samples.bundle/ORKLearnMoreItem.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocation.json b/ResearchKitTests/samples.bundle/ORKLocation.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocation.json rename to ResearchKitTests/samples.bundle/ORKLocation.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKLocationAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKLocationAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKLocationQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKLocationQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationQuestionResult.json b/ResearchKitTests/samples.bundle/ORKLocationQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKLocationQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKLocationRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKLocationRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKLocationRecorderConfiguration.json diff --git a/ResearchKitTests/samples.bundle/ORKLoginStep.json b/ResearchKitTests/samples.bundle/ORKLoginStep.json new file mode 100644 index 0000000000..0ae705e15e --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKLoginStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "loginViewControllerString":"ORKLoginStepViewController","optional":true,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKLoginStep","iconImage":{"imageName":"65159B22-6011-4EB7-81BD-2E597B4AA29A"},"auxiliaryImage":{"imageName":"45AA55E2-9A86-4285-9FF7-A1E77856C480"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"5B301CC2-521C-4403-BFBA-7597E0A93CFA"},"text":"","formItems":[],"useCardView":true,"autoScrollEnabled":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKMultipleComponentQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKMultipleComponentQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKMultipleComponentQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKMultipleComponentQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKMultipleComponentQuestionResult.json b/ResearchKitTests/samples.bundle/ORKMultipleComponentQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKMultipleComponentQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKMultipleComponentQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKMultipleValuePickerAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKMultipleValuePickerAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKMultipleValuePickerAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKMultipleValuePickerAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNavigableOrderedTask.json b/ResearchKitTests/samples.bundle/ORKNavigableOrderedTask.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKNavigableOrderedTask.json rename to ResearchKitTests/samples.bundle/ORKNavigableOrderedTask.json diff --git a/ResearchKitTests/samples.bundle/ORKNavigablePageStep.json b/ResearchKitTests/samples.bundle/ORKNavigablePageStep.json new file mode 100644 index 0000000000..05dac26568 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKNavigablePageStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"pageTask":{"_class":"ORKOrderedTask","identifier":"test1"},"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKNavigablePageStep","iconImage":{"imageName":"EA8D496D-A56D-4C7E-A4F0-78CE32EE034C"},"auxiliaryImage":{"imageName":"A17C26E6-AEE0-4F8A-97E5-96C2B925884F"},"title":"","identifier":"","image":{"imageName":"428F188A-57C5-44A2-8B53-1BA16F8F50E0"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKNormalizedReactionTimeResult.json b/ResearchKitTests/samples.bundle/ORKNormalizedReactionTimeResult.json new file mode 100644 index 0000000000..af52371c77 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKNormalizedReactionTimeResult.json @@ -0,0 +1,6 @@ +{"_class":"ORKNormalizedReactionTimeResult","endDate":"2019-05-27T00:35:06-0700","startDate":"2019-05-27T00:35:06-0700","identifier":"","currentInterval":0, + "reactionDate": "2019-05-27T00:35:06-0700", + "timerEndDate": "2019-05-27T00:35:06-0700", + "timerStartDate": "2019-05-27T00:35:06-0700", + "stimulusStartDate": "2019-05-27T00:35:06-0700", + "userInfo":{}} diff --git a/ResearchKitTests/samples.bundle/ORKNormalizedReactionTimeStep.json b/ResearchKitTests/samples.bundle/ORKNormalizedReactionTimeStep.json new file mode 100644 index 0000000000..cd28fa2e91 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKNormalizedReactionTimeStep.json @@ -0,0 +1 @@ +{"shouldVibrateOnStart":false,"spokenInstruction":"","shouldStartTimerAutomatically":false,"successSound":0,"stepDuration":0,"shouldShowDefaultTimer":true,"optional":false,"minimumStimulusInterval":0,"detailText":"", "headerTextAlignment": 0, "text":"","_class":"ORKNormalizedReactionTimeStep","useSurveyMode":false,"numberOfAttempts":0,"maximumStimulusInterval":0, "currentInterval":0,"thresholdAcceleration":0,"bodyItems":[],"shouldVibrateOnFinish":false,"image":{"imageName":"282B623C-C013-4FDD-8721-4D2EB755598F"},"iconImage":{"imageName":"904E22CF-C9ED-485D-B9C4-6B47D351C10A"},"shouldPlaySoundOnStart":false,"auxiliaryImage":{"imageName":"64424C2B-9897-4A78-A79E-B1948817505A"},"failureSound":0,"shouldContinueOnFinish":true,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldSpeakCountDown":false,"timeout":0,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"timeoutSound":0,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNumericAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKNumericAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKNumericAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKNumericAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNumericQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKNumericQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKNumericQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKNumericQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNumericQuestionResult.json b/ResearchKitTests/samples.bundle/ORKNumericQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKNumericQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKNumericQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKOrderedTask.json b/ResearchKitTests/samples.bundle/ORKOrderedTask.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKOrderedTask.json rename to ResearchKitTests/samples.bundle/ORKOrderedTask.json diff --git a/ResearchKitTests/samples.bundle/ORKPDFViewerStep.json b/ResearchKitTests/samples.bundle/ORKPDFViewerStep.json new file mode 100644 index 0000000000..be618b3364 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKPDFViewerStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"pdfURL":"file:\/\/\/usr\/","useSurveyMode":false,"_class":"ORKPDFViewerStep","shouldTintImages":true,"iconImage":{"imageName":"304906CA-FB5B-4147-AA16-1A087A78A324"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"auxiliaryImage":{"imageName":"2ED7211C-A4AB-4EB3-A59E-C99AA7884B2D"},"actionBarOption":0,"image":{"imageName":"E2F454DF-3E96-4974-8BBB-46E1FF556A0C"},"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPSATResult.json b/ResearchKitTests/samples.bundle/ORKPSATResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKPSATResult.json rename to ResearchKitTests/samples.bundle/ORKPSATResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPSATSample.json b/ResearchKitTests/samples.bundle/ORKPSATSample.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKPSATSample.json rename to ResearchKitTests/samples.bundle/ORKPSATSample.json diff --git a/ResearchKitTests/samples.bundle/ORKPSATStep.json b/ResearchKitTests/samples.bundle/ORKPSATStep.json new file mode 100644 index 0000000000..efc7886685 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKPSATStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"stimulusDuration":0,"recorderConfigurations":[],"shouldContinueOnFinish":true,"shouldSpeakCountDown":false,"interStimulusInterval":0,"shouldTintImages":true,"iconImage":{"imageName":"A0A7FA5A-91F9-4FC1-8D58-287F482B2074"},"auxiliaryImage":{"imageName":"A2ED4D38-98B4-46E2-A926-C226ED3415B0"},"shouldPlaySoundOnFinish":false,"seriesLength":0,"shouldPlaySoundOnStart":false,"title":"","image":{"imageName":"F7381130-E0E1-4B0E-A726-C0D0C6D0C8F0"},"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"presentationMode":0,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKPSATStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPageResult.json b/ResearchKitTests/samples.bundle/ORKPageResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKPageResult.json rename to ResearchKitTests/samples.bundle/ORKPageResult.json diff --git a/ResearchKitTests/samples.bundle/ORKPageStep.json b/ResearchKitTests/samples.bundle/ORKPageStep.json new file mode 100644 index 0000000000..fbf298dec1 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKPageStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"pageTask":{"_class":"ORKOrderedTask","identifier":"test1"},"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKPageStep","iconImage":{"imageName":"AF540A3D-754B-4D3B-8800-3147F200E737"},"auxiliaryImage":{"imageName":"3F29D2C0-BFAD-47F5-BF04-46C669F92C27"},"title":"","identifier":"","image":{"imageName":"D83FAB77-1713-4C02-BAFD-4C0C0D831BCD"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPasscodeResult.json b/ResearchKitTests/samples.bundle/ORKPasscodeResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKPasscodeResult.json rename to ResearchKitTests/samples.bundle/ORKPasscodeResult.json diff --git a/ResearchKitTests/samples.bundle/ORKPasscodeStep.json b/ResearchKitTests/samples.bundle/ORKPasscodeStep.json new file mode 100644 index 0000000000..6e84d3fa8e --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKPasscodeStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "passcodeType":0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKPasscodeStep","iconImage":{"imageName":"AD57BE82-B09F-4325-A9EA-DE82F7C29610"},"auxiliaryImage":{"imageName":"3B3736C1-BD56-4237-9875-5C65FFFD0A37"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"3F144446-AAAE-4D83-9860-46E99BB08AE1"},"text":"","useBiometrics":true, "passcodeFlow":0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPedometerRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKPedometerRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKPedometerRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKPedometerRecorderConfiguration.json diff --git a/ResearchKitTests/samples.bundle/ORKPredicateFormItemVisibilityRule.json b/ResearchKitTests/samples.bundle/ORKPredicateFormItemVisibilityRule.json new file mode 100644 index 0000000000..2f24832beb --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKPredicateFormItemVisibilityRule.json @@ -0,0 +1 @@ +{"predicateFormat":"SUBQUERY(SELF, $x, $x.identifier == $ORK_TASK_IDENTIFIER AND SUBQUERY($x.results, $y, $y.identifier == \"test\" AND $y.isPreviousResult == 0 AND SUBQUERY($y.results, $z, $z.identifier == \"test\" AND $z.answer == 1).@count > 0).@count > 0).@count > 0","_class":"ORKPredicateFormItemVisibilityRule"} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPredicateStepNavigationRule.json b/ResearchKitTests/samples.bundle/ORKPredicateStepNavigationRule.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKPredicateStepNavigationRule.json rename to ResearchKitTests/samples.bundle/ORKPredicateStepNavigationRule.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKQuestionResult.json b/ResearchKitTests/samples.bundle/ORKQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKQuestionResult.json diff --git a/ResearchKitTests/samples.bundle/ORKQuestionStep.json b/ResearchKitTests/samples.bundle/ORKQuestionStep.json new file mode 100644 index 0000000000..c777c2f8ec --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKQuestionStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"answerFormat":{"_class":"ORKAnswerFormat"},"detailText":"", "headerTextAlignment": 0, "optional":true,"shouldTintImages":true,"useSurveyMode":true,"_class":"ORKQuestionStep","presentationStyle":"default","iconImage":{"imageName":"08814579-346A-4783-8F5E-4BC2F61E9FE5"},"auxiliaryImage":{"imageName":"61DAEC67-9E43-4B89-A3F8-BE87C9F87C3B"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"B2C3112F-8A16-4A7C-9CCF-743FBAF9B993"},"text":"","placeholder":"","question":"","useCardView":true,"imageContentMode": 0, "learnMoreItem":{"_class":"ORKLearnMoreItem"},"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"tagText": "","earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRangeOfMotionResult.json b/ResearchKitTests/samples.bundle/ORKRangeOfMotionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKRangeOfMotionResult.json rename to ResearchKitTests/samples.bundle/ORKRangeOfMotionResult.json diff --git a/ResearchKitTests/samples.bundle/ORKRangeOfMotionStep.json b/ResearchKitTests/samples.bundle/ORKRangeOfMotionStep.json new file mode 100644 index 0000000000..edd96ebd52 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKRangeOfMotionStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"F3331959-D3B6-43BA-A279-E1502B81DE5E"},"auxiliaryImage":{"imageName":"2C398061-2D1F-45E6-BCCF-F470628D51D1"},"title":"","image":{"imageName":"E1CF0E97-5E1A-4860-AF2D-D36FC5C427E3"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"limbOption":0,"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKRangeOfMotionStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKReactionTimeResult.json b/ResearchKitTests/samples.bundle/ORKReactionTimeResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKReactionTimeResult.json rename to ResearchKitTests/samples.bundle/ORKReactionTimeResult.json diff --git a/ResearchKitTests/samples.bundle/ORKReactionTimeStep.json b/ResearchKitTests/samples.bundle/ORKReactionTimeStep.json new file mode 100644 index 0000000000..d8fb467df2 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKReactionTimeStep.json @@ -0,0 +1 @@ +{"shouldVibrateOnStart":false,"spokenInstruction":"","shouldStartTimerAutomatically":false,"successSound":0,"stepDuration":0,"shouldShowDefaultTimer":true,"optional":false,"minimumStimulusInterval":0,"detailText":"", "headerTextAlignment": 0, "text":"","_class":"ORKReactionTimeStep","useSurveyMode":false,"numberOfAttempts":0,"maximumStimulusInterval":0,"thresholdAcceleration":0,"bodyItems":[],"shouldVibrateOnFinish":false,"image":{"imageName":"282B623C-C013-4FDD-8721-4D2EB755598F"},"iconImage":{"imageName":"904E22CF-C9ED-485D-B9C4-6B47D351C10A"},"shouldPlaySoundOnStart":false,"auxiliaryImage":{"imageName":"64424C2B-9897-4A78-A79E-B1948817505A"},"failureSound":0,"shouldContinueOnFinish":true,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldSpeakCountDown":false,"timeout":0,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"timeoutSound":0,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKRecorderConfiguration.json diff --git a/ResearchKitTests/samples.bundle/ORKRegistrationStep.json b/ResearchKitTests/samples.bundle/ORKRegistrationStep.json new file mode 100644 index 0000000000..e709c2fb06 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKRegistrationStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "options":0,"optional":false,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKRegistrationStep","auxiliaryImage":{"imageName":"AE8E0687-1A0C-42C1-964A-E8F89E789B1E"},"iconImage":{"imageName":"4C7914C4-0EA8-4D43-A7B0-ECB2E3DE0FAC"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"0BB5BA89-09CC-4DB0-B941-6A2D51834EC6"},"text":"","formItems":[],"useCardView":true,"autoScrollEnabled":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKRelatedPerson.json b/ResearchKitTests/samples.bundle/ORKRelatedPerson.json new file mode 100644 index 0000000000..75bfefefce --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKRelatedPerson.json @@ -0,0 +1,2 @@ +{"_class":"ORKRelatedPerson","identifier":"","groupIdentifier":"", "identifierForCellTitle":"","taskResult":{"_class":"ORKTaskResult","endDate":"2019-05-27T00:35:06-0700","startDate":"2019-05-27T00:35:06-0700","taskRunUUID":"FDFCC3EC-01B6-43E7-8200-9B93E2744BB8","identifier":"","results":[],"userInfo":{},"device":{ "_class":"ORKDevice","product":"","osVersion": "","osBuild": "","platform": ""}}} + diff --git a/ResearchKitTests/samples.bundle/ORKRelativeGroup.json b/ResearchKitTests/samples.bundle/ORKRelativeGroup.json new file mode 100644 index 0000000000..9182597b01 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKRelativeGroup.json @@ -0,0 +1,3 @@ +{"_class":"ORKRelativeGroup","identifier":"","name":"","sectionTitle":"","sectionDetailText":"","maxAllowed":0, "identifierForCellTitle":"","formSteps":[], "detailTextIdentifiers":[]} + + diff --git a/ResearchKitTests/samples.bundle/ORKRequestPermissionsStep.json b/ResearchKitTests/samples.bundle/ORKRequestPermissionsStep.json new file mode 100644 index 0000000000..a87b92e61b --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKRequestPermissionsStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKRequestPermissionsStep","iconImage":{"imageName":"1425D9D4-DB67-4B5D-93B0-FE3125E67262"},"auxiliaryImage":{"imageName":"5DEF32D5-D23E-4E8F-8C05-4B1D24E6257D"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"DB613E0C-4491-457B-B958-C7FBE6232101"},"text":"","detailText":"","headerTextAlignment": 0,"imageContentMode": 0, "headerTextAlignment": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0, "permissionTypes":[],"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKResult.json b/ResearchKitTests/samples.bundle/ORKResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKResult.json rename to ResearchKitTests/samples.bundle/ORKResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKResultSelector.json b/ResearchKitTests/samples.bundle/ORKResultSelector.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKResultSelector.json rename to ResearchKitTests/samples.bundle/ORKResultSelector.json diff --git a/ResearchKitTests/samples.bundle/ORKReviewStep.json b/ResearchKitTests/samples.bundle/ORKReviewStep.json new file mode 100644 index 0000000000..bcda63006c --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKReviewStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKReviewStep","iconImage":{"imageName":"FC6FA284-33CF-4207-A766-E4B53D63D1FA"},"auxiliaryImage":{"imageName":"DF5BB476-8890-4AA0-9F39-D15A16D5FDF7"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"C71BC697-7306-4B7D-99B7-62E7C9D0CEB2"},"excludeInstructionSteps":false,"text":"","resultSource":{"results":[],"_class":"ORKTaskResult","startDate":"2019-05-27T00:35:06-0700","endDate":"2019-05-27T00:35:06-0700"},"steps":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSESAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKSESAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSESAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKSESAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSESQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKSESQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSESQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKSESQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSESQuestionResult.json b/ResearchKitTests/samples.bundle/ORKSESQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSESQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKSESQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKScaleAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKScaleAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKScaleAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKScaleAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKScaleQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKScaleQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKScaleQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKScaleQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKScaleQuestionResult.json b/ResearchKitTests/samples.bundle/ORKScaleQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKScaleQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKScaleQuestionResult.json diff --git a/ResearchKitTests/samples.bundle/ORKSecondaryTaskStep.json b/ResearchKitTests/samples.bundle/ORKSecondaryTaskStep.json new file mode 100644 index 0000000000..af6e0a0394 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKSecondaryTaskStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKSecondaryTaskStep","iconImage":{"imageName":"AA4B1340-91CA-43F8-8DFF-65D8072F47E0"},"auxiliaryImage":{"imageName":"51F527BE-5B1E-465A-9260-B79664443AC2"},"title":"","identifier":"","image":{"imageName":"EE23D70C-83EB-41CE-83FC-4D3D632322DE"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"secondaryTask":{"_class":"ORKOrderedTask","identifier":"test1"},"secondaryTaskButtonTitle":"","nextButtonTitle":"","requiredAttempts":0,"centerImageVertically":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSignatureResult.json b/ResearchKitTests/samples.bundle/ORKSignatureResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSignatureResult.json rename to ResearchKitTests/samples.bundle/ORKSignatureResult.json diff --git a/ResearchKitTests/samples.bundle/ORKSignatureStep.json b/ResearchKitTests/samples.bundle/ORKSignatureStep.json new file mode 100644 index 0000000000..40cd794801 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKSignatureStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKSignatureStep","iconImage":{"imageName":"37EEFD54-6752-4FE3-A7AD-ABC987E21266"},"auxiliaryImage":{"imageName":"3FF8D308-8975-4B50-B016-28BA3E62C095"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"10358617-E4C2-473F-8B22-9C68B4B8A5D9"},"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryGameRecord.json b/ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryGameRecord.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryGameRecord.json rename to ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryGameRecord.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryGameTouchSample.json b/ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryGameTouchSample.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryGameTouchSample.json rename to ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryGameTouchSample.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryResult.json b/ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryResult.json rename to ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryResult.json diff --git a/ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryStep.json b/ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryStep.json new file mode 100644 index 0000000000..9fe7b21c13 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKSpatialSpanMemoryStep.json @@ -0,0 +1 @@ +{"spokenInstruction":"","shouldStartTimerAutomatically":true,"stepDuration":0,"shouldShowDefaultTimer":true,"requireReversal":false,"maximumSpan":0,"optional":false,"initialSpan":0,"detailText":"", "headerTextAlignment": 0, "minimumSpan":0,"_class":"ORKSpatialSpanMemoryStep","text":"","useSurveyMode":false,"bodyItems":[],"customTargetPluralName":"","shouldVibrateOnFinish":false,"image":{"imageName":"A8AB293A-10C1-41BE-ACFE-7AE22DE83E8B"},"iconImage":{"imageName":"DCA06D4F-5800-4E11-AE9C-127854AE5393"},"shouldPlaySoundOnStart":false,"maximumTests":0,"auxiliaryImage":{"imageName":"68CF68A4-DED8-4EC1-8246-D11AAEBA99D8"},"customTargetImage":{"imageName":"7F102C61-3C9D-420A-8C29-ED016F6C4E45"},"shouldContinueOnFinish":true,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldSpeakCountDown":false,"playSpeed":0,"maximumConsecutiveFailures":0,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"shouldVibrateOnStart":false,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechInNoiseResult.json b/ResearchKitTests/samples.bundle/ORKSpeechInNoiseResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechInNoiseResult.json rename to ResearchKitTests/samples.bundle/ORKSpeechInNoiseResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechInNoiseStep.json b/ResearchKitTests/samples.bundle/ORKSpeechInNoiseStep.json similarity index 96% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechInNoiseStep.json rename to ResearchKitTests/samples.bundle/ORKSpeechInNoiseStep.json index 3e1554beae..c7ca4f35cb 100644 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechInNoiseStep.json +++ b/ResearchKitTests/samples.bundle/ORKSpeechInNoiseStep.json @@ -3,6 +3,7 @@ "targetSentence":"", "speechFilePath": "", "footnote": "", + "shouldAutomaticallyAdjustImageTintColor":0, "shouldContinueOnFinish": true, "recorderConfigurations":[], "shouldSpeakCountDown": false, diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechRecognitionResult.json b/ResearchKitTests/samples.bundle/ORKSpeechRecognitionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechRecognitionResult.json rename to ResearchKitTests/samples.bundle/ORKSpeechRecognitionResult.json diff --git a/ResearchKitTests/samples.bundle/ORKSpeechRecognitionStep.json b/ResearchKitTests/samples.bundle/ORKSpeechRecognitionStep.json new file mode 100644 index 0000000000..6681df51da --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKSpeechRecognitionStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"A7F86173-D719-4A24-80B1-84307C0CAF6F"},"auxiliaryImage":{"imageName":"FE592459-9F5E-41AB-B051-7EFCD8F7ADA4"},"title":"","image":{"imageName":"97352EFE-D43D-498A-B780-DCAADFB923E9"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"speechRecognitionText":"test","detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"shouldHideTranscript":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","speechRecognizerLocale":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKSpeechRecognitionStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKStep.json b/ResearchKitTests/samples.bundle/ORKStep.json new file mode 100644 index 0000000000..48aa63e5b6 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKStep","iconImage":{"imageName":"1425D9D4-DB67-4B5D-93B0-FE3125E67262"},"auxiliaryImage":{"imageName":"5DEF32D5-D23E-4E8F-8C05-4B1D24E6257D"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"DB613E0C-4491-457B-B958-C7FBE6232101"},"text":"","detailText":"","headerTextAlignment": 0,"imageContentMode": 0, "headerTextAlignment": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStepResult.json b/ResearchKitTests/samples.bundle/ORKStepResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKStepResult.json rename to ResearchKitTests/samples.bundle/ORKStepResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStreamingAudioRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKStreamingAudioRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKStreamingAudioRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKStreamingAudioRecorderConfiguration.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStroopResult.json b/ResearchKitTests/samples.bundle/ORKStroopResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKStroopResult.json rename to ResearchKitTests/samples.bundle/ORKStroopResult.json diff --git a/ResearchKitTests/samples.bundle/ORKStroopStep.json b/ResearchKitTests/samples.bundle/ORKStroopStep.json new file mode 100644 index 0000000000..75ee8144ad --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKStroopStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"62E9D4CF-3E7B-49B8-A295-7D2EB1ECC00B"},"auxiliaryImage":{"imageName":"8C25AB92-00C9-4E13-B55F-711658F53D48"},"title":"","image":{"imageName":"4930AC43-8AAA-4563-8C8F-6E7E25E550C3"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":9.2233720368547758e+18,"shouldShowDefaultTimer":false,"numberOfAttempts":0,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":true,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKStroopStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKTableStep.json b/ResearchKitTests/samples.bundle/ORKTableStep.json new file mode 100644 index 0000000000..28059e1def --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKTableStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"allowsSelection":false,"detailText":"","bottomPadding":35,"headerTextAlignment": 0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKTableStep","auxiliaryImage":{"imageName":"C594DE5C-AB0F-468C-956E-8347C5E14E08"},"iconImage":{"imageName":"A3C3C914-C4ED-4633-9852-67D8AB687094"},"isBulleted":false,"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"FC4CCE13-5C8A-434F-979C-1E48ADDEBBE0"},"items":[],"text":"","bulletType":0,"bulletIconNames":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"pinNavigationContainer":false,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTappingIntervalResult.json b/ResearchKitTests/samples.bundle/ORKTappingIntervalResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTappingIntervalResult.json rename to ResearchKitTests/samples.bundle/ORKTappingIntervalResult.json diff --git a/ResearchKitTests/samples.bundle/ORKTappingIntervalStep.json b/ResearchKitTests/samples.bundle/ORKTappingIntervalStep.json new file mode 100644 index 0000000000..2885ccac30 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKTappingIntervalStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"E99E1E45-69C1-4A8D-B93A-8A2C21F83BF8"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"8C6E1C04-F1B1-4EA7-93F4-415FBEB3C489"},"title":"","image":{"imageName":"1DA566D1-4BE7-48C9-849B-8E30C0EE613A"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTappingIntervalStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTappingSample.json b/ResearchKitTests/samples.bundle/ORKTappingSample.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTappingSample.json rename to ResearchKitTests/samples.bundle/ORKTappingSample.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTaskResult.json b/ResearchKitTests/samples.bundle/ORKTaskResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTaskResult.json rename to ResearchKitTests/samples.bundle/ORKTaskResult.json diff --git a/ResearchKitTests/samples.bundle/ORKTextAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKTextAnswerFormat.json new file mode 100644 index 0000000000..14f3053d88 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKTextAnswerFormat.json @@ -0,0 +1 @@ +{"secureTextEntry": false, "keyboardType": 0, "validationRegularExpression": {"pattern": ".", "options": []}, "_class": "ORKTextAnswerFormat", "spellCheckingType": 0, "invalidMessage": "", "maximumLength": 0, "textContentType": "", "passwordRules": {"rules": ""}, "autocorrectionType": 0, "autocapitalizationType": 0, "defaultTextAnswer": "", "multipleLines": false, "hideClearButton": false, "hideCharacterCountLabel": false, "showDontKnowButton": false, "customDontKnowButtonText": "", "placeholder": "", "dontKnowButtonStyle": 0} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextChoice.json b/ResearchKitTests/samples.bundle/ORKTextChoice.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextChoice.json rename to ResearchKitTests/samples.bundle/ORKTextChoice.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextChoiceAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKTextChoiceAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextChoiceAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKTextChoiceAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextChoiceOther.json b/ResearchKitTests/samples.bundle/ORKTextChoiceOther.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextChoiceOther.json rename to ResearchKitTests/samples.bundle/ORKTextChoiceOther.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKTextQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKTextQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextQuestionResult.json b/ResearchKitTests/samples.bundle/ORKTextQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKTextQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextScaleAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKTextScaleAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextScaleAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKTextScaleAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeIntervalAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKTimeIntervalAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeIntervalAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKTimeIntervalAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeIntervalQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKTimeIntervalQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeIntervalQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKTimeIntervalQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeIntervalQuestionResult.json b/ResearchKitTests/samples.bundle/ORKTimeIntervalQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeIntervalQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKTimeIntervalQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeOfDayAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKTimeOfDayAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeOfDayAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKTimeOfDayAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeOfDayQuestionResult-ORKDontKnowAnswer.json b/ResearchKitTests/samples.bundle/ORKTimeOfDayQuestionResult-ORKDontKnowAnswer.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeOfDayQuestionResult-ORKDontKnowAnswer.json rename to ResearchKitTests/samples.bundle/ORKTimeOfDayQuestionResult-ORKDontKnowAnswer.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeOfDayQuestionResult.json b/ResearchKitTests/samples.bundle/ORKTimeOfDayQuestionResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimeOfDayQuestionResult.json rename to ResearchKitTests/samples.bundle/ORKTimeOfDayQuestionResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimedWalkResult.json b/ResearchKitTests/samples.bundle/ORKTimedWalkResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimedWalkResult.json rename to ResearchKitTests/samples.bundle/ORKTimedWalkResult.json diff --git a/ResearchKitTests/samples.bundle/ORKTimedWalkStep.json b/ResearchKitTests/samples.bundle/ORKTimedWalkStep.json new file mode 100644 index 0000000000..52515847dc --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKTimedWalkStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"distanceInMeters":0,"iconImage":{"imageName":"392B209E-E4E0-458A-9CF3-0C7DF89F6626"},"auxiliaryImage":{"imageName":"0690C295-21F0-4FD8-926B-A4ECE1396745"},"title":"","shouldPlaySoundOnFinish":true,"shouldPlaySoundOnStart":true,"image":{"imageName":"2167A19B-9B1F-4010-812B-0F254CD98D00"},"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":true,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":true,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTimedWalkStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKToneAudiometryResult.json b/ResearchKitTests/samples.bundle/ORKToneAudiometryResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKToneAudiometryResult.json rename to ResearchKitTests/samples.bundle/ORKToneAudiometryResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKToneAudiometrySample.json b/ResearchKitTests/samples.bundle/ORKToneAudiometrySample.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKToneAudiometrySample.json rename to ResearchKitTests/samples.bundle/ORKToneAudiometrySample.json diff --git a/ResearchKitTests/samples.bundle/ORKToneAudiometryStep.json b/ResearchKitTests/samples.bundle/ORKToneAudiometryStep.json new file mode 100644 index 0000000000..1ae6100928 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKToneAudiometryStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"80051064-3F2B-4675-AB0C-5C2C841B6BD8"},"auxiliaryImage":{"imageName":"E7C93E74-A1F3-4FA7-887C-64254B197612"},"title":"","image":{"imageName":"06DE4520-4A3F-4E48-A331-84FA1BC2F05D"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","practiceStep":false,"optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKToneAudiometryStep","toneDuration":0,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKTouchAnywhereStep.json b/ResearchKitTests/samples.bundle/ORKTouchAnywhereStep.json new file mode 100644 index 0000000000..f96acc929b --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKTouchAnywhereStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"661D3E94-889E-406B-A010-63E1E382D649"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"2F9EF951-6F59-413F-AC9A-4005401B6430"},"title":"","image":{"imageName":"A1753FF0-DF94-4966-863F-47542F37D42E"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTouchAnywhereStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTouchRecorderConfiguration.json b/ResearchKitTests/samples.bundle/ORKTouchRecorderConfiguration.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTouchRecorderConfiguration.json rename to ResearchKitTests/samples.bundle/ORKTouchRecorderConfiguration.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTowerOfHanoiMove.json b/ResearchKitTests/samples.bundle/ORKTowerOfHanoiMove.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTowerOfHanoiMove.json rename to ResearchKitTests/samples.bundle/ORKTowerOfHanoiMove.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTowerOfHanoiResult.json b/ResearchKitTests/samples.bundle/ORKTowerOfHanoiResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTowerOfHanoiResult.json rename to ResearchKitTests/samples.bundle/ORKTowerOfHanoiResult.json diff --git a/ResearchKitTests/samples.bundle/ORKTowerOfHanoiStep.json b/ResearchKitTests/samples.bundle/ORKTowerOfHanoiStep.json new file mode 100644 index 0000000000..3fdf050e24 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKTowerOfHanoiStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"CF6F5959-510B-4131-99B0-2B625446CCE7"},"auxiliaryImage":{"imageName":"CEC9CBE5-4978-473A-B597-3BFD19AA17FD"},"title":"","image":{"imageName":"30F1BD7F-633F-41EA-8144-0E06BCA8C457"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":true,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTowerOfHanoiStep","numberOfDisks":3,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTrailmakingResult.json b/ResearchKitTests/samples.bundle/ORKTrailmakingResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTrailmakingResult.json rename to ResearchKitTests/samples.bundle/ORKTrailmakingResult.json diff --git a/ResearchKitTests/samples.bundle/ORKTrailmakingStep.json b/ResearchKitTests/samples.bundle/ORKTrailmakingStep.json new file mode 100644 index 0000000000..4f244ff102 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKTrailmakingStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"6C57DF6B-CBDE-4763-906B-82204530AD07"},"auxiliaryImage":{"imageName":"3ED81064-D8E6-4D26-A2F0-9302EFB1058F"},"title":"","image":{"imageName":"3F2A9599-FE48-41D2-9169-ABB8EFD777C6"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTrailmakingStep","trailType":"","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTrailmakingTap.json b/ResearchKitTests/samples.bundle/ORKTrailmakingTap.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKTrailmakingTap.json rename to ResearchKitTests/samples.bundle/ORKTrailmakingTap.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKUSDZModelManager.json b/ResearchKitTests/samples.bundle/ORKUSDZModelManager.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKUSDZModelManager.json rename to ResearchKitTests/samples.bundle/ORKUSDZModelManager.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKUSDZModelManagerResult.json b/ResearchKitTests/samples.bundle/ORKUSDZModelManagerResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKUSDZModelManagerResult.json rename to ResearchKitTests/samples.bundle/ORKUSDZModelManagerResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKValuePickerAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKValuePickerAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKValuePickerAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKValuePickerAnswerFormat.json diff --git a/ResearchKitTests/samples.bundle/ORKVerificationStep.json b/ResearchKitTests/samples.bundle/ORKVerificationStep.json new file mode 100644 index 0000000000..58479a7ff2 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKVerificationStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"","headerTextAlignment": 0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKVerificationStep","iconImage":{"imageName":"A3D51283-8457-474E-83F9-8624BA60C7D5"},"auxiliaryImage":{"imageName":"E9559DA0-9EE9-4365-A75E-5DA1A9A458F3"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"39D4B5C9-17BA-40B1-8EA2-E78B3BDA896F"},"text":"","verificationViewControllerString":"ORKVerificationStepViewController","imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKVideoCaptureStep.json b/ResearchKitTests/samples.bundle/ORKVideoCaptureStep.json new file mode 100644 index 0000000000..bf21c5f760 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKVideoCaptureStep.json @@ -0,0 +1 @@ +{"accessibilityHint":"","shouldTintImages":true,"templateImageInsets":{"right":1,"top":1,"left":1,"bottom":1},"iconImage":{"imageName":"3EBEBF88-86DD-4500-8B48-B7F61F75C7A6"},"title":"","devicePosition":1,"auxiliaryImage":{"imageName":"7832E6A2-DA40-4CFA-AB16-808717B2CA4E"},"duration":123,"templateImage":{"imageName":"0DCC3994-3FA0-4A05-97AC-A3C82777010B"},"image":{"imageName":"D2B3C2CB-10D5-4C97-B0FF-208C38971A0F"},"detailText":"","headerTextAlignment": 0,"optional":true,"audioMute":false,"useSurveyMode":false,"identifier":"","bodyItems":[],"text":"","accessibilityInstructions":"","_class":"ORKVideoCaptureStep","torchMode":2,"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKVideoInstructionStep.json b/ResearchKitTests/samples.bundle/ORKVideoInstructionStep.json new file mode 100644 index 0000000000..b4e2fc9bf8 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKVideoInstructionStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"videoURL":"file:\/\/\/usr\/","optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKVideoInstructionStep","auxiliaryImage":{"imageName":"8EB1EFFE-C9DE-48C5-BD63-7B3182834B09"},"iconImage":{"imageName":"3AF26F65-958B-4EFA-974A-184B40D35D7A"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"7025FEF9-6715-4499-B7C3-1C1AA8DDB3E1"},"text":"","thumbnailTime":0,"detailText":"","headerTextAlignment": 0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"bundleAsset":{"_class":"ORKBundleAsset","name":"filename","bundleIdentifier":"com.bundle.identifier","fileExtension":"mp4"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoInstructionStepResult.json b/ResearchKitTests/samples.bundle/ORKVideoInstructionStepResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoInstructionStepResult.json rename to ResearchKitTests/samples.bundle/ORKVideoInstructionStepResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVocalCue.json b/ResearchKitTests/samples.bundle/ORKVocalCue.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKVocalCue.json rename to ResearchKitTests/samples.bundle/ORKVocalCue.json diff --git a/ResearchKitTests/samples.bundle/ORKWaitStep.json b/ResearchKitTests/samples.bundle/ORKWaitStep.json new file mode 100644 index 0000000000..476173d066 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKWaitStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKWaitStep","indicatorType":0,"iconImage":{"imageName":"8AB7019D-38A4-4969-8A3B-4132B98A4D43"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"D9D9BA3C-8AE2-45F2-9439-7AF519EF2BFA"},"auxiliaryImage":{"imageName":"589E582A-6BE4-4956-9895-0C07DE2DE0E4"},"text":"","detailText":"","headerTextAlignment": 0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKWalkingTaskStep.json b/ResearchKitTests/samples.bundle/ORKWalkingTaskStep.json new file mode 100644 index 0000000000..cd80317496 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKWalkingTaskStep.json @@ -0,0 +1 @@ +{"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"shouldContinueOnFinish":false,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"B2C5CEC9-067F-42C7-ADD5-F6BDCB1AEB72"},"auxiliaryImage":{"imageName":"01708EE8-CC14-408A-AB15-4C9E9806172E"},"title":"","image":{"imageName":"10F66CE1-AA9F-4F9C-B51A-5AEED1B73A27"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"numberOfStepsPerLeg":0,"detailText":"","headerTextAlignment": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKWalkingTaskStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/ResearchKitTests/samples.bundle/ORKWebViewStep.json b/ResearchKitTests/samples.bundle/ORKWebViewStep.json new file mode 100644 index 0000000000..34e48963f0 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKWebViewStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"","headerTextAlignment": 0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKWebViewStep","iconImage":{"imageName":"369C0323-EB2C-4BD7-8B1F-90030C5A1B8F"},"auxiliaryImage":{"imageName":"C1A70CC9-EC88-4525-A166-5DE6BD2CFA1A"},"title":"","identifier":"","image":{"imageName":"4DAC99C9-1BC9-42EA-95E7-CD746641F78A"},"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"text":"","html":"","instructionSteps":[], "customCSS":"","showSignatureAfterContent":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWebViewStepResult.json b/ResearchKitTests/samples.bundle/ORKWebViewStepResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKWebViewStepResult.json rename to ResearchKitTests/samples.bundle/ORKWebViewStepResult.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWeightAnswerFormat.json b/ResearchKitTests/samples.bundle/ORKWeightAnswerFormat.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKWeightAnswerFormat.json rename to ResearchKitTests/samples.bundle/ORKWeightAnswerFormat.json diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryFrequencySample.json b/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryFrequencySample.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryFrequencySample.json rename to ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryFrequencySample.json diff --git a/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryOnboardingStep.json b/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryOnboardingStep.json new file mode 100644 index 0000000000..86843bddcf --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryOnboardingStep.json @@ -0,0 +1 @@ +{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":true,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKdBHLToneAudiometryOnboardingStep","auxiliaryImage":{"imageName":"0255CA0B-11EA-4502-926A-07DCA0599AEC"},"iconImage":{"imageName":"B10BDAB3-6380-4F75-A5D3-7E334CD94C7D"},"title":"","identifier":"","footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"image":{"imageName":"E2856DA0-1728-4A16-A468-9A940C0E6F95"},"text":"","formItems":[],"useCardView":true,"autoScrollEnabled":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryResult.json b/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryResult.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryResult.json rename to ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryResult.json diff --git a/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryStep.json b/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryStep.json new file mode 100644 index 0000000000..851e10d3f8 --- /dev/null +++ b/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryStep.json @@ -0,0 +1 @@ +{"postStimulusDelay":1,"spokenInstruction":"","headphoneType":"","shouldStartTimerAutomatically":false,"stepDuration":0,"shouldShowDefaultTimer":true,"optional":false,"detailText":"", "headerTextAlignment": 0, "earPreference":0,"text":"","_class":"ORKdBHLToneAudiometryStep","useSurveyMode":false,"initialdBHLValue":30,"dBHLStepDownSize":10,"dBHLMinimumThreshold":-10,"bodyItems":[],"maxNumberOfTransitionsPerFrequency":15,"shouldVibrateOnFinish":false,"iconImage":{"imageName":"90BF43E2-61B4-493A-A818-55FF314B240D"},"shouldPlaySoundOnStart":false,"image":{"imageName":"A660ED46-8FFE-4AFA-A3AA-AC9E134A20F0"},"auxiliaryImage":{"imageName":"99B355E5-D322-4C26-BA80-5701151B3352"},"shouldContinueOnFinish":false,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","shouldAutomaticallyAdjustImageTintColor":0,"dBHLStepUpSize":5,"dBHLStepUpSizeFirstMiss":20,"dBHLStepUpSizeSecondMiss":10,"dBHLStepUpSizeThirdMiss":10,"shouldSpeakCountDown":false,"toneDuration":1,"frequencyList":[],"maxRandomPreStimulusDelay":2,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"shouldVibrateOnStart":false,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryUnit.json b/ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryUnit.json similarity index 100% rename from Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryUnit.json rename to ResearchKitTests/samples.bundle/ORKdBHLToneAudiometryUnit.json diff --git a/ResearchKitUI/Accessibility/Localized/en.lproj/ResearchKitUI.strings b/ResearchKitUI/Accessibility/Localized/en.lproj/ResearchKitUI.strings new file mode 100644 index 0000000000..bd90420601 --- /dev/null +++ b/ResearchKitUI/Accessibility/Localized/en.lproj/ResearchKitUI.strings @@ -0,0 +1,31 @@ +/* + Copyright (c) 2020, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +"BUTTON_CANCEL" = "Cancel"; diff --git a/ResearchKit/Accessibility/ORKAccessibility.h b/ResearchKitUI/Accessibility/ORKAccessibility.h similarity index 91% rename from ResearchKit/Accessibility/ORKAccessibility.h rename to ResearchKitUI/Accessibility/ORKAccessibility.h index bb1aabd2e9..5ad2abb639 100644 --- a/ResearchKit/Accessibility/ORKAccessibility.h +++ b/ResearchKitUI/Accessibility/ORKAccessibility.h @@ -30,6 +30,6 @@ // Shared header for accessibility functionality. -#import -#import -#import +#import +#import +#import diff --git a/ResearchKit/Accessibility/ORKAccessibilityFunctions.h b/ResearchKitUI/Accessibility/ORKAccessibilityFunctions.h similarity index 75% rename from ResearchKit/Accessibility/ORKAccessibilityFunctions.h rename to ResearchKitUI/Accessibility/ORKAccessibilityFunctions.h index db5644c8ef..b1f3797083 100644 --- a/ResearchKit/Accessibility/ORKAccessibilityFunctions.h +++ b/ResearchKitUI/Accessibility/ORKAccessibilityFunctions.h @@ -51,6 +51,30 @@ ORK_INLINE void ORKAccessibilityPostNotificationAfterDelay(UIAccessibilityNotifi }); } +// Convenience for checking if accessibility large text is enabled +ORK_INLINE BOOL ORKIsAccessibilityLargeTextEnabled(void) { + NSString *contentSize = [UIApplication sharedApplication].preferredContentSizeCategory; + if ([@[UIContentSizeCategoryExtraExtraExtraLarge, + UIContentSizeCategoryAccessibilityExtraLarge, + UIContentSizeCategoryAccessibilityMedium, UIContentSizeCategoryAccessibilityLarge, + UIContentSizeCategoryAccessibilityExtraExtraLarge, + UIContentSizeCategoryAccessibilityExtraExtraExtraLarge, + ] containsObject:contentSize]) { + return YES; + } else { + return NO; + } +} + +// Convenience for checking which UIImageSymbolScale in regards to ccessibilityLargeTextEnabled +ORK_INLINE UIImageSymbolScale ORKImageScaleToUse(void) { + if (ORKIsAccessibilityLargeTextEnabled()) { + return UIImageSymbolScaleMedium; + } else { + return UIImageSymbolScaleLarge; + } +} + // Creates a string suitable for Voice Over by joining the variables with ", " and avoiding nil and empty strings. #define ORKAccessibilityStringForVariables(...) _ORKAccessibilityStringForVariables(ORK_NARG(__VA_ARGS__), ##__VA_ARGS__) ORK_EXTERN NSString *_ORKAccessibilityStringForVariables(NSInteger numParameters, NSString *baseString, ...); diff --git a/ResearchKit/Accessibility/ORKAccessibilityFunctions.m b/ResearchKitUI/Accessibility/ORKAccessibilityFunctions.m similarity index 100% rename from ResearchKit/Accessibility/ORKAccessibilityFunctions.m rename to ResearchKitUI/Accessibility/ORKAccessibilityFunctions.m diff --git a/ResearchKit/Accessibility/ORKGraphChartAccessibilityElement.h b/ResearchKitUI/Accessibility/ORKGraphChartAccessibilityElement.h similarity index 98% rename from ResearchKit/Accessibility/ORKGraphChartAccessibilityElement.h rename to ResearchKitUI/Accessibility/ORKGraphChartAccessibilityElement.h index a59c0effe0..d166c17449 100644 --- a/ResearchKit/Accessibility/ORKGraphChartAccessibilityElement.h +++ b/ResearchKitUI/Accessibility/ORKGraphChartAccessibilityElement.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Accessibility/ORKGraphChartAccessibilityElement.m b/ResearchKitUI/Accessibility/ORKGraphChartAccessibilityElement.m similarity index 100% rename from ResearchKit/Accessibility/ORKGraphChartAccessibilityElement.m rename to ResearchKitUI/Accessibility/ORKGraphChartAccessibilityElement.m diff --git a/ResearchKit/Accessibility/UIView+ORKAccessibility.h b/ResearchKitUI/Accessibility/UIView+ORKAccessibility.h similarity index 98% rename from ResearchKit/Accessibility/UIView+ORKAccessibility.h rename to ResearchKitUI/Accessibility/UIView+ORKAccessibility.h index 843fbdf8b3..89096c63fb 100644 --- a/ResearchKit/Accessibility/UIView+ORKAccessibility.h +++ b/ResearchKitUI/Accessibility/UIView+ORKAccessibility.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Accessibility/UIView+ORKAccessibility.m b/ResearchKitUI/Accessibility/UIView+ORKAccessibility.m similarity index 100% rename from ResearchKit/Accessibility/UIView+ORKAccessibility.m rename to ResearchKitUI/Accessibility/UIView+ORKAccessibility.m diff --git a/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKColorChoiceCellGroup.h b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKColorChoiceCellGroup.h new file mode 100644 index 0000000000..7ffa7f25dd --- /dev/null +++ b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKColorChoiceCellGroup.h @@ -0,0 +1,73 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ORKColorChoiceAnswerFormat; +@class ORKChoiceViewCell; +@class ORKTextChoiceAnswerFormat; + + +@interface ORKColorChoiceCellGroup : NSObject + +- (instancetype)initWithColorChoiceAnswerFormat:(ORKColorChoiceAnswerFormat *)answerFormat + answer:(nullable id)answer + beginningIndexPath:(NSIndexPath *)indexPath + immediateNavigation:(BOOL)immediateNavigation; + +@property (nonatomic, assign) ORKQuestionStepPresentationStyle presentationStyle; + +@property (nonatomic, strong, nullable) id answer; + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, copy) ORKColorChoiceAnswerFormat *answerFormat; + + +- (nullable ORKChoiceViewCell *)cellAtIndexPath:(NSIndexPath *)indexPath withReuseIdentifier:(nullable NSString *)identifier; + +- (BOOL)containsIndexPath:(NSIndexPath *)indexPath; + +- (void)didSelectCellAtIndexPath:(NSIndexPath *)indexPath; + +- (nullable id)answerForBoolean; + +- (NSUInteger)size; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKColorChoiceCellGroup.m b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKColorChoiceCellGroup.m new file mode 100644 index 0000000000..ab5e2bb941 --- /dev/null +++ b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKColorChoiceCellGroup.m @@ -0,0 +1,206 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKColorChoiceCellGroup.h" + +#import "ORKAnswerFormat_Internal.h" +#import "ORKAnswerTextView.h" +#import "ORKChoiceAnswerFormatHelper.h" +#import "ORKChoiceViewCell.h" +#import "ORKHelpers_Internal.h" +#import "ORKSelectionSubTitleLabel.h" +#import "ORKSelectionTitleLabel.h" +#import "ORKTextChoiceCellGroup.h" + + +@implementation ORKColorChoiceCellGroup { + ORKChoiceAnswerFormatHelper *_helper; + BOOL _singleChoice; + BOOL _immediateNavigation; + NSIndexPath *_beginningIndexPath; + + NSMutableDictionary *_cells; +} + +- (instancetype)initWithColorChoiceAnswerFormat:(ORKColorChoiceAnswerFormat *)answerFormat + answer:(id)answer + beginningIndexPath:(NSIndexPath *)indexPath + immediateNavigation:(BOOL)immediateNavigation { + self = [super init]; + if (self) { + _beginningIndexPath = indexPath; + _helper = [[ORKChoiceAnswerFormatHelper alloc] initWithAnswerFormat:answerFormat]; + _answerFormat = answerFormat; + _singleChoice = answerFormat.style == ORKChoiceAnswerStyleSingleChoice; + _immediateNavigation = immediateNavigation; + _cells = [NSMutableDictionary new]; + _presentationStyle = ORKQuestionStepPresentationStyleDefault; + [self setAnswer:answer]; + } + return self; +} + +- (NSUInteger)size { + return [_helper choiceCount]; +} + +- (void)setAnswer:(id)answer { + _answer = answer; + + [self safelySetSelectedIndexesForAnswer:answer]; +} + +- (ORKChoiceViewCell *)cellAtIndexPath:(NSIndexPath *)indexPath withReuseIdentifier:(NSString *)identifier { + if ([self containsIndexPath:indexPath] == NO) { + return nil; + } + + return [self cellAtIndex:indexPath.row-_beginningIndexPath.row withReuseIdentifier:identifier]; +} + +- (ORKChoiceViewCell *)cellAtIndex:(NSUInteger)index withReuseIdentifier:(NSString *)identifier { + ORKChoiceViewCell *cell = _cells[@(index)]; + + if (cell == nil) { + ORKColorChoice *colorChoice = [_helper colorChoiceAtIndex:index]; + + if ([self.presentationStyle isEqualToString:ORKQuestionStepPresentationStyleDefault]) { + cell = [[ORKChoiceViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; + } else if ([self.presentationStyle isEqualToString:ORKQuestionStepPresentationStylePlatter]) { + cell = [[ORKChoiceViewPlatterCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]; + } + + cell.isExclusive = colorChoice.exclusive; + cell.immediateNavigation = _immediateNavigation; + cell.shouldIgnoreDarkMode = YES; + [cell setSwatchColor:colorChoice.color]; + [cell setPrimaryText:colorChoice.text]; + [cell setDetailText:colorChoice.detailText]; + + _cells[@(index)] = cell; + + [self safelySetSelectedIndexesForAnswer:_answer]; + } + + return cell; +} + +- (void)didSelectCellAtIndexPath:(NSIndexPath *)indexPath { + if ([self containsIndexPath:indexPath]== NO) { + return; + } + NSUInteger index = indexPath.row - _beginningIndexPath.row; + ORKChoiceViewCell *touchedCell = [self cellAtIndex:index withReuseIdentifier:nil]; + + if (_singleChoice) { + [touchedCell setCellSelected:YES highlight:YES]; + for (ORKChoiceViewCell *cell in _cells.allValues) { + if (cell != touchedCell) { + [cell setCellSelected:NO highlight:NO]; + } + } + } else { + [touchedCell setCellSelected:!touchedCell.isCellSelected highlight:YES]; + if (touchedCell.isCellSelected) { + ORKColorChoice *touchedChoice = [_helper colorChoiceAtIndex:index]; + for (NSNumber *num in _cells.allKeys) { + ORKChoiceViewCell *cell = _cells[num]; + ORKColorChoice *choice = [_helper colorChoiceAtIndex:num.unsignedIntegerValue]; + if (cell != touchedCell && (touchedChoice.exclusive || (cell.isCellSelected && choice.exclusive))) { + [cell setCellSelected:NO highlight:NO]; + } + } + } + } + + _answer = [_helper answerForSelectedIndexes:[self selectedIndexes]]; + [self.delegate answerChangedForIndexPath:indexPath]; +} + +- (BOOL)containsIndexPath:(NSIndexPath *)indexPath { + NSUInteger count = _helper.choiceCount; + + return (indexPath.section == _beginningIndexPath.section) && + (indexPath.row >= _beginningIndexPath.row) && + (indexPath.row < (_beginningIndexPath.row + count)); +} + +-(void)safelySetSelectedIndexesForAnswer:(nullable id)answer { + NSArray *selectedIndexes; + @try { + selectedIndexes = [_helper selectedIndexesForAnswer:answer]; + } @catch (NSException *exception) { + selectedIndexes = [[NSArray alloc] init]; + ORK_Log_Error("Error getting selected indexes: %@", exception.reason); + } @finally { + [self setSelectedIndexes: selectedIndexes]; + } +} + +- (void)setSelectedIndexes:(NSArray *)indexes { + for (NSUInteger index = 0; index < self.size; index++ ) { + BOOL selected = [indexes containsObject:@(index)]; + + if (selected) { + // In case the cell has not been created, need to create cell + ORKChoiceViewCell *cell = [self cellAtIndex:index withReuseIdentifier:nil]; + [cell setCellSelected:YES highlight:NO]; + } else { + // It is ok to not create the cell at here + ORKChoiceViewCell *cell = _cells[@(index)]; + [cell setCellSelected:NO highlight:NO]; + + } + } +} + +- (NSArray *)selectedIndexes { + NSMutableArray *indexes = [NSMutableArray new]; + + for (NSUInteger index = 0; index < self.size; index++ ) { + ORKChoiceViewCell *cell = _cells[@(index)]; + if (cell.isCellSelected) { + [indexes addObject:@(index)]; + } + } + + return [indexes copy]; +} + +- (id)answerForBoolean { + // Boolean type uses a different format + if ([_answer isKindOfClass:[NSArray class]] ) { + NSArray *answerArray = _answer; + return (answerArray.count > 0) ? answerArray.firstObject : nil; + } + return _answer; +} + +@end diff --git a/ResearchKit/Common/ORKTextChoiceCellGroup.h b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKTextChoiceCellGroup.h similarity index 96% rename from ResearchKit/Common/ORKTextChoiceCellGroup.h rename to ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKTextChoiceCellGroup.h index b309a8dbbb..0877ccf5eb 100644 --- a/ResearchKit/Common/ORKTextChoiceCellGroup.h +++ b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKTextChoiceCellGroup.h @@ -29,9 +29,8 @@ */ -@import Foundation; -@import UIKit; - +#import +#import #import NS_ASSUME_NONNULL_BEGIN @@ -71,6 +70,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)didSelectCellAtIndexPath:(NSIndexPath *)indexPath; +- (ORKTextChoice *)textChoiceForIndex:(NSInteger)index; + - (nullable id)answerForBoolean; - (NSUInteger)size; diff --git a/ResearchKit/Common/ORKTextChoiceCellGroup.m b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKTextChoiceCellGroup.m similarity index 99% rename from ResearchKit/Common/ORKTextChoiceCellGroup.m rename to ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKTextChoiceCellGroup.m index 37b50fac8d..610c5f505c 100644 --- a/ResearchKit/Common/ORKTextChoiceCellGroup.m +++ b/ResearchKitUI/Common/Answer Format/Choice Format Helpers/ORKTextChoiceCellGroup.m @@ -87,6 +87,10 @@ - (ORKChoiceViewCell *)cellAtIndexPath:(NSIndexPath *)indexPath withReuseIdentif return [self cellAtIndex:indexPath.row-_beginningIndexPath.row withReuseIdentifier:identifier]; } +- (ORKTextChoice *)textChoiceForIndex:(NSInteger)index { + return [_helper textChoiceAtIndex:index]; +} + - (ORKChoiceViewCell *)cellAtIndex:(NSUInteger)index withReuseIdentifier:(NSString *)identifier { ORKChoiceViewCell *cell = _cells[@(index)]; diff --git a/ResearchKitUI/Common/Answer Format/Control Views/ORKAgePicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKAgePicker.h new file mode 100644 index 0000000000..439b23b3b6 --- /dev/null +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKAgePicker.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +@import UIKit; +#import + + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKAgePicker : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Answer Format/Control Views/ORKAgePicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKAgePicker.m new file mode 100644 index 0000000000..d44d6fa0e5 --- /dev/null +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKAgePicker.m @@ -0,0 +1,260 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKAgePicker.h" + +#import "ORKResult_Private.h" +#import "ORKAnswerFormat_Internal.h" +#import "ORKAccessibilityFunctions.h" + + +@interface ORKAgePicker () + +@end + +static const CGFloat PickerSpacerHeight = 15.0; +static const CGFloat PickerMinimumHeight = 34.0; + +@implementation ORKAgePicker { + UIPickerView *_pickerView; + ORKAgeAnswerFormat *_answerFormat; + NSArray *_ageOptions; + id _answer; + __weak id _pickerDelegate; +} + +@synthesize pickerDelegate = _pickerDelegate; + +- (instancetype)initWithAnswerFormat:(ORKAgeAnswerFormat *)answerFormat answer:(id)answer pickerDelegate:(id)delegate { + self = [super init]; + if (self) { + NSAssert([answerFormat isKindOfClass:[ORKAgeAnswerFormat class]], @"answerFormat should be ORKAgeAnswerFormat"); + + _answerFormat = answerFormat; + _pickerDelegate = delegate; + _answer = answer; + + NSMutableArray *tempArray = [NSMutableArray new]; + for (int i = _answerFormat.minimumAge; i <= _answerFormat.maximumAge; i++) { + [tempArray addObject:[[NSNumber alloc] initWithInt:i]]; + } + + _ageOptions = [tempArray copy]; + } + return self; +} + +- (UIView *)pickerView { + if (_pickerView == nil) { + _pickerView = [[UIPickerView alloc] init]; + _pickerView.dataSource = self; + _pickerView.delegate = self; + [self setAnswer:_answer]; + } + return _pickerView; +} + +- (void)setAnswer:(id)answer { + _answer = answer; + + if (!ORKIsAnswerEmpty(_answer)) { + NSNumber *value = (NSNumber *)_answer; + NSUInteger indexOfAgeOption = 0; + + if ([self isAnswerAYear:value]) { + // if year is passed in, its converted back to age so picker can be set correctly + NSNumber *ageValueForYear = [[NSNumber alloc] initWithInt:_answerFormat.relativeYear - value.intValue]; + indexOfAgeOption = [self indexForAgeValue:ageValueForYear]; + } else if (value < 0) { + // if a sentinel value is passed in, either the first or last index is passed back accordingly + indexOfAgeOption = [value intValue] == [ORKAgeAnswerFormat minimumAgeSentinelValue] ? 0 : _ageOptions.count - 1; + } else { + indexOfAgeOption = [self indexForAgeValue:value]; + } + + // offset the index by 1 to account for the empty value in first position of the picker + [_pickerView selectRow:indexOfAgeOption + 1 inComponent:0 animated:YES]; + + return; + } + + if (_answerFormat.defaultValue >= _answerFormat.minimumAge && _answerFormat.defaultValue <= _answerFormat.maximumAge) { + // use default to select a row + NSNumber *defaultValue = [self defaultAnswerValue]; + NSUInteger indexOfAgeOption = [_ageOptions indexOfObject: defaultValue]; + + [_pickerView selectRow:indexOfAgeOption + 1 inComponent:0 animated:YES]; + } +} + +- (id)answer { + return _answer; +} + +- (BOOL)isAnswerAYear:(NSNumber *)answer { + NSInteger relativeYear = _answerFormat.relativeYear; + + return answer.intValue <= relativeYear && answer.intValue >= (relativeYear - _answerFormat.maximumAge); +} + +- (NSUInteger)indexForAgeValue:(NSNumber *)ageValue { + if ([ageValue intValue] < _answerFormat.minimumAge) { + return 0; + } else if ([ageValue intValue] > _answerFormat.maximumAge) { + return _ageOptions.count - 1; + } + + return [_ageOptions indexOfObject:ageValue]; +} + +- (NSNumber *)ageToYear:(NSNumber *)age { + return [[NSNumber alloc] initWithInt: _answerFormat.relativeYear - age.intValue]; +} + +- (NSNumber *)defaultAnswerValue { + return [[NSNumber alloc] initWithInt:_answerFormat.defaultValue]; +} + +- (NSNumber *)selectedAnswerValue { + NSNumber *answer = nil; + NSInteger selectedRowIndex = [_pickerView selectedRowInComponent:0]; + + // The first option in the picker is an empty string. We return nil if this is selected + if (selectedRowIndex == 0) { + return nil; + } else if ((selectedRowIndex == 1 && _answerFormat.treatMinAgeAsRange) || (selectedRowIndex == _ageOptions.count && _answerFormat.treatMaxAgeAsRange)) { + // if the min or max has been selected a sentinel value is passed back if it should be treated as a range. + int sentinelValue = selectedRowIndex == 1 ? [ORKAgeAnswerFormat minimumAgeSentinelValue] : [ORKAgeAnswerFormat maximumAgeSentinelValue]; + answer = [NSNumber numberWithInt:sentinelValue]; + return answer; + } + + answer = [self ageForIndex:selectedRowIndex]; + + return _answerFormat.useYearForResult ? [self ageToYear:answer] : answer; +} + +- (NSString *)selectedLabelText { + return [_answerFormat stringForAnswer:_answer]; +} + +- (void)pickerWillAppear { + [self pickerView]; + [self valueDidChange:self]; + [self accessibilityFocusOnPickerElement]; +} + +- (void)valueDidChange:(id)sender { + _answer = [self selectedAnswerValue]; + if ([self.pickerDelegate respondsToSelector:@selector(picker:answerDidChangeTo:)]) { + [self.pickerDelegate picker:self answerDidChangeTo:_answer]; + } +} + +- (NSNumber *)ageForIndex:(NSInteger)index { + // index will need to be offset to account for empty choice added to picker + index = (index - 1 < 0) ? 0 : index - 1; + return [_ageOptions objectAtIndex:index]; +} + +#pragma mark - Accessibility + +- (void)accessibilityFocusOnPickerElement { + if (UIAccessibilityIsVoiceOverRunning()) { + ORKAccessibilityPerformBlockAfterDelay(0.75, ^{ + NSArray *axElements = [self.pickerView accessibilityElements]; + if ([axElements count] > 0) { + UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, [axElements objectAtIndex:0]); + } + }); + } +} + +#pragma mark - UIPickerViewDataSource + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { + return 1; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { + return _ageOptions.count + 1; +} + +- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { + + if (row == 0) { + return @""; + } + + NSString *title; + int ageValue = [self ageForIndex:row].intValue; + + if (row == 1 && _answerFormat.minimumAgeCustomText) { + title = _answerFormat.minimumAgeCustomText; + } else if (row == _ageOptions.count && _answerFormat.maximumAgeCustomText) { + title = _answerFormat.maximumAgeCustomText; + } else if (_answerFormat.showYear) { + title = [NSString stringWithFormat:@"%li (%i)", _answerFormat.relativeYear - ageValue, ageValue]; + } else { + title = [NSString stringWithFormat:@"%i", ageValue]; + } + + return title; +} + +- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view +{ + UILabel* valueLabel = (UILabel*)view; + if (!valueLabel) + { + valueLabel = [[UILabel alloc] init]; + [valueLabel setFont:[self defaultFont]]; + [valueLabel setTextAlignment:NSTextAlignmentCenter]; + } + valueLabel.text = [self pickerView:pickerView titleForRow:row forComponent:component]; + return valueLabel; +} + +- (UIFont *)defaultFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody]; + return [UIFont systemFontOfSize:((NSNumber *)[descriptor objectForKey:UIFontDescriptorSizeAttribute]).doubleValue + 2.0]; +} + +- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component { + UIFont *font = [self defaultFont]; + CGFloat height = font.pointSize + PickerSpacerHeight; + return (height < PickerMinimumHeight ? PickerMinimumHeight : height); +} + +- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { + [self valueDidChange:self]; +} + +@end diff --git a/ResearchKit/Common/ORKAnswerTextField.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextField.h similarity index 94% rename from ResearchKit/Common/ORKAnswerTextField.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextField.h index 2fc932f80b..c848666bfe 100644 --- a/ResearchKit/Common/ORKAnswerTextField.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextField.h @@ -29,9 +29,9 @@ */ -@import UIKit; -#import "ORKDefaultFont.h" -#import "ORKDefines.h" +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKAnswerTextField.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextField.m similarity index 100% rename from ResearchKit/Common/ORKAnswerTextField.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextField.m diff --git a/ResearchKit/Common/ORKAnswerTextView.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextView.h similarity index 100% rename from ResearchKit/Common/ORKAnswerTextView.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextView.h diff --git a/ResearchKit/Common/ORKAnswerTextView.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextView.m similarity index 94% rename from ResearchKit/Common/ORKAnswerTextView.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextView.m index d2508199bb..2d40f563b1 100644 --- a/ResearchKit/Common/ORKAnswerTextView.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKAnswerTextView.m @@ -68,12 +68,9 @@ - (void)commonInit { object:self]; _placeholderTextView = [[UITextView alloc] initWithFrame:CGRectZero]; - if (@available(iOS 13.0, *)) { - _placeholderTextView.textColor = [UIColor placeholderTextColor]; - } else { - _placeholderTextView.textColor = [UIColor ork_midGrayTintColor]; - } + _placeholderTextView.textColor = [UIColor placeholderTextColor]; _placeholderTextView.userInteractionEnabled = NO; + _placeholderTextView.isAccessibilityElement = NO; _placeholderTextView.translatesAutoresizingMaskIntoConstraints = NO; [self insertSubview:_placeholderTextView atIndex:0]; @@ -185,6 +182,19 @@ - (BOOL)accessibilityDismissKeyboardForAction:(UIAccessibilityCustomAction *)cus return YES; } +- (NSString *)accessibilityLabel { + if (!_placeholderTextView.hidden) { + return _placeholderTextView.text; + } else { + return [super accessibilityLabel]; + } +} + +- (NSArray *)automationElements { + // Placeholder TextView is excluded as an accessibility element but should still be available to automation. + return [[super automationElements] arrayByAddingObject:_placeholderTextView]; +} + - (NSArray *)accessibilityCustomActions { NSArray *actions = nil; diff --git a/ResearchKit/Common/ORKDateTimePicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKDateTimePicker.h similarity index 96% rename from ResearchKit/Common/ORKDateTimePicker.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKDateTimePicker.h index 6c1536c727..c45e95469a 100644 --- a/ResearchKit/Common/ORKDateTimePicker.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKDateTimePicker.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKPicker.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKDateTimePicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKDateTimePicker.m similarity index 100% rename from ResearchKit/Common/ORKDateTimePicker.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKDateTimePicker.m diff --git a/ResearchKit/Common/ORKHeightPicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKHeightPicker.h similarity index 96% rename from ResearchKit/Common/ORKHeightPicker.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKHeightPicker.h index e55e8a73b7..9d1a2123c6 100644 --- a/ResearchKit/Common/ORKHeightPicker.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKHeightPicker.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKHeightPicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKHeightPicker.m similarity index 99% rename from ResearchKit/Common/ORKHeightPicker.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKHeightPicker.m index 4f55af0ebc..12d5437c9f 100644 --- a/ResearchKit/Common/ORKHeightPicker.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKHeightPicker.m @@ -173,7 +173,8 @@ - (NSString *)selectedLabelText { - (void)pickerWillAppear { // Report current value, since ORKHeightPicker always has a value [self pickerView]; - [self valueDidChange:self]; + // only do the assignment that's done in `valueDidChange` + _answer = [self selectedAnswerValue]; [self accessibilityFocusOnPickerElement]; } diff --git a/ResearchKit/Common/ORKImageSelectionView.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKImageSelectionView.h similarity index 100% rename from ResearchKit/Common/ORKImageSelectionView.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKImageSelectionView.h diff --git a/ResearchKit/Common/ORKImageSelectionView.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKImageSelectionView.m similarity index 88% rename from ResearchKit/Common/ORKImageSelectionView.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKImageSelectionView.m index 76cfa8f01a..6ff0898e5d 100644 --- a/ResearchKit/Common/ORKImageSelectionView.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKImageSelectionView.m @@ -37,7 +37,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKSkin.h" - +#import "UIImageView+ResearchKit.h" +#import "UIImage+ResearchKit.h" @interface ORKChoiceButtonView : UIView @@ -45,6 +46,7 @@ - (instancetype)initWithImageChoice:(ORKImageChoice *)choice; @property (nonatomic, strong) UIButton *button; @property (nonatomic, copy) NSString *labelText; +@property (nonatomic, copy) ORKImageChoice *choice; @end @@ -54,17 +56,12 @@ @implementation ORKChoiceButtonView - (instancetype)initWithImageChoice:(ORKImageChoice *)choice { self = [super init]; if (self) { + _choice = [choice copy]; _labelText = choice.text.length > 0 ? choice.text: @" "; self.button = [UIButton buttonWithType:UIButtonTypeCustom]; _button.exclusiveTouch = YES; - - if (choice.selectedStateImage) { - [_button setImage:choice.selectedStateImage forState:UIControlStateSelected]; - } - - [_button setImage:choice.normalStateImage forState:UIControlStateNormal]; - + [self setupButtonImagesFromImageChoice:choice]; _button.imageView.contentMode = UIViewContentModeScaleAspectFit; [self addSubview:_button]; @@ -78,10 +75,45 @@ - (instancetype)initWithImageChoice:(ORKImageChoice *)choice { } else { self.button.accessibilityLabel = self.labelText; } + [self updateViewColors]; } return self; } +- (void)setupButtonImagesFromImageChoice:(ORKImageChoice *)choice { + if ([UITraitCollection currentTraitCollection].userInterfaceStyle == UIUserInterfaceStyleDark) { + [_button setImage:[_button.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal]; + } else { + [_button setImage:[_button.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal]; + } + + if (choice.selectedStateImage) { + UIImage *selectedStateImage = choice.selectedStateImage; + if (@available(iOS 12.0, *)) { + selectedStateImage = [choice.selectedStateImage ork_imageWithRenderingModeForUserInterfaceStyle:self.traitCollection.userInterfaceStyle]; + } + [_button setImage:selectedStateImage forState:UIControlStateSelected]; + } + + UIImage *normalStateImage = choice.normalStateImage; + if (@available(iOS 12.0, *)) { + normalStateImage = [choice.normalStateImage ork_imageWithRenderingModeForUserInterfaceStyle:self.traitCollection.userInterfaceStyle]; + } + + [_button setImage:normalStateImage forState:UIControlStateNormal]; +} + +- (void)updateViewColors { + if (@available(iOS 12.0, *)) { + _button.imageView.tintColor = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? [UIColor whiteColor] : nil; + } +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + [super traitCollectionDidChange:previousTraitCollection]; + [self setupButtonImagesFromImageChoice:_choice]; +} + - (void)setUpConstraints { NSMutableArray *constraints = [NSMutableArray new]; @@ -163,12 +195,7 @@ - (instancetype)initWithImageChoiceAnswerFormat:(ORKImageChoiceAnswerFormat *)an _placeHolderLabel = [self makeLabel]; _placeHolderLabel.text = [ORKLocalizedString(@"PLACEHOLDER_IMAGE_CHOICES", nil) stringByAppendingString:@""]; - - if (@available(iOS 13.0, *)) { - _placeHolderLabel.textColor = [UIColor secondaryLabelColor]; - } else { - _placeHolderLabel.textColor = [UIColor ork_midGrayTintColor]; - } + _placeHolderLabel.textColor = [UIColor secondaryLabelColor]; _choiceLabel = [self makeLabel]; @@ -188,6 +215,7 @@ - (instancetype)initWithImageChoiceAnswerFormat:(ORKImageChoiceAnswerFormat *)an ORKChoiceButtonView *buttonView = [[ORKChoiceButtonView alloc] initWithImageChoice:imageChoice]; [buttonView.button addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside]; + buttonView.button.imageView.layer.cornerRadius = ORKImageChoiceButtonCornerRadii; [buttonViews addObject:buttonView]; [self addSubview:buttonView]; } @@ -370,18 +398,22 @@ - (void)setAnswer:(id)answer { - (void)resetLabelText { _placeHolderLabel.hidden = NO; _choiceLabel.hidden = !_placeHolderLabel.hidden; - +} + +- (void)resetButtonSelection:(UIButton *)button { + [_buttonViews enumerateObjectsUsingBlock:^(ORKChoiceButtonView *buttonView, NSUInteger idx, BOOL *stop) { + if (_singleChoice) { + buttonView.button.imageView.backgroundColor = nil; + } else if ([buttonView.button isEqual: button]) { + buttonView.button.imageView.backgroundColor = nil; + } + }]; } - (void)setLabelText:(NSString *)text { if (_singleChoice || [text length] > 0) { _choiceLabel.text = text; - if (@available(iOS 13.0, *)) { - _choiceLabel.textColor = [UIColor labelColor]; - } else { - _choiceLabel.textColor = [UIColor blackColor]; - } - + _choiceLabel.textColor = [UIColor labelColor]; _choiceLabel.hidden = NO; _placeHolderLabel.hidden = !_choiceLabel.hidden; } else { @@ -398,6 +430,7 @@ - (IBAction)buttonTapped:(UIButton *)button { if (buttonView.button != button) { if (_singleChoice) { buttonView.button.selected = NO; + buttonView.button.imageView.backgroundColor = nil; } } else { if (_singleChoice) { @@ -405,6 +438,7 @@ - (IBAction)buttonTapped:(UIButton *)button { } else { [self setLabelText:[_helper labelForChoiceAnswer:[_helper answerForSelectedIndexes:[self selectedIndexes]]]]; } + buttonView.button.imageView.backgroundColor = [UIColor lightGrayColor]; } }]; @@ -415,6 +449,7 @@ - (IBAction)buttonTapped:(UIButton *)button { } else { [self setLabelText:[_helper labelForChoiceAnswer:[_helper answerForSelectedIndexes:[self selectedIndexes]]]]; } + [self resetButtonSelection:button]; } _answer = [_helper answerForSelectedIndexes:[self selectedIndexes]]; @@ -447,9 +482,16 @@ - (void)setSelectedIndexes:(NSArray *)selectedIndexes { if (number.unsignedIntegerValue < _buttonViews.count) { ORKChoiceButtonView *buttonView = _buttonViews[number.unsignedIntegerValue]; [buttonView button].selected = YES; - [self setLabelText:buttonView.labelText]; + buttonView.button.imageView.backgroundColor = [UIColor lightGrayColor]; + if (_singleChoice) { + [self setLabelText:buttonView.labelText]; + } } }]; + + if (!_singleChoice) { + [self setLabelText:[_helper labelForChoiceAnswer:[_helper answerForSelectedIndexes:[self selectedIndexes]]]]; + } } - (BOOL)isAccessibilityElement { diff --git a/ResearchKit/Common/ORKLocationSelectionView.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKLocationSelectionView.h similarity index 98% rename from ResearchKit/Common/ORKLocationSelectionView.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKLocationSelectionView.h index acc27dd93e..0f250427a7 100644 --- a/ResearchKit/Common/ORKLocationSelectionView.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKLocationSelectionView.h @@ -37,6 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @import UIKit; @@ -92,3 +93,4 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END +#endif diff --git a/ResearchKit/Common/ORKLocationSelectionView.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKLocationSelectionView.m similarity index 97% rename from ResearchKit/Common/ORKLocationSelectionView.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKLocationSelectionView.m index 2ff6e9c078..1c5a9d595e 100644 --- a/ResearchKit/Common/ORKLocationSelectionView.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKLocationSelectionView.m @@ -36,6 +36,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION #import "ORKLocationSelectionView.h" @@ -48,8 +49,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKSkin.h" -@import MapKit; +#import +@import MapKit; static const NSString *FormattedAddressLines = @"FormattedAddressLines"; @@ -278,23 +280,15 @@ - (void)showMapViewIfNecessary { - (void)loadCurrentLocationIfNecessary { if (_useCurrentLocation) { - CLAuthorizationStatus status = kCLAuthorizationStatusNotDetermined; + CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; - if (@available(iOS 14.0, *)) { - status = _locationManager.authorizationStatus; - } else { - status = [CLLocationManager authorizationStatus]; - } - if (status == kCLAuthorizationStatusAuthorizedAlways || status == kCLAuthorizationStatusAuthorizedWhenInUse) { _userLocationNeedsUpdate = YES; _mapView.showsUserLocation = YES; - } else if (_locationManager == nil) { + } else { _locationManager = [[CLLocationManager alloc] init]; _locationManager.delegate = self; - } - if (status == kCLAuthorizationStatusNotDetermined) { - [_locationManager requestWhenInUseAuthorization]; + [_locationManager ork_requestWhenInUseAuthorization]; } } } @@ -441,8 +435,10 @@ - (void)notifyDelegateOfError:(NSError *)error { # pragma mark CLLocationManagerDelegate -- (void)locationManagerDidChangeAuthorization:(CLLocationManager *)manager { +- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { + if (status == kCLAuthorizationStatusAuthorizedAlways || status == kCLAuthorizationStatusAuthorizedWhenInUse) { [self loadCurrentLocationIfNecessary]; + } } #pragma mark MKMapViewDelegate @@ -499,3 +495,4 @@ - (BOOL)textFieldShouldClear:(UITextField *)textField { } @end +#endif diff --git a/ResearchKit/Common/ORKMultipleValuePicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKMultipleValuePicker.h similarity index 96% rename from ResearchKit/Common/ORKMultipleValuePicker.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKMultipleValuePicker.h index bb36a3def2..190cf06efb 100644 --- a/ResearchKit/Common/ORKMultipleValuePicker.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKMultipleValuePicker.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKPicker.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKMultipleValuePicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKMultipleValuePicker.m similarity index 100% rename from ResearchKit/Common/ORKMultipleValuePicker.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKMultipleValuePicker.m diff --git a/ResearchKit/Common/ORKPicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKPicker.h similarity index 99% rename from ResearchKit/Common/ORKPicker.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKPicker.h index d504cc240a..d6c2075fff 100644 --- a/ResearchKit/Common/ORKPicker.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKPicker.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKPicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKPicker.m similarity index 94% rename from ResearchKit/Common/ORKPicker.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKPicker.m index 0b93c2d286..4603644cdd 100644 --- a/ResearchKit/Common/ORKPicker.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKPicker.m @@ -31,6 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKPicker.h" +#import "ORKAgePicker.h" #import "ORKDateTimePicker.h" #import "ORKHeightPicker.h" #import "ORKWeightPicker.h" @@ -70,6 +71,8 @@ @implementation ORKPicker : NSObject picker = [[ORKWeightPicker alloc] initWithAnswerFormat:answerFormat answer:answer pickerDelegate:delegate]; } else if ([answerFormat isKindOfClass:[ORKMultipleValuePickerAnswerFormat class]]) { picker = [[ORKMultipleValuePicker alloc] initWithAnswerFormat:answerFormat answer:answer pickerDelegate:delegate]; + } else if ([answerFormat isKindOfClass:[ORKAgeAnswerFormat class]]) { + picker = [[ORKAgePicker alloc] initWithAnswerFormat:answerFormat answer:answer pickerDelegate:delegate]; } NSAssert(picker, @"Cannot create picker for answer format %@", answerFormat); diff --git a/ResearchKit/Common/ORKSESSelectionView.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKSESSelectionView.h similarity index 100% rename from ResearchKit/Common/ORKSESSelectionView.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKSESSelectionView.h diff --git a/ResearchKit/Common/ORKSESSelectionView.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKSESSelectionView.m similarity index 94% rename from ResearchKit/Common/ORKSESSelectionView.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKSESSelectionView.m index c115f770b6..bd714693ed 100644 --- a/ResearchKit/Common/ORKSESSelectionView.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKSESSelectionView.m @@ -84,10 +84,7 @@ - (instancetype)initWithRungAtIndex:(NSUInteger)rungIndex text:(nullable NSStrin self = [super init]; if (self) { _rungIndex = rungIndex; - - if (@available(iOS 13.0, *)) { - self.tintColor = ORKViewTintColor(self); - } + self.tintColor = ORKWindowTintcolor(self.window) ? : [UIColor systemBlueColor]; [self setupLabels]; [self setText:text]; @@ -136,7 +133,7 @@ - (void)setupRungImageView { _rungImageView.contentMode = UIViewContentModeScaleAspectFit; _rungImageView.image = [[UIImage imageNamed:@"socioEconomicLadderRung" inBundle:ORKBundle() compatibleWithTraitCollection:nil] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; _rungImageView.tintColor = self.tintColor; - + [self addSubview:_rungImageView]; } @@ -146,6 +143,8 @@ - (void)setupLabels { for (UILabel *label in @[_frontLabel, _rearLabel]) { label.numberOfLines = 1; label.font = [self bodyTextFont]; + label.adjustsFontSizeToFitWidth = YES; + label.minimumScaleFactor = 0.2; label.textColor = [UIColor grayColor]; label.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:label]; @@ -188,6 +187,8 @@ - (void)setupDontKnowButtonWithText:(NSString *)text { _frontLabel = [UILabel new]; _frontLabel.numberOfLines = 1; _frontLabel.font = [self bodyTextFont]; + _frontLabel.adjustsFontSizeToFitWidth = YES; + _frontLabel.minimumScaleFactor = 0.9; _frontLabel.textColor = [UIColor grayColor]; _frontLabel.translatesAutoresizingMaskIntoConstraints = NO; _frontLabel.textAlignment = NSTextAlignmentLeft; @@ -213,7 +214,7 @@ - (void)setChecked:(BOOL)checked { } - (void)didMoveToWindow { - self.tintColor = ORKViewTintColor(self); + self.tintColor = ORKWindowTintcolor(self.window) ? : [UIColor systemBlueColor]; _rungImageView.tintColor = self.tintColor; } @@ -298,11 +299,7 @@ - (void)setSelected:(BOOL)selected highlight:(BOOL)highlight { - (void)tapAnimation { CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"backgroundColor"]; - if (@available(iOS 13.0, *)) { - animation.fromValue = (__bridge id _Nullable)(UIColor.systemGray5Color.CGColor); - } else { - animation.fromValue = (__bridge id _Nullable)([UIColor colorWithRed:0.282 green:0.282 blue:0.235 alpha:1.0].CGColor); - } + animation.fromValue = (__bridge id _Nullable)(UIColor.systemGray5Color.CGColor); animation.toValue = (__bridge id _Nullable)(_fillColor.CGColor); animation.beginTime = 0.0; animation.duration = 0.45; @@ -318,32 +315,24 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { } - (void)updateFillColor { - if (@available(iOS 13.0, *)) { - _fillColor = [UIColor secondarySystemGroupedBackgroundColor]; - - if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { - _fillColor = [UIColor colorWithRed:0.173 green:0.173 blue:0.180 alpha:1.0]; - } - } else { - _fillColor = [UIColor ork_borderGrayColor]; + _fillColor = [UIColor secondarySystemGroupedBackgroundColor]; + if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { + _fillColor = [UIColor colorWithRed:0.173 green:0.173 blue:0.180 alpha:1.0]; } + self.layer.backgroundColor = _fillColor.CGColor; } - (void)setHighlighted:(BOOL)highlighted { [super setHighlighted:highlighted]; if (highlighted) { - if (@available(iOS 13.0, *)) { - self.layer.backgroundColor = UIColor.systemGray5Color.CGColor; - } else { - self.layer.backgroundColor = [UIColor colorWithRed:0.282 green:0.282 blue:0.235 alpha:1.0].CGColor; - } + self.layer.backgroundColor = UIColor.systemGray5Color.CGColor; } else { self.layer.backgroundColor = _fillColor.CGColor; } } - + @end @implementation ORKSESSelectionView { @@ -387,7 +376,6 @@ - (void)addRungButtonsWithTopRungText:(NSString *)topRungText bottomRungText:(NS [[rungButton.leftAnchor constraintEqualToAnchor:self.leftAnchor] setActive:YES]; [[rungButton.rightAnchor constraintEqualToAnchor:self.rightAnchor] setActive:YES]; [[rungButton.topAnchor constraintEqualToAnchor:(i==0) ? self.topAnchor : _buttons[i-1].bottomAnchor constant:(i==0) ? rungButtonPadding : rungToRungPadding] setActive:YES]; - if (i==_buttons.count-1 && ![_answerFormat shouldShowDontKnowButton]) { [[self.bottomAnchor constraintGreaterThanOrEqualToAnchor:rungButton.bottomAnchor constant:rungButtonPadding] setActive:YES]; } diff --git a/ResearchKit/Common/ORKScaleSlider.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSlider.h similarity index 98% rename from ResearchKit/Common/ORKScaleSlider.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSlider.h index c47923b035..f49849cfac 100644 --- a/ResearchKit/Common/ORKScaleSlider.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSlider.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKScaleSlider.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSlider.m similarity index 97% rename from ResearchKit/Common/ORKScaleSlider.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSlider.m index 75e6c83674..7bd0dd71d4 100644 --- a/ResearchKit/Common/ORKScaleSlider.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSlider.m @@ -64,11 +64,7 @@ - (instancetype)initWithFrame:(CGRect)frame { UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(sliderTouched:)]; [self addGestureRecognizer:panGesture]; - if (@available(iOS 13.0, *)) { - self.maximumTrackTintColor = [UIColor systemGray3Color]; - } else { - self.maximumTrackTintColor = [UIColor systemGrayColor]; - } + self.maximumTrackTintColor = [UIColor systemGray3Color]; self.gradientLayer = [CAGradientLayer layer]; @@ -209,11 +205,7 @@ - (void)drawRect:(CGRect)rect { CGRect trackRect = [self trackRectForBounds:bounds]; CGFloat centerY = bounds.size.height / 2.0; - if (@available(iOS 13.0, *)) { - [[UIColor systemGray3Color] set]; - } else { - [[UIColor systemGrayColor] setStroke]; - } + [[UIColor systemGray3Color] set]; if (_numberOfSteps > 0 && !_hideValueMarkers) { diff --git a/ResearchKit/Common/ORKScaleSliderView.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSliderView.h similarity index 99% rename from ResearchKit/Common/ORKScaleSliderView.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSliderView.h index 702bb3c924..e3ad48ea2f 100644 --- a/ResearchKit/Common/ORKScaleSliderView.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSliderView.h @@ -39,6 +39,7 @@ NS_ASSUME_NONNULL_BEGIN @class ORKScaleRangeDescriptionLabel; @class ORKScaleRangeImageView; @class ORKScaleSliderView; + @protocol ORKScaleAnswerFormatProvider; @protocol ORKScaleSliderViewDelegate diff --git a/ResearchKit/Common/ORKScaleSliderView.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSliderView.m similarity index 97% rename from ResearchKit/Common/ORKScaleSliderView.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSliderView.m index 1d050a3f8a..8fb44b838f 100644 --- a/ResearchKit/Common/ORKScaleSliderView.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKScaleSliderView.m @@ -156,13 +156,8 @@ - (instancetype)initWithFormatProvider:(id)formatP } if (textChoices) { - if (@available(iOS 13.0, *)) { - [_leftRangeDescriptionLabel setTextColor:[UIColor labelColor]]; - [_rightRangeDescriptionLabel setTextColor:[UIColor labelColor]]; - } else { - _leftRangeDescriptionLabel.textColor = [UIColor blackColor]; - _rightRangeDescriptionLabel.textColor = [UIColor blackColor]; - } + [_leftRangeDescriptionLabel setTextColor:[UIColor labelColor]]; + [_rightRangeDescriptionLabel setTextColor:[UIColor labelColor]]; _leftRangeLabel.text = @""; _rightRangeLabel.text = @""; @@ -225,11 +220,7 @@ - (void)setupTopLabels { UIFontDescriptor *moveSliderDescriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleFootnote]; UIFontDescriptor *moveSliderFontDescriptor = [moveSliderDescriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; [_moveSliderLabel setFont: [UIFont fontWithDescriptor:moveSliderFontDescriptor size:[[moveSliderFontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]]; - if (@available(iOS 13.0, *)) { - _moveSliderLabel.textColor = [UIColor secondaryLabelColor]; - } else { - _moveSliderLabel.textColor = [UIColor grayColor]; - } + _moveSliderLabel.textColor = [UIColor secondaryLabelColor]; _valueLabel = [[ORKScaleValueLabel alloc] initWithFrame:CGRectZero]; _valueLabel.text = @""; @@ -246,16 +237,12 @@ - (void)setUpSliderAndRangeLabels { _leftRangeLabel = [[ORKScaleRangeLabel alloc] initWithFrame:CGRectZero]; _leftRangeLabel.textAlignment = NSTextAlignmentCenter; - if (@available(iOS 13.0, *)) { - [_leftRangeLabel setTextColor:[UIColor labelColor]]; - } + [_leftRangeLabel setTextColor:[UIColor labelColor]]; [_leftRangeLabel setFont: [UIFont fontWithDescriptor:rangeLabelRangeFontDescriptor size:[[rangeLabelRangeFontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]]; _rightRangeLabel = [[ORKScaleRangeLabel alloc] initWithFrame:CGRectZero]; _rightRangeLabel.textAlignment = NSTextAlignmentCenter; - if (@available(iOS 13.0, *)) { - [_rightRangeLabel setTextColor:[UIColor labelColor]]; - } + [_rightRangeLabel setTextColor:[UIColor labelColor]]; [_rightRangeLabel setFont: [UIFont fontWithDescriptor:rangeLabelRangeFontDescriptor size:[[rangeLabelRangeFontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]]; if ([_formatProvider minimumImage]) { @@ -296,18 +283,14 @@ - (void)setupRangeDescriptionLabels { _leftRangeDescriptionLabel.lineBreakMode = NSLineBreakByWordWrapping; [_leftRangeDescriptionLabel setFont: [UIFont fontWithDescriptor:rangeDescriptionLabelFontDescriptor size:[[rangeDescriptionLabelFontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]]; _leftRangeDescriptionLabel.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - [_leftRangeDescriptionLabel setTextColor:[UIColor labelColor]]; - } + [_leftRangeDescriptionLabel setTextColor:[UIColor labelColor]]; _rightRangeDescriptionLabel = [[ORKScaleRangeDescriptionLabel alloc] initWithFrame:CGRectZero]; _rightRangeDescriptionLabel.numberOfLines = 0; _rightRangeDescriptionLabel.lineBreakMode = NSLineBreakByWordWrapping; [_rightRangeDescriptionLabel setFont: [UIFont fontWithDescriptor:rangeDescriptionLabelFontDescriptor size:[[rangeDescriptionLabelFontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]]; _rightRangeDescriptionLabel.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - [_rightRangeDescriptionLabel setTextColor:[UIColor labelColor]]; - } + [_rightRangeDescriptionLabel setTextColor:[UIColor labelColor]]; } - (void)setupDontKnowButton { @@ -327,11 +310,7 @@ - (void)setupDontKnowButton { if (!_dividerView) { _dividerView = [UIView new]; - if (@available(iOS 13.0, *)) { - [_dividerView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_dividerView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_dividerView setBackgroundColor:[UIColor separatorColor]]; } } @@ -751,7 +730,7 @@ - (void)dontKnowButtonWasPressed { } } -- (void) tapGesture: (id)sender { +- (void)tapGesture:(id)sender { //this tap gesture is here to avoid the cell being selected if the user missed the dont know button } @@ -782,7 +761,6 @@ - (void)setCurrentTextChoiceValue:(NSObject *)current } - (id)currentAnswerValue { - if ([_dontKnowButton active]) { return [ORKDontKnowAnswer answer]; } diff --git a/ResearchKit/Common/ORKTimeIntervalPicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKTimeIntervalPicker.h similarity index 96% rename from ResearchKit/Common/ORKTimeIntervalPicker.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKTimeIntervalPicker.h index bd15f70d1f..bfd08f9f6c 100644 --- a/ResearchKit/Common/ORKTimeIntervalPicker.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKTimeIntervalPicker.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKPicker.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKTimeIntervalPicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKTimeIntervalPicker.m similarity index 100% rename from ResearchKit/Common/ORKTimeIntervalPicker.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKTimeIntervalPicker.m diff --git a/ResearchKit/Common/ORKValuePicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKValuePicker.h similarity index 96% rename from ResearchKit/Common/ORKValuePicker.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKValuePicker.h index 4a1169be1d..ab5d5becaf 100644 --- a/ResearchKit/Common/ORKValuePicker.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKValuePicker.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKPicker.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKValuePicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKValuePicker.m similarity index 100% rename from ResearchKit/Common/ORKValuePicker.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKValuePicker.m diff --git a/ResearchKit/Common/ORKWeightPicker.h b/ResearchKitUI/Common/Answer Format/Control Views/ORKWeightPicker.h similarity index 96% rename from ResearchKit/Common/ORKWeightPicker.h rename to ResearchKitUI/Common/Answer Format/Control Views/ORKWeightPicker.h index ac7264ca2b..52086de417 100644 --- a/ResearchKit/Common/ORKWeightPicker.h +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKWeightPicker.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKWeightPicker.m b/ResearchKitUI/Common/Answer Format/Control Views/ORKWeightPicker.m similarity index 95% rename from ResearchKit/Common/ORKWeightPicker.m rename to ResearchKitUI/Common/Answer Format/Control Views/ORKWeightPicker.m index 723813c60e..54110ecaaa 100644 --- a/ResearchKit/Common/ORKWeightPicker.m +++ b/ResearchKitUI/Common/Answer Format/Control Views/ORKWeightPicker.m @@ -95,6 +95,10 @@ - (UIView *)pickerView { return _pickerView; } +- (void)resetAnswerToDefault { + _answer = [self defaultAnswerValue]; +} + - (void)setAnswer:(id)answer { _answer = answer; if (ORKIsAnswerEmpty(answer)) { @@ -109,7 +113,8 @@ - (void)setAnswer:(id)answer { if (_answerFormat.numericPrecision != ORKNumericPrecisionHigh) { NSUInteger index = [_majorValues indexOfObject:@((double)((NSNumber *)answer).doubleValue)]; if (index == NSNotFound) { - [self setAnswer:[self defaultAnswerValue]]; + // Not calling setAnswer:defaultAnswerValue to avoid infinite recursion + [self resetAnswerToDefault]; return; } if (![_pickerDelegate isOptional]) { @@ -122,7 +127,8 @@ - (void)setAnswer:(id)answer { NSUInteger wholeIndex = [_majorValues indexOfObject:@((NSInteger)whole)]; NSUInteger fractionIndex = [_minorValues indexOfObject:@((NSInteger)fraction)]; if (wholeIndex == NSNotFound || fractionIndex == NSNotFound) { - [self setAnswer:[self defaultAnswerValue]]; + // Not calling setAnswer:defaultAnswerValue to avoid infinite recursion + [self resetAnswerToDefault]; return; } if (![_pickerDelegate isOptional]) { @@ -138,7 +144,8 @@ - (void)setAnswer:(id)answer { double pounds = ORKKilogramsToPounds(((NSNumber *)answer).doubleValue); NSUInteger poundsIndex = [_majorValues indexOfObject:@((NSInteger)pounds)]; if (poundsIndex == NSNotFound) { - [self setAnswer:[self defaultAnswerValue]]; + // Not calling setAnswer:defaultAnswerValue to avoid infinite recursion + [self resetAnswerToDefault]; return; } // need to add one if not optional @@ -152,7 +159,8 @@ - (void)setAnswer:(id)answer { NSUInteger poundsIndex = [_majorValues indexOfObject:@((NSInteger)pounds)]; NSUInteger ouncesIndex = [_minorValues indexOfObject:@((NSInteger)ounces)]; if (poundsIndex == NSNotFound || ouncesIndex == NSNotFound) { - [self setAnswer:[self defaultAnswerValue]]; + // Not calling setAnswer:defaultAnswerValue to avoid infinite recursion + [self resetAnswerToDefault]; return; } if (![_pickerDelegate isOptional]) { @@ -255,7 +263,8 @@ - (NSString *)selectedLabelText { - (void)pickerWillAppear { // Report current value, since ORKWeightPicker always has a value [self pickerView]; - [self valueDidChange:self]; + // only do the assignment that's done in `valueDidChange` + _answer = [self selectedAnswerValue]; [self accessibilityFocusOnPickerElement]; } diff --git a/ResearchKit/Common/ORKFormItemCell.h b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormItemCell.h similarity index 90% rename from ResearchKit/Common/ORKFormItemCell.h rename to ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormItemCell.h index d51ce773bb..dd474caf1c 100644 --- a/ResearchKit/Common/ORKFormItemCell.h +++ b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormItemCell.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKFormStep.h" +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -52,11 +52,10 @@ NS_ASSUME_NONNULL_BEGIN @interface ORKFormItemCell : UITableViewCell -- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier - formItem:(ORKFormItem *)formItem - answer:(nullable id)answer - maxLabelWidth:(CGFloat)maxLabelWidth - delegate:(id)delegate; +- (void)configureWithFormItem:(ORKFormItem *)formItem + answer:(id)answer + maxLabelWidth:(CGFloat)maxLabelWidth + delegate:(id)delegate; @property (nonatomic, weak, readonly) id delegate; @property (nonatomic, copy, nullable) id answer; @@ -114,10 +113,11 @@ NS_ASSUME_NONNULL_BEGIN @end - +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @interface ORKFormItemLocationCell : ORKFormItemCell @end +#endif @interface ORKFormItemSESCell : ORKFormItemCell diff --git a/ResearchKit/Common/ORKFormItemCell.m b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormItemCell.m similarity index 85% rename from ResearchKit/Common/ORKFormItemCell.m rename to ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormItemCell.m index 994bed1c04..92a7019539 100644 --- a/ResearchKit/Common/ORKFormItemCell.m +++ b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormItemCell.m @@ -43,7 +43,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTextFieldView.h" #import "ORKDontKnowButton.h" -#import "ORKAnswerFormat_Internal.h" +#import #import "ORKFormItem_Internal.h" #import "ORKResult_Private.h" @@ -65,6 +65,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const CGFloat DividerViewTopPadding = 10.0; static const CGFloat InlineFormItemLabelToTextFieldPadding = 3.0; +NSString * const ORKClearTextViewButtonAccessibilityIdentifier = @"ORKClearTextViewButton"; + @interface ORKFormItemCell () - (void)cellInit NS_REQUIRES_SUPER; @@ -123,34 +125,51 @@ @implementation ORKFormItemCell { NSArray *_containerConstraints; } -- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier - formItem:(ORKFormItem *)formItem - answer:(id)answer - maxLabelWidth:(CGFloat)maxLabelWidth - delegate:(id)delegate { - self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; - if (self) { - // Setting the 'delegate' on init is required, as some questions (such as the scale questions) - // need it when they wish to report their default answers to 'ORKFormStepViewController'. - _delegate = delegate; - - _maxLabelWidth = maxLabelWidth; - _answer = [answer copy]; - self.formItem = formItem; +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self != nil) { _labelLabel = [[ORKCaption1Label alloc] init]; - _labelLabel.text = formItem.text; _labelLabel.numberOfLines = 0; [self setBackgroundColor:[UIColor clearColor]]; + _containerView = [UIView new]; [_containerView addSubview:_labelLabel]; [self.contentView addSubview:_containerView]; - [self setupConstraints]; [self cellInit]; - [self setAnswer:_answer]; } return self; } +- (void)configureWithFormItem:(ORKFormItem *)formItem + answer:(id)answer + maxLabelWidth:(CGFloat)maxLabelWidth + delegate:(id)delegate { + + // We used to set the 'delegate' on init, as some questions (such as the scale questions) + // need it when they wish to report their default answers to 'ORKFormStepViewController'. By setting it + // here in config, before setAnswer: we seem to be getting the same effect. + _delegate = delegate; + _maxLabelWidth = maxLabelWidth; + _answer = [answer copy]; + _labelLabel.text = formItem.text; + // ORKFormItemTextCell + // ORKFormItemImageSelectionCell + // ORKFormItemScaleCell + + self.formItem = formItem; + [self setupConstraints]; + [self setAnswer:_answer]; + + [self enableAccessibilitySupport]; +} + +- (void)enableAccessibilitySupport { + self.isAccessibilityElement = true; + self.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction; + self.accessibilityLabel = self.formItem.placeholder ? self.formItem.placeholder : self.formItem.text; + self.accessibilityHint = self.formItem.placeholder ? self.formItem.placeholder : self.formItem.text; +} + - (void)setExpectedLayoutWidth:(CGFloat)newWidth { if (newWidth != _expectedLayoutWidth) { _expectedLayoutWidth = newWidth; @@ -177,7 +196,7 @@ - (void)setupConstraints { [NSLayoutConstraint activateConstraints:_containerConstraints]; } --(void) drawRect:(CGRect)rect { +-(void)drawRect:(CGRect)rect { [super drawRect:rect]; [self setMaskLayers]; } @@ -198,15 +217,9 @@ - (void)setMaskLayers { } _contentMaskLayer = [[CAShapeLayer alloc] init]; - UIColor *fillColor; - UIColor *borderColor; - if (@available(iOS 13.0, *)) { - fillColor = [UIColor secondarySystemGroupedBackgroundColor]; - borderColor = UIColor.separatorColor; - } else { - fillColor = [UIColor ork_borderGrayColor]; - borderColor = [UIColor ork_midGrayTintColor]; - } + UIColor *fillColor = [UIColor secondarySystemGroupedBackgroundColor];; + UIColor *borderColor = UIColor.separatorColor;; + [_contentMaskLayer setFillColor:[fillColor CGColor]]; CAShapeLayer *foreLayer = [CAShapeLayer layer]; @@ -246,6 +259,7 @@ - (void)setMaskLayers { CGRect foreLayerBounds = CGRectMake(ORKCardDefaultBorderWidth, 0, self.containerView.bounds.size.width - 2 * ORKCardDefaultBorderWidth, self.containerView.bounds.size.height); foreLayer.path = [UIBezierPath bezierPathWithRect:foreLayerBounds].CGPath; _contentMaskLayer.path = [UIBezierPath bezierPathWithRect:self.containerView.bounds].CGPath; + CGRect lineBounds = CGRectMake(0.0, self.containerView.bounds.size.height - 1.0, self.containerView.bounds.size.width, 0.5); lineLayer.path = [UIBezierPath bezierPathWithRect:lineBounds].CGPath; lineLayer.zPosition = 0.0f; @@ -342,9 +356,17 @@ - (BOOL)resignFirstResponder { - (void)prepareForReuse { self.hasChangedAnswer = NO; + _labelLabel.text = nil; + _delegate = nil; + _answer = nil; + [self _resetFormItem]; [super prepareForReuse]; } +- (void)_resetFormItem { + _formItem = nil; +} + // Inform delegate of the change - (void)ork_setAnswer:(id)answer { _answer = [answer copy]; @@ -375,28 +397,22 @@ - (void)updateErrorLabelWithMessage:(NSString *)message { NSString *separatorString = @":"; NSString *stringtoParse = message ? : ORKLocalizedString(@"RANGE_ALERT_TITLE", @""); NSString *parsedString = [stringtoParse componentsSeparatedByString:separatorString].firstObject; - - if (@available(iOS 13.0, *)) { - - NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; - NSTextAttachment *imageAttachment = [NSTextAttachment new]; - - UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithPointSize:12 weight:UIImageSymbolWeightRegular scale:UIImageSymbolScaleMedium]; - UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle"]; - UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; - - imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; - - [fullString insertAttributedString:imageString atIndex:0]; - - self.errorLabel.attributedText = fullString; - } else { - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:parsedString]; - self.errorLabel.attributedText = fullString; - } + NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; + NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; + NSTextAttachment *imageAttachment = [NSTextAttachment new]; + + UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithPointSize:12 weight:UIImageSymbolWeightRegular scale:UIImageSymbolScaleMedium]; + UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle"]; + UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; + + imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + + NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; + + [fullString insertAttributedString:imageString atIndex:0]; + + self.errorLabel.attributedText = fullString; [self updateConstraints]; [self cellNeedsToResize]; @@ -427,28 +443,19 @@ - (ORKUnitTextField *)textField; @implementation ORKFormItemTextFieldBasedCell { BOOL _shouldShowDontKnow; + ORKDontKnowButtonStyle _dontKnowButtonStyle; NSString *_customDontKnowString; UIView *_dividerView; UIView *_dontKnowBackgroundView; } -- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier - formItem:(ORKFormItem *)formItem - answer:(id)answer - maxLabelWidth:(CGFloat)maxLabelWidth - delegate:(id)delegate{ - self = [super initWithReuseIdentifier:reuseIdentifier - formItem:formItem - answer:answer - maxLabelWidth:maxLabelWidth - delegate:delegate]; +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self != nil) { UILabel *label = self.labelLabel; label.isAccessibilityElement = NO; self.textFieldView.isAccessibilityElement = YES; - self.textFieldView.accessibilityLabel = label.text; - _doneButtonWasPressed = NO; - + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orkDoneButtonPressed:) name:ORKDoneButtonPressedKey @@ -461,28 +468,64 @@ - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier return self; } +- (void)configureWithFormItem:(ORKFormItem *)formItem + answer:(id)answer + maxLabelWidth:(CGFloat)maxLabelWidth + delegate:(id)delegate { + self.textFieldView.textField.placeholder = formItem.placeholder; + self.textFieldView.accessibilityLabel = self.labelLabel.text; + + if ([formItem.answerFormat shouldShowDontKnowButton]) { + _shouldShowDontKnow = YES; + _customDontKnowString = formItem.answerFormat.customDontKnowButtonText; + _dontKnowButtonStyle = formItem.answerFormat.dontKnowButtonStyle; // reset in prepareForResuse + + [self setupDontKnowButtonWithAnswer:answer]; + self.accessibilityElements = @[_textFieldView, _dontKnowButton, self.errorLabel]; + } else { + self.accessibilityElements = @[_textFieldView, self.errorLabel]; + } + + [self setUpContentConstraint]; + [self setNeedsUpdateConstraints]; + + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; + [self enableAccessibilitySupport]; +} + - (ORKUnitTextField *)textField { return _textFieldView.textField; } +- (void)enableAccessibilitySupport { + NSString *accessibilityLabelTitle = self.formItem.placeholder; + if (!accessibilityLabelTitle) { + accessibilityLabelTitle = self.formItem.text; + } + self.textFieldView.isAccessibilityElement = true; + self.textFieldView.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction; + self.textFieldView.accessibilityLabel = accessibilityLabelTitle; + self.textFieldView.accessibilityHint = accessibilityLabelTitle; +} + - (void)cellInit { [super cellInit]; - _textFieldView = [[ORKTextFieldView alloc] init]; - _textFieldView.isAccessibilityElement = YES; + _textFieldView = [[ORKTextFieldView alloc] init]; // (init) + _textFieldView.isAccessibilityElement = YES; // (init) - ORKUnitTextField *textField = _textFieldView.textField; - textField.delegate = self; - textField.placeholder = self.formItem.placeholder; + ORKUnitTextField *textField = _textFieldView.textField; // init + textField.delegate = self; // init - [self.containerView addSubview:_textFieldView]; + [self.containerView addSubview:_textFieldView]; // init - self.errorLabel = [UILabel new]; - [self.errorLabel setTextColor: [UIColor redColor]]; - [self.errorLabel setFont:[UIFont preferredFontForTextStyle:UIFontTextStyleFootnote]]; - self.errorLabel.numberOfLines = 0; + self.errorLabel = [UILabel new]; // init + [self.errorLabel setTextColor: [UIColor redColor]]; // init + [self.errorLabel setFont:[UIFont preferredFontForTextStyle:UIFontTextStyleFootnote]]; // init + self.errorLabel.numberOfLines = 0; // init + self.errorLabel.isAccessibilityElement = YES; - [self.containerView addSubview:self.errorLabel]; + [self.containerView addSubview:self.errorLabel]; // init self.labelLabel.translatesAutoresizingMaskIntoConstraints = NO; [self.labelLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; @@ -490,17 +533,27 @@ - (void)cellInit { [_textFieldView setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal]; self.errorLabel.translatesAutoresizingMaskIntoConstraints = NO; +// } + +} + +- (void)prepareForReuse { + [super prepareForReuse]; + _doneButtonWasPressed = NO; _shouldShowDontKnow = NO; _customDontKnowString = nil; - if ([self.formItem.answerFormat shouldShowDontKnowButton]) { - _shouldShowDontKnow = YES; - _customDontKnowString = self.formItem.answerFormat.customDontKnowButtonText; - [self setupDontKnowButton]; - self.accessibilityElements = @[_textFieldView, _dontKnowButton]; - } + _dontKnowButtonStyle = ORKDontKnowButtonStyleStandard; + + [_dontKnowBackgroundView removeFromSuperview]; + _dontKnowBackgroundView = nil; - [self setUpContentConstraint]; - [self setNeedsUpdateConstraints]; + [_dontKnowButton removeFromSuperview]; + _dontKnowButton = nil; + + [_dividerView removeFromSuperview]; + _dividerView = nil; + + self.accessibilityElements = nil; } - (void)willMoveToWindow:(UIWindow *)newWindow { @@ -508,7 +561,7 @@ - (void)willMoveToWindow:(UIWindow *)newWindow { [self setNeedsUpdateConstraints]; } -- (void)setupDontKnowButton { +- (void)setupDontKnowButtonWithAnswer:(id)answer { if(!_dontKnowBackgroundView) { _dontKnowBackgroundView = [UIView new]; _dontKnowBackgroundView.userInteractionEnabled = YES; @@ -520,8 +573,8 @@ - (void)setupDontKnowButton { if (!_dontKnowButton) { _dontKnowButton = [ORKDontKnowButton new]; - _dontKnowButton.customDontKnowButtonText = self.formItem.answerFormat.customDontKnowButtonText; - _dontKnowButton.dontKnowButtonStyle = self.formItem.answerFormat.dontKnowButtonStyle; + _dontKnowButton.customDontKnowButtonText = _customDontKnowString; + _dontKnowButton.dontKnowButtonStyle = _dontKnowButtonStyle; _dontKnowButton.translatesAutoresizingMaskIntoConstraints = NO; [_dontKnowButton addTarget:self action:@selector(dontKnowButtonWasPressed) forControlEvents:UIControlEventTouchUpInside]; } @@ -529,18 +582,14 @@ - (void)setupDontKnowButton { if (!_dividerView) { _dividerView = [UIView new]; _dividerView.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - [_dividerView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_dividerView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_dividerView setBackgroundColor:[UIColor separatorColor]]; } [self.containerView addSubview:_dontKnowBackgroundView]; [self.containerView addSubview:_dontKnowButton]; [self.containerView addSubview:_dividerView]; - if (self.answer == [ORKDontKnowAnswer answer]) { + if (answer == [ORKDontKnowAnswer answer]) { [self dontKnowButtonWasPressed]; } } @@ -552,7 +601,6 @@ - (void)dontKnowButtonWasPressed { if (![_textFieldView.textField isFirstResponder]) { [self inputValueDidChange]; - if (self.delegate) { [self.delegate formItemCellDidResignFirstResponder:self]; } @@ -587,7 +635,7 @@ - (void)setUpContentConstraint { - (void)updateConstraints { CGFloat labelWidth = self.maxLabelWidth; - + NSString *contentSize = [[UIApplication sharedApplication] preferredContentSizeCategory]; NSArray *largeSizes = @[ UIContentSizeCategoryExtraExtraLarge, @@ -680,11 +728,8 @@ - (void)updateConstraints { - (void)setEditingHighlight:(BOOL)editingHighlight { _editingHighlight = editingHighlight; UIColor *defaultColor; - if (@available(iOS 13.0, *)) { - defaultColor = [UIColor labelColor]; - } else { - defaultColor = [UIColor blackColor]; - } + defaultColor = [UIColor labelColor]; + self.labelLabel.textColor = _editingHighlight ? [self tintColor] : defaultColor; [self textField].textColor = _editingHighlight ? [self tintColor] : defaultColor; } @@ -740,7 +785,6 @@ - (BOOL)resignFirstResponder { } - (void)inputValueDidClear { - if ([_dontKnowButton active]) { [self ork_setAnswer:[ORKDontKnowAnswer answer]]; } else { @@ -801,7 +845,10 @@ - (BOOL)textFieldShouldEndEditing:(UITextField *)textField { [self updateConstraints]; [self cellNeedsToResize]; } - + + if (self.delegate && ![self.delegate formItemCellShouldDismissKeyboard:self]) { + NSLog(@"%@ textFieldShouldEndEditing called", self); + } if (self.delegate && wasDoneButtonPressed && ![self.delegate formItemCellShouldDismissKeyboard:self]) { self.editingHighlight = NO; [self inputValueDidChange]; @@ -844,13 +891,13 @@ - (BOOL)isAccessibilityElement { #pragma mark NSNotification Methods -- (void) orkDoneButtonPressed:(NSNotification *) notification { +- (void)orkDoneButtonPressed:(NSNotification *) notification { if ([[notification name] isEqualToString:ORKDoneButtonPressedKey]) { _doneButtonWasPressed = YES; } } -- (void) resetDoneButton:(NSNotification *) notification { +- (void)resetDoneButton:(NSNotification *) notification { if ([[notification name] isEqualToString:ORKResetDoneButtonKey]) { _doneButtonWasPressed = NO; } @@ -931,10 +978,10 @@ @implementation ORKFormItemTextFieldCell { NSString *_defaultTextAnswer; } -- (void)cellInit { - [super cellInit]; +- (void)configureWithFormItem:(ORKFormItem *)formItem answer:(id)answer maxLabelWidth:(CGFloat)maxLabelWidth delegate:(id)delegate { + self.textField.allowsSelection = YES; - ORKTextAnswerFormat *answerFormat = (ORKTextAnswerFormat *)[self.formItem impliedAnswerFormat]; + ORKTextAnswerFormat *answerFormat = (ORKTextAnswerFormat *)[formItem impliedAnswerFormat]; _defaultTextAnswer = answerFormat.defaultTextAnswer; self.textField.autocorrectionType = answerFormat.autocorrectionType; self.textField.autocapitalizationType = answerFormat.autocapitalizationType; @@ -942,12 +989,12 @@ - (void)cellInit { self.textField.keyboardType = answerFormat.keyboardType; self.textField.secureTextEntry = answerFormat.secureTextEntry; self.textField.textContentType = answerFormat.textContentType; - + if (@available(iOS 12.0, *)) { self.textField.passwordRules = answerFormat.passwordRules; } - [self answerDidChange]; + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; } - (void)inputValueDidChange { @@ -1009,7 +1056,7 @@ - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRang NSInteger maxLength = answerFormat.maximumLength; if (maxLength > 0 && text.length > maxLength) { - [self updateErrorLabelWithMessage:[[self.formItem impliedAnswerFormat] localizedInvalidValueStringWithAnswerString:@""]]; + [self updateErrorLabelWithMessage:[[self.formItem impliedAnswerFormat] localizedInvalidValueStringWithAnswerString:text]]; return NO; } } @@ -1030,28 +1077,33 @@ @implementation ORKFormItemNumericCell { NSNumber *_defaultNumericAnswer; } -- (void)cellInit { - [super cellInit]; - ORKQuestionType questionType = [self.formItem questionType]; +- (void)configureWithFormItem:(ORKFormItem *)formItem answer:(id)answer maxLabelWidth:(CGFloat)maxLabelWidth delegate:(id)delegate { + + ORKQuestionType questionType = [formItem questionType]; self.textField.keyboardType = (questionType == ORKQuestionTypeInteger) ? UIKeyboardTypeNumberPad : UIKeyboardTypeDecimalPad; [self.textField addTarget:self action:@selector(valueFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; self.textField.allowsSelection = YES; - ORKNumericAnswerFormat *answerFormat = (ORKNumericAnswerFormat *)[self.formItem impliedAnswerFormat]; + ORKNumericAnswerFormat *answerFormat = (ORKNumericAnswerFormat *)[formItem impliedAnswerFormat]; _defaultNumericAnswer = answerFormat.defaultNumericAnswer; self.textField.manageUnitAndPlaceholder = YES; self.textField.unit = answerFormat.displayUnit ?: answerFormat.unit; - self.textField.placeholder = self.formItem.placeholder; + self.textField.placeholder = formItem.placeholder; _numberFormatter = ORKDecimalNumberFormatter(); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(localeDidChange:) name:NSCurrentLocaleDidChangeNotification object:nil]; - [self answerDidChange]; + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; +} +- (void)prepareForReuse { + [super prepareForReuse]; + + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSCurrentLocaleDidChangeNotification object:nil]; } -- (void) assignDefaultAnswer { +- (void)assignDefaultAnswer { if (_defaultNumericAnswer) { [self ork_setAnswer:_defaultNumericAnswer]; if (self.textField) { @@ -1145,25 +1197,26 @@ @implementation ORKFormItemTextCell { BOOL _shouldShowDontKnow; } -- (void)cellInit { - [super cellInit]; - - _lastSeenLineCount = 1; - self.labelLabel.text = nil; +- (void)configureWithFormItem:(ORKFormItem *)formItem answer:(id)answer maxLabelWidth:(CGFloat)maxLabelWidth delegate:(id)delegate { + + self.labelLabel.text = nil; // reset value set during [super config] + _textView = [[ORKFormTextView alloc] init]; _textView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive; _textView.delegate = self; _textView.textAlignment = NSTextAlignmentNatural; _textView.scrollEnabled = YES; - _textView.placeholder = self.formItem.placeholder; - - if (@available(iOS 13.0, *)) { - _textView.textColor = [UIColor labelColor]; - _textView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; - } - + _textView.placeholder = formItem.placeholder; + + //moved from cellInit + _textView.textColor = [UIColor labelColor]; + _textView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; + + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; + + + // only test _maxLength after configureWithFormItem since that's where _maxLength is set ORKTextAnswerFormat *textAnswerFormat = [self textAnswerFormat]; - if ((_maxLength > 0 && !textAnswerFormat.hideCharacterCountLabel) || !textAnswerFormat.hideClearButton) { [self setupMaxLengthView]; } @@ -1172,14 +1225,42 @@ - (void)cellInit { if (_shouldShowDontKnow) { [self setupDontKnowButton]; } - - [self applyAnswerFormat]; - [self answerDidChange]; - + [self.containerView addSubview:_textView]; [self setUpConstraints]; } +- (void)prepareForReuse { + [super prepareForReuse]; + + _lastSeenLineCount = 1; + _shouldShowDontKnow = NO; + + [_textView removeFromSuperview]; + _textView = nil; + + [_textCountLabel removeFromSuperview]; + _textCountLabel = nil; + + [_maxLengthView removeFromSuperview]; + _maxLengthView = nil; + + [_dontKnowBackgroundView removeFromSuperview]; + _dontKnowBackgroundView = nil; + + [_dividerView removeFromSuperview]; + _dividerView = nil; + + [_textCountLabel removeFromSuperview]; + _textCountLabel = nil; + + [_clearTextViewButton removeFromSuperview]; + _clearTextViewButton = nil; + + [_dontKnowButton removeFromSuperview]; + _dontKnowButton = nil; +} + - (void)setUpConstraints { NSDictionary *views = @{ @"textView": _textView }; ORKEnableAutoLayoutForViews(views.allValues); @@ -1254,27 +1335,6 @@ - (void)setUpConstraints { bottomViewToConstrainTo = _dontKnowButton; } - //TextView vertical constraints - if (_maxLengthView || _shouldShowDontKnow) { - [[_textView.topAnchor constraintEqualToAnchor:self.containerView.topAnchor constant:TextViewVerticalMargin] setActive:YES]; - [[_textView.heightAnchor constraintGreaterThanOrEqualToConstant:TextViewMinHeight] setActive:YES]; - - NSLayoutConstraint *constraint2 = [NSLayoutConstraint constraintWithItem:self.containerView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:bottomViewToConstrainTo - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:DontKnowButtonTopBottomPadding]; - constraint2.priority = UILayoutPriorityRequired - 1; - constraint2.active = YES; - } else { - [constraints addObjectsFromArray: - [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-vMargin-[textView]-vMargin-|" - options:NSLayoutFormatDirectionLeadingToTrailing - metrics:metrics - views:views]]; - } //TextView vertical constraints if (_maxLengthView || _shouldShowDontKnow) { @@ -1319,11 +1379,7 @@ - (void)setupMaxLengthView { if (_maxLength > 0 && !textAnswerFormat.hideCharacterCountLabel) { _textCountLabel = [UILabel new]; - if (@available(iOS 13.0, *)) { - [_textCountLabel setTextColor:[UIColor labelColor]]; - } else { - [_textCountLabel setTextColor:[UIColor grayColor]]; - } + [_textCountLabel setTextColor:[UIColor labelColor]]; [self updateTextCountLabel]; @@ -1339,6 +1395,8 @@ - (void)setupMaxLengthView { [_clearTextViewButton addTarget:self action:@selector(clearTextView) forControlEvents:UIControlEventTouchUpInside]; _clearTextViewButton.translatesAutoresizingMaskIntoConstraints = NO; [_maxLengthView addSubview: _clearTextViewButton]; + + _clearTextViewButton.accessibilityIdentifier = ORKClearTextViewButtonAccessibilityIdentifier; } [self.containerView addSubview:_maxLengthView]; @@ -1365,11 +1423,7 @@ - (void)setupDontKnowButton { if (!_dividerView) { _dividerView = [UIView new]; _dividerView.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - [_dividerView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_dividerView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_dividerView setBackgroundColor:[UIColor separatorColor]]; } [self.containerView addSubview:_dontKnowBackgroundView]; @@ -1418,8 +1472,7 @@ - (void)dontKnowBackgroundViewPressed { } } -- (void)applyAnswerFormat { - ORKAnswerFormat *answerFormat = [self.formItem impliedAnswerFormat]; +- (void)applyAnswerFormat:(ORKAnswerFormat *)answerFormat { if ([answerFormat isKindOfClass:[ORKTextAnswerFormat class]]) { ORKTextAnswerFormat *textAnswerFormat = (ORKTextAnswerFormat *)answerFormat; _defaultTextAnswer = textAnswerFormat.defaultTextAnswer; @@ -1441,7 +1494,7 @@ - (void)applyAnswerFormat { - (void)setFormItem:(ORKFormItem *)formItem { [super setFormItem:formItem]; - [self applyAnswerFormat]; + [self applyAnswerFormat:formItem.impliedAnswerFormat]; } - (void)assignDefaultAnswer { @@ -1517,11 +1570,9 @@ - (void)textViewDidChange:(UITextView *)textView { UITableView *tableView = [self parentTableView]; - [tableView beginUpdates]; - [tableView endUpdates]; - CGRect visibleRect = [textView caretRectForPosition:textView.selectedTextRange.start]; CGRect convertedVisibleRect = [tableView convertRect:visibleRect fromView:_textView]; + [tableView scrollRectToVisible:convertedVisibleRect animated:YES]; } @@ -1531,12 +1582,7 @@ - (void)textViewDidChange:(UITextView *)textView { - (void)textViewDidBeginEditing:(UITextView *)textView { if (textView.textColor == [self placeholderColor]) { textView.text = nil; - - if (@available(iOS 13.0, *)) { - _textView.textColor = [UIColor labelColor]; - } else { - _textView.textColor = [UIColor blackColor]; - } + _textView.textColor = [UIColor labelColor]; } // Ask table view to adjust scrollview's position @@ -1591,13 +1637,12 @@ @implementation ORKFormItemImageSelectionCell { ORKImageSelectionView *_selectionView; } -- (void)cellInit { - // Subclasses should override this - - self.labelLabel.text = nil; +- (void)configureWithFormItem:(ORKFormItem *)formItem answer:(id)answer maxLabelWidth:(CGFloat)maxLabelWidth delegate:(id)delegate { + + self.labelLabel.text = nil; // reset value set in [super config] - _selectionView = [[ORKImageSelectionView alloc] initWithImageChoiceAnswerFormat:(ORKImageChoiceAnswerFormat *)self.formItem.answerFormat - answer:self.answer]; + _selectionView = [[ORKImageSelectionView alloc] initWithImageChoiceAnswerFormat:(ORKImageChoiceAnswerFormat *)formItem.answerFormat + answer:answer]; _selectionView.delegate = self; self.contentView.layoutMargins = UIEdgeInsetsMake(VerticalMargin, ORKSurveyItemMargin, VerticalMargin, ORKSurveyItemMargin); @@ -1605,7 +1650,14 @@ - (void)cellInit { [self.containerView addSubview:_selectionView]; [self setUpConstraints]; - [super cellInit]; + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; +} + +- (void)prepareForReuse { + [super prepareForReuse]; + + [_selectionView removeFromSuperview]; + _selectionView = nil; } - (void)setUpConstraints { @@ -1663,17 +1715,6 @@ @implementation ORKFormItemScaleCell { return _formatProvider; } -- (void)cellInit { - self.labelLabel.text = nil; - - _sliderView = [[ORKScaleSliderView alloc] initWithFormatProvider:(ORKScaleAnswerFormat *)self.formItem.answerFormat delegate:self]; - - [self.containerView addSubview:_sliderView]; - [self setUpConstraints]; - - [super cellInit]; -} - - (void)setUpConstraints { NSMutableArray *constraints = [NSMutableArray new]; @@ -1693,6 +1734,26 @@ - (void)setUpConstraints { [NSLayoutConstraint activateConstraints:constraints]; } +- (void)configureWithFormItem:(ORKFormItem *)formItem answer:(id)answer maxLabelWidth:(CGFloat)maxLabelWidth delegate:(id)delegate { + + self.labelLabel.text = nil; + _sliderView = [[ORKScaleSliderView alloc] initWithFormatProvider:(ORKScaleAnswerFormat *)formItem.answerFormat + delegate:self]; + [self.containerView addSubview:_sliderView]; + [self setUpConstraints]; + + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; +} + +- (void)prepareForReuse { + [super prepareForReuse]; + + _formatProvider = nil; + + [_sliderView removeFromSuperview]; + _sliderView = nil; +} + #pragma mark recover answer - (void)answerDidChange { @@ -1720,7 +1781,6 @@ - (void)scaleSliderViewCurrentValueDidChange:(ORKScaleSliderView *)sliderView { @end - #pragma mark - ORKFormItemPickerCell @interface ORKFormItemPickerCell () @@ -1732,6 +1792,22 @@ @implementation ORKFormItemPickerCell { id _picker; } +- (void)configureWithFormItem:(ORKFormItem *)formItem + answer:(id)answer + maxLabelWidth:(CGFloat)maxLabelWidth + delegate:(id)delegate { + + ORKAnswerFormat *answerFormat = [formItem impliedAnswerFormat]; + _picker = [ORKPicker pickerWithAnswerFormat:answerFormat answer:answer delegate:self]; + + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; +} + +- (void)prepareForReuse { + [super prepareForReuse]; + + _picker = nil; +} - (void)setFormItem:(ORKFormItem *)formItem { ORKAnswerFormat *answerFormat = formItem.impliedAnswerFormat; @@ -1742,30 +1818,34 @@ - (void)setFormItem:(ORKFormItem *)formItem { [answerFormat isKindOfClass:[ORKTimeIntervalAnswerFormat class]] || [answerFormat isKindOfClass:[ORKValuePickerAnswerFormat class]] || [answerFormat isKindOfClass:[ORKMultipleValuePickerAnswerFormat class]] || + [answerFormat isKindOfClass:[ORKAgeAnswerFormat class]] || [answerFormat isKindOfClass:[ORKHeightAnswerFormat class]] || [answerFormat isKindOfClass:[ORKWeightAnswerFormat class]])) { - @throw [NSException exceptionWithName:NSGenericException reason:@"formItem.answerFormat should be an ORKDateAnswerFormat, ORKTimeOfDayAnswerFormat, ORKTimeIntervalAnswerFormat, ORKValuePicker, ORKMultipleValuePickerAnswerFormat, ORKHeightAnswerFormat, or ORKWeightAnswerFormat instance" userInfo:nil]; + [self throwPickerTypeException]; } + [super setFormItem:formItem]; } +- (void)throwPickerTypeException { + @throw [NSException exceptionWithName:NSGenericException reason:@"formItem.answerFormat should be an ORKDateAnswerFormat, ORKTimeOfDayAnswerFormat, ORKTimeIntervalAnswerFormat, ORKValuePicker, ORKMultipleValuePickerAnswerFormat, ORKHeightAnswerFormat, or ORKWeightAnswerFormat instance" userInfo:nil]; +} + - (void)setDefaultAnswer:(id)defaultAnswer { ORK_Log_Debug("%@", defaultAnswer); [super setDefaultAnswer:defaultAnswer]; } - (void)answerDidChange { - + [self updateControls]; +} + +- (void)updateControls { self.picker.answer = (self.answer == [ORKDontKnowAnswer answer]) ? nil : self.answer; self.textField.text = self.picker.selectedLabelText; } - (id)picker { - if (_picker == nil) { - ORKAnswerFormat *answerFormat = [self.formItem impliedAnswerFormat]; - _picker = [ORKPicker pickerWithAnswerFormat:answerFormat answer:self.answer delegate:self]; - } - return _picker; } @@ -1847,7 +1927,7 @@ - (void)dontKnowButtonWasPressed @end #pragma mark - ORKFormItemLocationCell - +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @interface ORKFormItemLocationCell () @property (nonatomic, assign) BOOL editingHighlight; @@ -1861,21 +1941,34 @@ @implementation ORKFormItemLocationCell { NSLayoutConstraint *_bottomConstraint; } -- (void)cellInit { - [super cellInit]; - +- (void)configureWithFormItem:(ORKFormItem *)formItem + answer:(id)answer + maxLabelWidth:(CGFloat)maxLabelWidth + delegate:(id)delegate { + _selectionView = [[ORKLocationSelectionView alloc] initWithFormMode:YES - useCurrentLocation:((ORKLocationAnswerFormat *)self.formItem.answerFormat).useCurrentLocation + useCurrentLocation:((ORKLocationAnswerFormat *)formItem.answerFormat).useCurrentLocation leadingMargin:self.separatorInset.left]; _selectionView.delegate = self; [self.containerView addSubview:_selectionView]; - if (self.formItem.placeholder != nil) { - [_selectionView setPlaceholderText:self.formItem.placeholder]; + if (formItem.placeholder != nil) { + [_selectionView setPlaceholderText:formItem.placeholder]; } [self setUpConstraints]; + + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; + + [_selectionView showMapViewIfNecessary]; +} + +- (void)prepareForReuse { + [super prepareForReuse]; + + [_selectionView removeFromSuperview]; + _selectionView = nil; } - (void)setUpConstraints { @@ -1913,11 +2006,7 @@ - (void)setEditingHighlight:(BOOL)editingHighlight { if (_editingHighlight) { [_selectionView setTextColor:[self tintColor]]; } else { - if (@available(iOS 13.0, *)) { - [_selectionView setTextColor:[UIColor labelColor]]; - } else { - [_selectionView setTextColor:[UIColor blackColor]]; - } + [_selectionView setTextColor:[UIColor labelColor]]; } } @@ -1963,7 +2052,7 @@ - (BOOL)resignFirstResponder { } @end - +#endif @interface ORKFormItemSESCell() @@ -1975,14 +2064,22 @@ @implementation ORKFormItemSESCell { NSLayoutConstraint *_bottomConstraint; } -- (void)cellInit { - [super cellInit]; - - _selectionView = [[ORKSESSelectionView alloc] initWithAnswerFormat:(ORKSESAnswerFormat *)self.formItem.answerFormat answer:self.answer]; +- (void)configureWithFormItem:(ORKFormItem *)formItem answer:(id)answer maxLabelWidth:(CGFloat)maxLabelWidth delegate:(id)delegate { + + _selectionView = [[ORKSESSelectionView alloc] initWithAnswerFormat:(ORKSESAnswerFormat *)formItem.answerFormat answer:answer]; _selectionView.delegate = self; [self.containerView addSubview:_selectionView]; [self setUpConstraints]; + + [super configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:delegate]; +} + +- (void)prepareForReuse { + [super prepareForReuse]; + + [_selectionView removeFromSuperview]; + _selectionView = nil; } - (void)setUpConstraints { diff --git a/ResearchKit/Common/ORKFormSectionTitleLabel.h b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormSectionTitleLabel.h similarity index 98% rename from ResearchKit/Common/ORKFormSectionTitleLabel.h rename to ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormSectionTitleLabel.h index 3fd5fd5bcf..4f851f535d 100644 --- a/ResearchKit/Common/ORKFormSectionTitleLabel.h +++ b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormSectionTitleLabel.h @@ -28,8 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#import "ORKLabel.h" +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKFormSectionTitleLabel.m b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormSectionTitleLabel.m similarity index 100% rename from ResearchKit/Common/ORKFormSectionTitleLabel.m rename to ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormSectionTitleLabel.m diff --git a/ResearchKit/Common/ORKFormTextView.h b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormTextView.h similarity index 100% rename from ResearchKit/Common/ORKFormTextView.h rename to ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormTextView.h diff --git a/ResearchKit/Common/ORKFormTextView.m b/ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormTextView.m similarity index 100% rename from ResearchKit/Common/ORKFormTextView.m rename to ResearchKitUI/Common/Answer Format/Form Step Views/ORKFormTextView.m diff --git a/ResearchKit/Common/ORKSurveyCardHeaderView.h b/ResearchKitUI/Common/Answer Format/ORKSurveyCardHeaderView.h similarity index 76% rename from ResearchKit/Common/ORKSurveyCardHeaderView.h rename to ResearchKitUI/Common/Answer Format/ORKSurveyCardHeaderView.h index 6f586d4919..ce11019bc9 100644 --- a/ResearchKit/Common/ORKSurveyCardHeaderView.h +++ b/ResearchKitUI/Common/Answer Format/ORKSurveyCardHeaderView.h @@ -28,12 +28,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN @class ORKLearnMoreView; -@interface ORKSurveyCardHeaderView: UIView +@interface ORKSurveyCardHeaderView: UITableViewHeaderFooterView - (instancetype)initWithTitle:(NSString *)title; @@ -49,7 +49,22 @@ NS_ASSUME_NONNULL_BEGIN progressText:(nullable NSString *)progressText tagText:(nullable NSString *)tagText showBorder:(BOOL)showBorder - hasMultipleChoiceItem:(BOOL)hasMultipleChoiceItem; + hasMultipleChoiceItem:(BOOL)hasMultipleChoiceItem + shouldIgnoreDarkMode:(BOOL)shouldIgnoreDarkMode; + +- (void)configureWithTitle:(NSString *)title + detailText:(nullable NSString *)text + learnMoreView:(nullable ORKLearnMoreView *)learnMoreView + progressText:(nullable NSString *)progressText + tagText:(nullable NSString *)tagText + showBorder:(BOOL)showBorder + hasMultipleChoiceItem:(BOOL)hasMultipleChoiceItem + shouldIgnoreDarkMode:(BOOL)shouldIgnoreDarkMode; + +- (void)setProgressText:(nullable NSString *)text; + ++ (UIFont *)detailTextLabelFont; ++ (UIFont *)titleLabelFont; @end diff --git a/ResearchKitUI/Common/Answer Format/ORKSurveyCardHeaderView.m b/ResearchKitUI/Common/Answer Format/ORKSurveyCardHeaderView.m new file mode 100644 index 0000000000..990043de31 --- /dev/null +++ b/ResearchKitUI/Common/Answer Format/ORKSurveyCardHeaderView.m @@ -0,0 +1,515 @@ +/* + Copyright (c) 2018, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKSurveyCardHeaderView.h" +#import "ORKSkin.h" +#import "ORKLearnMoreView.h" +#import "ORKTagLabel.h" +#import "ORKHelpers_Internal.h" + +static const CGFloat HeaderViewLabelTopBottomPadding = 6.0; +static const CGFloat HeaderViewLabelTopPadding = 4.0; +static const CGFloat TagBottomPadding = 4.0; +static const CGFloat TagTopPadding = 8.0; +static const CGFloat HeaderViewBottomPadding = 24.0; +static const CGFloat SelectAllThatApplyTopPadding = 24.0; +static const CGFloat SelectAllThatApplyBottomPadding = 6.0; + +NSString * const ORKSurveyCardHeaderViewTitleLabelAccessibilityIdentifier = @"ORKSurveyCardHeaderView_titleLabel"; +NSString * const ORKSurveyCardHeaderViewProgressLabelAccessibilityIdentifier = @"ORKSurveyCardHeaderView_progressLabel"; +NSString * const ORKSurveyCardHeaderViewDetailTextLabelAccessibilityIdentifier = @"ORKSurveyCardHeaderView_detailTextLabel"; +NSString * const ORKSurveyCardHeaderViewSelectAllThatApplyLabelAccessibilityIdentifier = @"ORKSurveyCardHeaderView_selectAllThatApplyLabel"; + +@implementation ORKSurveyCardHeaderView { + + UIView *_headlineView; + NSString *_title; + UILabel *_titleLabel; + NSString *_detailText; + UILabel *_detailTextLabel; + ORKLearnMoreView *_learnMoreView; + NSString *_progressText; + UILabel *_progressLabel; + UILabel *_tagLabel; + UILabel *_selectAllThatApplyLabel; + BOOL _showBorder; + BOOL _hasMultipleChoiceItem; + BOOL _shouldIgnoreDarkMode; + NSString *_tagText; + CAShapeLayer *_headlineMaskLayer; + NSMutableArray *_headerViewConstraints; + NSArray *_learnMoreViewConstraints; +} + +- (instancetype)initWithTitle:(NSString *)title { + + self = [super init]; + if (self) { + _title = title; + [self setupView]; + } + return self; +} + +- (instancetype)initWithTitle:(NSString *)title + detailText:(nullable NSString *)text + learnMoreView:(nullable ORKLearnMoreView *)learnMoreView + progressText:(nullable NSString *)progressText + tagText:(nullable NSString *)tagText { + + return [self initWithTitle:title + detailText:text + learnMoreView:learnMoreView + progressText:progressText + tagText:tagText + showBorder:NO + hasMultipleChoiceItem:NO + shouldIgnoreDarkMode:NO]; +} + +- (instancetype)initWithTitle:(NSString *)title + detailText:(NSString *)text + learnMoreView:(ORKLearnMoreView *)learnMoreView + progressText:(NSString *)progressText + tagText:(nullable NSString *)tagText + showBorder:(BOOL)showBorder + hasMultipleChoiceItem:(BOOL)hasMultipleChoiceItem + shouldIgnoreDarkMode:(BOOL)shouldIgnoreDarkMode { + + self = [super init]; + if (self) { + [self configureWithTitle:title + detailText:text + learnMoreView:learnMoreView + progressText:progressText + tagText:tagText + showBorder:showBorder + hasMultipleChoiceItem:hasMultipleChoiceItem + shouldIgnoreDarkMode:shouldIgnoreDarkMode]; + } + return self; +} + +- (void)configureWithTitle:(NSString *)title + detailText:(NSString *)text + learnMoreView:(ORKLearnMoreView *)learnMoreView + progressText:(NSString *)progressText + tagText:(NSString *)tagText + showBorder:(BOOL)showBorder + hasMultipleChoiceItem:(BOOL)hasMultipleChoiceItem + shouldIgnoreDarkMode:(BOOL)shouldIgnoreDarkMode { + _title = [title copy]; + _detailText = [text copy]; + _learnMoreView = learnMoreView; + _progressText = [progressText copy]; + _showBorder = showBorder; + _tagText = [tagText copy]; + _hasMultipleChoiceItem = hasMultipleChoiceItem; + _shouldIgnoreDarkMode = shouldIgnoreDarkMode; + [self setupView]; +} + +- (void)setupView { + if (@available(iOS 14.0, *)) { + [self setBackgroundConfiguration:[UIBackgroundConfiguration clearConfiguration]]; + } else { + [self setBackgroundColor:[UIColor clearColor]]; + } + [self setupHeaderView]; + [self setupConstraints]; +} + +- (void)setupHeaderView { + [self setupHeadlineView]; + [self addSubview:_headlineView]; + + if (_tagText) { + [self setupTagLabel]; + [_headlineView addSubview:_tagLabel]; + } + + if (_progressText) { + [self setUpProgressLabel]; + [_headlineView addSubview:_progressLabel]; + } + + [self setupTitleLabel]; + [_headlineView addSubview:_titleLabel]; + + if (_detailText) { + [self setUpDetailTextLabel]; + [_headlineView addSubview:_detailTextLabel]; + } + + if (_learnMoreView) { + [_headlineView addSubview:_learnMoreView]; + } + + if (_hasMultipleChoiceItem) { + [self setupSelectAllThatApplyLabel]; + [_headlineView addSubview:_selectAllThatApplyLabel]; + } + + if (_shouldIgnoreDarkMode) { + self.overrideUserInterfaceStyle = UIUserInterfaceStyleLight; + } +} + +- (void)setupHeadlineView { + if (!_headlineView) { + _headlineView = [UIView new]; + } +} + +- (void)setupTitleLabel { + if (!_titleLabel) { + _titleLabel = [UILabel new]; + } + _titleLabel.text = _title; + _titleLabel.numberOfLines = 0; + _titleLabel.textColor = _shouldIgnoreDarkMode ? [UIColor blackColor] : [UIColor labelColor]; + _titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + _titleLabel.textAlignment = NSTextAlignmentNatural; + [_titleLabel setFont:[ORKSurveyCardHeaderView titleLabelFont]]; +} + +- (void)setUpDetailTextLabel { + if (!_detailTextLabel) { + _detailTextLabel = [UILabel new]; + } + _detailTextLabel.text = _detailText; + _detailTextLabel.numberOfLines = 0; + _detailTextLabel.lineBreakMode = NSLineBreakByWordWrapping; + _detailTextLabel.textAlignment = NSTextAlignmentNatural; + _detailTextLabel.accessibilityIdentifier = ORKSurveyCardHeaderViewDetailTextLabelAccessibilityIdentifier; + [_detailTextLabel setFont:[ORKSurveyCardHeaderView detailTextLabelFont]]; +} + +- (void)setUpProgressLabel { + if (!_progressLabel) { + _progressLabel = [UILabel new]; + } + _progressLabel.text = _progressText; + _progressLabel.numberOfLines = 0; + _progressLabel.textColor = _shouldIgnoreDarkMode ? [UIColor lightGrayColor] : [UIColor secondaryLabelColor]; + _progressLabel.textAlignment = NSTextAlignmentNatural; + [_progressLabel setFont:[self progressLabelFont]]; +} + +- (void)setProgressText:(nullable NSString *)text { + if (_progressText != text) { + _progressText = [text copy]; + + if (_progressText != nil) { + if (_progressLabel == nil) { + [self setUpProgressLabel]; + [_headlineView addSubview:_progressLabel]; + [self setupConstraints]; + } else { + _progressLabel.text = _progressText; + } + } else { + if (_progressLabel != nil) { + [_progressLabel removeFromSuperview]; + _progressLabel = nil; + [self setupConstraints]; + } else { + // intentionally left empty + // new text is nil, but _progressLabel is already nil + // nothing to do + } + } + } +} + +- (void)prepareForReuse { + [_headlineView removeFromSuperview]; + _headlineView = nil; + + [_titleLabel removeFromSuperview]; + _titleLabel = nil; + _title = nil; + + [_detailTextLabel removeFromSuperview]; + _detailTextLabel = nil; + _detailText = nil; + + [_learnMoreView removeFromSuperview]; + _learnMoreView = nil; + + [_progressLabel removeFromSuperview]; + _progressLabel = nil; + _progressText = nil; + + [_tagLabel removeFromSuperview]; + _tagLabel = nil; + _tagText = nil; + + [_selectAllThatApplyLabel removeFromSuperview]; + _selectAllThatApplyLabel = nil; + + _showBorder = NO; + _hasMultipleChoiceItem = NO; + _shouldIgnoreDarkMode = NO; + + [super prepareForReuse]; +} + +- (void)setupTagLabel { + if (!_tagLabel) { + _tagLabel = [ORKTagLabel new]; + } + _tagLabel.text = _tagText; +} + +- (void)setupSelectAllThatApplyLabel { + if (!_selectAllThatApplyLabel) { + _selectAllThatApplyLabel = [UILabel new]; + } + + _selectAllThatApplyLabel.text = ORKLocalizedString(@"AX_SELECT_ALL_THAT_APPLY", nil); + _selectAllThatApplyLabel.accessibilityIdentifier = ORKSurveyCardHeaderViewSelectAllThatApplyLabelAccessibilityIdentifier; + _selectAllThatApplyLabel.numberOfLines = 0; + _selectAllThatApplyLabel.textColor = _shouldIgnoreDarkMode ? [UIColor lightGrayColor] : [UIColor secondaryLabelColor]; + _selectAllThatApplyLabel.textAlignment = NSTextAlignmentNatural; + [_selectAllThatApplyLabel setFont:[self selectAllThatApplyFont]]; +} + ++ (UIFont *)titleLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + ++ (UIFont *)detailTextLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; + return [UIFont fontWithDescriptor:descriptor size:[[descriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + +- (UIFont *)progressLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleFootnote]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + +- (UIFont *)selectAllThatApplyFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleFootnote]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + + if (_headlineView) { + if (!_headlineMaskLayer) { + _headlineMaskLayer = [CAShapeLayer layer]; + } + for (CALayer *sublayer in [_headlineMaskLayer.sublayers mutableCopy]) { + [sublayer removeFromSuperlayer]; + } + [_headlineMaskLayer removeFromSuperlayer]; + + _headlineMaskLayer.path = [UIBezierPath bezierPathWithRoundedRect: _headlineView.bounds byRoundingCorners: UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii: (CGSize){ORKCardDefaultCornerRadii, ORKCardDefaultCornerRadii}].CGPath; + + CAShapeLayer *foreLayer = [CAShapeLayer layer]; + UIColor *fillColor = _shouldIgnoreDarkMode ? [UIColor whiteColor] : [UIColor secondarySystemGroupedBackgroundColor]; + UIColor *borderColor = _shouldIgnoreDarkMode ? [UIColor ork_midGrayTintColor] : UIColor.separatorColor;; + + [foreLayer setFillColor:[fillColor CGColor]]; + CGRect foreLayerBounds = CGRectMake(ORKCardDefaultBorderWidth, ORKCardDefaultBorderWidth, _headlineView.bounds.size.width - 2 * ORKCardDefaultBorderWidth, _headlineView.bounds.size.height - ORKCardDefaultBorderWidth); + + CGFloat foreLayerCornerRadii = ORKCardDefaultCornerRadii >= ORKCardDefaultBorderWidth ? ORKCardDefaultCornerRadii - ORKCardDefaultBorderWidth : ORKCardDefaultCornerRadii; + + foreLayer.path = [UIBezierPath bezierPathWithRoundedRect: foreLayerBounds byRoundingCorners: UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii: (CGSize){foreLayerCornerRadii, foreLayerCornerRadii}].CGPath; + foreLayer.zPosition = 0.0f; + + [_headlineMaskLayer addSublayer:foreLayer]; + + if (_titleLabel.text) { + CAShapeLayer *lineLayer = [CAShapeLayer layer]; + CGRect lineBounds = CGRectMake(0.0, _headlineView.bounds.size.height - 1.0, _headlineView.bounds.size.width, 0.5); + lineLayer.path = [UIBezierPath bezierPathWithRect:lineBounds].CGPath; + lineLayer.zPosition = 0.0f; + [lineLayer setFillColor:[borderColor CGColor]]; + + [_headlineMaskLayer addSublayer:lineLayer]; + } + + if (_showBorder) { + [_headlineMaskLayer setFillColor:[borderColor CGColor]]; + } else { + [_headlineMaskLayer setFillColor:[[UIColor clearColor] CGColor]]; + } + + [_headlineView.layer insertSublayer:_headlineMaskLayer atIndex:0]; + } + +} + +- (BOOL)useLearnMoreLeftAlignmentLayout { + return ((_learnMoreView != nil) && ([_learnMoreView isTextLink] == NO)); +} + +- (void)setupConstraints { + if (_headerViewConstraints) { + [NSLayoutConstraint deactivateConstraints:_headerViewConstraints]; + } + + _headerViewConstraints = [NSMutableArray new]; + + NSLayoutXAxisAnchor *trailingAnchor = [self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor; + NSLayoutYAxisAnchor *lastYAxisAnchor = self.topAnchor; + + _headlineView.translatesAutoresizingMaskIntoConstraints = NO; + + if (_progressLabel) { + _progressLabel.translatesAutoresizingMaskIntoConstraints = NO; + + [_headerViewConstraints addObject:[_progressLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:ORKSurveyItemMargin]]; + [_headerViewConstraints addObject:[_progressLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor]]; + [_headerViewConstraints addObject:[_progressLabel.trailingAnchor constraintEqualToAnchor:trailingAnchor constant:-ORKSurveyItemMargin]]; + + lastYAxisAnchor = _progressLabel.bottomAnchor; + } + + if (_tagLabel) { + CGFloat topPadding = _progressLabel ? TagTopPadding : ORKSurveyItemMargin; + _tagLabel.translatesAutoresizingMaskIntoConstraints = NO; + + [_headerViewConstraints addObject:[_tagLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:topPadding]]; + [_headerViewConstraints addObject:[_tagLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor]]; + + [_headerViewConstraints addObject:[_tagLabel.trailingAnchor constraintLessThanOrEqualToAnchor:_headlineView.trailingAnchor constant:-ORKSurveyItemMargin]]; + lastYAxisAnchor = _tagLabel.bottomAnchor; + } + + CGFloat titlePadding; + if (_tagLabel) { + titlePadding = TagBottomPadding; + } else if (_progressLabel) { + titlePadding = HeaderViewLabelTopPadding; + } else { + titlePadding = ORKSurveyItemMargin; + } + _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + + [_headerViewConstraints addObject:[_titleLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:titlePadding]]; + [_headerViewConstraints addObject:[_titleLabel.leadingAnchor constraintEqualToAnchor:_headlineView.leadingAnchor constant:ORKSurveyItemMargin]]; + [_headerViewConstraints addObject:[_titleLabel.trailingAnchor constraintEqualToAnchor:[self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor constant:-ORKSurveyItemMargin]]; + + lastYAxisAnchor = _titleLabel.bottomAnchor; + NSLayoutYAxisAnchor *headlineViewBottomAnchor = _titleLabel.bottomAnchor; + + if (_detailTextLabel) { + _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; + + [_headerViewConstraints addObject:[_detailTextLabel.topAnchor constraintEqualToAnchor:_titleLabel.bottomAnchor constant:HeaderViewLabelTopBottomPadding]]; + [_headerViewConstraints addObject:[_detailTextLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor]]; + [_headerViewConstraints addObject:[_detailTextLabel.trailingAnchor constraintEqualToAnchor:[self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor constant:-ORKSurveyItemMargin]]; + + lastYAxisAnchor = _detailTextLabel.bottomAnchor; + headlineViewBottomAnchor = _detailTextLabel.bottomAnchor; + } + + if (_learnMoreView) { + [self setupLearnMoreViewConstraints]; + if ([_learnMoreView isTextLink] == YES) { + [_learnMoreView setLearnMoreButtonFont:[UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]]; + [_learnMoreView setLearnMoreButtonTextAlignment:NSTextAlignmentLeft]; + + [_headerViewConstraints addObject:[_learnMoreView.topAnchor constraintEqualToAnchor:_detailTextLabel ? _detailTextLabel.bottomAnchor : _titleLabel.bottomAnchor constant:HeaderViewLabelTopBottomPadding]]; + [_headerViewConstraints addObject:[_learnMoreView.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor]]; + [_headerViewConstraints addObject:[_learnMoreView.trailingAnchor constraintEqualToAnchor:[self useLearnMoreLeftAlignmentLayout] ? _learnMoreView.leadingAnchor : _headlineView.trailingAnchor constant:-ORKSurveyItemMargin]]; + + lastYAxisAnchor = _learnMoreView.bottomAnchor; + headlineViewBottomAnchor = _learnMoreView.bottomAnchor; + } + } + + if (_selectAllThatApplyLabel) { + _selectAllThatApplyLabel.translatesAutoresizingMaskIntoConstraints = NO; + + [_headerViewConstraints addObject:[_selectAllThatApplyLabel.topAnchor constraintEqualToAnchor:lastYAxisAnchor constant:SelectAllThatApplyTopPadding]]; + [_headerViewConstraints addObject:[_selectAllThatApplyLabel.leadingAnchor constraintEqualToAnchor:_titleLabel.leadingAnchor]]; + [_headerViewConstraints addObject:[_selectAllThatApplyLabel.trailingAnchor constraintEqualToAnchor:_titleLabel.trailingAnchor]]; + + headlineViewBottomAnchor = _selectAllThatApplyLabel.bottomAnchor; + } + + [_headerViewConstraints addObject:[_headlineView.topAnchor constraintEqualToAnchor:self.topAnchor constant:0.0]]; + [_headerViewConstraints addObject:[_headlineView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:ORKCardLeftRightMarginForWindow(self.window)]]; + [_headerViewConstraints addObject:[_headlineView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-ORKCardLeftRightMarginForWindow(self.window)]]; + [_headerViewConstraints addObject:[_headlineView.bottomAnchor constraintEqualToAnchor: headlineViewBottomAnchor constant: _selectAllThatApplyLabel ? SelectAllThatApplyBottomPadding : HeaderViewBottomPadding]]; + + + [_headerViewConstraints addObject:[self.bottomAnchor constraintEqualToAnchor:_headlineView.bottomAnchor constant:0.0]]; + + + [NSLayoutConstraint activateConstraints:_headerViewConstraints]; +} + +- (void)setupLearnMoreViewConstraints { + if (_learnMoreViewConstraints) { + [NSLayoutConstraint deactivateConstraints:_learnMoreViewConstraints]; + } + _learnMoreView.translatesAutoresizingMaskIntoConstraints = NO; + + if ([_learnMoreView isTextLink] == NO) { + _learnMoreViewConstraints = @[ + [NSLayoutConstraint constraintWithItem:_learnMoreView + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem: _titleLabel ? : _headlineView + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:_titleLabel ? 0.0 : ORKSurveyItemMargin], + [NSLayoutConstraint constraintWithItem:_learnMoreView + attribute:NSLayoutAttributeTrailing + relatedBy:NSLayoutRelationEqual + toItem: _headlineView + attribute:NSLayoutAttributeTrailing + multiplier:1.0 + constant:-ORKSurveyItemMargin], + [NSLayoutConstraint constraintWithItem:_learnMoreView + attribute:NSLayoutAttributeWidth + relatedBy:NSLayoutRelationEqual + toItem: _learnMoreView + attribute:NSLayoutAttributeHeight + multiplier:1.0 + constant: 0.0] + ]; + } + + [NSLayoutConstraint activateConstraints:_learnMoreViewConstraints]; +} + + +@end diff --git a/ResearchKit/Common/ORKSurveyAnswerCell.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCell.h similarity index 98% rename from ResearchKit/Common/ORKSurveyAnswerCell.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCell.h index adae97aaca..0d41b8bcfb 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCell.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCell.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKTableViewCell.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSurveyAnswerCell.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCell.m similarity index 98% rename from ResearchKit/Common/ORKSurveyAnswerCell.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCell.m index 29e80f5f03..22f4ff5d05 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCell.m +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCell.m @@ -188,7 +188,7 @@ - (void)keyboardWillHide:(NSNotification *)aNotification { } if (UIEdgeInsetsEqualToEdgeInsets(tableView.verticalScrollIndicatorInsets, _cachedScrollIndicatorInsets) == NO) { - tableView.scrollIndicatorInsets = _cachedScrollIndicatorInsets; + tableView.verticalScrollIndicatorInsets = _cachedScrollIndicatorInsets; } } completion:^(BOOL finished) { diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForImageSelection.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForImageSelection.h similarity index 96% rename from ResearchKit/Common/ORKSurveyAnswerCellForImageSelection.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForImageSelection.h index 2c30558311..aec547c921 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForImageSelection.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForImageSelection.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKSurveyAnswerCell.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForImageSelection.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForImageSelection.m similarity index 97% rename from ResearchKit/Common/ORKSurveyAnswerCellForImageSelection.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForImageSelection.m index 0eaf8bf73d..5f31b70a98 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForImageSelection.m +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForImageSelection.m @@ -35,7 +35,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKAnswerFormat_Internal.h" #import "ORKQuestionStep.h" -#import "ORKQuestionStep_Internal.h" #import "ORKHelpers_Internal.h" #import "ORKSkin.h" @@ -53,7 +52,7 @@ @implementation ORKSurveyAnswerCellForImageSelection { - (void)prepareView { [super prepareView]; - _selectionView = [[ORKImageSelectionView alloc] initWithImageChoiceAnswerFormat:(ORKImageChoiceAnswerFormat *)self.step.impliedAnswerFormat answer:self.answer]; + _selectionView = [[ORKImageSelectionView alloc] initWithImageChoiceAnswerFormat:(ORKImageChoiceAnswerFormat *)self.step.answerFormat answer:self.answer]; _selectionView.delegate = self; _selectionView.frame = self.bounds; diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForLocation.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForLocation.h similarity index 93% rename from ResearchKit/Common/ORKSurveyAnswerCellForLocation.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForLocation.h index d0b2feaf10..02864bf21a 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForLocation.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForLocation.h @@ -31,14 +31,16 @@ */ -@import UIKit; -#import "ORKSurveyAnswerCell.h" +#import +#import NS_ASSUME_NONNULL_BEGIN +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @interface ORKSurveyAnswerCellForLocation : ORKSurveyAnswerCell @end +#endif NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForLocation.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForLocation.m similarity index 97% rename from ResearchKit/Common/ORKSurveyAnswerCellForLocation.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForLocation.m index fca70f2a15..1e5dbc26b6 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForLocation.m +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForLocation.m @@ -29,6 +29,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION #import "ORKSurveyAnswerCellForLocation.h" @@ -67,7 +68,7 @@ + (CGFloat)suggestedCellHeightForView:(UIView *)view { - (void)prepareView { _selectionView = [[ORKLocationSelectionView alloc] initWithFormMode:NO - useCurrentLocation:((ORKLocationAnswerFormat *)self.step.impliedAnswerFormat).useCurrentLocation + useCurrentLocation:((ORKLocationAnswerFormat *)self.step.answerFormat).useCurrentLocation leadingMargin:self.separatorInset.left]; _selectionView.delegate = self; _selectionView.tintColor = self.tintColor; @@ -123,3 +124,4 @@ - (void)locationSelectionView:(ORKLocationSelectionView *)view didFailWithErrorT } @end +#endif diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForNumber.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForNumber.h similarity index 96% rename from ResearchKit/Common/ORKSurveyAnswerCellForNumber.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForNumber.h index d03fba94b9..8a7f7e5ffa 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForNumber.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForNumber.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKSurveyAnswerCell.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForNumber.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForNumber.m similarity index 87% rename from ResearchKit/Common/ORKSurveyAnswerCellForNumber.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForNumber.m index bb0bd2c9e6..1324c58824 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForNumber.m +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForNumber.m @@ -76,10 +76,14 @@ - (void)numberCell_initialize { _dontKnowButtonActive = NO; - ORKNumericAnswerFormat *numericAnswerFormat = (ORKNumericAnswerFormat *)self.step.answerFormat; - + ORKAnswerFormat *answerFormat = self.step.answerFormat; + { + ORKNumericAnswerFormat *numericAnswerFormat = ORKDynamicCast(answerFormat, ORKNumericAnswerFormat); + _textFieldView.hideUnitWhenAnswerEmpty = numericAnswerFormat ? numericAnswerFormat.hideUnitWhenAnswerIsEmpty : NO; + } + _textFieldView = [[ORKTextFieldView alloc] init]; - _textFieldView.hideUnitWhenAnswerEmpty = numericAnswerFormat.hideUnitWhenAnswerIsEmpty; + ORKUnitTextField *textField = _textFieldView.textField; textField.delegate = self; @@ -101,10 +105,10 @@ - (void)numberCell_initialize { _errorLabel.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:_errorLabel]; - if (numericAnswerFormat.shouldShowDontKnowButton) { + if (answerFormat.shouldShowDontKnowButton) { if (!_dontKnowButton) { _dontKnowButton = [ORKDontKnowButton new]; - _dontKnowButton.customDontKnowButtonText = numericAnswerFormat.customDontKnowButtonText; + _dontKnowButton.customDontKnowButtonText = answerFormat.customDontKnowButtonText; _dontKnowButton.translatesAutoresizingMaskIntoConstraints = NO; [_dontKnowButton addTarget:self action:@selector(dontKnowButtonWasPressed) forControlEvents:UIControlEventTouchUpInside]; } @@ -112,11 +116,7 @@ - (void)numberCell_initialize { if (!_dividerView) { _dividerView = [UIView new]; _dividerView.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - [_dividerView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_dividerView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_dividerView setBackgroundColor:[UIColor separatorColor]]; } [self addSubview:_dontKnowButton]; @@ -273,27 +273,21 @@ - (void)updateErrorLabelWithMessage:(NSString *)message { NSString *stringtoParse = message ? : ORKLocalizedString(@"RANGE_ALERT_TITLE", @""); NSString *parsedString = [stringtoParse componentsSeparatedByString:separatorString].firstObject; - if (@available(iOS 13.0, *)) { - - NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; - NSTextAttachment *imageAttachment = [NSTextAttachment new]; - - UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithPointSize:12 weight:UIImageSymbolWeightRegular scale:UIImageSymbolScaleMedium]; - UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle"]; - UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; - - imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - - NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; - - [fullString insertAttributedString:imageString atIndex:0]; - - self.errorLabel.attributedText = fullString; - } else { - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:parsedString]; - self.errorLabel.attributedText = fullString; - } + NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; + NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; + NSTextAttachment *imageAttachment = [NSTextAttachment new]; + + UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithPointSize:12 weight:UIImageSymbolWeightRegular scale:UIImageSymbolScaleMedium]; + UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle"]; + UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; + + imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + + NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; + + [fullString insertAttributedString:imageString atIndex:0]; + + self.errorLabel.attributedText = fullString; [self setUpConstraints]; } @@ -319,7 +313,6 @@ - (void)valueFieldDidChange:(UITextField *)textField { } - (BOOL)textFieldShouldClear:(UITextField *)textField { - if ([_dontKnowButton active]) { [self ork_setAnswer:[ORKDontKnowAnswer answer]]; } else { diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForPicker.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForPicker.h similarity index 96% rename from ResearchKit/Common/ORKSurveyAnswerCellForPicker.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForPicker.h index 818e99bd5e..46b54c1209 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForPicker.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForPicker.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKSurveyAnswerCell.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForPicker.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForPicker.m similarity index 94% rename from ResearchKit/Common/ORKSurveyAnswerCellForPicker.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForPicker.m index d1b9dc3847..676b166f58 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForPicker.m +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForPicker.m @@ -68,10 +68,7 @@ - (void)prepareView { - (void)loadPicker { if (_picker == nil) { _picker = [ORKPicker pickerWithAnswerFormat:[self.step impliedAnswerFormat] answer:self.answer delegate:self]; - - if (@available(iOS 13.0, *)) { - _picker.pickerView.backgroundColor = UIColor.secondarySystemGroupedBackgroundColor; - } + _picker.pickerView.backgroundColor = UIColor.secondarySystemGroupedBackgroundColor; [self.picker pickerWillAppear]; @@ -95,11 +92,7 @@ - (void)setupDontKnowButton { if (!_dividerView) { _dividerView = [UIView new]; - if (@available(iOS 13.0, *)) { - [_dividerView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_dividerView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_dividerView setBackgroundColor:[UIColor separatorColor]]; [self addSubview:_dividerView]; } diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForSES.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForSES.h similarity index 97% rename from ResearchKit/Common/ORKSurveyAnswerCellForSES.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForSES.h index 4422d52bf9..14235abd16 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForSES.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForSES.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "ORKSurveyAnswerCell.h" +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForSES.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForSES.m similarity index 99% rename from ResearchKit/Common/ORKSurveyAnswerCellForSES.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForSES.m index eb141b2a86..924b47ddd8 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForSES.m +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForSES.m @@ -50,7 +50,6 @@ - (NSArray *)suggestedCellHeightConstraintsForView:(UIView *)view { - (void)prepareView { [super prepareView]; - _selectionView = [[ORKSESSelectionView alloc] initWithAnswerFormat:(ORKSESAnswerFormat *)self.step.answerFormat answer:self.answer]; _selectionView.delegate = self; _selectionView.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForScale.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForScale.h similarity index 96% rename from ResearchKit/Common/ORKSurveyAnswerCellForScale.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForScale.h index 36d77170ca..925cf66ec8 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForScale.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForScale.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKSurveyAnswerCell.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForScale.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForScale.m similarity index 100% rename from ResearchKit/Common/ORKSurveyAnswerCellForScale.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForScale.m diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForText.h b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForText.h similarity index 96% rename from ResearchKit/Common/ORKSurveyAnswerCellForText.h rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForText.h index b301f3f18f..1405895f48 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForText.h +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForText.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKSurveyAnswerCell.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSurveyAnswerCellForText.m b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForText.m similarity index 91% rename from ResearchKit/Common/ORKSurveyAnswerCellForText.m rename to ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForText.m index d5a3394154..f1892c20f8 100644 --- a/ResearchKit/Common/ORKSurveyAnswerCellForText.m +++ b/ResearchKitUI/Common/Answer Format/Question Step Views/ORKSurveyAnswerCellForText.m @@ -77,7 +77,7 @@ @implementation ORKSurveyAnswerCellForText { } - (void)applyAnswerFormat { - ORKAnswerFormat *answerFormat = [self.step impliedAnswerFormat]; + ORKAnswerFormat *answerFormat = [self.step.answerFormat impliedAnswerFormat]; if ([answerFormat isKindOfClass:[ORKTextAnswerFormat class]]) { ORKTextAnswerFormat *textAnswerFormat = (ORKTextAnswerFormat *)answerFormat; @@ -125,9 +125,7 @@ - (void)prepareView { self.textView.delegate = self; self.textView.editable = YES; - if (@available(iOS 13.0, *)) { - self.textView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; - } + self.textView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; [self addSubview:self.textView]; @@ -146,23 +144,14 @@ - (void)prepareView { if (_bottomSeperatorView == nil) { _bottomSeperatorView = [UIView new]; - - if (@available(iOS 13.0, *)) { - [_bottomSeperatorView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_bottomSeperatorView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_bottomSeperatorView setBackgroundColor:[UIColor separatorColor]]; _bottomSeperatorView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:_bottomSeperatorView]; } if (_textCountLabel == nil && _maxLength > 0) { _textCountLabel = [UILabel new]; - if (@available(iOS 13.0, *)) { - [_textCountLabel setTextColor:[UIColor labelColor]]; - } else { - [_textCountLabel setTextColor:[UIColor grayColor]]; - } + [_textCountLabel setTextColor:[UIColor labelColor]]; if (!_hideCharacterCountLabel) { [accessibilityElements addObject:_textCountLabel]; @@ -382,11 +371,7 @@ - (void)setupDontKnowButton { if (!_dividerView) { _dividerView = [UIView new]; _dividerView.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - [_dividerView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_dividerView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_dividerView setBackgroundColor:[UIColor separatorColor]]; } [self addSubview:_dontKnowBackgroundView]; @@ -466,28 +451,22 @@ - (void)updateErrorLabelWithMessage:(NSString *)message { self.accessibilityElements = [self.accessibilityElements arrayByAddingObject:self.errorLabel]; } - if (@available(iOS 13.0, *)) { - - NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; - NSTextAttachment *imageAttachment = [NSTextAttachment new]; - - UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle.fill"]; - - UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithTextStyle:UIFontTextStyleFootnote]; - UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; - - imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - - NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; - - [fullString insertAttributedString:imageString atIndex:0]; - - self.errorLabel.attributedText = fullString; - } else { - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:parsedString]; - self.errorLabel.attributedText = fullString; - } + NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; + NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; + NSTextAttachment *imageAttachment = [NSTextAttachment new]; + + UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle.fill"]; + + UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithTextStyle:UIFontTextStyleFootnote]; + UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; + + imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + + NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; + + [fullString insertAttributedString:imageString atIndex:0]; + + self.errorLabel.attributedText = fullString; [self setUpConstraints]; } @@ -611,6 +590,7 @@ - (void)textFieldCell_initialize { [self addSubview:_errorLabel]; } + _shouldShowDontKnow = NO; if ([[self textAnswerFormat] shouldShowDontKnowButton]) { _shouldShowDontKnow = YES; @@ -717,11 +697,7 @@ - (void)setupDontKnowButton { if (!_dividerView) { _dividerView = [UIView new]; _dividerView.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - [_dividerView setBackgroundColor:[UIColor separatorColor]]; - } else { - [_dividerView setBackgroundColor:[UIColor lightGrayColor]]; - } + [_dividerView setBackgroundColor:[UIColor separatorColor]]; } [self addSubview:_dontKnowBackgroundView]; @@ -835,28 +811,22 @@ - (void)updateErrorLabelWithMessage:(NSString *)message { if (![self.accessibilityElements containsObject:self.errorLabel]) { self.accessibilityElements = [self.accessibilityElements arrayByAddingObject:self.errorLabel]; } - - if (@available(iOS 13.0, *)) { - - NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; - NSTextAttachment *imageAttachment = [NSTextAttachment new]; - - UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithPointSize:12 weight:UIImageSymbolWeightRegular scale:UIImageSymbolScaleMedium]; - UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle"]; - UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; - - imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; - - [fullString insertAttributedString:imageString atIndex:0]; - - self.errorLabel.attributedText = fullString; - } else { - NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:parsedString]; - self.errorLabel.attributedText = fullString; - } + NSString *errorMessage = [NSString stringWithFormat:@" %@", parsedString]; + NSMutableAttributedString *fullString = [[NSMutableAttributedString alloc] initWithString:errorMessage]; + NSTextAttachment *imageAttachment = [NSTextAttachment new]; + + UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithPointSize:12 weight:UIImageSymbolWeightRegular scale:UIImageSymbolScaleMedium]; + UIImage *exclamationMarkImage = [UIImage systemImageNamed:@"exclamationmark.circle"]; + UIImage *configuredImage = [exclamationMarkImage imageByApplyingSymbolConfiguration:imageConfig]; + + imageAttachment.image = [configuredImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + + NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; + + [fullString insertAttributedString:imageString atIndex:0]; + + self.errorLabel.attributedText = fullString; [self setUpConstraints]; } @@ -878,7 +848,6 @@ - (ORKTextAnswerFormat *)textAnswerFormat { reason:@"the ORKSurveyAnswerCellForTextFields's answerFormat must be a ORKTextAnswerFormat" userInfo:nil]; } - return textAnswerFormat; } diff --git a/ResearchKitUI/Common/Answer Format/SwiftUI Views/SwiftUIViewFactory.swift b/ResearchKitUI/Common/Answer Format/SwiftUI Views/SwiftUIViewFactory.swift new file mode 100644 index 0000000000..cfbeedc625 --- /dev/null +++ b/ResearchKitUI/Common/Answer Format/SwiftUI Views/SwiftUIViewFactory.swift @@ -0,0 +1,95 @@ +/* + Copyright (c) 2021, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import Foundation +import SwiftUI +import ResearchKit + +@objc +public class SwiftUIViewFactory: NSObject { + + @objc public var answerDidUpdateClosure: ((Any) -> Void)? + + @objc public func makeSwiftUIView(answerFormat: ORKAnswerFormat, answer: Any) -> UIView? { + // SwiftUI view for ORKTextChoiceAnswerFormat when at least one of the textChoices + // has an image passed along with it + if let textChoiceAnswerFormat = answerFormat as? ORKTextChoiceAnswerFormat { + let textChoiceHelper = SwiftUITextChoiceHelper(answer: answer, + answerFormat: textChoiceAnswerFormat) + var textChoiceView = TextChoiceView(textChoiceHelper: textChoiceHelper) + textChoiceView.answerDidUpdateClosure = { answer in + + if let closure = self.answerDidUpdateClosure { + closure(answer) + } + } + + let hostingController = UIHostingController(rootView: textChoiceView) + hostingController.view.backgroundColor = .clear + return hostingController.view + } + + return nil + } +} + +struct WidthPreferenceKey: PreferenceKey { + static var defaultValue: CGFloat? + + static func reduce( + value: inout CGFloat?, + nextValue: () -> CGFloat? + ) { + if value == nil { + value = nextValue() + } + } +} + +struct FullScreenModifier: ViewModifier { + let isPresented: Binding + let builder: () -> V + + @ViewBuilder + func body(content: Content) -> some View { + if #available(iOS 14.0, *) { + content.fullScreenCover(isPresented: isPresented, content: builder) + } else { + content.sheet(isPresented: isPresented, content: builder) + } + } +} + +extension View { + func compatibleFullScreen(isPresented: Binding, + @ViewBuilder content: @escaping () -> Content) -> some View { + self.modifier(FullScreenModifier(isPresented: isPresented, builder: content)) + } +} diff --git a/ResearchKit/Common/TextChoiceView.swift b/ResearchKitUI/Common/Answer Format/SwiftUI Views/TextChoiceView.swift similarity index 97% rename from ResearchKit/Common/TextChoiceView.swift rename to ResearchKitUI/Common/Answer Format/SwiftUI Views/TextChoiceView.swift index 73e881e6dd..4d3dae55b6 100644 --- a/ResearchKit/Common/TextChoiceView.swift +++ b/ResearchKitUI/Common/Answer Format/SwiftUI Views/TextChoiceView.swift @@ -29,8 +29,8 @@ */ import SwiftUI +import ResearchKit -@available(iOS 13.0, *) struct TextChoiceView: View { @ObservedObject var textChoiceHelper: SwiftUITextChoiceHelper @@ -79,7 +79,6 @@ struct TextChoiceView: View { var dividerPadding: CGFloat = 20 dividerPadding += (imageWidth + 16) - return dividerPadding } @@ -102,7 +101,8 @@ struct TextChoiceView: View { if let img = image { Image(uiImage: img) .resizable() - .aspectRatio(contentMode: .fill) + .aspectRatio(contentMode: .fit) + .frame(width: 115) .overlay(RoundedRectangle(cornerRadius: 6).stroke(Color.clear, lineWidth: 1)) .overlay(ExpandImageOverlay().padding([.leading, .top], @@ -173,7 +173,7 @@ struct TextChoiceView: View { NavigationView { VStack { Spacer() - + Image(uiImage: image).resizable().aspectRatio(contentMode: .fit) Spacer() @@ -210,7 +210,6 @@ struct TextChoiceView: View { } -@available(iOS 13.0, *) class SwiftUITextChoiceHelper: ObservableObject { var answer: Any let answerFormat: ORKTextChoiceAnswerFormat @@ -288,7 +287,9 @@ class SwiftUITextChoiceHelper: ObservableObject { // iterate through collectedTextChoices and update the selectedIndexes array for textChoice in collectedTextChoices { - let result = self.swiftUItextChoices.first(where: { $0.value.isEqual(textChoice.value) }) + let result = self.swiftUItextChoices.first(where: { + $0.value.isEqual(textChoice.value) + }) if let swiftUITextChoice = result, !selectedIndexes.contains(swiftUITextChoice.index) { self.selectedIndexes.append(swiftUITextChoice.index) @@ -298,7 +299,6 @@ class SwiftUITextChoiceHelper: ObservableObject { } -@available(iOS 13.0, *) private struct SwiftUITextChoice: Identifiable { var id: String var text: String @@ -307,7 +307,6 @@ private struct SwiftUITextChoice: Identifiable { var value: NSCopying & NSSecureCoding & NSObjectProtocol } -@available(iOS 13.0, *) private struct CompatibleNavigationBarItems< LeadingContent: View, TrailingContent: View @@ -337,7 +336,6 @@ private struct CompatibleNavigationBarItems< } } -@available(iOS 13.0, *) extension CompatibleNavigationBarItems where LeadingContent == EmptyView { init(@ViewBuilder trailingContent: () -> TrailingContent) { @@ -348,7 +346,6 @@ extension CompatibleNavigationBarItems where LeadingContent == EmptyView { } } -@available(iOS 13.0, *) extension CompatibleNavigationBarItems where TrailingContent == EmptyView { init(@ViewBuilder leadingContent: () -> LeadingContent) { diff --git a/ResearchKit/Common/ORKCheckmarkView.h b/ResearchKitUI/Common/CheckmarkView/ORKCheckmarkView.h similarity index 97% rename from ResearchKit/Common/ORKCheckmarkView.h rename to ResearchKitUI/Common/CheckmarkView/ORKCheckmarkView.h index 19b592da0d..b9570f8f02 100644 --- a/ResearchKit/Common/ORKCheckmarkView.h +++ b/ResearchKitUI/Common/CheckmarkView/ORKCheckmarkView.h @@ -41,6 +41,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, nullable) UIImage *checkedImage; @property (nonatomic, nullable) UIImage *uncheckedImage; @property (nonatomic) BOOL checked; +@property (nonatomic) BOOL shouldIgnoreDarkMode; - (CGFloat)getDimension; diff --git a/ResearchKitUI/Common/CheckmarkView/ORKCheckmarkView.m b/ResearchKitUI/Common/CheckmarkView/ORKCheckmarkView.m new file mode 100644 index 0000000000..362f2babb7 --- /dev/null +++ b/ResearchKitUI/Common/CheckmarkView/ORKCheckmarkView.m @@ -0,0 +1,126 @@ +/* + Copyright (c) 2019, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKCheckmarkView.h" +#import "ORKHelpers_Internal.h" +#import "ORKSkin.h" +#import "ORKAccessibilityFunctions.h" + +@implementation ORKCheckmarkView { + CGFloat _dimension; + BOOL _shouldShowCircle; +} + +- (instancetype)initWithRadius:(CGFloat)radius checkedImage:(UIImage *)checkedImage uncheckedImage:(UIImage *)uncheckedImage shouldShowCircle:(BOOL)shouldShowCircle { + self = [super init]; + if (self) { + _dimension = 2*radius; + _checkedImage = checkedImage; + _uncheckedImage = uncheckedImage; + _shouldShowCircle = shouldShowCircle; + } + [self setupView]; + return self; +} + +- (instancetype)initWithRadius:(CGFloat)radius checkedImage:(UIImage *)checkedImage uncheckedImage:(UIImage *)uncheckedImage { + return [self initWithRadius:CheckmarkViewDimension*0.5 + checkedImage:[ORKCheckmarkView checkedImage] + uncheckedImage:[ORKCheckmarkView unCheckedImage] + shouldShowCircle:YES]; +} + +- (instancetype)initWithDefaults { + return [self initWithRadius:CheckmarkViewDimension*0.5 + checkedImage:[ORKCheckmarkView checkedImage] + uncheckedImage:[ORKCheckmarkView unCheckedImage]]; +} + +- (instancetype)initWithDefaultsWithoutCircle { + return [self initWithRadius:CheckmarkViewDimension*0.5 + checkedImage:[ORKCheckmarkView checkedImageWithoutCircle] + uncheckedImage:nil + shouldShowCircle:NO]; +} + +- (CGFloat)getDimension { + return _dimension; +} + ++ (UIImage *)unCheckedImage { + UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody] scale:ORKImageScaleToUse()]; + return [UIImage systemImageNamed:@"circle" withConfiguration:configuration]; +} + ++ (UIImage *)checkedImage { + UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody] scale:ORKImageScaleToUse()]; + return [UIImage systemImageNamed:@"checkmark.circle.fill" withConfiguration:configuration]; +} + ++ (UIImage *)checkedImageWithoutCircle { + UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody] scale:ORKImageScaleToUse()]; + return [UIImage systemImageNamed:@"checkmark" withConfiguration:configuration]; +} + +- (void)updateCheckView { + if (_checked) { + self.image = _checkedImage; + self.tintColor = ORKViewTintColor(self); + } + else { + self.image = _uncheckedImage; + self.tintColor = _shouldIgnoreDarkMode ? [UIColor lightGrayColor] : [UIColor systemGray3Color]; + } +} + +- (void)setupView { + [[self.widthAnchor constraintEqualToConstant:_dimension] setActive:YES]; + [[self.heightAnchor constraintEqualToConstant:_dimension] setActive:YES]; + + self.contentMode = UIViewContentModeCenter; +} + +- (void)setChecked:(BOOL)checked { + _checked = checked; + [self updateCheckView]; +} + +- (void)setShouldIgnoreDarkMode:(BOOL)shouldIgnoreDarkMode { + _shouldIgnoreDarkMode = shouldIgnoreDarkMode; + [self updateCheckView]; +} + +- (void)tintColorDidChange { + [super tintColorDidChange]; + [self updateCheckView]; +} + +@end + diff --git a/ResearchKit/Common/ORKLearnMoreView.h b/ResearchKitUI/Common/Container Views/Learn More/ORKLearnMoreView.h similarity index 99% rename from ResearchKit/Common/ORKLearnMoreView.h rename to ResearchKitUI/Common/Container Views/Learn More/ORKLearnMoreView.h index 360c1dd896..f38e8fc369 100644 --- a/ResearchKit/Common/ORKLearnMoreView.h +++ b/ResearchKitUI/Common/Container Views/Learn More/ORKLearnMoreView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKLearnMoreView.m b/ResearchKitUI/Common/Container Views/Learn More/ORKLearnMoreView.m similarity index 95% rename from ResearchKit/Common/ORKLearnMoreView.m rename to ResearchKitUI/Common/Container Views/Learn More/ORKLearnMoreView.m index 88555673f0..3af55774b4 100644 --- a/ResearchKit/Common/ORKLearnMoreView.m +++ b/ResearchKitUI/Common/Container Views/Learn More/ORKLearnMoreView.m @@ -60,15 +60,7 @@ + (instancetype)learnMoreCustomButtonWithText:(NSString *)text { button.titleLabel.numberOfLines = 0; button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; button.titleLabel.translatesAutoresizingMaskIntoConstraints = NO; - - if (@available(iOS 15.0, *)) { - UIButtonConfiguration *buttonConfig = [UIButtonConfiguration plainButtonConfiguration]; - [buttonConfig setContentInsets:NSDirectionalEdgeInsetsMake(0, 0, 0, 0)]; - [button setConfiguration:buttonConfig]; - } else { - [button setContentEdgeInsets:UIEdgeInsetsMake(CGFLOAT_MIN, CGFLOAT_MIN, CGFLOAT_MIN, CGFLOAT_MIN)]; - } - + [button setContentEdgeInsets:UIEdgeInsetsMake(CGFLOAT_MIN, CGFLOAT_MIN, CGFLOAT_MIN, CGFLOAT_MIN)]; return button; } @@ -130,6 +122,7 @@ - (void)setupCustomButtonWithText:(NSString *)text { if (!_learnMoreButton) { _learnMoreButton = [ORKLearnMoreButton learnMoreCustomButtonWithText:text]; } + [self setLearnMoreButtonColor]; [self addSubview:_learnMoreButton]; [_learnMoreButton addTarget:self action:@selector(presentLearnMoreViewController) forControlEvents:UIControlEventTouchUpInside]; [self setupConstraints]; @@ -139,6 +132,7 @@ - (void)setupDetailDisclosureButton { if (!_learnMoreButton) { _learnMoreButton = [ORKLearnMoreButton learnMoreDetailDisclosureButton]; } + [self setLearnMoreButtonColor]; [self addSubview:_learnMoreButton]; [_learnMoreButton addTarget:self action:@selector(presentLearnMoreViewController) forControlEvents:UIControlEventTouchUpInside]; [self setupConstraints]; @@ -150,6 +144,13 @@ - (void)setLearnMoreButtonFont: (UIFont *)font { } } +- (void)setLearnMoreButtonColor { + if (_learnMoreButton) { + [_learnMoreButton setTitleColor:self.tintColor forState:UIControlStateNormal]; + _learnMoreButton.tintColor = self.tintColor; + } +} + - (void)setLearnMoreButtonTextAlignment:(NSTextAlignment)textAlignment { if (textAlignment == NSTextAlignmentLeft) { [_learnMoreButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft]; @@ -203,4 +204,9 @@ - (void)presentLearnMoreViewController { [_delegate learnMoreButtonPressedWithStep:_learnMoreInstructionStep]; } +- (void)tintColorDidChange { + [super tintColorDidChange]; + [self setLearnMoreButtonColor]; +} + @end diff --git a/ResearchKit/Common/ORKBodyContainerView.h b/ResearchKitUI/Common/Container Views/ORKBodyContainerView.h similarity index 99% rename from ResearchKit/Common/ORKBodyContainerView.h rename to ResearchKitUI/Common/Container Views/ORKBodyContainerView.h index 405e903938..0b5dd23b52 100644 --- a/ResearchKit/Common/ORKBodyContainerView.h +++ b/ResearchKitUI/Common/Container Views/ORKBodyContainerView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKBodyContainerView.m b/ResearchKitUI/Common/Container Views/ORKBodyContainerView.m similarity index 94% rename from ResearchKit/Common/ORKBodyContainerView.m rename to ResearchKitUI/Common/Container Views/ORKBodyContainerView.m index 3f346dbc84..57b115831b 100644 --- a/ResearchKit/Common/ORKBodyContainerView.m +++ b/ResearchKitUI/Common/Container Views/ORKBodyContainerView.m @@ -63,6 +63,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static NSString *ORKBulletUnicode = @"\u2981"; +//static const CGFloat ORKBulletToBulletPaddingShort = 22.0; +//static const CGFloat ORKBulletToBulletPaddingGenerous = 36.0; +//static const CGFloat ORKBodyToBulletPaddingShort = 22.0; + @protocol ORKBodyItemViewDelegate @@ -116,7 +120,7 @@ - (void)setupBodyStyleView { _cardView.translatesAutoresizingMaskIntoConstraints = NO; [self addArrangedSubview:_cardView]; } - + if ([_bodyItem isCustomButtonItemType]) { [self setupCustomButtonViewWithConfigurationHandler:_bodyItem.customButtonConfigurationHandler]; @@ -200,11 +204,7 @@ - (void)setupBodyStyleHorizontalRule { self.distribution = UIStackViewDistributionFill; UIView *separator = [UIView new]; separator.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - separator.backgroundColor = UIColor.separatorColor; - } else { - separator.backgroundColor = UIColor.lightGrayColor; - } + separator.backgroundColor = UIColor.separatorColor; [separator.heightAnchor constraintEqualToConstant:1.0 / [UIScreen mainScreen].scale].active = YES; [self addArrangedSubview:separator]; } @@ -299,13 +299,14 @@ - (void)setupBodyStyleBulletPointView { - (void)setupBodyStyleImage { UIImageView *imageView = [self imageView]; - self.alignment = UIStackViewAlignmentCenter; + self.alignment = _bodyItem.alignImageToTop ? UIStackViewAlignmentTop : UIStackViewAlignmentCenter; if (_bodyItem.useCardStyle == YES) { imageView.translatesAutoresizingMaskIntoConstraints = NO; [_cardView addSubview:imageView]; [imageView.leadingAnchor constraintEqualToAnchor:_cardView.leadingAnchor].active = YES; [imageView.centerYAnchor constraintEqualToAnchor:_cardView.centerYAnchor].active = YES; + [_cardView.heightAnchor constraintGreaterThanOrEqualToAnchor:imageView.heightAnchor].active = YES; _cardStyleAccessoryView = imageView; } else { [self addArrangedSubview:imageView]; @@ -319,11 +320,7 @@ - (UILabel *)bulletIcon { UILabel *bulletIconLabel = [UILabel new]; bulletIconLabel.numberOfLines = 1; bulletIconLabel.font = [ORKBodyItemView bulletIconFont]; - if (@available(iOS 13.0, *)) { - bulletIconLabel.textColor = [UIColor secondaryLabelColor]; - } else { - bulletIconLabel.textColor = [UIColor systemGrayColor]; - } + bulletIconLabel.textColor = [UIColor secondaryLabelColor]; [bulletIconLabel setText:ORKBulletUnicode]; bulletIconLabel.translatesAutoresizingMaskIntoConstraints = NO; @@ -339,13 +336,12 @@ - (UIImageView *)imageView { if (self.bodyItem.useSecondaryColor) { imageView.tintColor = UIColor.grayColor; } - if (@available(iOS 13.0, *)) { - // To allow symbols to handle their own configuration - if (imageView.image.isSymbolImage) { - imageView.contentMode = UIViewContentModeCenter; - } else { - imageView.contentMode = UIViewContentModeScaleAspectFit; - } + + // To allow symbols to handle their own configuration + if (imageView.image.isSymbolImage) { + imageView.contentMode = UIViewContentModeCenter; + } else { + imageView.contentMode = UIViewContentModeScaleAspectFit; } [imageView.heightAnchor constraintEqualToConstant:ORKBulletIconDimension].active = YES; @@ -426,11 +422,7 @@ - (void)addSubStackView { detailTextLabel.font = [ORKBodyItemView bulletDetailTextFont]; detailTextLabel.text = _bodyItem.detailText; if (_bodyItem.useCardStyle == YES) { - if (@available(iOS 13.0, *)) { - [detailTextLabel setTextColor:[UIColor labelColor]]; - } else{ - [detailTextLabel setTextColor:ORKColor(ORKBulletItemTextColorKey)]; - } + [detailTextLabel setTextColor:[UIColor labelColor]]; } else { [detailTextLabel setTextColor:ORKColor(ORKBulletItemTextColorKey)]; } @@ -459,17 +451,15 @@ - (NSMutableAttributedString *)icon:(UIImage *)image withText:(NSString *)text f NSString *textString = [[NSString alloc] initWithFormat:@" %@", text]; NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:textString]; NSTextAttachment *imageAttachment = [[NSTextAttachment alloc] init]; - - if (@available(iOS 13.0, *)) { - UIImage *iconImage = image; - if (iconImage.isSymbolImage) { - UIImageSymbolConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:font]; - iconImage = [[image imageWithConfiguration:configuration] imageWithTintColor:color]; - } - imageAttachment.image = iconImage; - NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; - [attributedText insertAttributedString:imageString atIndex:0]; + + UIImage *iconImage = image; + if (iconImage.isSymbolImage) { + UIImageSymbolConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:font]; + iconImage = [[image imageWithConfiguration:configuration] imageWithTintColor:color]; } + imageAttachment.image = iconImage; + NSAttributedString *imageString = [NSAttributedString attributedStringWithAttachment:imageAttachment]; + [attributedText insertAttributedString:imageString atIndex:0]; return attributedText; } diff --git a/ResearchKit/Common/ORKNavigationContainerView.h b/ResearchKitUI/Common/Container Views/ORKNavigationContainerView.h similarity index 97% rename from ResearchKit/Common/ORKNavigationContainerView.h rename to ResearchKitUI/Common/Container Views/ORKNavigationContainerView.h index f9f4393af4..83655422c9 100644 --- a/ResearchKit/Common/ORKNavigationContainerView.h +++ b/ResearchKitUI/Common/Container Views/ORKNavigationContainerView.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKNavigationContainerView.m b/ResearchKitUI/Common/Container Views/ORKNavigationContainerView.m similarity index 90% rename from ResearchKit/Common/ORKNavigationContainerView.m rename to ResearchKitUI/Common/Container Views/ORKNavigationContainerView.m index efc070cafe..19c507ac36 100644 --- a/ResearchKit/Common/ORKNavigationContainerView.m +++ b/ResearchKitUI/Common/Container Views/ORKNavigationContainerView.m @@ -55,15 +55,7 @@ @implementation ORKNavigationContainerView { - (instancetype)init { self = [super init]; if (self) { - [self setBackgroundColor:ORKColor(ORKNavigationContainerColorKey)]; - [self setupVisualEffectView]; - [self setupViews]; - [self setupFootnoteLabel]; - [self setupNavigationDetailTextLabel]; - self.preservesSuperviewLayoutMargins = NO; - _appTintColor = nil; - self.skipButtonStyle = ORKNavigationContainerButtonStyleTextBold; - [self updateContinueAndSkipEnabled]; + [self commonInit]; } return self; } @@ -76,6 +68,18 @@ - (void)removeStyling { } } +- (void)commonInit { + [self setBackgroundColor:ORKColor(ORKNavigationContainerColorKey)]; + [self setupVisualEffectView]; + [self setupViews]; + [self setupFootnoteLabel]; + [self setupNavigationDetailTextLabel]; + self.preservesSuperviewLayoutMargins = NO; + _appTintColor = nil; + self.skipButtonStyle = ORKNavigationContainerButtonStyleTextBold; + [self updateContinueAndSkipEnabled]; +} + - (void)flattenIfNeeded { if (![self hasContinueOrSkip] || (self.continueButtonItem == nil && [self neverHasSkipButton] && [self neverHasFootnote])) { [[self.heightAnchor constraintEqualToConstant:0] setActive:YES]; @@ -86,11 +90,7 @@ - (void)setupVisualEffectView { if (!effectView && !_removeVisualEffect) { self.backgroundColor = [UIColor clearColor]; UIVisualEffect *blurEffect; - if (@available(iOS 13.0, *)) { - blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemChromeMaterial]; - } else { - blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; - } + blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemChromeMaterial]; effectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; } effectView.translatesAutoresizingMaskIntoConstraints = NO; @@ -130,14 +130,16 @@ - (void)setupSkipButton { [_skipButton setTitle:nil forState:UIControlStateNormal]; [_skipButton addTarget:self action:@selector(skipButtonAction:) forControlEvents:UIControlEventTouchUpInside]; _skipButton.translatesAutoresizingMaskIntoConstraints = NO; + _skipButton.accessibilityIdentifier = @"ORKNavigationContainerView_skipButton"; [self addSubview:_skipButton]; } - (void)setupFootnoteLabel { _footnoteLabel = [ORKFootnoteLabel new]; _footnoteLabel.numberOfLines = 0; - _footnoteLabel.textAlignment = NSTextAlignmentNatural; + _footnoteLabel.textAlignment = NSTextAlignmentCenter; _footnoteLabel.translatesAutoresizingMaskIntoConstraints = NO; + _footnoteLabel.textColor = UIColor.secondaryLabelColor; [self addSubview:_footnoteLabel]; } @@ -146,11 +148,7 @@ - (void)setupNavigationDetailTextLabel { _detailTextLabel.numberOfLines = 0; _detailTextLabel.textAlignment = NSTextAlignmentCenter; _detailTextLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption2]; - if (@available(iOS 13.0, *)) { - _detailTextLabel.textColor = [UIColor secondaryLabelColor]; - } else { - _detailTextLabel.textColor = [UIColor grayColor]; - } + _detailTextLabel.textColor = [UIColor secondaryLabelColor]; _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:_detailTextLabel]; } @@ -481,9 +479,36 @@ - (void)setUpConstraints { } UIView *lastView = _skipButton ? : _continueButton; + + if (![self neverHasFootnote]) { + UIView *lastButton = [self neverHasSkipButton] ? _continueButton : _skipButton; + [_regularConstraints addObjectsFromArray:@[ + [NSLayoutConstraint constraintWithItem:_footnoteLabel + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:lastButton ? : self.safeAreaLayoutGuide + attribute:lastButton ? NSLayoutAttributeBottom : NSLayoutAttributeTop + multiplier:1.0 + constant:lastButton ? standardSpacing : topSpacing], + [NSLayoutConstraint constraintWithItem:_footnoteLabel + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:self.safeAreaLayoutGuide + attribute:NSLayoutAttributeLeft + multiplier:1.0 + constant:leftRightPadding], + [NSLayoutConstraint constraintWithItem:_footnoteLabel + attribute:NSLayoutAttributeRight + relatedBy:NSLayoutRelationEqual + toItem:self.safeAreaLayoutGuide + attribute:NSLayoutAttributeRight + multiplier:1.0 + constant:-leftRightPadding], + ]]; + lastView = _footnoteLabel; + } if (lastView) { - [_regularConstraints addObject:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual diff --git a/ResearchKit/Common/ORKNavigationContainerView_Internal.h b/ResearchKitUI/Common/Container Views/ORKNavigationContainerView_Internal.h similarity index 94% rename from ResearchKit/Common/ORKNavigationContainerView_Internal.h rename to ResearchKitUI/Common/Container Views/ORKNavigationContainerView_Internal.h index 9b7ac8909e..32802afdeb 100644 --- a/ResearchKit/Common/ORKNavigationContainerView_Internal.h +++ b/ResearchKitUI/Common/Container Views/ORKNavigationContainerView_Internal.h @@ -29,9 +29,9 @@ */ #import -#import -#import -#import +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKStepContainerView.h b/ResearchKitUI/Common/Container Views/ORKStepContainerView.h similarity index 97% rename from ResearchKit/Common/ORKStepContainerView.h rename to ResearchKitUI/Common/Container Views/ORKStepContainerView.h index 38281faeaf..f16fd5da89 100644 --- a/ResearchKit/Common/ORKStepContainerView.h +++ b/ResearchKitUI/Common/Container Views/ORKStepContainerView.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKStepContainerView.m b/ResearchKitUI/Common/Container Views/ORKStepContainerView.m similarity index 99% rename from ResearchKit/Common/ORKStepContainerView.m rename to ResearchKitUI/Common/Container Views/ORKStepContainerView.m index 982e022dd7..16bbcfa6d0 100644 --- a/ResearchKit/Common/ORKStepContainerView.m +++ b/ResearchKitUI/Common/Container Views/ORKStepContainerView.m @@ -631,7 +631,6 @@ - (void)setCustomContentView:(UIView *)customContentView withTopPadding:(CGFloat - (void)setCustomContentView:(UIView *)customContentView withTopPadding:(CGFloat)topPadding sidePadding:(CGFloat)sidePadding { _customContentTopPadding = topPadding; _customContentLeftRightPadding = sidePadding; - [self.stepContentView setCustomTopPadding:[NSNumber numberWithFloat:topPadding]]; [self setCustomContentView:customContentView]; } diff --git a/ResearchKit/Common/ORKStepContainerView_Private.h b/ResearchKitUI/Common/Container Views/ORKStepContainerView_Private.h similarity index 96% rename from ResearchKit/Common/ORKStepContainerView_Private.h rename to ResearchKitUI/Common/Container Views/ORKStepContainerView_Private.h index 929c31d8f3..7c799f6bb3 100644 --- a/ResearchKit/Common/ORKStepContainerView_Private.h +++ b/ResearchKitUI/Common/Container Views/ORKStepContainerView_Private.h @@ -29,7 +29,8 @@ */ -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKStepContentView.h b/ResearchKitUI/Common/Container Views/ORKStepContentView.h similarity index 96% rename from ResearchKit/Common/ORKStepContentView.h rename to ResearchKitUI/Common/Container Views/ORKStepContentView.h index 8ee9520893..c4ff2627a8 100644 --- a/ResearchKit/Common/ORKStepContentView.h +++ b/ResearchKitUI/Common/Container Views/ORKStepContentView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN @@ -67,6 +67,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) BOOL useExtendedPadding; +@property (nonatomic) BOOL shouldAutomaticallyAdjustImageTintColor; + @property (nonatomic, weak) id delegate; - (instancetype)initWithStandardPadding; diff --git a/ResearchKit/Common/ORKStepContentView.m b/ResearchKitUI/Common/Container Views/ORKStepContentView.m similarity index 96% rename from ResearchKit/Common/ORKStepContentView.m rename to ResearchKitUI/Common/Container Views/ORKStepContentView.m index 255312e146..3475ee97c1 100644 --- a/ResearchKit/Common/ORKStepContentView.m +++ b/ResearchKitUI/Common/Container Views/ORKStepContentView.m @@ -36,7 +36,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKCompletionCheckmarkView.h" #import "ORKBodyContainerView.h" #import "ORKSkin.h" - +#import "UIImageView+ResearchKit.h" /* +_________________________+ @@ -87,6 +87,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const CGFloat ORKStepContentTagPaddingTop = 15.0; static const CGFloat ORKStepContentBottomPadding = 35.0; +NSString * const ORKStepBodyContainerViewAccessibilityIdentifier = @"ORKStepBodyContainerView"; + typedef NS_CLOSED_ENUM(NSInteger, ORKUpdateConstraintSequence) { ORKUpdateConstraintSequenceTopContentImageView = 0, ORKUpdateConstraintSequenceIconImageView, @@ -177,9 +179,36 @@ - (void)setStepTopContentImage:(UIImage *)stepTopContentImage { _topContentImageView.image = [self topContentAndAuxiliaryImage]; } + [self updateViewColors]; [[NSNotificationCenter defaultCenter] postNotificationName:ORKStepTopContentImageChangedKey object:nil]; } +- (void)setShouldAutomaticallyAdjustImageTintColor:(BOOL)shouldAutomaticallyAdjustImageTintColor { + _shouldAutomaticallyAdjustImageTintColor = shouldAutomaticallyAdjustImageTintColor; + [self updateViewColors]; +} + +- (void)updateViewColors { + if (!_shouldAutomaticallyAdjustImageTintColor) { + return; + } + + // this requires the image to be set to the UIImageRenderingModeAlwaysTemplate rendering mode + // in the UIImageRenderingModeAlwaysOriginal rendering mode, tintColor does not apply + [_topContentImageView updateRenderingModeForUserInterfaceStyle:self.traitCollection.userInterfaceStyle]; + [_iconImageView updateRenderingModeForUserInterfaceStyle:self.traitCollection.userInterfaceStyle]; + + UIColor *imageViewTintColor = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? [UIColor whiteColor] : nil; + _topContentImageView.tintColor = imageViewTintColor; + _iconImageView.tintColor = imageViewTintColor; + +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + [super traitCollectionDidChange:previousTraitCollection]; + [self updateViewColors]; +} + - (void)setAuxiliaryImage:(UIImage *)auxiliaryImage { _auxiliaryImage = auxiliaryImage; if (_stepTopContentImage) { @@ -299,6 +328,7 @@ - (void)setupIconImageView { _iconImageView.contentMode = UIViewContentModeScaleAspectFit; [self addSubview:_iconImageView]; + [self updateViewColors]; [self setIconImageViewConstraints]; } @@ -383,6 +413,7 @@ - (void)setupTitleLabel { } _titleLabel.numberOfLines = 0; _titleLabel.textAlignment = _stepHeaderTextAlignment; + _titleLabel.accessibilityIdentifier = @"ORKStepContentView_titleLabel"; [self addSubview:_titleLabel]; [self setupTitleLabelConstraints]; [self setContainerLeftRightConstraints]; @@ -461,6 +492,7 @@ - (void)setupTextLabel { _textLabel.textAlignment = _stepHeaderTextAlignment; _textLabel.numberOfLines = 0; _textLabel.lineBreakMode = NSLineBreakByWordWrapping; + _textLabel.accessibilityIdentifier = @"ORKStepContentView_textLabel"; [self addSubview:_textLabel]; [self setupTextLabelConstraints]; [self setContainerLeftRightConstraints]; @@ -557,6 +589,7 @@ - (void)setupDetailTextLabel { _detailTextLabel.textAlignment = _stepHeaderTextAlignment; _detailTextLabel.numberOfLines = 0; _detailTextLabel.lineBreakMode = NSLineBreakByWordWrapping; + _detailTextLabel.accessibilityIdentifier = @"ORKStepContentView_detailTextLabel"; [self addSubview:_detailTextLabel]; [self setupDetailTextLabelConstraints]; [self setContainerLeftRightConstraints]; @@ -667,6 +700,7 @@ - (void)setBodyItems:(NSArray *)bodyItems { - (void)setBuildsInBodyItems:(BOOL)buildsInBodyItems { _buildsInBodyItems = buildsInBodyItems; _bodyContainerView.buildsInBodyItems = _buildsInBodyItems; + _bodyContainerView.accessibilityIdentifier = ORKStepBodyContainerViewAccessibilityIdentifier; } - (void)setupBodyContainerView { @@ -972,7 +1006,6 @@ - (void)setBodyContainerViewTopConstraint { else if (_textLabel && ![_stepText isEqualToString:@""]) { topItem = _textLabel; - if (_bodyItems.firstObject.bodyItemStyle == ORKBodyItemStyleTag || _bodyItems.firstObject.bodyItemStyle == ORKBodyItemStyleHorizontalRule) { topPadding = ORKBodyToBodyParagraphPaddingStandard; @@ -1097,6 +1130,10 @@ - (void)setStepContentViewBottomConstraint { constant:constant]; } +- (void)setStepContentViewBottomConstraint:(CGFloat)bottomConstraint { + _stepContentBottomConstraint.constant = bottomConstraint; +} + - (void)setupUpdatedConstraints { _updatedConstraints = [[NSMutableArray alloc] init]; } diff --git a/ResearchKit/Common/ORKStepContentView_Private.h b/ResearchKitUI/Common/Container Views/ORKStepContentView_Private.h similarity index 95% rename from ResearchKit/Common/ORKStepContentView_Private.h rename to ResearchKitUI/Common/Container Views/ORKStepContentView_Private.h index 650b6b64f9..1f6db9ac8e 100644 --- a/ResearchKit/Common/ORKStepContentView_Private.h +++ b/ResearchKitUI/Common/Container Views/ORKStepContentView_Private.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -54,6 +54,8 @@ NS_ASSUME_NONNULL_BEGIN - (nullable ORKCompletionCheckmarkView *)completionCheckmarkView; +- (void)setStepContentViewBottomConstraint:(CGFloat)bottomConstraint; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKStepHeaderView.h b/ResearchKitUI/Common/Container Views/ORKStepHeaderView.h similarity index 98% rename from ResearchKit/Common/ORKStepHeaderView.h rename to ResearchKitUI/Common/Container Views/ORKStepHeaderView.h index c77db1959c..a27eea25f1 100644 --- a/ResearchKit/Common/ORKStepHeaderView.h +++ b/ResearchKitUI/Common/Container Views/ORKStepHeaderView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKStepHeaderView.m b/ResearchKitUI/Common/Container Views/ORKStepHeaderView.m similarity index 99% rename from ResearchKit/Common/ORKStepHeaderView.m rename to ResearchKitUI/Common/Container Views/ORKStepHeaderView.m index 7ce16eef67..47a05f5949 100644 --- a/ResearchKit/Common/ORKStepHeaderView.m +++ b/ResearchKitUI/Common/Container Views/ORKStepHeaderView.m @@ -98,13 +98,12 @@ - (instancetype)initWithFrame:(CGRect)frame { { _learnMoreButton = [ORKTextButton new]; _learnMoreButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading; + _learnMoreButton.contentEdgeInsets = (UIEdgeInsets){10,0,10,10}; [_learnMoreButton setTitle:nil forState:UIControlStateNormal]; [_learnMoreButton addTarget:self action:@selector(learnMoreAction:) forControlEvents:UIControlEventTouchUpInside]; _learnMoreButton.exclusiveTouch = YES; _learnMoreButton.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; _learnMoreButton.titleLabel.textAlignment = NSTextAlignmentNatural; - [_learnMoreButton updateContentInsets:NSDirectionalEdgeInsetsMake(10, 0, 10, 10)]; - [self addSubview:_learnMoreButton]; self.learnMoreButtonItem = nil; } diff --git a/ResearchKit/Common/ORKStepHeaderView_Internal.h b/ResearchKitUI/Common/Container Views/ORKStepHeaderView_Internal.h similarity index 92% rename from ResearchKit/Common/ORKStepHeaderView_Internal.h rename to ResearchKitUI/Common/Container Views/ORKStepHeaderView_Internal.h index 79ea05547b..a6634e996a 100644 --- a/ResearchKit/Common/ORKStepHeaderView_Internal.h +++ b/ResearchKitUI/Common/Container Views/ORKStepHeaderView_Internal.h @@ -29,10 +29,10 @@ */ -#import -#import -#import -#import +#import +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKTableContainerView.h b/ResearchKitUI/Common/Container Views/ORKTableContainerView.h similarity index 94% rename from ResearchKit/Common/ORKTableContainerView.h rename to ResearchKitUI/Common/Container Views/ORKTableContainerView.h index d7efd19d96..acd3fab0f7 100644 --- a/ResearchKit/Common/ORKTableContainerView.h +++ b/ResearchKitUI/Common/Container Views/ORKTableContainerView.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKStepView_Private.h" +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -64,7 +64,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)sizeHeaderToFit; -- (void)resizeFooterToFit; +- (void)resizeFooterToFitUsingMinHeight:(BOOL)useMinHeight; + +- (void)removeFooterView; @end diff --git a/ResearchKit/Common/ORKTableContainerView.m b/ResearchKitUI/Common/Container Views/ORKTableContainerView.m similarity index 98% rename from ResearchKit/Common/ORKTableContainerView.m rename to ResearchKitUI/Common/Container Views/ORKTableContainerView.m index 83e9fb638e..3f40c981d2 100644 --- a/ResearchKit/Common/ORKTableContainerView.m +++ b/ResearchKitUI/Common/Container Views/ORKTableContainerView.m @@ -189,13 +189,13 @@ - (void)setupNavigationContainerViewConstraints { - (void)layoutSubviews { [super layoutSubviews]; [self sizeHeaderToFit]; - [self resizeFooterToFit]; + [self resizeFooterToFitUsingMinHeight:NO]; [self updateTableViewBottomConstraint]; } - (void)didMoveToWindow { [self sizeHeaderToFit]; - [self resizeFooterToFit]; + [self resizeFooterToFitUsingMinHeight:NO]; [self layoutIfNeeded]; } @@ -219,7 +219,7 @@ - (void)removeFooterView { _tableView.tableFooterView = nil; } -- (void)resizeFooterToFit { +- (void)resizeFooterToFitUsingMinHeight:(BOOL)useMinHeight { // This method would resize the tableFooterView, so that navigationContainerView can have appropriate height. if (self.isNavigationContainerScrollable && _tableView.bounds.size.height > 0 && self.navigationFooterView.bounds.size.height > 0 && ![self.navigationFooterView wasContinueOrSkipButtonJustPressed]) { CGFloat minHeight = self.navigationFooterView.bounds.size.height; @@ -227,6 +227,11 @@ - (void)resizeFooterToFit { [_tableView layoutIfNeeded]; CGFloat tableViewHeight = self.tableView.bounds.size.height; CGFloat newHeight = tableViewHeight - self.tableView.contentSize.height + FooterViewHeightOffset; + + if (useMinHeight) { + newHeight = minHeight; + } + CGRect footerRect = newHeight < minHeight ? CGRectMake(0.0, 0.0, _tableView.bounds.size.width, minHeight) : CGRectMake(0.0, 0.0, _tableView.bounds.size.width, newHeight); [_footerView setFrame:footerRect]; diff --git a/ResearchKit/Common/ORKVerticalContainerView.h b/ResearchKitUI/Common/Container Views/ORKVerticalContainerView.h similarity index 99% rename from ResearchKit/Common/ORKVerticalContainerView.h rename to ResearchKitUI/Common/Container Views/ORKVerticalContainerView.h index d13993c97b..036d6fc023 100644 --- a/ResearchKit/Common/ORKVerticalContainerView.h +++ b/ResearchKitUI/Common/Container Views/ORKVerticalContainerView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKVerticalContainerView.m b/ResearchKitUI/Common/Container Views/ORKVerticalContainerView.m similarity index 99% rename from ResearchKit/Common/ORKVerticalContainerView.m rename to ResearchKitUI/Common/Container Views/ORKVerticalContainerView.m index abf1e2670c..d3c73309c1 100644 --- a/ResearchKit/Common/ORKVerticalContainerView.m +++ b/ResearchKitUI/Common/Container Views/ORKVerticalContainerView.m @@ -32,7 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKVerticalContainerView.h" #import "ORKVerticalContainerView_Internal.h" -#import "ORKCustomStepView_Internal.h" #import "ORKNavigationContainerView.h" #import "ORKStepHeaderView_Internal.h" #import "ORKTintedImageView.h" @@ -749,7 +748,7 @@ - (UIImageView *)imageView { return _imageView; } -- (void)setStepView:(ORKActiveStepCustomView *)customView { +- (void)setStepView:(UIView *)customView { [_stepView removeFromSuperview]; _stepView = customView; [_stepViewContainer addSubview:_stepView]; diff --git a/ResearchKit/Common/ORKVerticalContainerView_Internal.h b/ResearchKitUI/Common/Container Views/ORKVerticalContainerView_Internal.h similarity index 97% rename from ResearchKit/Common/ORKVerticalContainerView_Internal.h rename to ResearchKitUI/Common/Container Views/ORKVerticalContainerView_Internal.h index 3efc194b9c..e0bb0dc895 100644 --- a/ResearchKit/Common/ORKVerticalContainerView_Internal.h +++ b/ResearchKitUI/Common/Container Views/ORKVerticalContainerView_Internal.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKObserver.h b/ResearchKitUI/Common/Misc/ORKObserver.h similarity index 99% rename from ResearchKit/Common/ORKObserver.h rename to ResearchKitUI/Common/Misc/ORKObserver.h index 13b57676cc..7e95eeb4d8 100644 --- a/ResearchKit/Common/ORKObserver.h +++ b/ResearchKitUI/Common/Misc/ORKObserver.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKObserver.m b/ResearchKitUI/Common/Misc/ORKObserver.m similarity index 100% rename from ResearchKit/Common/ORKObserver.m rename to ResearchKitUI/Common/Misc/ORKObserver.m diff --git a/ResearchKit/Common/ORKRecordButton.h b/ResearchKitUI/Common/ORKCheckmarkButton/ORKRecordButton.h similarity index 100% rename from ResearchKit/Common/ORKRecordButton.h rename to ResearchKitUI/Common/ORKCheckmarkButton/ORKRecordButton.h diff --git a/ResearchKit/Common/ORKRecordButton.m b/ResearchKitUI/Common/ORKCheckmarkButton/ORKRecordButton.m similarity index 100% rename from ResearchKit/Common/ORKRecordButton.m rename to ResearchKitUI/Common/ORKCheckmarkButton/ORKRecordButton.m diff --git a/ResearchKit/Common/ORKPlaybackButton.h b/ResearchKitUI/Common/Playback Button/ORKPlaybackButton.h similarity index 100% rename from ResearchKit/Common/ORKPlaybackButton.h rename to ResearchKitUI/Common/Playback Button/ORKPlaybackButton.h diff --git a/ResearchKit/Common/ORKPlaybackButton.m b/ResearchKitUI/Common/Playback Button/ORKPlaybackButton.m similarity index 99% rename from ResearchKit/Common/ORKPlaybackButton.m rename to ResearchKitUI/Common/Playback Button/ORKPlaybackButton.m index aac6049b84..3aef671703 100644 --- a/ResearchKit/Common/ORKPlaybackButton.m +++ b/ResearchKitUI/Common/Playback Button/ORKPlaybackButton.m @@ -99,7 +99,6 @@ - (void)setupTextLabel { - (void)setTintColor:(UIColor *)tintColor { [super setTintColor:tintColor]; - _iconImageView.tintColor = tintColor; _textLabel.textColor = tintColor; } diff --git a/ResearchKit/Common/ORKPlaybackButton_Internal.h b/ResearchKitUI/Common/Playback Button/ORKPlaybackButton_Internal.h similarity index 100% rename from ResearchKit/Common/ORKPlaybackButton_Internal.h rename to ResearchKitUI/Common/Playback Button/ORKPlaybackButton_Internal.h diff --git a/ResearchKit/Common/ORKReviewIncompleteCell.h b/ResearchKitUI/Common/Review/ORKReviewIncompleteCell.h similarity index 100% rename from ResearchKit/Common/ORKReviewIncompleteCell.h rename to ResearchKitUI/Common/Review/ORKReviewIncompleteCell.h diff --git a/ResearchKit/Common/ORKReviewIncompleteCell.m b/ResearchKitUI/Common/Review/ORKReviewIncompleteCell.m similarity index 88% rename from ResearchKit/Common/ORKReviewIncompleteCell.m rename to ResearchKitUI/Common/Review/ORKReviewIncompleteCell.m index d4d83875b7..bd51d41fdf 100644 --- a/ResearchKit/Common/ORKReviewIncompleteCell.m +++ b/ResearchKitUI/Common/Review/ORKReviewIncompleteCell.m @@ -54,11 +54,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSStr - (void)setupView { cardView = [[UIView alloc] init]; cardView.translatesAutoresizingMaskIntoConstraints = NO; - if (@available(iOS 13.0, *)) { - cardView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; - } else { - cardView.backgroundColor = [UIColor whiteColor]; - } + cardView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; cardView.layer.cornerRadius = ORKCardDefaultCornerRadii; [self.contentView addSubview:cardView]; @@ -91,17 +87,9 @@ - (void)setText:(NSString *)text { - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { if (highlighted == YES) { - if (@available(iOS 13.0, *)) { - cardView.backgroundColor = [UIColor systemGray5Color]; - } else { - cardView.backgroundColor = [UIColor grayColor]; - } + cardView.backgroundColor = [UIColor systemGray5Color]; } else { - if (@available(iOS 13.0, *)) { - cardView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; - } else { - cardView.backgroundColor = [UIColor whiteColor]; - } + cardView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; } } diff --git a/ResearchKit/Common/ORKReviewViewController.h b/ResearchKitUI/Common/Review/ORKReviewViewController.h similarity index 100% rename from ResearchKit/Common/ORKReviewViewController.h rename to ResearchKitUI/Common/Review/ORKReviewViewController.h diff --git a/ResearchKit/Common/ORKReviewViewController.m b/ResearchKitUI/Common/Review/ORKReviewViewController.m similarity index 96% rename from ResearchKit/Common/ORKReviewViewController.m rename to ResearchKitUI/Common/Review/ORKReviewViewController.m index d23a3bc96c..a722efeca6 100644 --- a/ResearchKit/Common/ORKReviewViewController.m +++ b/ResearchKitUI/Common/Review/ORKReviewViewController.m @@ -88,7 +88,7 @@ - (instancetype)initWithTask:(ORKNavigableOrderedTask *)task delegate:(id #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKRingView.m b/ResearchKitUI/Common/Ring View/ORKRingView.m similarity index 94% rename from ResearchKit/Common/ORKRingView.m rename to ResearchKitUI/Common/Ring View/ORKRingView.m index 3e3123a11d..1a841441a1 100644 --- a/ResearchKit/Common/ORKRingView.m +++ b/ResearchKitUI/Common/Ring View/ORKRingView.m @@ -30,9 +30,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import UIKit; - #import "ORKRingView.h" +#import + const double ORKRingViewMinimumValue = 0.001; const double ORKRingViewMaximumValue = 1.0; @@ -41,7 +42,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const CGFloat RingLineWidth = 3.0; static const CGFloat CircleLineWidth = 3.0; - @implementation ORKRingView { CAShapeLayer *_circleLayer; CAShapeLayer *_backgroundLayer; @@ -110,7 +110,6 @@ - (CAShapeLayer *)filledCircleLayer { } - (void)setValue:(double)value { - if (value != _value) { double oldValue = _value; _value = value; @@ -132,11 +131,7 @@ - (void)setValue:(double)value { [_circleLayer removeFromSuperlayer]; _circleLayer = [self createShapeLayer]; _circleLayer.lineWidth = CircleLineWidth; - - if (@available(iOS 13.0, *)) { - _circleLayer.strokeColor = UIColor.systemGreenColor.CGColor; - } - + _circleLayer.strokeColor = UIColor.systemGreenColor.CGColor; [self.layer addSublayer:_circleLayer]; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"strokeStart"]; @@ -167,7 +162,6 @@ - (void)setValue:(double)value { }); } else { - if (value != ORKRingViewMaximumValue) { _backgroundLayer.fillColor = [UIColor clearColor].CGColor; [_filledCircleLayer removeFromSuperlayer]; @@ -183,7 +177,6 @@ - (void)setValue:(double)value WithColor:(nullable UIColor *)color { } - (void)setBackgroundLayerStrokeColor:(UIColor *)backgroundStrokeColor circleStrokeColor:(UIColor *)circleStrokeColor withAnimationDuration:(NSTimeInterval)animationDuration { - if (_backgroundLayer) { [CATransaction begin]; [CATransaction setAnimationDuration:(CFTimeInterval)animationDuration]; @@ -205,11 +198,16 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { [self resetLayerColors]; } +- (UIColor *)fetchSystemGrayColor { + return [UIColor colorWithDynamicProvider:^UIColor * _Nonnull(UITraitCollection * _Nonnull traits) { + return traits.userInterfaceStyle == UIUserInterfaceStyleDark ? UIColor.systemGray5Color : UIColor.systemGray6Color; + }]; +} + - (void)resetLayerColors { + _backgroundLayer.strokeColor = [UIColor ork_ringViewStrokeColor].CGColor; - if (@available(iOS 13.0, *)) { - _circleLayer.strokeColor = UIColor.systemGreenColor.CGColor; - } + _circleLayer.strokeColor = UIColor.systemGreenColor.CGColor; } - (void)fillRingWithDuration:(NSTimeInterval)duration { diff --git a/ResearchKit/Common/ORKBodyLabel.h b/ResearchKitUI/Common/Skin/ORKBodyLabel.h similarity index 96% rename from ResearchKit/Common/ORKBodyLabel.h rename to ResearchKitUI/Common/Skin/ORKBodyLabel.h index b3f653a2e0..30c449c60d 100644 --- a/ResearchKit/Common/ORKBodyLabel.h +++ b/ResearchKitUI/Common/Skin/ORKBodyLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKBodyLabel.m b/ResearchKitUI/Common/Skin/ORKBodyLabel.m similarity index 100% rename from ResearchKit/Common/ORKBodyLabel.m rename to ResearchKitUI/Common/Skin/ORKBodyLabel.m diff --git a/ResearchKit/Common/ORKBorderedButton.h b/ResearchKitUI/Common/Skin/ORKBorderedButton.h similarity index 93% rename from ResearchKit/Common/ORKBorderedButton.h rename to ResearchKitUI/Common/Skin/ORKBorderedButton.h index 35b200d3e9..ea2c320215 100644 --- a/ResearchKit/Common/ORKBorderedButton.h +++ b/ResearchKitUI/Common/Skin/ORKBorderedButton.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -47,12 +47,6 @@ typedef NS_ENUM(NSInteger, ORKBorderedButtonDisabledStyle) { ORK_CLASS_AVAILABLE -@interface CALayer (ORKCornerCurveContinuousCategory) - -- (void)setCornerCurveContinuous; -- (void)setCornerCurveCircular; - -@end @interface ORKBorderedButton : ORKTextButton diff --git a/ResearchKit/Common/ORKBorderedButton.m b/ResearchKitUI/Common/Skin/ORKBorderedButton.m similarity index 91% rename from ResearchKit/Common/ORKBorderedButton.m rename to ResearchKitUI/Common/Skin/ORKBorderedButton.m index b0b6962026..5d5cc55903 100644 --- a/ResearchKit/Common/ORKBorderedButton.m +++ b/ResearchKitUI/Common/Skin/ORKBorderedButton.m @@ -30,26 +30,23 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKBorderedButton.h" +#import "ORKBorderedButton_Internal.h" #import "ORKTextButton_Internal.h" -static const CGFloat ORKBorderedButtonCornerRadii = 14.0; @implementation CALayer (ORKCornerCurveContinuousCategory) - (void)setCornerCurveContinuous { - if (@available(iOS 13.0, *)) { - self.cornerCurve = kCACornerCurveContinuous; - } + self.cornerCurve = kCACornerCurveContinuous; } - (void)setCornerCurveCircular { - if (@available(iOS 13.0, *)) { - self.cornerCurve = kCACornerCurveCircular; - } + self.cornerCurve = kCACornerCurveCircular; } @end +static const CGFloat ORKBorderedButtonCornerRadii = 14.0; @implementation ORKBorderedButton { @@ -100,11 +97,7 @@ - (void)tintColorDidChange { // Always override the title color for ORKBorderedButtonDisabledStyleSystemGray if (_disabledButtonStyle == ORKBorderedButtonDisabledStyleSystemGray) { - if (@available(iOS 13.0, *)) { - [self setTitleColor:[UIColor tertiaryLabelColor] forState:UIControlStateDisabled]; - } else { - [self setTitleColor:[UIColor grayColor] forState:UIControlStateDisabled]; - } + [self setTitleColor:[UIColor tertiaryLabelColor] forState:UIControlStateDisabled]; } [self updateBackgroundColor]; @@ -122,7 +115,6 @@ - (void)setNormalTintColor:(UIColor *)normalTintColor { if (self.disabledButtonStyle == ORKBorderedButtonDisabledStyleDefault) { _disableTintColor = [normalTintColor colorWithAlphaComponent:0.3f]; } - [self updateBackgroundColor]; } @@ -180,11 +172,7 @@ - (void)updateBackgroundColor { } } else { if (self.disabledButtonStyle == ORKBorderedButtonDisabledStyleSystemGray) { - if (@available(iOS 13.0, *)) { - _disableTintColor = [UIColor tertiarySystemFillColor]; - } else { - _disableTintColor = [UIColor lightGrayColor]; - } + _disableTintColor = [UIColor tertiarySystemFillColor]; } self.backgroundColor = _disableTintColor; self.layer.borderColor = [_disableTintColor CGColor]; diff --git a/ResearchKitUI/Common/Skin/ORKBorderedButton_Internal.h b/ResearchKitUI/Common/Skin/ORKBorderedButton_Internal.h new file mode 100644 index 0000000000..439384bebe --- /dev/null +++ b/ResearchKitUI/Common/Skin/ORKBorderedButton_Internal.h @@ -0,0 +1,36 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +@interface CALayer (ORKCornerCurveContinuousCategory) + +- (void)setCornerCurveContinuous; +- (void)setCornerCurveCircular; + +@end diff --git a/ResearchKit/Common/ORKCaption1Label.h b/ResearchKitUI/Common/Skin/ORKCaption1Label.h similarity index 96% rename from ResearchKit/Common/ORKCaption1Label.h rename to ResearchKitUI/Common/Skin/ORKCaption1Label.h index 262e9984b7..104575ea8a 100644 --- a/ResearchKit/Common/ORKCaption1Label.h +++ b/ResearchKitUI/Common/Skin/ORKCaption1Label.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKCaption1Label.m b/ResearchKitUI/Common/Skin/ORKCaption1Label.m similarity index 100% rename from ResearchKit/Common/ORKCaption1Label.m rename to ResearchKitUI/Common/Skin/ORKCaption1Label.m diff --git a/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKColorChoice.h b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKColorChoice.h new file mode 100644 index 0000000000..1e8c7f8242 --- /dev/null +++ b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKColorChoice.h @@ -0,0 +1,43 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKChoiceViewCell.h" +#import "ORKAnswerFormat.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKChoiceViewCell (ORKColorChoice) + +- (void)configureWithColorChoice:(ORKColorChoice *)colorChoice + isLastItem:(BOOL)isLastItem; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKColorChoice.m b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKColorChoice.m new file mode 100644 index 0000000000..ad75704da3 --- /dev/null +++ b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKColorChoice.m @@ -0,0 +1,46 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKChoiceViewCell+ORKColorChoice.h" + +@implementation ORKChoiceViewCell (ORKColorChoice) + +- (void)configureWithColorChoice:(nonnull ORKColorChoice *)colorChoice isLastItem:(BOOL)isLastItem { + [self setSwatchColor:colorChoice.color]; + self.shouldIgnoreDarkMode = YES; + + self.isExclusive = colorChoice.exclusive;; + self.isLastItem = isLastItem; + self.immediateNavigation = NO; + [self setPrimaryText:colorChoice.text]; + [self setDetailText:colorChoice.detailText]; +} + +@end diff --git a/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKTextChoice.h b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKTextChoice.h new file mode 100644 index 0000000000..0d17eb64bd --- /dev/null +++ b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKTextChoice.h @@ -0,0 +1,43 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKChoiceViewCell.h" +#import "ORKTextChoiceCellGroup.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKChoiceViewCell (ORKTextChoice) + +- (void)configureWithTextChoice:(ORKTextChoice *)textChoice + isLastItem:(BOOL)isLastItem; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKTextChoice.m b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKTextChoice.m new file mode 100644 index 0000000000..d377c3bcab --- /dev/null +++ b/ResearchKitUI/Common/Skin/ORKChoiceViewCell+ORKTextChoice.m @@ -0,0 +1,52 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKChoiceViewCell+ORKTextChoice.h" + +@implementation ORKChoiceViewCell (ORKTextChoice) + +- (void)configureWithTextChoice:(ORKTextChoice *)textChoice + isLastItem:(BOOL)isLastItem { + if (textChoice.primaryTextAttributedString) { + [self setPrimaryAttributedText:textChoice.primaryTextAttributedString]; + } + if (textChoice.detailTextAttributedString) { + [self setDetailAttributedText:textChoice.detailTextAttributedString]; + } + + self.isExclusive = textChoice.exclusive;; + self.isLastItem = isLastItem; + self.immediateNavigation = NO; + [self setPrimaryText:textChoice.text]; + [self setDetailText:textChoice.detailText]; + [self setTextChoiceImage:textChoice.image]; +} + +@end diff --git a/ResearchKit/Common/ORKChoiceViewCell.h b/ResearchKitUI/Common/Skin/ORKChoiceViewCell.h similarity index 90% rename from ResearchKit/Common/ORKChoiceViewCell.h rename to ResearchKitUI/Common/Skin/ORKChoiceViewCell.h index d375c85b92..3103d521aa 100644 --- a/ResearchKit/Common/ORKChoiceViewCell.h +++ b/ResearchKitUI/Common/Skin/ORKChoiceViewCell.h @@ -29,12 +29,12 @@ */ -@import UIKit; +#import #import - NS_ASSUME_NONNULL_BEGIN @class ORKAnswerTextView; +@class ORKTextChoiceOther; @interface ORKChoiceViewCell : UITableViewCell @@ -50,8 +50,13 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) BOOL isExclusive; +@property (nonatomic) BOOL shouldIgnoreDarkMode; + @property (nonatomic) ORKCardViewStyle cardViewStyle; + +- (void)setTextChoiceImage:(UIImage *)image; +- (void)setSwatchColor:(UIColor *)swatchColor; - (void)setPrimaryText:(NSString *)primaryText; - (void)setPrimaryAttributedText: (NSAttributedString *)primaryAttributedText; - (void)setDetailText:(NSString *)detailText; @@ -66,6 +71,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign, setter=hideTextView:) BOOL textViewHidden; +- (void)setupWithText:(NSString *)text + placeholderText:(NSString *)placeholderText; @end @interface ORKChoiceViewPlatterCell : ORKChoiceViewCell diff --git a/ResearchKitUI/Common/Skin/ORKChoiceViewCell.m b/ResearchKitUI/Common/Skin/ORKChoiceViewCell.m new file mode 100644 index 0000000000..6ebfd72930 --- /dev/null +++ b/ResearchKitUI/Common/Skin/ORKChoiceViewCell.m @@ -0,0 +1,865 @@ +/* + Copyright (c) 2015, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import "ORKChoiceViewCell_Internal.h" + +#import "ORKSelectionTitleLabel.h" +#import "ORKSelectionSubTitleLabel.h" + +#import "ORKAccessibility.h" +#import "ORKHelpers_Internal.h" +#import "ORKAnswerTextView.h" +#import "ORKSkin.h" +#import "ORKCheckmarkView.h" + +static const CGFloat CardTopBottomMargin = 2.0; +static const CGFloat LabelTopBottomMargin = 14.0; +static const CGFloat LabelTopBottomMarginWithColorSwatch = 18.0; +static const CGFloat TextViewTopMargin = 20.0; +static const CGFloat TextViewHeight = 100.0; +static const CGFloat LabelCheckViewPadding = 10.0; +static const CGFloat ColorSwatchViewHeightWidth = 40.0; +static const CGFloat ColorSwatchViewTopBottomPadding = 12.0; +static const CGFloat ColorSwatchExpandedRightPadding = 16.0; + +@interface ORKChoiceViewCell() + +@property (nonatomic) UIView *containerView; +@property (nonatomic) UIImageView *textChoiceImageView; +@property (nonatomic) UIView *colorSwatchView; +@property (nonatomic) ORKSelectionTitleLabel *primaryLabel; +@property (nonatomic) ORKSelectionSubTitleLabel *detailLabel; +@property (nonatomic) ORKCheckmarkView *checkView; +@property (nonatomic) NSMutableArray *containerConstraints; +@property (nonatomic, readonly) CGFloat leftRightMargin; +@property (nonatomic, readonly) CGFloat intraCellSpacing; + +@end + +@implementation ORKChoiceViewCell { + + CGFloat _topBottomMargin; + CAShapeLayer *_contentMaskLayer; + UIColor *_fillColor; + CAShapeLayer *_foreLayer; + CAShapeLayer *_animationLayer; + CGRect _foreLayerBounds; +} + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + self.clipsToBounds = YES; + _topBottomMargin = 0.0; + [self setupContainerView]; + [self setupCheckView]; + } + return self; +} + +- (void)drawRect:(CGRect)rect { + [super drawRect:rect]; + [self setMaskLayers]; +} + +- (CGFloat)leftRightMargin { + return self.useCardView ? ORKCardLeftRightMarginForWindow(self.window) : 0.0; +} + +- (CGFloat)intraCellSpacing { + return 0; +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + [super traitCollectionDidChange:previousTraitCollection]; + _fillColor = [self __fillColor]; +} + +- (void)clearLayerIfNeeded:(CALayer *)layer { + + if (layer) { + for (CALayer *sublayer in [layer.sublayers mutableCopy]) { + [sublayer removeFromSuperlayer]; + } + + [layer removeFromSuperlayer]; + layer = nil; + } +} + +- (UIColor *)__fillColor { + + if (_shouldIgnoreDarkMode) { + return [UIColor whiteColor]; + } + + UIColor *color = [UIColor secondarySystemGroupedBackgroundColor];; + + if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) { + color = [UIColor colorWithRed:0.173 green:0.173 blue:0.180 alpha:1.0]; + } + + return color; +} + +- (UIColor *)__borderColor { + return UIColor.separatorColor; +} + +- (UIRectCorner)roundedCorners { + + if (_isLastItem && !_isFirstItemInSectionWithoutTitle) { + + return UIRectCornerBottomLeft | UIRectCornerBottomRight; + + } else if (!_isLastItem && _isFirstItemInSectionWithoutTitle) { + + return UIRectCornerTopLeft | UIRectCornerTopRight; + + } else { + + return UIRectCornerAllCorners; + } +} + +- (BOOL)shouldApplyMaskLayers { + return _isLastItem || _isFirstItemInSectionWithoutTitle; +} + +- (void)setMaskLayers { + + if (_useCardView && !_animationLayer) { + + UIColor *borderColor = [self __borderColor]; + _fillColor = [self __fillColor]; + + [self clearLayerIfNeeded:_contentMaskLayer]; + _contentMaskLayer = [[CAShapeLayer alloc] init]; + [_contentMaskLayer setFillColor:[_fillColor CGColor]]; + + [self clearLayerIfNeeded:_foreLayer]; + _foreLayer = [CAShapeLayer layer]; + [_foreLayer setFillColor:[_fillColor CGColor]]; + _foreLayer.zPosition = 0.0f; + + if ([self shouldApplyMaskLayers]) { + + UIRectCorner rectCorners = [self roundedCorners]; + + _foreLayerBounds = CGRectMake(ORKCardDefaultBorderWidth, 0, self.containerView.bounds.size.width - 2 * ORKCardDefaultBorderWidth, self.containerView.bounds.size.height - ORKCardDefaultBorderWidth); + + CGFloat foreLayerCornerRadii = ORKCardDefaultCornerRadii >= ORKCardDefaultBorderWidth ? ORKCardDefaultCornerRadii - ORKCardDefaultBorderWidth : ORKCardDefaultCornerRadii; + + _foreLayer.path = [UIBezierPath bezierPathWithRoundedRect: _foreLayerBounds + byRoundingCorners: rectCorners + cornerRadii: (CGSize){foreLayerCornerRadii, foreLayerCornerRadii}].CGPath; + + _contentMaskLayer.path = [UIBezierPath bezierPathWithRoundedRect: self.containerView.bounds + byRoundingCorners:rectCorners + cornerRadii: (CGSize){ORKCardDefaultCornerRadii, ORKCardDefaultCornerRadii}].CGPath; + } else { + + _foreLayerBounds = CGRectMake(ORKCardDefaultBorderWidth, 0, self.containerView.bounds.size.width - 2 * ORKCardDefaultBorderWidth, self.containerView.bounds.size.height); + _foreLayer.path = [UIBezierPath bezierPathWithRect:_foreLayerBounds].CGPath; + _contentMaskLayer.path = [UIBezierPath bezierPathWithRect:self.containerView.bounds].CGPath; + } + + if (_cardViewStyle == ORKCardViewStyleBordered) { + _contentMaskLayer.fillColor = borderColor.CGColor; + } + + [_contentMaskLayer addSublayer:_foreLayer]; + + [_contentMaskLayer addSublayer:[self lineLayer]]; + + [_containerView.layer insertSublayer:_contentMaskLayer atIndex:0]; + } +} + +- (nullable CAShapeLayer *)lineLayer { + CAShapeLayer *lineLayer = [CAShapeLayer layer]; + if (!_isLastItem) { + CGRect lineBounds = CGRectMake(ORKSurveyItemMargin, self.containerView.bounds.size.height - 1.0, self.containerView.bounds.size.width - ORKSurveyItemMargin, 0.5); + lineLayer.path = [UIBezierPath bezierPathWithRect:lineBounds].CGPath; + lineLayer.zPosition = 0.0f; + } + lineLayer.fillColor = [self __borderColor].CGColor; + + return lineLayer; +} + +- (void)setupContainerView { + if (!_containerView) { + _containerView = [UIView new]; + _containerView.translatesAutoresizingMaskIntoConstraints = NO; + } + [self.contentView addSubview:_containerView]; +} + +- (void)addContainerViewToSelfConstraints { + [_containerConstraints addObjectsFromArray:@[ + [NSLayoutConstraint constraintWithItem:_containerView + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:self.contentView + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:0], + [NSLayoutConstraint constraintWithItem:_containerView + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:self.contentView + attribute:NSLayoutAttributeLeft + multiplier:1.0 + constant:self.leftRightMargin], + [NSLayoutConstraint constraintWithItem:_containerView + attribute:NSLayoutAttributeRight + relatedBy:NSLayoutRelationEqual + toItem:self.contentView + attribute:NSLayoutAttributeRight + multiplier:1.0 + constant:-self.leftRightMargin], + [NSLayoutConstraint constraintWithItem:_containerView + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:self.contentView + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:-self.intraCellSpacing], + ]]; +} + +- (void)addLeftContentViewToContainerViewConstraints { + UIView *leftContentView = [self getLeftContentView]; + + if (leftContentView) { + + [_containerConstraints addObject:[leftContentView.leadingAnchor constraintEqualToAnchor:_containerView.leadingAnchor constant:ORKSurveyItemMargin]]; + + [_containerConstraints addObject:[leftContentView.centerYAnchor constraintEqualToAnchor:_containerView.centerYAnchor]]; + [_containerConstraints addObject:[leftContentView.heightAnchor constraintEqualToConstant:ColorSwatchViewHeightWidth]]; + + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:leftContentView + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:ColorSwatchViewTopBottomPadding]]; + + if (!_primaryLabel && !_detailLabel) { + [_containerConstraints addObject:[leftContentView.topAnchor constraintEqualToAnchor:_containerView.topAnchor constant:LabelTopBottomMargin]]; + [_containerConstraints addObject:[leftContentView.trailingAnchor constraintEqualToAnchor:_checkView.leadingAnchor constant:-ColorSwatchExpandedRightPadding]]; + } else if (leftContentView) { + [_containerConstraints addObject:[leftContentView.widthAnchor constraintEqualToConstant:ColorSwatchViewHeightWidth]]; + } + } +} + +- (void)addPrimaryLabelToContainerViewConstraints { + if (_primaryLabel) { + UIView *leftContentView = [self getLeftContentView]; + + if (leftContentView) { + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeCenterY + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeCenterY + multiplier:1.0 + constant:0.0]]; + } else { + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:LabelTopBottomMargin]]; + } + + if (_colorSwatchView) { + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeCenterY + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeCenterY + multiplier:1.0 + constant:0.0]]; + } else { + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:LabelTopBottomMargin]]; + } + + if (_colorSwatchView) { + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeCenterY + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeCenterY + multiplier:1.0 + constant:0.0]]; + } else { + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:LabelTopBottomMargin]]; + } + + [_containerConstraints addObjectsFromArray:@[ + [NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeTrailing + relatedBy:NSLayoutRelationEqual + toItem:_checkView + attribute:NSLayoutAttributeLeading + multiplier:1.0 + constant:-LabelCheckViewPadding], + [NSLayoutConstraint constraintWithItem:_primaryLabel + attribute:NSLayoutAttributeLeading + relatedBy:NSLayoutRelationEqual + toItem:leftContentView ?: _containerView + attribute:leftContentView ? NSLayoutAttributeTrailing : NSLayoutAttributeLeading + multiplier:1.0 + constant:ORKSurveyItemMargin] + ]]; + } +} + +- (void)addDetailLabelConstraints { + if (_detailLabel) { + [_containerConstraints addObjectsFromArray:@[ + [NSLayoutConstraint constraintWithItem:_detailLabel + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:_primaryLabel ?: _containerView + attribute:_primaryLabel ? NSLayoutAttributeBottom : NSLayoutAttributeTop + multiplier:1.0 + constant:_primaryLabel ? 0.0 : LabelTopBottomMargin], + [NSLayoutConstraint constraintWithItem:_detailLabel + attribute:NSLayoutAttributeTrailing + relatedBy:NSLayoutRelationEqual + toItem:_checkView + attribute:NSLayoutAttributeLeading + multiplier:1.0 + constant:-LabelCheckViewPadding], + [NSLayoutConstraint constraintWithItem:_detailLabel + attribute:NSLayoutAttributeLeading + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeLeading + multiplier:1.0 + constant:ORKSurveyItemMargin] + ]]; + } +} + +- (void)addContainerViewBottomConstraint { + UIView *bottomMostView = _detailLabel ?: _primaryLabel; + UIView *leftContentView = [self getLeftContentView]; + + // only use extra margin if the primary or detail label have been initialized + CGFloat bottomMargin = (leftContentView && bottomMostView) ? LabelTopBottomMarginWithColorSwatch : LabelTopBottomMargin; + + if (leftContentView) { + bottomMostView = leftContentView; + bottomMargin = ColorSwatchViewTopBottomPadding; + } + + [_containerConstraints addObject:[NSLayoutConstraint constraintWithItem:_containerView + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:bottomMostView + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:bottomMargin]]; +} + +- (void)setupConstraints { + if (!_primaryLabel && !_detailLabel && !_colorSwatchView) { + return; + } + + if (_containerConstraints) { + [NSLayoutConstraint deactivateConstraints:_containerConstraints]; + } + + _containerConstraints = [[NSMutableArray alloc] init]; + [self addContainerViewToSelfConstraints]; + [self addLeftContentViewToContainerViewConstraints]; + [self addPrimaryLabelToContainerViewConstraints]; + [self addDetailLabelConstraints]; + [self addCheckViewToContainerViewConstraints]; + [self addContainerViewBottomConstraint]; + + [NSLayoutConstraint activateConstraints:_containerConstraints]; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + [self updateSelectedItem]; + [self setMaskLayers]; + [self setPrimaryLabelFont]; +} + +- (void)prepareForReuse { + _primaryLabel.text = nil; + _detailLabel.text = nil; + + if (_textChoiceImageView) { + [_textChoiceImageView removeFromSuperview]; + _textChoiceImageView = nil; + } + + if (_colorSwatchView) { + [_colorSwatchView removeFromSuperview]; + _colorSwatchView = nil; + } + [NSLayoutConstraint deactivateConstraints:_containerConstraints]; + [_containerConstraints removeAllObjects]; + // [choiceViewCell setCellSelected:NO highlight:NO]; + [super prepareForReuse]; +} + +- (void)setUseCardView:(bool)useCardView { + _useCardView = useCardView; + _topBottomMargin = CardTopBottomMargin; + [self setBackgroundColor:[UIColor clearColor]]; + self.selectionStyle = UITableViewCellSelectionStyleNone; + [self setupConstraints]; +} + +- (void)tintColorDidChange { + [super tintColorDidChange]; + [self updateSelectedItem]; +} + +- (void)updateSelectedItem { + [self updateCheckView]; +} + +- (void)setImmediateNavigation:(BOOL)immediateNavigation { + _immediateNavigation = immediateNavigation; +} + +- (void)setCellSelected:(BOOL)cellSelected highlight:(BOOL)highlight { + _cellSelected = cellSelected; + [self updateSelectedItem]; + + if (highlight) + { + + _animationLayer = [CAShapeLayer layer]; + [_animationLayer setOpaque:NO]; + _animationLayer.zPosition = 1.0f; + + if ([self shouldApplyMaskLayers]) { + UIRectCorner rectCorners = [self roundedCorners]; + + CGFloat animationLayerCornerRadii = ORKCardDefaultCornerRadii >= ORKCardDefaultBorderWidth ? ORKCardDefaultCornerRadii - ORKCardDefaultBorderWidth : ORKCardDefaultCornerRadii; + + _animationLayer.path = [UIBezierPath bezierPathWithRoundedRect: _foreLayerBounds + byRoundingCorners: rectCorners + cornerRadii: (CGSize){animationLayerCornerRadii, animationLayerCornerRadii}].CGPath; + + _animationLayer.fillColor = UIColor.clearColor.CGColor; + } + + _animationLayer.frame = CGRectMake(_foreLayerBounds.origin.x, _foreLayerBounds.origin.y, _foreLayerBounds.size.width, _foreLayerBounds.size.height - 1.0); + + [_contentMaskLayer addSublayer:_animationLayer]; + + NSString *animationKeyPath = [self shouldApplyMaskLayers] ? @"fillColor" : @"backgroundColor"; + CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:animationKeyPath]; + + if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleLight){ + animation.fromValue = (__bridge id _Nullable)(UIColor.systemGray5Color.CGColor); + } else { + animation.fromValue = (__bridge id _Nullable)(UIColor.systemGray3Color.CGColor); + } + + animation.toValue = (__bridge id _Nullable)(_fillColor.CGColor); + animation.beginTime = 0.0; + animation.duration = 0.45; + animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + animation.removedOnCompletion = YES; + animation.delegate = self; + + [_animationLayer addAnimation:animation forKey:animationKeyPath]; + } +} + +- (void)setupTextChoiceImageView { + if (!_textChoiceImageView) { + _textChoiceImageView = [UIImageView new]; + _textChoiceImageView.contentMode = UIViewContentModeScaleToFill; + _textChoiceImageView.translatesAutoresizingMaskIntoConstraints = NO; + + [_containerView addSubview:_textChoiceImageView]; + } +} + +- (void)setupColorSwatchView { + if (!_colorSwatchView) { + _colorSwatchView = [UIView new]; + _colorSwatchView.clipsToBounds = YES; + _colorSwatchView.layer.cornerRadius = 4.0; + _colorSwatchView.translatesAutoresizingMaskIntoConstraints = NO; + + [_containerView addSubview:_colorSwatchView]; + } +} + +- (nullable UIView *)getLeftContentView { + if (_textChoiceImageView) { + return _textChoiceImageView; + } else if (_colorSwatchView) { + return _colorSwatchView; + } + + return nil; +} + +- (void)setupPrimaryLabel { + if (!_primaryLabel) { + _primaryLabel = [ORKSelectionTitleLabel new]; + _primaryLabel.numberOfLines = 0; + _primaryLabel.textColor = _shouldIgnoreDarkMode ? [UIColor blackColor] : [UIColor labelColor]; + + [self.containerView addSubview:_primaryLabel]; + [self setPrimaryLabelFont]; + _primaryLabel.translatesAutoresizingMaskIntoConstraints = NO; + [self setupConstraints]; + } +} + +- (void)setupDetailLabel { + if (!_detailLabel) { + _detailLabel = [ORKSelectionSubTitleLabel new]; + _detailLabel.numberOfLines = 0; + _detailLabel.textColor = [UIColor ork_darkGrayColor]; + [self.containerView addSubview:_detailLabel]; + _detailLabel.translatesAutoresizingMaskIntoConstraints = NO; + [self setupConstraints]; + } +} + +- (void)setupCheckView { + if (!_checkView) { + _checkView = [[ORKCheckmarkView alloc] initWithDefaults]; + } + + [_checkView setChecked:NO]; + [self.containerView addSubview:_checkView]; +} + +- (void)addCheckViewToContainerViewConstraints { + if (_checkView) { + _checkView.translatesAutoresizingMaskIntoConstraints = NO; + [_containerConstraints addObjectsFromArray:@[ + [NSLayoutConstraint constraintWithItem:_checkView + attribute:NSLayoutAttributeCenterY + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeCenterY + multiplier:1.0 + constant:0.0], + [NSLayoutConstraint constraintWithItem:_checkView + attribute:NSLayoutAttributeTrailing + relatedBy:NSLayoutRelationEqual + toItem:_containerView + attribute:NSLayoutAttributeTrailing + multiplier:1.0 + constant:-ORKSurveyItemMargin] + ]]; + } +} + +- (void)setShouldIgnoreDarkMode:(BOOL)shouldIgnoreDarkMode { + _shouldIgnoreDarkMode = shouldIgnoreDarkMode; + + if (_checkView) { + _checkView.shouldIgnoreDarkMode = shouldIgnoreDarkMode; + } +} + +- (void)setTextChoiceImage:(UIImage *)image { + if (image && !_colorSwatchView) { + [self setupTextChoiceImageView]; + + [_textChoiceImageView setImage:image]; + } +} + +- (void)setSwatchColor:(UIColor *)swatchColor { + if (swatchColor && !_textChoiceImageView) { + [self setupColorSwatchView]; + _colorSwatchView.backgroundColor = swatchColor; + } +} + +- (void)setPrimaryText:(NSString *)primaryText { + if (primaryText) { + [self setupPrimaryLabel]; + _primaryLabel.text = primaryText; + } +} + +- (void)setPrimaryAttributedText:(NSAttributedString *)primaryAttributedText { + if (primaryAttributedText) { + [self setupPrimaryLabel]; + _primaryLabel.attributedText = primaryAttributedText; + } +} + +- (void)setDetailText:(NSString *)detailText { + if (detailText) { + [self setupDetailLabel]; + _detailLabel.text = detailText; + } +} + +- (void)setDetailAttributedText:(NSAttributedString *)detailAttributedText { + if (detailAttributedText) { + [self setupDetailLabel]; + _detailLabel.attributedText = detailAttributedText; + } +} + +- (void)setPrimaryLabelFont { + if (!_primaryLabel.attributedText) { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; + [_primaryLabel setFont:[UIFont fontWithDescriptor:descriptor size:[[descriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]]; + } +} + +- (void)updateCheckView { + if (_checkView) { + _checkView.tintColor = self.tintColor; + [_checkView setChecked:_cellSelected]; + } +} + + +#pragma mark - Accessibility + +- (NSString *)accessibilityLabel { + return ORKAccessibilityStringForVariables(_primaryLabel.accessibilityLabel, _detailLabel.accessibilityLabel); +} + +- (UIAccessibilityTraits)accessibilityTraits { + return UIAccessibilityTraitButton | (self.isCellSelected ? UIAccessibilityTraitSelected : 0); +} + +- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated { + [super setHighlighted:highlighted + animated:animated]; + + if (highlighted) { + [_foreLayer setFillColor:UIColor.systemGray5Color.CGColor]; + } + else { + _foreLayer.fillColor = _fillColor.CGColor; + } +} + +#pragma mark - Animation Delegate + +- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { + [_animationLayer removeFromSuperlayer]; + _animationLayer = nil; + [self setMaskLayers]; +} + +@end + + +@implementation ORKChoiceOtherViewCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style + reuseIdentifier:(NSString *)reuseIdentifier { + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + _textViewHidden = NO; + [self setupAnswerTextView]; + return self; +} + +- (void)setupAnswerTextView { + if (!_textView) { + _textView = [[ORKAnswerTextView alloc] init]; + _textView.delegate = self; + _textView.translatesAutoresizingMaskIntoConstraints = NO; + _textView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; + [self.containerView addSubview:_textView]; + [self updateTextView]; + } +} + +- (void)hideTextView:(BOOL)textViewHidden { + _textViewHidden = textViewHidden; + [self updateTextView]; + [self setupConstraints]; +} + +- (void)setupWithText:(NSString *)text + placeholderText:(NSString *)placeholderText { + self.textView.placeholder = placeholderText; + self.textView.text = text; + BOOL hideTextView = YES; + + if (self.isCellSelected) { + hideTextView = NO; + } else { + hideTextView = self.textView.text.length == 0; + } + + [self hideTextView:hideTextView]; +} + +- (void)updateTextView { + [self.textView setHidden:_textViewHidden]; +} + +- (void)addOtherAnswerTextViewConstraints { + + NSLayoutConstraint *textViewHeightConstraint = [NSLayoutConstraint constraintWithItem:_textView + attribute:NSLayoutAttributeHeight + relatedBy:NSLayoutRelationEqual + toItem:nil + attribute:NSLayoutAttributeNotAnAttribute + multiplier:1.0 + constant:MAX(_textView.font.pointSize, TextViewHeight)]; + textViewHeightConstraint.priority = UILayoutPriorityDefaultLow; + + [self.containerConstraints addObjectsFromArray:@[ + [NSLayoutConstraint constraintWithItem:_textView + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:self.detailLabel ?: self.primaryLabel + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:TextViewTopMargin], + [NSLayoutConstraint constraintWithItem:_textView + attribute:NSLayoutAttributeTrailing + relatedBy:NSLayoutRelationEqual + toItem:self.checkView + attribute:NSLayoutAttributeLeading + multiplier:1.0 + constant:-LabelCheckViewPadding], + [NSLayoutConstraint constraintWithItem:_textView + attribute:NSLayoutAttributeLeading + relatedBy:NSLayoutRelationEqual + toItem:self.containerView + attribute:NSLayoutAttributeLeading + multiplier:1.0 + constant:ORKSurveyItemMargin], + textViewHeightConstraint, + [NSLayoutConstraint constraintWithItem:self.containerView + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:_textView + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:LabelTopBottomMargin] + ]]; +} + +// Overriding ContainerView Bottom Constraints +- (void)addContainerViewBottomConstraint { + if (_textViewHidden) { + [super addContainerViewBottomConstraint]; + } + else { + [self addOtherAnswerTextViewConstraints]; + } +} + +- (void)setMaskLayers { + [super setMaskLayers]; + _textView.layer.borderWidth = 0.25; + [_textView.layer setBorderColor:[UIColor lightGrayColor].CGColor]; + _textView.layer.cornerRadius = 10.0; +} + +# pragma mark - UITextViewDelegate + +- (BOOL)textViewShouldBeginEditing:(UITextView *)textView { + if (self.delegate && [self.delegate respondsToSelector:@selector(textChoiceOtherCellDidBecomeFirstResponder:)]) { + [self.delegate textChoiceOtherCellDidBecomeFirstResponder:self]; + } + + return YES; +} + +- (void)textViewDidChange:(UITextView *)textView { + if (self.delegate && [self.delegate respondsToSelector:@selector(textChoiceOtherCellDidChangeText:choiceOtherCell:)]) { + [self.delegate textChoiceOtherCellDidChangeText:textView.text choiceOtherCell:self]; + } +} + +- (void)textViewDidEndEditing:(UITextView *)textView { + if (self.delegate && [self.delegate respondsToSelector:@selector(textChoiceOtherCellDidResignFirstResponder:)]) { + [self.delegate textChoiceOtherCellDidResignFirstResponder:self]; + } +} + +@end + +#pragma mark - ORKChoiceViewPlatterCell + +@implementation ORKChoiceViewPlatterCell + +#pragma mark - ORKTextChoiceCell Overrides + +- (BOOL)shouldApplyMaskLayers { + return YES; +} + +- (UIRectCorner)roundedCorners { + return UIRectCornerAllCorners; +} + +- (CGFloat)intraCellSpacing { + return 10; +} + +- (nullable CAShapeLayer *)lineLayer { + return nil; +} + +@end diff --git a/ResearchKit/Common/ORKChoiceViewCell_Internal.h b/ResearchKitUI/Common/Skin/ORKChoiceViewCell_Internal.h similarity index 92% rename from ResearchKit/Common/ORKChoiceViewCell_Internal.h rename to ResearchKitUI/Common/Skin/ORKChoiceViewCell_Internal.h index 81b2bf45a5..b2ca2e1313 100644 --- a/ResearchKit/Common/ORKChoiceViewCell_Internal.h +++ b/ResearchKitUI/Common/Skin/ORKChoiceViewCell_Internal.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -38,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)textChoiceOtherCellDidBecomeFirstResponder:(ORKChoiceOtherViewCell *)choiceOtherViewCell; - (void)textChoiceOtherCellDidResignFirstResponder:(ORKChoiceOtherViewCell *)choiceOtherViewCell; +- (void)textChoiceOtherCellDidChangeText:(NSString *)text choiceOtherCell:(ORKChoiceOtherViewCell *)choiceOtherViewCell; @end diff --git a/ResearchKit/Common/ORKContinueButton.h b/ResearchKitUI/Common/Skin/ORKContinueButton.h similarity index 96% rename from ResearchKit/Common/ORKContinueButton.h rename to ResearchKitUI/Common/Skin/ORKContinueButton.h index bcb2667de0..063836c0b2 100644 --- a/ResearchKit/Common/ORKContinueButton.h +++ b/ResearchKitUI/Common/Skin/ORKContinueButton.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKContinueButton.m b/ResearchKitUI/Common/Skin/ORKContinueButton.m similarity index 79% rename from ResearchKit/Common/ORKContinueButton.m rename to ResearchKitUI/Common/Skin/ORKContinueButton.m index 3464013e32..e251806044 100644 --- a/ResearchKit/Common/ORKContinueButton.m +++ b/ResearchKitUI/Common/Skin/ORKContinueButton.m @@ -32,11 +32,14 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKContinueButton.h" #import "ORKSkin.h" - +#import "ORKAccessibilityFunctions.h" static const CGFloat ContinueButtonTouchMargin = 10; static const CGFloat ContinueButtonHeight = 50.0; +static NSString *accessibilityIdentifierDone = @"ORKContinueButton.Done"; +static NSString *accessibilityIdentifierNext = @"ORKContinueButton.Next"; + @implementation ORKContinueButton { NSLayoutConstraint *_heightConstraint; } @@ -45,18 +48,25 @@ - (instancetype)initWithTitle:(NSString *)title isDoneButton:(BOOL)isDoneButton self = [super init]; if (self) { [self setTitle:title forState:UIControlStateNormal]; + if (isDoneButton) { + self.accessibilityIdentifier = accessibilityIdentifierDone; + } else { + self.accessibilityIdentifier = accessibilityIdentifierNext; + } self.isDoneButton = isDoneButton; self.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; - - [self setUpConstraints]; + self.titleLabel.numberOfLines = 0; + self.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + self.titleLabel.textAlignment = NSTextAlignmentCenter; } return self; } -- (void)setUpConstraints { +- (void)updateConstraints { + [super updateConstraints]; _heightConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeHeight - relatedBy:NSLayoutRelationEqual + relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 @@ -64,6 +74,15 @@ - (void)setUpConstraints { _heightConstraint.active = YES; } +- (CGSize)intrinsicContentSize { + return self.titleLabel.intrinsicContentSize; +} + +- (void)layoutSubviews { + [super layoutSubviews]; + self.titleLabel.preferredMaxLayoutWidth = self.titleLabel.frame.size.width; +} + - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { CGRect outsetRect = UIEdgeInsetsInsetRect(self.bounds, (UIEdgeInsets){-ContinueButtonTouchMargin, diff --git a/ResearchKit/Common/ORKCountdownLabel.h b/ResearchKitUI/Common/Skin/ORKCountdownLabel.h similarity index 96% rename from ResearchKit/Common/ORKCountdownLabel.h rename to ResearchKitUI/Common/Skin/ORKCountdownLabel.h index 174f767df2..bdcba9a5ed 100644 --- a/ResearchKit/Common/ORKCountdownLabel.h +++ b/ResearchKitUI/Common/Skin/ORKCountdownLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKCountdownLabel.m b/ResearchKitUI/Common/Skin/ORKCountdownLabel.m similarity index 100% rename from ResearchKit/Common/ORKCountdownLabel.m rename to ResearchKitUI/Common/Skin/ORKCountdownLabel.m diff --git a/ResearchKit/Common/ORKDefaultFont.h b/ResearchKitUI/Common/Skin/ORKDefaultFont.h similarity index 100% rename from ResearchKit/Common/ORKDefaultFont.h rename to ResearchKitUI/Common/Skin/ORKDefaultFont.h diff --git a/ResearchKit/Common/ORKDirectionView.h b/ResearchKitUI/Common/Skin/ORKDirectionView.h similarity index 98% rename from ResearchKit/Common/ORKDirectionView.h rename to ResearchKitUI/Common/Skin/ORKDirectionView.h index dfbebafe77..87e62067e4 100644 --- a/ResearchKit/Common/ORKDirectionView.h +++ b/ResearchKitUI/Common/Skin/ORKDirectionView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import #import diff --git a/ResearchKit/Common/ORKDirectionView.m b/ResearchKitUI/Common/Skin/ORKDirectionView.m similarity index 100% rename from ResearchKit/Common/ORKDirectionView.m rename to ResearchKitUI/Common/Skin/ORKDirectionView.m diff --git a/ResearchKit/Common/ORKDontKnowButton.h b/ResearchKitUI/Common/Skin/ORKDontKnowButton.h similarity index 98% rename from ResearchKit/Common/ORKDontKnowButton.h rename to ResearchKitUI/Common/Skin/ORKDontKnowButton.h index 742eb6db87..640d973247 100644 --- a/ResearchKit/Common/ORKDontKnowButton.h +++ b/ResearchKitUI/Common/Skin/ORKDontKnowButton.h @@ -28,8 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; - +#import #import #import diff --git a/ResearchKit/Common/ORKDontKnowButton.m b/ResearchKitUI/Common/Skin/ORKDontKnowButton.m similarity index 83% rename from ResearchKit/Common/ORKDontKnowButton.m rename to ResearchKitUI/Common/Skin/ORKDontKnowButton.m index 08cd21e546..d1e3bd618d 100644 --- a/ResearchKit/Common/ORKDontKnowButton.m +++ b/ResearchKitUI/Common/Skin/ORKDontKnowButton.m @@ -31,6 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKDontKnowButton.h" #import "ORKHelpers_Internal.h" #import "ORKBorderedButton.h" +#import "ORKBorderedButton_Internal.h" #import "ORKCheckmarkView.h" #import "ORKSkin.h" #import "ORKLabel.h" @@ -171,30 +172,26 @@ - (void)setButtonConstraintsStandard { _constraints = [NSMutableArray new]; [self updateAppearance]; + + if (_active) { + UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithScale:UIImageSymbolScaleSmall]; + UIImage *checkMarkImage = [UIImage systemImageNamed:@"checkmark.circle.fill" withConfiguration:imageConfig]; + UIImage *tintedCheckMarkImage = [checkMarkImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - if (@available(iOS 13.0, *)) { - - if (_active) { - - UIImageSymbolConfiguration *imageConfig = [UIImageSymbolConfiguration configurationWithScale:UIImageSymbolScaleSmall]; - UIImage *checkMarkImage = [UIImage systemImageNamed:@"checkmark.circle.fill" withConfiguration:imageConfig]; - UIImage *tintedCheckMarkImage = [checkMarkImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - - _dontKnowButtonCustomImageView = [[UIImageView alloc] initWithImage:tintedCheckMarkImage]; - _dontKnowButtonCustomImageView.translatesAutoresizingMaskIntoConstraints = NO; - [_dontKnowButtonCustomImageView setTintColor:_dontKnowButtonTextLabel.textColor]; - [_dontKnowButtonCustomView addSubview:_dontKnowButtonCustomImageView]; - - [_constraints addObjectsFromArray:@[ - [_dontKnowButtonCustomImageView.heightAnchor constraintEqualToAnchor:_dontKnowButtonCustomImageView.widthAnchor], - [_dontKnowButtonCustomImageView.heightAnchor constraintEqualToAnchor:_dontKnowButtonTextLabel.heightAnchor constant:CheckMarkImageHeightOffset], - [_dontKnowButtonCustomImageView.trailingAnchor constraintEqualToAnchor:_dontKnowButtonTextLabel.leadingAnchor constant:-CheckMarkImageTrailingPadding], - [_dontKnowButtonCustomImageView.centerYAnchor constraintEqualToAnchor:_dontKnowButtonCustomView.centerYAnchor] - ]]; - } else { - [_dontKnowButtonCustomImageView removeFromSuperview]; - _dontKnowButtonCustomImageView = nil; - } + _dontKnowButtonCustomImageView = [[UIImageView alloc] initWithImage:tintedCheckMarkImage]; + _dontKnowButtonCustomImageView.translatesAutoresizingMaskIntoConstraints = NO; + [_dontKnowButtonCustomImageView setTintColor:_dontKnowButtonTextLabel.textColor]; + [_dontKnowButtonCustomView addSubview:_dontKnowButtonCustomImageView]; + + [_constraints addObjectsFromArray:@[ + [_dontKnowButtonCustomImageView.heightAnchor constraintEqualToAnchor:_dontKnowButtonCustomImageView.widthAnchor], + [_dontKnowButtonCustomImageView.heightAnchor constraintEqualToAnchor:_dontKnowButtonTextLabel.heightAnchor constant:CheckMarkImageHeightOffset], + [_dontKnowButtonCustomImageView.trailingAnchor constraintEqualToAnchor:_dontKnowButtonTextLabel.leadingAnchor constant:-CheckMarkImageTrailingPadding], + [_dontKnowButtonCustomImageView.centerYAnchor constraintEqualToAnchor:_dontKnowButtonCustomView.centerYAnchor] + ]]; + } else { + [_dontKnowButtonCustomImageView removeFromSuperview]; + _dontKnowButtonCustomImageView = nil; } if (_active && _dontKnowButtonCustomImageView) { @@ -280,20 +277,12 @@ - (UIColor *)dontKnowButtonTextLabelColor { switch (_dontKnowButtonStyle) { case ORKDontKnowButtonStyleStandard: { - if (@available(iOS 13.0, *)) { - color = _active ? [UIColor systemBackgroundColor] : [UIColor secondaryLabelColor]; - } else { - color = _active ? [UIColor whiteColor] : [UIColor grayColor]; - } + color = _active ? [UIColor systemBackgroundColor] : [UIColor secondaryLabelColor]; break; } case ORKDontKnowButtonStyleCircleChoice: { - if (@available(iOS 13.0, *)) { - color = [UIColor labelColor]; - } else { - color = [UIColor blackColor]; - } + color = [UIColor labelColor]; break; } } @@ -326,11 +315,7 @@ - (UIColor *)customViewBackgroundColor { case ORKDontKnowButtonStyleStandard: { if (!_active) { - if (@available(iOS 13.0, *)) { - color = [UIColor systemFillColor]; - } else { - color = [UIColor grayColor]; - } + color = [UIColor systemFillColor]; } else { color = ORKViewTintColor(self); } @@ -339,12 +324,7 @@ - (UIColor *)customViewBackgroundColor { } case ORKDontKnowButtonStyleCircleChoice: { - if (@available(iOS 13.0, *)) { - color = [UIColor secondarySystemGroupedBackgroundColor]; - } else { - color = [UIColor whiteColor]; - } - + color = [UIColor secondarySystemGroupedBackgroundColor]; break; } } diff --git a/ResearchKit/Common/ORKFootnoteLabel.h b/ResearchKitUI/Common/Skin/ORKFootnoteLabel.h similarity index 96% rename from ResearchKit/Common/ORKFootnoteLabel.h rename to ResearchKitUI/Common/Skin/ORKFootnoteLabel.h index c4f52de88d..ceb2f32dd7 100644 --- a/ResearchKit/Common/ORKFootnoteLabel.h +++ b/ResearchKitUI/Common/Skin/ORKFootnoteLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKFootnoteLabel.m b/ResearchKitUI/Common/Skin/ORKFootnoteLabel.m similarity index 100% rename from ResearchKit/Common/ORKFootnoteLabel.m rename to ResearchKitUI/Common/Skin/ORKFootnoteLabel.m diff --git a/ResearchKit/Common/ORKHeadlineLabel.h b/ResearchKitUI/Common/Skin/ORKHeadlineLabel.h similarity index 96% rename from ResearchKit/Common/ORKHeadlineLabel.h rename to ResearchKitUI/Common/Skin/ORKHeadlineLabel.h index 72533b91fc..a8fdda0b33 100644 --- a/ResearchKit/Common/ORKHeadlineLabel.h +++ b/ResearchKitUI/Common/Skin/ORKHeadlineLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKHeadlineLabel.m b/ResearchKitUI/Common/Skin/ORKHeadlineLabel.m similarity index 100% rename from ResearchKit/Common/ORKHeadlineLabel.m rename to ResearchKitUI/Common/Skin/ORKHeadlineLabel.m diff --git a/ResearchKit/Common/ORKIconButton.h b/ResearchKitUI/Common/Skin/ORKIconButton.h similarity index 98% rename from ResearchKit/Common/ORKIconButton.h rename to ResearchKitUI/Common/Skin/ORKIconButton.h index afa6865cd1..fc14ff9fe6 100644 --- a/ResearchKit/Common/ORKIconButton.h +++ b/ResearchKitUI/Common/Skin/ORKIconButton.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKIconButton.m b/ResearchKitUI/Common/Skin/ORKIconButton.m similarity index 99% rename from ResearchKit/Common/ORKIconButton.m rename to ResearchKitUI/Common/Skin/ORKIconButton.m index 3d4d1fb468..5837080ac3 100644 --- a/ResearchKit/Common/ORKIconButton.m +++ b/ResearchKitUI/Common/Skin/ORKIconButton.m @@ -32,6 +32,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKLabel.h" #import "ORKBorderedButton.h" +#import "ORKBorderedButton_Internal.h" @implementation ORKIconButton { UIView *_customView; diff --git a/ResearchKit/Common/ORKImageChoiceLabel.h b/ResearchKitUI/Common/Skin/ORKImageChoiceLabel.h similarity index 96% rename from ResearchKit/Common/ORKImageChoiceLabel.h rename to ResearchKitUI/Common/Skin/ORKImageChoiceLabel.h index 8fc9949b97..7241df178b 100644 --- a/ResearchKit/Common/ORKImageChoiceLabel.h +++ b/ResearchKitUI/Common/Skin/ORKImageChoiceLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKImageChoiceLabel.m b/ResearchKitUI/Common/Skin/ORKImageChoiceLabel.m similarity index 100% rename from ResearchKit/Common/ORKImageChoiceLabel.m rename to ResearchKitUI/Common/Skin/ORKImageChoiceLabel.m diff --git a/ResearchKit/Common/ORKLabel.h b/ResearchKitUI/Common/Skin/ORKLabel.h similarity index 96% rename from ResearchKit/Common/ORKLabel.h rename to ResearchKitUI/Common/Skin/ORKLabel.h index a45dc1fd25..956448b985 100644 --- a/ResearchKit/Common/ORKLabel.h +++ b/ResearchKitUI/Common/Skin/ORKLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import #import diff --git a/ResearchKit/Common/ORKLabel.m b/ResearchKitUI/Common/Skin/ORKLabel.m similarity index 98% rename from ResearchKit/Common/ORKLabel.m rename to ResearchKitUI/Common/Skin/ORKLabel.m index dd76a1579d..3a783df24f 100644 --- a/ResearchKit/Common/ORKLabel.m +++ b/ResearchKitUI/Common/Skin/ORKLabel.m @@ -67,6 +67,7 @@ - (void)willMoveToWindow:(UIWindow *)newWindow { } - (void)updateAppearance { + self.font = [[self class] defaultFont]; [self invalidateIntrinsicContentSize]; } diff --git a/ResearchKit/Common/ORKProgressView.h b/ResearchKitUI/Common/Skin/ORKProgressView.h similarity index 98% rename from ResearchKit/Common/ORKProgressView.h rename to ResearchKitUI/Common/Skin/ORKProgressView.h index 4c3c82e3ba..a5139cb09b 100644 --- a/ResearchKit/Common/ORKProgressView.h +++ b/ResearchKitUI/Common/Skin/ORKProgressView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import diff --git a/ResearchKit/Common/ORKProgressView.m b/ResearchKitUI/Common/Skin/ORKProgressView.m similarity index 100% rename from ResearchKit/Common/ORKProgressView.m rename to ResearchKitUI/Common/Skin/ORKProgressView.m diff --git a/ResearchKit/Common/ORKRoundTappingButton.h b/ResearchKitUI/Common/Skin/ORKRoundTappingButton.h similarity index 96% rename from ResearchKit/Common/ORKRoundTappingButton.h rename to ResearchKitUI/Common/Skin/ORKRoundTappingButton.h index e6b14dcf8b..96e0f9b124 100644 --- a/ResearchKit/Common/ORKRoundTappingButton.h +++ b/ResearchKitUI/Common/Skin/ORKRoundTappingButton.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKRoundTappingButton.m b/ResearchKitUI/Common/Skin/ORKRoundTappingButton.m similarity index 99% rename from ResearchKit/Common/ORKRoundTappingButton.m rename to ResearchKitUI/Common/Skin/ORKRoundTappingButton.m index 1f1a27b58a..93c134b0b6 100644 --- a/ResearchKit/Common/ORKRoundTappingButton.m +++ b/ResearchKitUI/Common/Skin/ORKRoundTappingButton.m @@ -30,6 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTextButton_Internal.h" #import "ORKRoundTappingButton.h" +#import "ORKBorderedButton_Internal.h" static const CGFloat RoundTappingButtonDefaultDiameter = 104; diff --git a/ResearchKit/Common/ORKScaleRangeDescriptionLabel.h b/ResearchKitUI/Common/Skin/ORKScaleRangeDescriptionLabel.h similarity index 96% rename from ResearchKit/Common/ORKScaleRangeDescriptionLabel.h rename to ResearchKitUI/Common/Skin/ORKScaleRangeDescriptionLabel.h index 3c961a259b..1d22f01865 100644 --- a/ResearchKit/Common/ORKScaleRangeDescriptionLabel.h +++ b/ResearchKitUI/Common/Skin/ORKScaleRangeDescriptionLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKScaleRangeLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKScaleRangeDescriptionLabel.m b/ResearchKitUI/Common/Skin/ORKScaleRangeDescriptionLabel.m similarity index 100% rename from ResearchKit/Common/ORKScaleRangeDescriptionLabel.m rename to ResearchKitUI/Common/Skin/ORKScaleRangeDescriptionLabel.m diff --git a/ResearchKit/Common/ORKScaleRangeImageView.h b/ResearchKitUI/Common/Skin/ORKScaleRangeImageView.h similarity index 100% rename from ResearchKit/Common/ORKScaleRangeImageView.h rename to ResearchKitUI/Common/Skin/ORKScaleRangeImageView.h diff --git a/ResearchKit/Common/ORKScaleRangeImageView.m b/ResearchKitUI/Common/Skin/ORKScaleRangeImageView.m similarity index 100% rename from ResearchKit/Common/ORKScaleRangeImageView.m rename to ResearchKitUI/Common/Skin/ORKScaleRangeImageView.m diff --git a/ResearchKit/Common/ORKScaleRangeLabel.h b/ResearchKitUI/Common/Skin/ORKScaleRangeLabel.h similarity index 96% rename from ResearchKit/Common/ORKScaleRangeLabel.h rename to ResearchKitUI/Common/Skin/ORKScaleRangeLabel.h index 8a76316e4e..ea72fd8bb3 100644 --- a/ResearchKit/Common/ORKScaleRangeLabel.h +++ b/ResearchKitUI/Common/Skin/ORKScaleRangeLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKScaleRangeLabel.m b/ResearchKitUI/Common/Skin/ORKScaleRangeLabel.m similarity index 100% rename from ResearchKit/Common/ORKScaleRangeLabel.m rename to ResearchKitUI/Common/Skin/ORKScaleRangeLabel.m diff --git a/ResearchKit/Common/ORKScaleValueLabel.h b/ResearchKitUI/Common/Skin/ORKScaleValueLabel.h similarity index 96% rename from ResearchKit/Common/ORKScaleValueLabel.h rename to ResearchKitUI/Common/Skin/ORKScaleValueLabel.h index dbf38942d1..13fd793ad4 100644 --- a/ResearchKit/Common/ORKScaleValueLabel.h +++ b/ResearchKitUI/Common/Skin/ORKScaleValueLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKScaleValueLabel.m b/ResearchKitUI/Common/Skin/ORKScaleValueLabel.m similarity index 100% rename from ResearchKit/Common/ORKScaleValueLabel.m rename to ResearchKitUI/Common/Skin/ORKScaleValueLabel.m diff --git a/ResearchKit/Common/ORKSelectionSubTitleLabel.h b/ResearchKitUI/Common/Skin/ORKSelectionSubTitleLabel.h similarity index 96% rename from ResearchKit/Common/ORKSelectionSubTitleLabel.h rename to ResearchKitUI/Common/Skin/ORKSelectionSubTitleLabel.h index 787672db55..b20d0991e7 100644 --- a/ResearchKit/Common/ORKSelectionSubTitleLabel.h +++ b/ResearchKitUI/Common/Skin/ORKSelectionSubTitleLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSelectionSubTitleLabel.m b/ResearchKitUI/Common/Skin/ORKSelectionSubTitleLabel.m similarity index 100% rename from ResearchKit/Common/ORKSelectionSubTitleLabel.m rename to ResearchKitUI/Common/Skin/ORKSelectionSubTitleLabel.m diff --git a/ResearchKit/Common/ORKSelectionTitleLabel.h b/ResearchKitUI/Common/Skin/ORKSelectionTitleLabel.h similarity index 96% rename from ResearchKit/Common/ORKSelectionTitleLabel.h rename to ResearchKitUI/Common/Skin/ORKSelectionTitleLabel.h index 8bdec9579c..e53340c5f6 100644 --- a/ResearchKit/Common/ORKSelectionTitleLabel.h +++ b/ResearchKitUI/Common/Skin/ORKSelectionTitleLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSelectionTitleLabel.m b/ResearchKitUI/Common/Skin/ORKSelectionTitleLabel.m similarity index 100% rename from ResearchKit/Common/ORKSelectionTitleLabel.m rename to ResearchKitUI/Common/Skin/ORKSelectionTitleLabel.m diff --git a/ResearchKit/Common/ORKSeparatorView.h b/ResearchKitUI/Common/Skin/ORKSeparatorView.h similarity index 98% rename from ResearchKit/Common/ORKSeparatorView.h rename to ResearchKitUI/Common/Skin/ORKSeparatorView.h index c754fdfb6e..87e353c36b 100644 --- a/ResearchKit/Common/ORKSeparatorView.h +++ b/ResearchKitUI/Common/Skin/ORKSeparatorView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import diff --git a/ResearchKit/Common/ORKSeparatorView.m b/ResearchKitUI/Common/Skin/ORKSeparatorView.m similarity index 100% rename from ResearchKit/Common/ORKSeparatorView.m rename to ResearchKitUI/Common/Skin/ORKSeparatorView.m diff --git a/ResearchKit/Common/ORKSubheadlineLabel.h b/ResearchKitUI/Common/Skin/ORKSubheadlineLabel.h similarity index 96% rename from ResearchKit/Common/ORKSubheadlineLabel.h rename to ResearchKitUI/Common/Skin/ORKSubheadlineLabel.h index e2dbb40e18..feeb9f4048 100644 --- a/ResearchKit/Common/ORKSubheadlineLabel.h +++ b/ResearchKitUI/Common/Skin/ORKSubheadlineLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSubheadlineLabel.m b/ResearchKitUI/Common/Skin/ORKSubheadlineLabel.m similarity index 100% rename from ResearchKit/Common/ORKSubheadlineLabel.m rename to ResearchKitUI/Common/Skin/ORKSubheadlineLabel.m diff --git a/ResearchKit/Common/ORKTableViewCell.h b/ResearchKitUI/Common/Skin/ORKTableViewCell.h similarity index 97% rename from ResearchKit/Common/ORKTableViewCell.h rename to ResearchKitUI/Common/Skin/ORKTableViewCell.h index 93ce13ff10..d70f780c9e 100644 --- a/ResearchKit/Common/ORKTableViewCell.h +++ b/ResearchKitUI/Common/Skin/ORKTableViewCell.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKDefines.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKTableViewCell.m b/ResearchKitUI/Common/Skin/ORKTableViewCell.m similarity index 100% rename from ResearchKit/Common/ORKTableViewCell.m rename to ResearchKitUI/Common/Skin/ORKTableViewCell.m diff --git a/ResearchKit/Common/ORKTagLabel.h b/ResearchKitUI/Common/Skin/ORKTagLabel.h similarity index 97% rename from ResearchKit/Common/ORKTagLabel.h rename to ResearchKitUI/Common/Skin/ORKTagLabel.h index 9e798b6834..4bd3728918 100644 --- a/ResearchKit/Common/ORKTagLabel.h +++ b/ResearchKitUI/Common/Skin/ORKTagLabel.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; +#import #import @@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN ORK_CLASS_AVAILABLE @interface ORKTagLabel : UILabel ++ (UIFont*)font; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKTagLabel.m b/ResearchKitUI/Common/Skin/ORKTagLabel.m similarity index 76% rename from ResearchKit/Common/ORKTagLabel.m rename to ResearchKitUI/Common/Skin/ORKTagLabel.m index 94bc1d506c..42b6cdced2 100644 --- a/ResearchKit/Common/ORKTagLabel.m +++ b/ResearchKitUI/Common/Skin/ORKTagLabel.m @@ -41,23 +41,20 @@ - (instancetype)init { self.numberOfLines = 0; self.clipsToBounds = YES; self.layer.cornerRadius = 2.0; - - UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleCaption1]; - UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; - - self.font = [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; - - if (@available(iOS 13.0, *)) { - self.textColor = [UIColor systemGrayColor]; - self.backgroundColor = [UIColor tertiarySystemGroupedBackgroundColor]; - } else { - self.textColor = [UIColor darkGrayColor]; - self.backgroundColor = [UIColor lightGrayColor]; - } + self.font = [ORKTagLabel font]; + self.textColor = [UIColor systemGrayColor]; + self.backgroundColor = [UIColor tertiarySystemGroupedBackgroundColor]; } return self; } ++ (UIFont*)font { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleCaption1]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; + + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + - (void)drawTextInRect:(CGRect)rect { UIEdgeInsets insets = {verticalInset, horizontalInset, verticalInset, horizontalInset}; [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)]; diff --git a/ResearchKit/Common/ORKTapCountLabel.h b/ResearchKitUI/Common/Skin/ORKTapCountLabel.h similarity index 98% rename from ResearchKit/Common/ORKTapCountLabel.h rename to ResearchKitUI/Common/Skin/ORKTapCountLabel.h index cc1a1a3de9..4c85207e2b 100644 --- a/ResearchKit/Common/ORKTapCountLabel.h +++ b/ResearchKitUI/Common/Skin/ORKTapCountLabel.h @@ -30,7 +30,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKTapCountLabel.m b/ResearchKitUI/Common/Skin/ORKTapCountLabel.m similarity index 100% rename from ResearchKit/Common/ORKTapCountLabel.m rename to ResearchKitUI/Common/Skin/ORKTapCountLabel.m diff --git a/ResearchKit/Common/ORKTextButton.h b/ResearchKitUI/Common/Skin/ORKTextButton.h similarity index 95% rename from ResearchKit/Common/ORKTextButton.h rename to ResearchKitUI/Common/Skin/ORKTextButton.h index 3cad04b839..4e0086e677 100644 --- a/ResearchKit/Common/ORKTextButton.h +++ b/ResearchKitUI/Common/Skin/ORKTextButton.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; +#import #import @@ -47,8 +47,6 @@ ORK_CLASS_AVAILABLE - (void)init_ORKTextButton; -- (void)updateContentInsets:(NSDirectionalEdgeInsets)contentInsets; - @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKTextButton.m b/ResearchKitUI/Common/Skin/ORKTextButton.m similarity index 93% rename from ResearchKit/Common/ORKTextButton.m rename to ResearchKitUI/Common/Skin/ORKTextButton.m index 21fb993fed..8a448fc334 100644 --- a/ResearchKit/Common/ORKTextButton.m +++ b/ResearchKitUI/Common/Skin/ORKTextButton.m @@ -72,14 +72,6 @@ - (void)tintColorDidChange { [self setTitleColor:[[self tintColor] colorWithAlphaComponent:0.7] forState:UIControlStateHighlighted]; } -- (void)updateContentInsets:(NSDirectionalEdgeInsets)contentInsets { - if (@available(iOS 15.0, *)) { - UIButtonConfiguration *buttonConfiguration = [UIButtonConfiguration plainButtonConfiguration]; - [buttonConfiguration setContentInsets:contentInsets]; - [self setConfiguration:buttonConfiguration]; - } -} - - (void)updateAppearance { self.titleLabel.font = [[self class] defaultFont]; diff --git a/ResearchKit/Common/ORKTextButton_Internal.h b/ResearchKitUI/Common/Skin/ORKTextButton_Internal.h similarity index 100% rename from ResearchKit/Common/ORKTextButton_Internal.h rename to ResearchKitUI/Common/Skin/ORKTextButton_Internal.h diff --git a/ResearchKit/Common/ORKTextFieldView.h b/ResearchKitUI/Common/Skin/ORKTextFieldView.h similarity index 100% rename from ResearchKit/Common/ORKTextFieldView.h rename to ResearchKitUI/Common/Skin/ORKTextFieldView.h diff --git a/ResearchKit/Common/ORKTextFieldView.m b/ResearchKitUI/Common/Skin/ORKTextFieldView.m similarity index 97% rename from ResearchKit/Common/ORKTextFieldView.m rename to ResearchKitUI/Common/Skin/ORKTextFieldView.m index e29cc9b96c..83db707a41 100644 --- a/ResearchKit/Common/ORKTextFieldView.m +++ b/ResearchKitUI/Common/Skin/ORKTextFieldView.m @@ -185,11 +185,8 @@ - (void)ork_setSuffix:(NSString *)suffix withColor:(UIColor *)color { if (suffix.length == 0) { return; } - if (@available(iOS 13.0, *)) { - _suffixLabel = [self ork_createTextLabelWithTextColor:(color ? : [UIColor placeholderTextColor])]; - } else { - _suffixLabel = [self ork_createTextLabelWithTextColor:(color ? : [UIColor ork_midGrayTintColor])]; - } + + _suffixLabel = [self ork_createTextLabelWithTextColor:(color ? : [UIColor placeholderTextColor])]; _suffixLabel.text = suffix; _suffixLabel.font = self.font; _suffixLabel.textAlignment = NSTextAlignmentLeft; @@ -245,14 +242,8 @@ - (void)setUnit:(NSString *)unit { if (_unit.length > 0) { _unitWithNumber = [NSString stringWithFormat:@" %@", unit]; - - if (@available(iOS 13.0, *)) { - _unitRegularColor = [UIColor placeholderTextColor]; - _unitActiveColor = [UIColor placeholderTextColor]; - } else { - _unitRegularColor = [UIColor blackColor]; - _unitActiveColor = [UIColor ork_midGrayTintColor]; - } + _unitRegularColor = [UIColor placeholderTextColor]; + _unitActiveColor = [UIColor placeholderTextColor]; } else { _unitWithNumber = nil; } diff --git a/ResearchKit/Common/ORKTintedImageView.h b/ResearchKitUI/Common/Skin/ORKTintedImageView.h similarity index 98% rename from ResearchKit/Common/ORKTintedImageView.h rename to ResearchKitUI/Common/Skin/ORKTintedImageView.h index 931d59f401..104b3d66b9 100644 --- a/ResearchKit/Common/ORKTintedImageView.h +++ b/ResearchKitUI/Common/Skin/ORKTintedImageView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKTintedImageView.m b/ResearchKitUI/Common/Skin/ORKTintedImageView.m similarity index 100% rename from ResearchKit/Common/ORKTintedImageView.m rename to ResearchKitUI/Common/Skin/ORKTintedImageView.m diff --git a/ResearchKit/Common/ORKTintedImageView_Internal.h b/ResearchKitUI/Common/Skin/ORKTintedImageView_Internal.h similarity index 100% rename from ResearchKit/Common/ORKTintedImageView_Internal.h rename to ResearchKitUI/Common/Skin/ORKTintedImageView_Internal.h diff --git a/ResearchKit/Common/ORKTitleLabel.h b/ResearchKitUI/Common/Skin/ORKTitleLabel.h similarity index 96% rename from ResearchKit/Common/ORKTitleLabel.h rename to ResearchKitUI/Common/Skin/ORKTitleLabel.h index cae30fdcfa..af7c079cb6 100644 --- a/ResearchKit/Common/ORKTitleLabel.h +++ b/ResearchKitUI/Common/Skin/ORKTitleLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import "ORKLabel.h" +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKTitleLabel.m b/ResearchKitUI/Common/Skin/ORKTitleLabel.m similarity index 100% rename from ResearchKit/Common/ORKTitleLabel.m rename to ResearchKitUI/Common/Skin/ORKTitleLabel.m diff --git a/ResearchKit/Common/ORKUnitLabel.h b/ResearchKitUI/Common/Skin/ORKUnitLabel.h similarity index 96% rename from ResearchKit/Common/ORKUnitLabel.h rename to ResearchKitUI/Common/Skin/ORKUnitLabel.h index 34dc28ed0a..8320d31e6d 100644 --- a/ResearchKit/Common/ORKUnitLabel.h +++ b/ResearchKitUI/Common/Skin/ORKUnitLabel.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKUnitLabel.m b/ResearchKitUI/Common/Skin/ORKUnitLabel.m similarity index 100% rename from ResearchKit/Common/ORKUnitLabel.m rename to ResearchKitUI/Common/Skin/ORKUnitLabel.m diff --git a/ResearchKit/Common/ORKCustomStepViewController.h b/ResearchKitUI/Common/Step/Custom Step/ORKCustomStepViewController.h similarity index 97% rename from ResearchKit/Common/ORKCustomStepViewController.h rename to ResearchKitUI/Common/Step/Custom Step/ORKCustomStepViewController.h index c25f8089bc..828da89736 100644 --- a/ResearchKit/Common/ORKCustomStepViewController.h +++ b/ResearchKitUI/Common/Step/Custom Step/ORKCustomStepViewController.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKCustomStepViewController.m b/ResearchKitUI/Common/Step/Custom Step/ORKCustomStepViewController.m similarity index 96% rename from ResearchKit/Common/ORKCustomStepViewController.m rename to ResearchKitUI/Common/Step/Custom Step/ORKCustomStepViewController.m index 1e2238430c..9da9ab4dae 100644 --- a/ResearchKit/Common/ORKCustomStepViewController.m +++ b/ResearchKitUI/Common/Step/Custom Step/ORKCustomStepViewController.m @@ -36,6 +36,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKStepContainerView_Private.h" #import "ORKStepView_Private.h" +NSString * const ORKCustomStepViewAccessibilityIdentifier = @"ORKCustomStepView"; + @interface ORKCustomStepViewController () @end @@ -65,6 +67,7 @@ - (void)stepDidChange { if (self.step && [self isViewLoaded]) { _containerView = [[ORKStepContainerView alloc] init]; + _containerView.accessibilityIdentifier = ORKCustomStepViewAccessibilityIdentifier; [self configureContainerView]; [_containerView setPinNavigationContainer:self.customStep.pinNavigationContainer]; [_containerView setCustomContentView:[self customStep].contentView withTopPadding:0.0 sidePadding:0.0]; @@ -127,7 +130,6 @@ - (void)viewDidLoad { } - (void)configureContainerView { - if (self.customStep.title){ [_containerView setStepTitle:self.customStep.title]; } @@ -140,6 +142,10 @@ - (void)configureContainerView { [_containerView setStepDetailText:self.customStep.detailText]; } + if (self.customStep.bodyItems) { + [_containerView setBodyItems:self.customStep.bodyItems]; + } + if (self.customStep.headerTextAlignment) { [_containerView setStepHeaderTextAlignment:self.customStep.headerTextAlignment]; } @@ -147,6 +153,7 @@ - (void)configureContainerView { if (self.step.iconImage){ [_containerView setTitleIconImage:self.step.iconImage]; } + } - (void)setStepHeaderTextAlignment:(NSTextAlignment)stepHeaderTextAlignment { diff --git a/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryRelatedPersonCell.h b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryRelatedPersonCell.h new file mode 100644 index 0000000000..71c30ae9de --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryRelatedPersonCell.h @@ -0,0 +1,67 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ORKFamilyHistoryRelatedPersonCell; +@protocol ORKFamilyHistoryRelatedPersonCellDelegate; + +typedef NS_ENUM(NSInteger, ORKFamilyHistoryTooltipOption) { + ORKFamilyHistoryTooltipOptionEdit, + ORKFamilyHistoryTooltipOptionDelete +}; + + +@protocol ORKFamilyHistoryRelatedPersonCellDelegate + +- (void)familyHistoryRelatedPersonCell:(ORKFamilyHistoryRelatedPersonCell *)relatedPersonCell + tappedOption:(ORKFamilyHistoryTooltipOption)option; + +@end + + +@interface ORKFamilyHistoryRelatedPersonCell : UITableViewCell + +@property (nonatomic) NSString *title; +@property (nonatomic) NSString *relativeID; +@property (nonatomic) NSArray *detailValues; +@property (nonatomic) NSArray *conditionValues; +@property (nonatomic) BOOL isLastItemBeforeAddRelativeButton; +@property (nonatomic, weak, nullable) id delegate; + +- (void)configureWithDetailValues:(NSArray *)detailValues + conditionsValues:(NSArray *)conditionsValues +isLastItemBeforeAddRelativeButton:(BOOL)isLastItemBeforeAddRelativeButton; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryRelatedPersonCell.m b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryRelatedPersonCell.m new file mode 100644 index 0000000000..55d30b4ace --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryRelatedPersonCell.m @@ -0,0 +1,467 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKFamilyHistoryRelatedPersonCell.h" + +#import "ORKAccessibilityFunctions.h" + +#import + +static const CGFloat BackgroundViewBottomPadding = 18.0; +static const CGFloat CellLeftRightPadding = 12.0; +static const CGFloat CellTopBottomPadding = 12.0; +static const CGFloat CellBottomPadding = 8.0; +static const CGFloat CellLabelTopPadding = 8.0; +static const CGFloat CellBottomPaddingBeforeAddRelativeButton = 20.0; +static const CGFloat ContentLeftRightPadding = 16.0; +static const CGFloat DividerViewTopBottomPadding = 10.0; +static const CGFloat OptionsButtonWidth = 20.0; + +typedef NS_ENUM(NSUInteger, ORKFamilyHistoryEditDeleteViewEvent) { + ORKFamilyHistoryEditDeleteViewEventEdit = 0, + ORKFamilyHistoryEditDeleteViewEventDelete, +}; + +typedef void (^ORKFamilyHistoryEditDeleteViewEventHandler)(ORKFamilyHistoryEditDeleteViewEvent); + +@implementation ORKFamilyHistoryRelatedPersonCell { + UIView *_backgroundView; + UIView *_dividerView; + UILabel *_titleLabel; + UILabel *_conditionsLabel; + UIButton *_optionsButton; + + NSArray *_detailListLabels; + NSArray *_conditionListLabels; + + NSMutableArray *_viewConstraints; +} + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; + if (self) { + [self setBackgroundColor:[UIColor clearColor]]; + [self.contentView setBackgroundColor:[UIColor clearColor]]; + } + + return self; +} + +- (UIMenu *)optionsMenu API_AVAILABLE(ios(13.0)) { + ORKWeakTypeOf(self) weakSelf = self; + // Edit Button + UIImage *editImage = [UIImage systemImageNamed:@"pencil"]; + UIAction *editMenuItem = [UIAction actionWithTitle:ORKLocalizedString(@"FAMILY_HISTORY_EDIT_ENTRY", @"") + image:editImage + identifier:nil + handler:^(__kindof UIAction * _Nonnull action) { + ORKStrongTypeOf(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf handleContentViewEvent:ORKFamilyHistoryEditDeleteViewEventEdit]; + } + }]; + + // Delete Button + UIImage *deleteImage = [UIImage systemImageNamed:@"trash.fill"]; + UIAction *deleteMenuItem = [UIAction actionWithTitle:ORKLocalizedString(@"FAMILY_HISTORY_DELETE_ENTRY", @"") + image:deleteImage + identifier:nil + handler:^(__kindof UIAction * _Nonnull action) { + ORKStrongTypeOf(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf handleContentViewEvent:ORKFamilyHistoryEditDeleteViewEventDelete]; + } + }]; + [deleteMenuItem setAttributes:UIMenuElementAttributesDestructive]; + + NSArray *menuChildren = @[ + editMenuItem, + deleteMenuItem + ]; + UIMenu *menu = [UIMenu menuWithTitle:@"" children:menuChildren]; + return menu; +} + +- (UIAlertController *)alertForOptionsMenu { + ORKWeakTypeOf(self) weakSelf = self; + UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil + message:nil + preferredStyle:UIAlertControllerStyleActionSheet]; + UIAlertAction *editAction = [UIAlertAction actionWithTitle:ORKLocalizedString(@"FAMILY_HISTORY_EDIT_ENTRY", @"") + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * _Nonnull action) { + ORKStrongTypeOf(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf handleContentViewEvent:ORKFamilyHistoryEditDeleteViewEventEdit]; + } + }]; + + UIAlertAction *deleteAction = [UIAlertAction actionWithTitle:ORKLocalizedString(@"FAMILY_HISTORY_DELETE_ENTRY", @"") + style:UIAlertActionStyleDestructive + handler:^(UIAlertAction * _Nonnull action) { + ORKStrongTypeOf(weakSelf) strongSelf = weakSelf; + if (strongSelf) { + [strongSelf handleContentViewEvent:ORKFamilyHistoryEditDeleteViewEventDelete]; + } + }]; + + UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:ORKLocalizedString(@"BUTTON_CANCEL", @"") + style:UIAlertActionStyleCancel + handler:^(UIAlertAction * _Nonnull action) { + }]; + + [alert addAction:editAction]; + [alert addAction:deleteAction]; + [alert addAction:cancelAction]; + return alert; +} + +- (void)presentOptionsMenuAlert { + UIAlertController *alert = [self alertForOptionsMenu]; + NSArray *windows = [[UIApplication sharedApplication] windows]; + for (UIWindow *window in windows) { + if (window.isKeyWindow) { + [window.rootViewController presentViewController:alert animated:true completion:nil]; + } + } +} + +- (void)setupSubViews { + _backgroundView = [UIView new]; + _backgroundView.clipsToBounds = YES; + _backgroundView.layer.cornerRadius = 12.0; + _backgroundView.translatesAutoresizingMaskIntoConstraints = NO; + [_backgroundView setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisVertical]; + [self.contentView addSubview:_backgroundView]; + + _titleLabel = [self _primaryLabel]; + [_titleLabel setText:_title]; + [_backgroundView addSubview:_titleLabel]; + + _optionsButton = [UIButton new]; + _optionsButton.translatesAutoresizingMaskIntoConstraints = NO; + _optionsButton.backgroundColor = [UIColor clearColor]; + _optionsButton.tintColor = [UIColor systemGrayColor]; + _optionsButton.accessibilityLabel = ORKLocalizedString(@"AX_FAMILY_HISTORY_EDIT_BUTTON", nil); + _optionsButton.accessibilityHint = ORKLocalizedString(@"AX_FAMILY_HISTORY_EDIT_BUTTON", nil); + _optionsButton.accessibilityTraits = UIAccessibilityTraitButton; + if (@available(iOS 14.0, *)) { + _optionsButton.menu = [self optionsMenu]; + _optionsButton.showsMenuAsPrimaryAction = YES; + } else { + [_optionsButton addTarget:self action:@selector(presentOptionsMenuAlert) forControlEvents:UIControlEventTouchUpInside]; + } + + UIImageConfiguration *configuration = [UIImageSymbolConfiguration configurationWithFont:[UIFont preferredFontForTextStyle:UIFontTextStyleBody] scale:ORKImageScaleToUse()]; + [_optionsButton setImage:[UIImage systemImageNamed:@"ellipsis.circle" withConfiguration:configuration] forState:UIControlStateNormal]; + [_optionsButton.imageView setContentMode:UIViewContentModeScaleAspectFit]; + + [_backgroundView addSubview:_optionsButton]; + + _dividerView = [UIView new]; + _dividerView.translatesAutoresizingMaskIntoConstraints = NO; + _dividerView.backgroundColor = [UIColor separatorColor]; + [_backgroundView addSubview:_dividerView]; + + _conditionsLabel = [self _primaryLabel]; + _conditionsLabel.text = ORKLocalizedString(@"FAMILY_HISTORY_CONDITIONS", @""); + [_backgroundView addSubview:_conditionsLabel]; + + [self updateViewColors]; +} + +- (void)updateViewColors { + _backgroundView.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; + _dividerView.backgroundColor = [UIColor separatorColor]; + _titleLabel.textColor = [UIColor labelColor]; + _conditionsLabel.textColor = [UIColor labelColor]; + _optionsButton.tintColor = [UIColor secondaryLabelColor]; + + [self updateViewLabelsTextColor:[UIColor secondaryLabelColor]]; +} + +- (void)updateViewLabelsTextColor:(UIColor *)color { + for (UILabel* detailLabel in _detailListLabels) { + detailLabel.textColor = color; + } + for (UILabel* conditionLabel in _conditionListLabels) { + conditionLabel.textColor = color; + } +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + [super traitCollectionDidChange:previousTraitCollection]; + [self updateViewColors]; +} + +- (void)_clearActiveConstraints { + if (_viewConstraints.count > 0) { + [NSLayoutConstraint deactivateConstraints:_viewConstraints]; + } + + _viewConstraints = [NSMutableArray new]; + + for (UILabel *label in _conditionListLabels) { + [label removeFromSuperview]; + } + _conditionListLabels = @[]; + + for (UILabel *label in _detailListLabels) { + [label removeFromSuperview]; + } + _detailListLabels = @[]; +} + +- (NSArray *)_backgroundViewContraints { + CGFloat bottomPadding = _isLastItemBeforeAddRelativeButton ? -CellBottomPaddingBeforeAddRelativeButton : -CellBottomPadding; + + return @[ + [_backgroundView.topAnchor constraintEqualToAnchor:self.contentView.topAnchor], + [_backgroundView.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor constant:ContentLeftRightPadding], + [_backgroundView.trailingAnchor constraintEqualToAnchor:self.contentView.trailingAnchor constant:-ContentLeftRightPadding], + [_backgroundView.bottomAnchor constraintEqualToAnchor:self.contentView.bottomAnchor constant:bottomPadding] + ]; +} + +- (NSArray *)_titleLabelConstraints { + // _titleLabel becomes the first detailsLowerMostView, which sets `bottomAnchor` accordingly. + return @[ + [_titleLabel.topAnchor constraintEqualToAnchor:_backgroundView.topAnchor constant:CellTopBottomPadding], + [_titleLabel.leadingAnchor constraintEqualToAnchor:_backgroundView.leadingAnchor constant:CellLeftRightPadding], + [_titleLabel.trailingAnchor constraintEqualToAnchor:_optionsButton.leadingAnchor constant:-CellLeftRightPadding] + ]; +} + +- (NSArray *)_optionsButtonConstraints { + // leadingAnchor: set in _titleLabelConstraints + // bottomAnchor: ambiguous + + NSLayoutConstraint *widthConstraint = [_optionsButton.widthAnchor constraintEqualToConstant:OptionsButtonWidth]; + [widthConstraint setPriority:UILayoutPriorityDefaultLow]; + + return @[ + [_optionsButton.topAnchor constraintEqualToAnchor:_titleLabel.topAnchor], + widthConstraint, + [_optionsButton.trailingAnchor constraintEqualToAnchor:_backgroundView.trailingAnchor constant:-CellLeftRightPadding] + ]; +} + +- (NSArray *)_dividerConstraintsFromView:(UIView *)referenceView { + CGFloat separatorHeight = 1.0 / [UIScreen mainScreen].scale; + NSLayoutConstraint *heightConstraint = [_dividerView.heightAnchor constraintEqualToConstant:separatorHeight]; + [heightConstraint setPriority:UILayoutPriorityDefaultLow]; + return @[ + [_dividerView.leadingAnchor constraintEqualToAnchor:_backgroundView.leadingAnchor], + [_dividerView.trailingAnchor constraintEqualToAnchor:_backgroundView.trailingAnchor], + heightConstraint, + [_dividerView.topAnchor constraintEqualToAnchor: referenceView.bottomAnchor constant:DividerViewTopBottomPadding], + [_dividerView.bottomAnchor constraintEqualToAnchor:_conditionsLabel.topAnchor constant:-DividerViewTopBottomPadding] + ]; +} + +- (NSArray *)_conditionsLabelConstraints { + return @[ + [_conditionsLabel.leadingAnchor constraintEqualToAnchor:_backgroundView.leadingAnchor constant:CellLeftRightPadding], + [_conditionsLabel.trailingAnchor constraintEqualToAnchor:_backgroundView.trailingAnchor constant:-CellLeftRightPadding] + ]; +} + +- (NSArray *)_constraintsForLabel:(UILabel *)label relativeTo:(UIView *)referenceView { + return @[ + [label.leadingAnchor constraintEqualToAnchor:_backgroundView.leadingAnchor constant:CellLeftRightPadding], + [label.trailingAnchor constraintEqualToAnchor:_backgroundView.trailingAnchor constant:-CellLeftRightPadding], + [label.topAnchor constraintEqualToAnchor:referenceView.bottomAnchor constant:CellLabelTopPadding] + ]; +} + +- (void)setupConstraints { + [self _clearActiveConstraints]; + _viewConstraints = [NSMutableArray new]; + + // backgroundView constraints + [_viewConstraints addObjectsFromArray:[self _backgroundViewContraints]]; + + // titleLabel constraints + [_viewConstraints addObjectsFromArray:[self _titleLabelConstraints]]; + + // optionsButton constraints + [_viewConstraints addObjectsFromArray:[self _optionsButtonConstraints]]; + + // find lower most view to constrain the dividerView to + UIView *detailsLowerMostView = _titleLabel; + + _detailListLabels = [self getDetailLabels]; + + for (UILabel *label in _detailListLabels) { + [_backgroundView addSubview:label]; + [_viewConstraints addObjectsFromArray: [self _constraintsForLabel:label relativeTo:detailsLowerMostView]]; + detailsLowerMostView = label; + } + + // dividerView constraints + [_viewConstraints addObjectsFromArray: [self _dividerConstraintsFromView:detailsLowerMostView]]; + + // conditionsLabel constraints + [_viewConstraints addObjectsFromArray:[self _conditionsLabelConstraints]]; + + // find lower most view to constrain the backgroundView to + UIView *conditionsLowerMostView = _conditionsLabel; + + _conditionListLabels = [self getConditionLabels]; + + for (UILabel *label in _conditionListLabels) { + [_backgroundView addSubview:label]; + [_viewConstraints addObjectsFromArray: [self _constraintsForLabel:label relativeTo:conditionsLowerMostView]]; + conditionsLowerMostView = label; + } + + // set backgroundView's bottom anchor to lower most UILabel + NSLayoutConstraint *bottomConstraint = [conditionsLowerMostView.lastBaselineAnchor constraintEqualToAnchor:_backgroundView.bottomAnchor constant:-BackgroundViewBottomPadding]; + [bottomConstraint setPriority:UILayoutPriorityDefaultHigh]; + [_viewConstraints addObject:bottomConstraint]; + + [NSLayoutConstraint activateConstraints:_viewConstraints]; +} + +- (UILabel *)_baseLabel { + UILabel *label = [UILabel new]; + label.translatesAutoresizingMaskIntoConstraints = NO; + label.lineBreakMode = NSLineBreakByWordWrapping; + label.textAlignment = NSTextAlignmentNatural; + label.numberOfLines = 0; + return label; +} + +- (UILabel *)_primaryLabel { + UILabel *label = [self _baseLabel]; + label.font = [self titleLabelFont]; + return label; +} + +- (UILabel *)_secondaryLabel { + UILabel *label = [self _baseLabel]; + label.font = [self conditionsLabelFont]; + label.textColor = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? [UIColor whiteColor] : [UIColor lightGrayColor]; + return label; +} + +- (NSArray *)getDetailLabels { + NSMutableArray *labels = [NSMutableArray new]; + + for (NSString *detailValue in _detailValues) { + UILabel *label = [self _secondaryLabel]; + label.text = detailValue; + [labels addObject:label]; + } + + return [labels copy]; +} + +- (NSArray *)getConditionLabels { + NSMutableArray *labels = [NSMutableArray new]; + + if (!_conditionValues || _conditionValues.count == 0) { + UILabel *noneSelectedLabel = [self _secondaryLabel]; + noneSelectedLabel.text = @""; + [labels addObject:noneSelectedLabel]; + } else { + for (NSString *conditionValue in _conditionValues) { + UILabel *label = [self _secondaryLabel]; + label.text = conditionValue; + [labels addObject:label]; + } + } + + return [labels copy]; +} + +- (void)handleContentViewEvent:(ORKFamilyHistoryEditDeleteViewEvent)event { + switch (event) { + case ORKFamilyHistoryEditDeleteViewEventEdit: + [_delegate familyHistoryRelatedPersonCell:self tappedOption:ORKFamilyHistoryTooltipOptionEdit]; + break; + + case ORKFamilyHistoryEditDeleteViewEventDelete: + [_delegate familyHistoryRelatedPersonCell:self tappedOption:ORKFamilyHistoryTooltipOptionDelete]; + break; + } +} + +- (void)setTitle:(NSString *)title { + _title = title; +} + +- (void)configureWithDetailValues:(NSArray *)detailValues + conditionsValues:(NSArray *)conditionsValues +isLastItemBeforeAddRelativeButton:(BOOL)isLastItemBeforeAddRelativeButton { + _detailValues = detailValues; + _conditionValues = conditionsValues; + _isLastItemBeforeAddRelativeButton = isLastItemBeforeAddRelativeButton; + + [self setupSubViews]; + [self setupConstraints]; +} + +- (UIFont *)titleLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + +- (UIFont *)conditionsLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitUIOptimized)]; + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + +- (void)prepareForReuse { + _title = @""; + _relativeID = @""; + + [_titleLabel removeFromSuperview]; + _titleLabel = nil; + + [_conditionsLabel removeFromSuperview]; + _conditionsLabel = nil; + + [_optionsButton removeFromSuperview]; + _optionsButton = nil; + + [_dividerView removeFromSuperview]; + _dividerView = nil; + + [_backgroundView removeFromSuperview]; + _backgroundView = nil; + + [self _clearActiveConstraints]; + [super prepareForReuse]; +} + +@end diff --git a/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableFooterView.h b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableFooterView.h new file mode 100644 index 0000000000..a42381dc56 --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableFooterView.h @@ -0,0 +1,52 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ORKRelativeGroup; +@class ORKFamilyHistoryTableFooterView; + +@protocol ORKFamilyHistoryTableFooterViewDelegate + +- (void)ORKFamilyHistoryTableFooterView:(ORKFamilyHistoryTableFooterView *)footerView didSelectFooterForRelativeGroup:(NSString *)relativeGroup; + +@end + +@interface ORKFamilyHistoryTableFooterView: UIView + +- (instancetype)initWithTitle:(NSString *)title relativeGroupIdentifier:(NSString *)relativeGroupIdentifier delegate:(id)delegate; + +- (void)setExpanded:(BOOL)isExpanded; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableFooterView.m b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableFooterView.m new file mode 100644 index 0000000000..77b4890523 --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableFooterView.m @@ -0,0 +1,172 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKFamilyHistoryTableFooterView.h" + +static const CGFloat CellLeftRightPadding = 12.0; +static const CGFloat CellTopCollapsedPadding = 10.0; +static const CGFloat CellBottomCollapsedPadding = 30.0; + +static const CGFloat CellTopExpandedPadding = 0.0; +static const CGFloat CellBottomExpandedPadding = 20.0; + +static const CGFloat ViewButtonLeadingPadding = 5.0; +static const CGFloat ViewButtonTopBottomPadding = 12.0; +static const CGFloat ViewLeftRightPadding = 16.0; + +@implementation ORKFamilyHistoryTableFooterView { + NSString *_relativeGroupIdentifier; + NSString *_title; + + UILabel *_titleLabel; + UIImageView *_iconImageview; + + UIButton *_viewButton; + + NSMutableArray *_viewConstraints; + NSLayoutConstraint *topConstraint; + NSLayoutConstraint *bottomConstraint; + __weak id _delegate; +} + +- (instancetype)initWithTitle:(NSString *)title relativeGroupIdentifier:(NSString *)relativeGroupIdentifier delegate:(id)delegate { + self = [super init]; + + if (self) { + _title = [title copy]; + _relativeGroupIdentifier = [relativeGroupIdentifier copy]; + _delegate = delegate; + + self.backgroundColor = [UIColor clearColor]; + + [self setupSubviews]; + [self setupConstraints]; + [self enableAccessibilitySupport]; + } + return self; +} + +- (void)setFrame:(CGRect)frame { + frame.origin.x += ViewLeftRightPadding; + frame.size.width -= 2 * ViewLeftRightPadding; + [super setFrame:frame]; +} + +- (void)setExpanded:(BOOL)isExpanded { + topConstraint.constant = isExpanded ? -CellTopExpandedPadding : -CellTopCollapsedPadding; + bottomConstraint.constant = isExpanded ? CellBottomCollapsedPadding : CellBottomExpandedPadding; + [self setNeedsUpdateConstraints]; +} + +- (void)setupSubviews { + _viewButton = [UIButton new]; + _viewButton.translatesAutoresizingMaskIntoConstraints = NO; + _viewButton.clipsToBounds = YES; + _viewButton.layer.cornerRadius = 12.0; + [_viewButton addTarget:self action:@selector(buttonWasPressed) forControlEvents:UIControlEventTouchUpInside]; + [self addSubview:_viewButton]; + + _titleLabel = [UILabel new]; + _titleLabel.text = [_title copy]; + _titleLabel.numberOfLines = 0; + _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + _titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + _titleLabel.font = [self titleLabelFont]; + + _titleLabel.textAlignment = NSTextAlignmentLeft; + [_viewButton addSubview:_titleLabel]; + + _iconImageview = [UIImageView new]; + _iconImageview.image = [UIImage systemImageNamed:@"plus.circle.fill"]; + _iconImageview.translatesAutoresizingMaskIntoConstraints = NO; + _iconImageview.backgroundColor = [UIColor clearColor]; + _iconImageview.tintColor = [UIColor systemBlueColor]; + [_viewButton addSubview:_iconImageview]; + + [self updateViewColors]; +} + +- (void)updateViewColors { + _titleLabel.textColor = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? [UIColor whiteColor] : [UIColor systemBlueColor]; + _viewButton.backgroundColor = [UIColor secondarySystemGroupedBackgroundColor]; +} + +- (void)enableAccessibilitySupport { + self.isAccessibilityElement = true; + self.accessibilityTraits = UIAccessibilityTraitButton; + self.accessibilityLabel = [_title copy]; + self.accessibilityHint = [_title copy]; +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + [super traitCollectionDidChange:previousTraitCollection]; + [self updateViewColors]; +} + +- (void)setupConstraints { + if (_viewConstraints.count > 0) { + [NSLayoutConstraint deactivateConstraints:_viewConstraints]; + } + + _viewConstraints = [NSMutableArray new]; + + [_viewConstraints addObject:[_viewButton.leadingAnchor constraintEqualToAnchor:self.leadingAnchor]]; + [_viewConstraints addObject:[_viewButton.trailingAnchor constraintEqualToAnchor:self.trailingAnchor]]; + + topConstraint = [self.topAnchor constraintEqualToAnchor:_viewButton.topAnchor constant:-CellTopCollapsedPadding]; + [_viewConstraints addObject:topConstraint]; + + bottomConstraint = [self.bottomAnchor constraintEqualToAnchor:_viewButton.bottomAnchor constant:CellBottomCollapsedPadding]; + [_viewConstraints addObject: bottomConstraint]; + + [_viewConstraints addObject:[_titleLabel.centerYAnchor constraintEqualToAnchor:_viewButton.centerYAnchor]]; + [_viewConstraints addObject:[_titleLabel.leadingAnchor constraintEqualToAnchor:_viewButton.leadingAnchor constant:CellLeftRightPadding]]; + [_viewConstraints addObject:[_titleLabel.topAnchor constraintEqualToAnchor:_viewButton.topAnchor constant:ViewButtonTopBottomPadding]]; + [_viewConstraints addObject:[_titleLabel.bottomAnchor constraintEqualToAnchor:_viewButton.bottomAnchor constant:-ViewButtonTopBottomPadding]]; + + [_viewConstraints addObject:[_titleLabel.trailingAnchor constraintEqualToAnchor:_iconImageview.leadingAnchor constant:ViewButtonLeadingPadding]]; + [_viewConstraints addObject:[_iconImageview.centerYAnchor constraintEqualToAnchor:_viewButton.centerYAnchor]]; + [_viewConstraints addObject:[_iconImageview.trailingAnchor constraintEqualToAnchor:_viewButton.trailingAnchor constant:-CellLeftRightPadding]]; + + [NSLayoutConstraint activateConstraints:_viewConstraints]; +} + +- (UIFont *)titleLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitUIOptimized)]; + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + +- (void)buttonWasPressed { + [_delegate ORKFamilyHistoryTableFooterView:self didSelectFooterForRelativeGroup:_relativeGroupIdentifier]; +} + +@end + diff --git a/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableHeaderView.h b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableHeaderView.h new file mode 100644 index 0000000000..ee8999516a --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableHeaderView.h @@ -0,0 +1,44 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +@import UIKit; + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKFamilyHistoryTableHeaderView: UIView + +- (instancetype)initWithTitle:(NSString *)title + detailText:(nullable NSString *)text; + +- (void)setExpanded:(BOOL)isExpanded; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableHeaderView.m b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableHeaderView.m new file mode 100644 index 0000000000..9a1ab89acb --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/Family History TableView Views/ORKFamilyHistoryTableHeaderView.m @@ -0,0 +1,170 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKFamilyHistoryTableHeaderView.h" + +static const CGFloat HeaderViewLabelTopBottomPadding = 6.0; +static const CGFloat HeaderViewLeftRightLabelPadding = 11.0; +static const CGFloat HeaderViewCollapsedBottomPadding = 0.0; +static const CGFloat HeaderViewExpandedBottomPadding = 10.0; +static const CGFloat CellLeftRightPadding = 8.0; +static const CGFloat MaxDetailLabelFont = 40.0; + +@implementation ORKFamilyHistoryTableHeaderView { + NSString *_title; + UILabel *_titleLabel; + NSString *_detailText; + UILabel *_detailTextLabel; + + NSMutableArray *_viewConstraints; +} + +- (instancetype)initWithTitle:(NSString *)title detailText:(nullable NSString *)detailText { + self = [super init]; + + if (self) { + _title = [title copy]; + _detailText = [detailText copy]; + + self.backgroundColor = [UIColor clearColor]; + + [self setupSubviews]; + [self setupConstraints]; + } + return self; +} + +- (void)setFrame:(CGRect)frame { + frame.origin.x += CellLeftRightPadding; + frame.size.width -= 2 * CellLeftRightPadding; + + [super setFrame:frame]; +} + +- (void)setupSubviews { + if (_titleLabel != nil) { + [_titleLabel removeFromSuperview]; + _titleLabel = nil; + } + + if (_detailTextLabel != nil) { + [_detailTextLabel removeFromSuperview]; + _detailTextLabel = nil; + } + + _titleLabel = [[UILabel alloc] init]; + _titleLabel.numberOfLines = 0; + _titleLabel.lineBreakMode = NSLineBreakByWordWrapping; + _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + _titleLabel.text = _title; + + _titleLabel.textAlignment = NSTextAlignmentLeft; + _titleLabel.font = [self titleLabelFont]; + [self addSubview:_titleLabel]; + + if (_detailText != nil) { + _detailTextLabel = [[UILabel alloc] init]; + _detailTextLabel.numberOfLines = 0; + _detailTextLabel.lineBreakMode = NSLineBreakByWordWrapping; + _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; + _detailTextLabel.text = _detailText; + _detailTextLabel.textAlignment = NSTextAlignmentLeft; + _detailTextLabel.font = [self detailTextLabelFont]; + [self addSubview:_detailTextLabel]; + } + [self updateViewColors]; +} + +- (void)updateViewColors { + if (@available(iOS 12.0, *)) { + _detailTextLabel.textColor = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? [UIColor whiteColor] : [UIColor blackColor]; + _titleLabel.textColor = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? [UIColor whiteColor] : [UIColor blackColor]; + + } else { + _detailTextLabel.textColor = [UIColor blackColor]; + _titleLabel.textColor = [UIColor blackColor]; + } +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + [super traitCollectionDidChange:previousTraitCollection]; + [self updateViewColors]; +} + +- (void)setupConstraints { + if (_viewConstraints != nil) { + [NSLayoutConstraint deactivateConstraints:_viewConstraints]; + } + + _viewConstraints = [NSMutableArray new]; + + // titleLabel constraints + [_viewConstraints addObject:[_titleLabel.topAnchor constraintEqualToAnchor:self.topAnchor constant:HeaderViewLabelTopBottomPadding]]; + [_viewConstraints addObject:[_titleLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:HeaderViewLeftRightLabelPadding]]; + [_viewConstraints addObject:[_titleLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-HeaderViewLeftRightLabelPadding]]; + + UIView *bottomElementToConstraintViewTo; + + // detailLabel constraints if detailText was provided + if (_detailText != nil) { + [_viewConstraints addObject:[_detailTextLabel.topAnchor constraintEqualToAnchor:_titleLabel.bottomAnchor constant:HeaderViewLabelTopBottomPadding]]; + [_viewConstraints addObject:[_detailTextLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:HeaderViewLeftRightLabelPadding]]; + [_viewConstraints addObject:[_detailTextLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-HeaderViewLeftRightLabelPadding]]; + bottomElementToConstraintViewTo = _detailTextLabel; + } else { + bottomElementToConstraintViewTo = _titleLabel; + } + + // ORKFamilyHistoryTableHeaderView bottom constraint + [_viewConstraints addObject:[self.bottomAnchor constraintEqualToAnchor:bottomElementToConstraintViewTo.bottomAnchor constant:HeaderViewCollapsedBottomPadding]]; + + [NSLayoutConstraint activateConstraints:_viewConstraints]; +} + +- (void)setExpanded:(BOOL)isExpanded { + NSLayoutConstraint *bottomConstraint = [_viewConstraints lastObject]; + bottomConstraint.constant = isExpanded ? HeaderViewExpandedBottomPadding : HeaderViewCollapsedBottomPadding; + [self setNeedsUpdateConstraints]; +} + +- (UIFont *)titleLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody]; + UIFontDescriptor *fontDescriptor = [descriptor fontDescriptorWithSymbolicTraits:(UIFontDescriptorTraitBold)]; + return [UIFont fontWithDescriptor:fontDescriptor size:[[fontDescriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]]; +} + +- (UIFont *)detailTextLabelFont { + UIFontDescriptor *descriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleSubheadline]; + double fontSize = [[descriptor objectForKey: UIFontDescriptorSizeAttribute] doubleValue]; + double suggestedFontSize = MIN(fontSize, MaxDetailLabelFont); + return [UIFont fontWithDescriptor:descriptor size: suggestedFontSize]; +} + +@end diff --git a/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController.h b/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController.h new file mode 100644 index 0000000000..c1cfd0d1bb --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + + +NS_ASSUME_NONNULL_BEGIN + +ORK_CLASS_AVAILABLE +@interface ORKFamilyHistoryStepViewController : ORKStepViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController.m b/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController.m new file mode 100644 index 0000000000..ba16c4de23 --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController.m @@ -0,0 +1,802 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import "ORKFamilyHistoryStepViewController.h" + +#import "ORKAccessibilityFunctions.h" +#import "ORKFamilyHistoryRelatedPersonCell.h" +#import "ORKFamilyHistoryStepViewController_Private.h" +#import "ORKFamilyHistoryTableFooterView.h" +#import "ORKFamilyHistoryTableHeaderView.h" +#import "ORKLearnMoreStepViewController.h" +#import "ORKNavigationContainerView_Internal.h" +#import "ORKReviewIncompleteCell.h" +#import "ORKStepContainerView.h" +#import "ORKStepContentView.h" +#import "ORKStepHeaderView_Internal.h" +#import "ORKStepViewController_Internal.h" +#import "ORKTableContainerView.h" +#import "ORKTaskViewController_Internal.h" + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + + +@class ORKTaskViewController; + + +NSString * const ORKFamilyHistoryRelatedPersonCellIdentifier = @"ORKFamilyHistoryRelatedPersonCellIdentifier"; + +NSString * const ORKHealthConditionIDontKnowChoiceValue = @"do not know"; +NSString * const ORKHealthConditionNoneOfTheAboveChoiceValue = @"none of the above"; +NSString * const ORKHealthConditionPreferNotToAnswerChoiceValue = @"prefer not to answer"; + + +@interface ORKFamilyHistoryStepViewController () + +@property (nonatomic, strong) ORKTableContainerView *tableContainer; +@property (nonatomic, strong) UITableView *tableView; +@property (nonatomic, strong) ORKStepContentView *headerView; + +@end + + +@implementation ORKFamilyHistoryStepViewController { + NSArray *_constraints; + + NSArray *_relativeGroups; + NSArray *_relativeGroupOrderedTasks; + + NSMutableDictionary *> *_relatedPersons; + NSMutableArray *_displayedConditions; + NSArray *_conditionIdentifiersFromLastSession; + + NSMutableDictionary *_conditionsTextAndValues; + + NSArray *_conditionsWithinCurrentTask; + + BOOL _editingPreviousTask; + ORKRelatedPerson *_relativeForPresentedTask; +} + + +- (instancetype)ORKFamilyHistoryStepViewController_initWithResult:(ORKResult *)result { + ORKStepResult *stepResult = (ORKStepResult *)result; + if (stepResult && stepResult.results.count > 0) { + ORKFamilyHistoryResult *familyHistoryResult = (ORKFamilyHistoryResult *)stepResult.firstResult; + + if (familyHistoryResult) { + _relatedPersons = [NSMutableDictionary new]; + for (ORKRelatedPerson *relatedPerson in familyHistoryResult.relatedPersons) { + [self saveRelatedPerson:[relatedPerson copy]]; + } + + _conditionIdentifiersFromLastSession = [familyHistoryResult.displayedConditions copy]; + } + + } + + return self; +} + +- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result { + self = [super initWithStep:step]; + return [self ORKFamilyHistoryStepViewController_initWithResult:result]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self stepDidChange]; + + _relatedPersons = _relatedPersons ? : [NSMutableDictionary new]; + _displayedConditions = [NSMutableArray new]; + _conditionsTextAndValues = [NSMutableDictionary new]; + + _relativeGroups = [[self familyHistoryStep].relativeGroups copy]; + + [self configureOrderedTasks]; + + [_tableView reloadData]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear: animated]; + [_tableContainer setNeedsLayout]; +} + +- (void)stepDidChange { + [super stepDidChange]; + + [_tableContainer removeFromSuperview]; + _tableContainer = nil; + + if (self.isViewLoaded && self.step) { + _tableContainer = [[ORKTableContainerView alloc] initWithStyle:UITableViewStyleGrouped pinNavigationContainer:NO]; + _tableContainer.tableContainerDelegate = self; + [self.view addSubview:_tableContainer]; + _tableContainer.tapOffView = self.view; + + [self setupViews]; + } +} + +- (void)setupViews { + [self setupTableView]; + [self setupHeaderView]; + [self setupFooterViewIfNeeded]; + [self updateViewColors]; + + [self setupConstraints]; + [_tableContainer setNeedsLayout]; +} + +- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { + [super traitCollectionDidChange:previousTraitCollection]; + + [self setupViews]; + [self updateViewColors]; +} + +- (void)updateNavBarBackgroundColor:(UIColor *)color { + UINavigationBarAppearance *appearance = [UINavigationBarAppearance new]; + [appearance configureWithOpaqueBackground]; + appearance.backgroundColor = color; + appearance.shadowImage = [UIImage new]; + appearance.shadowColor = [UIColor clearColor]; + + self.navigationController.navigationBar.scrollEdgeAppearance = appearance; + self.navigationController.navigationBar.compactAppearance = appearance; + self.navigationController.navigationBar.standardAppearance = appearance; + + if (@available(iOS 15.0, *)) { + self.navigationController.navigationBar.compactScrollEdgeAppearance = appearance; + } +} + +- (void)setupConstraints { + if (_constraints) { + [NSLayoutConstraint deactivateConstraints:_constraints]; + } + _tableContainer.translatesAutoresizingMaskIntoConstraints = NO; + _constraints = nil; + + + _constraints = @[ + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:0.0], + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeLeft + multiplier:1.0 + constant:0.0], + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeRight + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeRight + multiplier:1.0 + constant:0.0], + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:0.0] + ]; + [NSLayoutConstraint activateConstraints:_constraints]; + +} + +- (void)setupTableView { + _tableView = _tableContainer.tableView; + [_tableView registerClass:[ORKFamilyHistoryRelatedPersonCell class] forCellReuseIdentifier:ORKFamilyHistoryRelatedPersonCellIdentifier]; + _tableView.separatorColor = [UIColor clearColor]; + _tableView.delegate = self; + _tableView.dataSource = self; + _tableView.clipsToBounds = YES; + _tableView.rowHeight = UITableViewAutomaticDimension; + _tableView.sectionHeaderHeight = UITableViewAutomaticDimension; + _tableView.estimatedRowHeight = ORKGetMetricForWindow(ORKScreenMetricTableCellDefaultHeight, self.view.window); + _tableView.estimatedSectionHeaderHeight = 30.0; +} + +- (void)setupHeaderView { + _headerView = _tableContainer.stepContentView; + _headerView.stepTopContentImage = self.step.image; + _headerView.titleIconImage = self.step.iconImage; + _headerView.stepTitle = self.step.title; + _headerView.stepText = self.step.text; + _headerView.stepDetailText = self.step.detailText; + _headerView.stepHeaderTextAlignment = self.step.headerTextAlignment; + _headerView.bodyItems = self.step.bodyItems; + _tableContainer.stepTopContentImageContentMode = self.step.imageContentMode; +} + +- (ORKFamilyHistoryStep *)familyHistoryStep { + ORKFamilyHistoryStep *step = ORKDynamicCast(self.step, ORKFamilyHistoryStep); + + if (step == nil) { + @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"the ORKFamilyHistoryStepViewController must be presented with a ORKFamilyHistoryStep" userInfo:nil]; + } + + return step; +} + +- (void)configureOrderedTasks { + NSMutableArray *relativeGroupOrderedTasks = [NSMutableArray new]; + + ORKFamilyHistoryStep *step = [self familyHistoryStep]; + + for (ORKRelativeGroup *relativeGroup in step.relativeGroups) { + NSMutableArray *steps = [NSMutableArray array]; + + // add formSteps from ORKRelativeGroup to steps array + + for (ORKFormStep *formStep in relativeGroup.formSteps) { + [steps addObject:[formStep copy]]; + } + + // configure and add health condition formStep to steps array + + NSMutableArray *formItems = [NSMutableArray new]; + + ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = [self makeConditionsTextChoiceAnswerFormat:[step.conditionStepConfiguration.conditions copy]]; + ORKFormItem *healthConditionsFormItem = [[ORKFormItem alloc] initWithIdentifier:step.conditionStepConfiguration.conditionsFormItemIdentifier + text:ORKLocalizedString(@"FAMILY_HISTORY_CONDITIONS_FORM_ITEM_TEXT", @"") + answerFormat:textChoiceAnswerFormat]; + + + healthConditionsFormItem.showsProgress = YES; + + [formItems addObject:healthConditionsFormItem]; + [formItems addObjectsFromArray:step.conditionStepConfiguration.formItems]; + + ORKFormStep *conditionFormStep = [[ORKFormStep alloc] initWithIdentifier:step.conditionStepConfiguration.stepIdentifier]; + conditionFormStep.title = ORKLocalizedString(@"FAMILY_HISTORY_CONDITIONS_STEP_TITLE", @""); + conditionFormStep.detailText = ORKLocalizedString(@"FAMILY_HISTORY_CONDITIONS_STEP_DESCRIPTION_TEMP", @""); + conditionFormStep.optional = NO; + conditionFormStep.formItems = [formItems copy]; + + [steps addObject:conditionFormStep]; + + ORKNavigableOrderedTask *orderedTask = [[ORKNavigableOrderedTask alloc] initWithIdentifier:relativeGroup.identifier steps:steps]; + [relativeGroupOrderedTasks addObject:orderedTask]; + } + + _relativeGroupOrderedTasks = [relativeGroupOrderedTasks copy]; +} + +- (ORKTextChoiceAnswerFormat *)makeConditionsTextChoiceAnswerFormat:(NSArray *)healthConditions { + NSMutableArray *conditionsWithinCurrentTask = _conditionsWithinCurrentTask ? [_conditionsWithinCurrentTask mutableCopy] : [NSMutableArray new]; + + NSMutableArray *textChoices = [NSMutableArray new]; + for (ORKHealthCondition *healthCondition in healthConditions) { + + if (![conditionsWithinCurrentTask containsObject:healthCondition.identifier]) { + [conditionsWithinCurrentTask addObject:healthCondition.identifier]; + } + + ORKTextChoice *textChoice = [[ORKTextChoice alloc] initWithText:healthCondition.displayName + detailText:nil + value:healthCondition.value + exclusive:NO]; + + [textChoices addObject:textChoice]; + + _conditionsTextAndValues[(NSString *)healthCondition.value] = healthCondition.displayName; + } + + _conditionsWithinCurrentTask = [conditionsWithinCurrentTask copy]; + + ORKTextChoice *noneOfTheAboveTextChoice = [[ORKTextChoice alloc] initWithText:ORKLocalizedString(@"FAMILY_HISTORY_NONE_OF_THE_ABOVE", @"") + detailText:nil + value:ORKHealthConditionNoneOfTheAboveChoiceValue + exclusive:YES]; + + ORKTextChoice *idkTextChoice = [[ORKTextChoice alloc] initWithText:ORKLocalizedString(@"FAMILY_HISTORY_I_DONT_KNOW", @"") + detailText:nil + value:ORKHealthConditionIDontKnowChoiceValue + exclusive:YES]; + + ORKTextChoice *preferNotToAnswerTextChoice = [[ORKTextChoice alloc] initWithText:ORKLocalizedString(@"FAMILY_HISTORY_PREFER_NOT_TO_ANSWER", @"") + detailText:nil + value:ORKHealthConditionPreferNotToAnswerChoiceValue + exclusive:YES]; + + [textChoices addObject:noneOfTheAboveTextChoice]; + [textChoices addObject:idkTextChoice]; + [textChoices addObject:preferNotToAnswerTextChoice]; + + _conditionsTextAndValues[(NSString *)noneOfTheAboveTextChoice.value] = noneOfTheAboveTextChoice.text; + _conditionsTextAndValues[(NSString *)idkTextChoice.value] = idkTextChoice.text; + _conditionsTextAndValues[(NSString *)preferNotToAnswerTextChoice.value] = preferNotToAnswerTextChoice.text; + + ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = [[ORKTextChoiceAnswerFormat alloc] initWithStyle:ORKChoiceAnswerStyleMultipleChoice + textChoices:textChoices]; + + return textChoiceAnswerFormat; +} + +- (void)presentNewOrderedTaskForRelativeGroup:(ORKRelativeGroup *)relativeGroup { + ORKNavigableOrderedTask *taskToPresent = [self taskForRelativeGroup:relativeGroup]; + + ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:taskToPresent taskRunUUID:nil]; + taskViewController.modalPresentationStyle = UIModalPresentationAutomatic; + taskViewController.delegate = self; + + [self presentViewController:taskViewController animated:YES completion:nil]; +} + +- (ORKNavigableOrderedTask *)taskForRelativeGroup:(ORKRelativeGroup *)relativeGroup { + ORKNavigableOrderedTask *task; + + for (ORKNavigableOrderedTask *orderedTask in _relativeGroupOrderedTasks) { + if ([orderedTask.identifier isEqual:relativeGroup.identifier]) { + task = orderedTask; + break; + } + } + + if (task == nil) { + @throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"An orderedTask was not found for relative group `%@`", relativeGroup.name] userInfo:nil]; + } + + return [task copy]; +} + +- (ORKRelativeGroup *)relativeGroupForRelatedPerson:(ORKRelatedPerson *)relatedPerson { + ORKRelativeGroup *relativeGroup; + + for (ORKRelativeGroup *group in _relativeGroups) { + if ([group.identifier isEqual:relatedPerson.groupIdentifier]) { + relativeGroup = group; + break; + } + } + + if (relativeGroup == nil) { + @throw [NSException exceptionWithName:NSInvalidArgumentException reason:[NSString stringWithFormat:@"An relative group was not found for related person `%@`", relatedPerson.identifier] userInfo:nil]; + } + + return [relativeGroup copy]; +} + +- (ORKRelatedPerson *)relatedPersonAtIndexPath:(NSIndexPath *)indexPath { + ORKRelativeGroup *relativeGroup = _relativeGroups[indexPath.section]; + return _relatedPersons[relativeGroup.identifier][indexPath.row]; +} + +- (void)saveRelatedPerson:(ORKRelatedPerson *)relatedPerson { + // check if array for relativeGroup is initialized + if (!_relatedPersons[relatedPerson.groupIdentifier]) { + _relatedPersons[relatedPerson.groupIdentifier] = [NSMutableArray new]; + } + + [_relatedPersons[relatedPerson.groupIdentifier] addObject:relatedPerson]; + +} + + + +- (BOOL)didReachMaxForRelativeGroup:(ORKRelativeGroup *)relativeGroup { + return _relatedPersons[relativeGroup.identifier].count >= relativeGroup.maxAllowed; +} + +- (NSDictionary *> *)getDetailInfoTextAndValuesForRelativeGroup:(ORKRelativeGroup *)relativeGroup { + NSMutableDictionary *> *detailInfoTextAndValues = [NSMutableDictionary new]; + + // parse all formSteps of the relativeGroup and check if any of its formItems are a choice type. If yes, we'll need to grab the text values from the textChoices for presentation in the tableView as opposed to presenting the value of the formItem + for (ORKFormStep *formStep in relativeGroup.formSteps) { + + for (ORKFormItem *formItem in formStep.formItems) { + + for (NSString *identifier in relativeGroup.detailTextIdentifiers) { + if ([identifier isEqual:formItem.identifier]) { + + detailInfoTextAndValues[identifier] = [NSMutableDictionary new]; + + // check if formItem.answerFormat is of type ORKTextChoiceAnswerFormat, ORKTextScaleAnswerFormat, or ORKValuePickerAnswerFormat + NSArray *textChoices = [NSArray new]; + + if ([formItem.answerFormat isKindOfClass:[ORKTextChoiceAnswerFormat class]]) { + ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = (ORKTextChoiceAnswerFormat *)formItem.answerFormat; + textChoices = textChoiceAnswerFormat.textChoices; + } else if ([formItem.answerFormat isKindOfClass:[ORKTextScaleAnswerFormat class]]) { + ORKTextScaleAnswerFormat *textScaleAnswerFormat = (ORKTextScaleAnswerFormat *)formItem.answerFormat; + textChoices = textScaleAnswerFormat.textChoices; + } else if ([formItem.answerFormat isKindOfClass:[ORKValuePickerAnswerFormat class]]) { + ORKValuePickerAnswerFormat *valuePickerAnswerFormat = (ORKValuePickerAnswerFormat *)formItem.answerFormat; + textChoices = valuePickerAnswerFormat.textChoices; + } + + for (ORKTextChoice *textChoice in textChoices) { + if ([textChoice.value isKindOfClass:[NSString class]]) { + NSString *stringValue = (NSString *)textChoice.value; + detailInfoTextAndValues[identifier][stringValue] = textChoice.text; + } + } + } + } + } + } + + return [detailInfoTextAndValues copy]; +} + +- (NSArray *)flattenRelatedPersonArrays { + NSMutableArray *relatedPersons = [NSMutableArray new]; + + for (NSString *key in _relatedPersons) { + [relatedPersons addObjectsFromArray:_relatedPersons[key]]; + } + + return [relatedPersons copy]; +} + +- (void)notifyDelegateOnResultChange { + [super notifyDelegateOnResultChange]; + + if (self.hasNextStep == NO) { + self.continueButtonItem = self.internalDoneButtonItem; + } else { + self.continueButtonItem = self.internalContinueButtonItem; + } + + self.skipButtonItem = self.internalSkipButtonItem; +} + +- (ORKStepResult *)result { + ORKStepResult *stepResult = [super result]; + + NSMutableArray *results = [NSMutableArray arrayWithArray:stepResult.results]; + ORKFamilyHistoryResult *familyHistoryResult = [[ORKFamilyHistoryResult alloc] initWithIdentifier:[self step].identifier]; + familyHistoryResult.startDate = stepResult.startDate; + familyHistoryResult.endDate = stepResult.endDate; + familyHistoryResult.relatedPersons = [self flattenRelatedPersonArrays]; + familyHistoryResult.displayedConditions = [_displayedConditions copy]; + [results addObject:familyHistoryResult]; + + stepResult.results = [results copy]; + + return stepResult; +} + +- (void)resultUpdated { + // For subclasses +} + +- (nonnull UITableViewCell *)currentFirstResponderCellForTableContainerView:(nonnull ORKTableContainerView *)tableContainerView { + return [UITableViewCell new]; +} + +#pragma mark ORKTaskViewControllerDelegate + +- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskFinishReason)reason error:(NSError *)error { + [self dismissViewControllerAnimated:YES completion:^{ + switch (reason) { + case ORKTaskFinishReasonFailed: + case ORKTaskFinishReasonDiscarded: + break; + case ORKTaskFinishReasonSaved: + case ORKTaskFinishReasonCompleted: + case ORKTaskFinishReasonEarlyTermination: + [self handleRelatedPersonTaskResult:taskViewController.result taskIdentifier:taskViewController.task.identifier]; + [self updateDisplayedConditionsFromTaskResult:taskViewController.result]; + break; + } + + self->_editingPreviousTask = NO; + self->_relativeForPresentedTask = nil; + }]; +} + +- (void)taskViewController:(ORKTaskViewController *)taskViewController learnMoreButtonPressedWithStep:(ORKLearnMoreInstructionStep *)learnMoreStep forStepViewController:(ORKStepViewController *)stepViewController { + ORKLearnMoreStepViewController *learnMoreStepViewController = [[ORKLearnMoreStepViewController alloc] initWithStep:learnMoreStep result:nil]; + [stepViewController presentViewController:[[UINavigationController alloc] initWithRootViewController:learnMoreStepViewController] animated:YES completion:nil]; +} + +#pragma mark ORKFamilyHistoryRelatedPersonCellDelegate + +- (void)familyHistoryRelatedPersonCell:(ORKFamilyHistoryRelatedPersonCell *)relatedPersonCell tappedOption:(ORKFamilyHistoryTooltipOption)option { + NSIndexPath *indexPath = [_tableView indexPathForCell:relatedPersonCell]; + ORKRelatedPerson *currentRelatedPerson = [self relatedPersonAtIndexPath:indexPath]; + + if (currentRelatedPerson) { + switch (option) { + case ORKFamilyHistoryTooltipOptionEdit: { + // edit flow for ORKRelatedPerson + ORKRelativeGroup *relativeGroup = [self relativeGroupForRelatedPerson:currentRelatedPerson]; + ORKNavigableOrderedTask *relatedPersonTask = [self taskForRelativeGroup:relativeGroup]; + + _editingPreviousTask = YES; + _relativeForPresentedTask = [currentRelatedPerson copy]; + + ORKTaskViewController *taskVC = [[ORKTaskViewController alloc] initWithTask:relatedPersonTask + ongoingResult:currentRelatedPerson.taskResult + restoreAtFirstStep:YES + defaultResultSource:nil + delegate:self]; + + + [self presentViewController:taskVC animated:YES completion:nil]; + break; + } + + case ORKFamilyHistoryTooltipOptionDelete: { + // delete flow for ORKRelatedPerson + UIAlertController *deleteAlert = [UIAlertController alertControllerWithTitle:ORKLocalizedString(@"FAMILY_HISTORY_DELETE_ENTRY_TITLE", @"") + message:nil + preferredStyle:UIAlertControllerStyleActionSheet]; + + UIAlertAction* unfollowAction = [UIAlertAction actionWithTitle:ORKLocalizedString(@"FAMILY_HISTORY_DELETE_ENTRY", @"") + style:UIAlertActionStyleDestructive + handler:^(UIAlertAction * action) { + [self->_relatedPersons[currentRelatedPerson.groupIdentifier] removeObject:currentRelatedPerson]; + NSIndexSet *section = [NSIndexSet indexSetWithIndex:indexPath.section]; + [self->_tableView reloadSections:section withRowAnimation:UITableViewRowAnimationAutomatic]; + [self resultUpdated]; + }]; + + UIAlertAction* cancelAction = [UIAlertAction actionWithTitle:ORKLocalizedString(@"FAMILY_HISTORY_CANCEL", @"") + style:UIAlertActionStyleCancel + handler:nil]; + + [deleteAlert addAction:unfollowAction]; + [deleteAlert addAction:cancelAction]; + [self presentViewController:deleteAlert animated:YES completion:nil]; + break; + } + } + } +} + +#pragma mark ORKFamilyHistoryTableFooterViewDelegate + +- (void)ORKFamilyHistoryTableFooterView:(ORKFamilyHistoryTableFooterView *)footerView didSelectFooterForRelativeGroup:(NSString *)groupIdentifier { + for (ORKRelativeGroup *relativeGroup in _relativeGroups) { + if ([relativeGroup.identifier isEqual:groupIdentifier]) { + if (![self didReachMaxForRelativeGroup:[relativeGroup copy]]) { + [self presentNewOrderedTaskForRelativeGroup:[relativeGroup copy]]; + } + } + } +} + +@end + +@implementation ORKFamilyHistoryStepViewController (ORKFamilyHistoryReviewSupport) + +- (void)updateViewColors { + UIColor *updateColor = self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ? [UIColor systemGray6Color] : [UIColor systemGroupedBackgroundColor];; + self.view.backgroundColor = updateColor; + self.tableView.backgroundColor = updateColor; + [self updateNavBarBackgroundColor: updateColor]; +} + +- (void)setupFooterViewIfNeeded { + _navigationFooterView = _tableContainer.navigationFooterView; + _navigationFooterView.skipButtonItem = self.skipButtonItem; + _navigationFooterView.continueEnabled = YES; + _navigationFooterView.continueButtonItem = self.continueButtonItem; + _navigationFooterView.optional = self.step.optional; + + [_navigationFooterView removeStyling]; +} + +- (void)handleRelatedPersonTaskResult:(ORKTaskResult *)taskResult taskIdentifier:(NSString *)identifier { + ORKFamilyHistoryStep *familyHistoryStep = [self familyHistoryStep]; + + // If the user is editing a previous task, just update the result of the relatedPerson + if (_editingPreviousTask && _relativeForPresentedTask) { + _relativeForPresentedTask.taskResult = taskResult; + + NSInteger index = 0; + + for (ORKRelatedPerson *relatedPerson in _relatedPersons[identifier]) { + if ([relatedPerson.identifier isEqual:_relativeForPresentedTask.identifier]) { + break; + } + + index += 1; + } + + _relatedPersons[identifier][index] = [_relativeForPresentedTask copy]; + + + [_tableView reloadData]; + } else { + + // create new relatedPerson object and attach taskResult + for (ORKRelativeGroup *relativeGroup in familyHistoryStep.relativeGroups) { + if ([relativeGroup.identifier isEqual:identifier]) { + ORKRelatedPerson *relatedPerson = [[ORKRelatedPerson alloc] initWithIdentifier:[NSUUID new].UUIDString + groupIdentifier:identifier + identifierForCellTitle:relativeGroup.identifierForCellTitle + taskResult:taskResult]; + + [self saveRelatedPerson:[relatedPerson copy]]; + [_tableView reloadData]; + break; + } + } + } + + [self resultUpdated]; + + [_tableContainer setNeedsLayout]; +} + +- (NSInteger)numberOfRowsForRelativeGroupInSection:(NSInteger)section { + ORKRelativeGroup *relativeGroup = _relativeGroups[section]; + return _relatedPersons[relativeGroup.identifier].count; +} + +- (void)updateDisplayedConditionsFromTaskResult:(ORKTaskResult *)taskResult { + ORKFamilyHistoryStep *step = [self familyHistoryStep]; + + ORKStepResult *stepResult = (ORKStepResult *)[taskResult resultForIdentifier:step.conditionStepConfiguration.stepIdentifier]; + + // if stepResult is nil, then choiceQuestionResult will also be nil here + ORKChoiceQuestionResult *choiceQuestionResult = (ORKChoiceQuestionResult *)[stepResult resultForIdentifier:step.conditionStepConfiguration.conditionsFormItemIdentifier]; + + // if choiceQuestionResult is nil, then choiceQuestionResult.choiceAnswers is nil + NSArray *conditionsIdentifiers = choiceQuestionResult.choiceAnswers != nil ? _conditionsWithinCurrentTask : [NSArray new]; + + for (NSString *conditionIdentifier in conditionsIdentifiers) { + if (![_displayedConditions containsObject:conditionIdentifier]) { + [_displayedConditions addObject:conditionIdentifier]; + } + } +} + + +#pragma mark UITableViewDataSource + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return _relativeGroups.count; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [self numberOfRowsForRelativeGroupInSection:section]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + ORKRelativeGroup *relativeGroup = _relativeGroups[indexPath.section]; + + // present a related person cell + ORKFamilyHistoryRelatedPersonCell *cell = [tableView dequeueReusableCellWithIdentifier:ORKFamilyHistoryRelatedPersonCellIdentifier]; + [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; + + ORKFamilyHistoryStep *familyHistoryStep = [self familyHistoryStep]; + + BOOL didReachMaxNumberOfRelatives = [self didReachMaxForRelativeGroup:relativeGroup]; + BOOL shouldAddExtraSpaceBelowCell = ([self numberOfRowsForRelativeGroupInSection:indexPath.section] == (indexPath.row + 1)) && !didReachMaxNumberOfRelatives; + ORKRelatedPerson *relatedPerson = [self relatedPersonAtIndexPath:indexPath]; + + + NSString *title = [relatedPerson getTitleValueWithIdentifier:relativeGroup.identifierForCellTitle]; + + cell.title = title != nil ? title : [NSString stringWithFormat:@"%@ %ld", relativeGroup.name, indexPath.row + 1]; + cell.relativeID = [relatedPerson.identifier copy]; + NSArray *detailValues = [relatedPerson getDetailListValuesWithIdentifiers:relativeGroup.detailTextIdentifiers + displayInfoKeyAndValues:[self getDetailInfoTextAndValuesForRelativeGroup:relativeGroup]]; + + NSArray *conditionValues = [relatedPerson getConditionsListWithStepIdentifier:familyHistoryStep.conditionStepConfiguration.stepIdentifier + formItemIdentifier:familyHistoryStep.conditionStepConfiguration.conditionsFormItemIdentifier + conditionsKeyValues:[_conditionsTextAndValues copy]]; + [cell configureWithDetailValues:detailValues conditionsValues:conditionValues isLastItemBeforeAddRelativeButton:shouldAddExtraSpaceBelowCell]; + cell.delegate = self; + + return cell; +} + +#pragma mark UITableViewDelegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [tableView deselectRowAtIndexPath:indexPath animated:NO]; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + return UITableViewAutomaticDimension; +} + +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { + ORKRelativeGroup *relativeGroup = _relativeGroups[section]; + + ORKFamilyHistoryTableHeaderView *headerView = (ORKFamilyHistoryTableHeaderView *)[tableView dequeueReusableHeaderFooterViewWithIdentifier:@(section).stringValue]; + + if (headerView == nil) { + headerView = [[ORKFamilyHistoryTableHeaderView alloc] initWithTitle:relativeGroup.sectionTitle detailText:relativeGroup.sectionDetailText]; + } + + BOOL isExpanded = _relatedPersons[relativeGroup.identifier].count > 0; + [headerView setExpanded:isExpanded]; + + return headerView; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { + ORKRelativeGroup *relativeGroup = _relativeGroups[section]; + + if ([self didReachMaxForRelativeGroup:relativeGroup]) { + return 0; + } + + return UITableViewAutomaticDimension; +} + +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { + ORKFamilyHistoryTableFooterView *footerView = (ORKFamilyHistoryTableFooterView *)[tableView dequeueReusableHeaderFooterViewWithIdentifier:@(section).stringValue]; + ORKRelativeGroup *relativeGroup = _relativeGroups[section]; + + if (footerView == nil) { + footerView = [[ORKFamilyHistoryTableFooterView alloc] initWithTitle:[NSString stringWithFormat:ORKLocalizedString(@"FAMILY_HISTORY_ADD", @"") ,relativeGroup.name] + relativeGroupIdentifier:[relativeGroup.identifier copy] + delegate:self]; + } + + BOOL isExpanded = _relatedPersons[relativeGroup.identifier].count > 0; + [footerView setExpanded:isExpanded]; + + return footerView; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return UITableViewAutomaticDimension; +} + + +@end diff --git a/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController_Private.h b/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController_Private.h new file mode 100644 index 0000000000..9cecd0cc88 --- /dev/null +++ b/ResearchKitUI/Common/Step/Family History/ORKFamilyHistoryStepViewController_Private.h @@ -0,0 +1,44 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN +@interface ORKFamilyHistoryStepViewController (ORKFamilyHistoryReviewSupport) + +- (void)setupFooterViewIfNeeded; +- (void)handleRelatedPersonTaskResult:(ORKTaskResult *)taskResult taskIdentifier:(NSString *)identifier; +- (void)updateDisplayedConditionsFromTaskResult:(ORKTaskResult *)taskResult; +- (NSInteger)numberOfRowsForRelativeGroupInSection:(NSInteger)section; +- (void)updateViewColors; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Step/Form Step/ORKAnswerFormat+FormStepViewControllerAdditions.h b/ResearchKitUI/Common/Step/Form Step/ORKAnswerFormat+FormStepViewControllerAdditions.h new file mode 100644 index 0000000000..9666127721 --- /dev/null +++ b/ResearchKitUI/Common/Step/Form Step/ORKAnswerFormat+FormStepViewControllerAdditions.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ORKAnswerFormat (FormStepViewControllerAdditions) + +@property(nonatomic, nullable, readonly) Class formStepViewControllerCellClass; + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/Step/Form Step/ORKAnswerFormat+FormStepViewControllerAdditions.m b/ResearchKitUI/Common/Step/Form Step/ORKAnswerFormat+FormStepViewControllerAdditions.m new file mode 100644 index 0000000000..313febfc0d --- /dev/null +++ b/ResearchKitUI/Common/Step/Form Step/ORKAnswerFormat+FormStepViewControllerAdditions.m @@ -0,0 +1,158 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKAnswerFormat+FormStepViewControllerAdditions.h" + +#import "ORKFormItemCell.h" + +#import + +NS_ASSUME_NONNULL_BEGIN + +@implementation ORKAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + Class result = nil; + + ORKQuestionType type = self.questionType; + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeDateAndTime); + matchesType = matchesType || (type == ORKQuestionTypeDate); + matchesType = matchesType || (type == ORKQuestionTypeTimeOfDay); + matchesType = matchesType || (type == ORKQuestionTypeTimeInterval); + matchesType = matchesType || (type == ORKQuestionTypeMultiplePicker); + matchesType = matchesType || (type == ORKQuestionTypeHeight); + matchesType = matchesType || (type == ORKQuestionTypeWeight); + matchesType = matchesType || (type == ORKQuestionTypeAge); + matchesType = matchesType || (type == ORKQuestionTypeYear); + result = matchesType ? [ORKFormItemPickerCell class] : result; + } + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeDecimal); + matchesType = matchesType || (type == ORKQuestionTypeInteger); + result = matchesType ? [ORKFormItemNumericCell class] : result; + } + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeScale); + result = matchesType ? [ORKFormItemScaleCell class] : result; + } + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeLocation); + result = matchesType ? [ORKFormItemLocationCell class] : result; + } +#endif + + if (result == nil) { + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeSES); + result = matchesType ? [ORKFormItemSESCell class] : result; + } + + return result; +} + +@end + +@implementation ORKImageChoiceAnswerFormat (FormStepViewControllerAdditions) + + +- (nullable Class)formStepViewControllerCellClass { + ORKQuestionType type = self.questionType; + + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeSingleChoice); + matchesType = matchesType || (type == ORKQuestionTypeMultipleChoice); + + Class result = matchesType ? [ORKFormItemImageSelectionCell class] : [super formStepViewControllerCellClass]; + return result; +} + +@end + +@implementation ORKValuePickerAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + ORKQuestionType type = self.questionType; + + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeSingleChoice); + matchesType = matchesType || (type == ORKQuestionTypeMultipleChoice); + + Class result = matchesType ? [ORKFormItemPickerCell class] : [super formStepViewControllerCellClass]; + return result; +} + +@end + +@implementation ORKConfirmTextAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + ORKQuestionType type = self.questionType; + + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeText); + + Class result = matchesType ? [ORKFormItemConfirmTextCell class] : [super formStepViewControllerCellClass]; + return result; +} + +@end + +@implementation ORKTextAnswerFormat (FormStepViewControllerAdditions) + +- (nullable Class)formStepViewControllerCellClass { + Class result = nil; + + ORKQuestionType type = self.questionType; + BOOL matchesType = NO; + matchesType = matchesType || (type == ORKQuestionTypeText); + + if (matchesType == YES) { + result = (self.multipleLines == YES) ? [ORKFormItemTextCell class] : [ORKFormItemTextFieldCell class]; + } else { + result = [super formStepViewControllerCellClass]; + } + + return result; +} + + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKFormStepViewController.h b/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKFormStepViewController.h rename to ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController.h index 044e697622..3f160e551f 100644 --- a/ResearchKit/Common/ORKFormStepViewController.h +++ b/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController.m b/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController.m new file mode 100644 index 0000000000..cabc4cce75 --- /dev/null +++ b/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController.m @@ -0,0 +1,2433 @@ +/* + Copyright (c) 2015, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import "ORKFormStepViewController.h" + +#import "ORKCaption1Label.h" +#import "ORKChoiceViewCell_Internal.h" +#import "ORKChoiceViewCell+ORKColorChoice.h" +#import "ORKColorChoiceCellGroup.h" +#import "ORKFormItemCell.h" +#import "ORKFormSectionTitleLabel.h" +#import "ORKStepHeaderView_Internal.h" +#import "ORKTableContainerView.h" +#import "ORKStepContentView.h" +#import "ORKBodyItem.h" +#import "ORKLearnMoreView.h" + +#import "ORKBodyItem.h" + +#import "ORKLearnMoreStepViewController.h" +#import "ORKSurveyCardHeaderView.h" +#import "ORKTextChoiceCellGroup.h" +#import "ORKAnswerTextView.h" + +#import "ORKNavigationContainerView_Internal.h" +#import "ORKStepViewController_Internal.h" +#import "ORKTaskViewController_Internal.h" + +#import "ORKAnswerFormat_Internal.h" +#import "ORKAnswerFormat+FormStepViewControllerAdditions.h" +#import "ORKCollectionResult_Private.h" +#import "ORKQuestionResult_Private.h" +#import "ORKFormItem_Internal.h" +#import "ORKFormStep_Internal.h" +#import "ORKResult_Private.h" +#import "ORKStep_Private.h" + +#import "ORKSESSelectionView.h" +#import "ORKHelpers_Internal.h" +#import "ORKSkin.h" +#import "ORKChoiceViewCell+ORKTextChoice.h" +#import "ORKAccessibilityFunctions.h" +#import "ORKTagLabel.h" + +#import "ORKQuestionStep.h" + +#import + + +static const CGFloat TableViewYOffsetStandard = 30.0; +static const NSTimeInterval DelayBeforeAutoScroll = 0.25; + +NSString * const ORKSurveyCardHeaderViewIdentifier = @"SurveyCardHeaderViewIdentifier"; +NSString * const ORKFormStepViewAccessibilityIdentifier = @"ORKFormStepView"; + +@interface ORKFormItem (FormStepViewControllerExtensions) + +- (BOOL)requiresSingleSection; + +@end + +@interface ORKTableCellItemIdentifier : NSObject + +- (instancetype)initWithFormItemIdentifier:(NSString *)formItemIdentifier choiceIndex:(NSInteger)index; + +@property (nonatomic, copy, readonly) NSString *formItemIdentifier; +@property (nonatomic, readonly) NSInteger choiceIndex; + +@end + +@implementation ORKTableCellItemIdentifier + +- (instancetype)initWithFormItemIdentifier:(NSString *)formItemIdentifier choiceIndex:(NSInteger)index { + self = [super init]; + if (self != nil) { + _formItemIdentifier = [formItemIdentifier copy]; + _choiceIndex = index; + } + return self; +} + +- (NSUInteger)hash { + return _formItemIdentifier.hash ^ _choiceIndex; +} + +- (BOOL)isEqual:(id)object { + if ([self class] != [object class]) { + return NO; + } + + __typeof(self) castObject = object; + return (ORKEqualObjects(_formItemIdentifier, castObject->_formItemIdentifier) + && (_choiceIndex == castObject->_choiceIndex)); +} + +- (nonnull id)copyWithZone:(nullable NSZone *)zone { + __typeof(self) copy = [[[self class] alloc] init]; + copy->_formItemIdentifier = [_formItemIdentifier copy]; + copy->_choiceIndex = _choiceIndex; + return copy; +} + +- (NSString *)description { + NSString *indexString = (_choiceIndex == NSNotFound) ? @"NSNotFound" : @(_choiceIndex).stringValue; + return [NSString stringWithFormat:@"[%@ '%@', index: %@]", [super description], _formItemIdentifier, indexString]; +} + +@end + +@interface ORKTableCellItem : NSObject + +- (instancetype)initWithFormItem:(ORKFormItem *)formItem; +- (instancetype)initWithFormItem:(ORKFormItem *)formItem choiceIndex:(NSUInteger)index; + +@property (nonatomic, copy) ORKFormItem *formItem; + +@property (nonatomic, copy) ORKAnswerFormat *answerFormat; + +@property (nonatomic, readonly) CGFloat labelWidth; + +// For choice types only +@property (nonatomic, copy, readonly) ORKTextChoice *choice; + +@end + + +@implementation ORKTableCellItem + +- (instancetype)initWithFormItem:(ORKFormItem *)formItem { + self = [super init]; + if (self) { + self.formItem = formItem; + _answerFormat = [[formItem impliedAnswerFormat] copy]; + } + return self; +} + +- (instancetype)initWithFormItem:(ORKFormItem *)formItem choiceIndex:(NSUInteger)index { + self = [super init]; + if (self) { + self.formItem = formItem; + _answerFormat = [[formItem impliedAnswerFormat] copy]; + + if ([self textChoiceAnswerFormat] != nil) { + _choice = [self.textChoiceAnswerFormat.textChoices[index] copy]; + } + } + return self; +} + +- (ORKTextChoiceAnswerFormat *)textChoiceAnswerFormat { + if ([self.answerFormat isKindOfClass:[ORKTextChoiceAnswerFormat class]]) { + return (ORKTextChoiceAnswerFormat *)self.answerFormat; + } + return nil; +} + +- (CGFloat)labelWidth { + static ORKCaption1Label *sharedLabel; + + if (sharedLabel == nil) { + sharedLabel = [ORKCaption1Label new]; + } + + sharedLabel.text = _formItem.text; + + return [sharedLabel textRectForBounds:CGRectInfinite limitedToNumberOfLines:1].size.width; +} + +@end + + +@interface ORKTableSection : NSObject + +- (instancetype)initWithSectionIndex:(NSUInteger)index; + +@property (nonatomic, assign, readonly) NSUInteger index; + +@property (nonatomic, copy) NSString *title; + +@property (nonatomic, copy, nullable) NSString *detailText; + +@property (nonatomic) BOOL showsProgress; + +@property (nonatomic, nullable) ORKLearnMoreItem *learnMoreItem; + +@property (nonatomic, copy, nullable) NSString *tagText; + +// ORKTableCellItem +@property (nonatomic, copy, readonly) NSArray *items; + +@property (nonatomic, readonly) BOOL hasChoiceRows; + +@property (nonatomic, strong) ORKTextChoiceCellGroup *textChoiceCellGroup; + +@property (nonatomic, strong) ORKColorChoiceCellGroup *colorChoiceCellGroup; + +- (void)addFormItem:(ORKFormItem *)item; + +- (BOOL)containsFormItem:(ORKFormItem *)formItem; + +@property (nonatomic, readonly) CGFloat maxLabelWidth; + +@end + + +@implementation ORKTableSection + +- (instancetype)initWithSectionIndex:(NSUInteger)index { + self = [super init]; + if (self) { + _items = [NSMutableArray new]; + self.title = nil; + _index = index; + } + return self; +} + +- (void)setTitle:(NSString *)title { + _title = title; +} + +- (void)addFormItem:(ORKFormItem *)item { + if ([[item impliedAnswerFormat] isKindOfClass:[ORKTextChoiceAnswerFormat class]]) { + _hasChoiceRows = YES; + ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = (ORKTextChoiceAnswerFormat *)[item impliedAnswerFormat]; + + _textChoiceCellGroup = [[ORKTextChoiceCellGroup alloc] initWithTextChoiceAnswerFormat:textChoiceAnswerFormat + answer:nil + beginningIndexPath:[NSIndexPath indexPathForRow:0 inSection:_index] + immediateNavigation:NO]; + + [textChoiceAnswerFormat.textChoices enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + ORKTableCellItem *cellItem = [[ORKTableCellItem alloc] initWithFormItem:item choiceIndex:idx]; + [(NSMutableArray *)self.items addObject:cellItem]; + }]; + + } else { + + if ([[item impliedAnswerFormat] isKindOfClass:[ORKColorChoiceAnswerFormat class]]) { + _hasChoiceRows = YES; + ORKColorChoiceAnswerFormat *colorChoiceAnswerFormat = (ORKColorChoiceAnswerFormat *)[item impliedAnswerFormat]; + + _colorChoiceCellGroup = [[ORKColorChoiceCellGroup alloc] initWithColorChoiceAnswerFormat:colorChoiceAnswerFormat + answer:nil + beginningIndexPath:[NSIndexPath indexPathForRow:0 inSection:_index] + immediateNavigation:NO]; + + [colorChoiceAnswerFormat.colorChoices enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + ORKTableCellItem *cellItem = [[ORKTableCellItem alloc] initWithFormItem:item choiceIndex:idx]; + [(NSMutableArray *)self.items addObject:cellItem]; + }]; + + return; + } + + ORKTableCellItem *cellItem = [[ORKTableCellItem alloc] initWithFormItem:item]; + [(NSMutableArray *)self.items addObject:cellItem]; + } +} + +- (BOOL)containsFormItem:(ORKFormItem *)formItem { + for (ORKTableCellItem *cellItem in _items) { + if (cellItem.formItem.identifier == formItem.identifier) { + return YES; + } + } + + return NO; +} + +- (CGFloat)maxLabelWidth { + CGFloat max = 0; + for (ORKTableCellItem *item in self.items) { + if (item.labelWidth > max) { + max = item.labelWidth; + } + } + return max; +} + +@end + +@interface ORKFormSectionHeaderView : UIView + +- (instancetype)initWithTitle:(NSString *)title tableView:(UITableView *)tableView firstSection:(BOOL)firstSection; + +@property (nonatomic, strong) NSLayoutConstraint *leftMarginConstraint; + +@property (nonatomic, weak) UITableView *tableView; + +@end + + +@implementation ORKFormSectionHeaderView { + ORKFormSectionTitleLabel *_label; + BOOL _firstSection; +} + +- (instancetype)initWithTitle:(NSString *)title tableView:(UITableView *)tableView firstSection:(BOOL)firstSection { + self = [super init]; + if (self) { + _tableView = tableView; + _firstSection = firstSection; + self.backgroundColor = [UIColor whiteColor]; + + _label = [ORKFormSectionTitleLabel new]; + _label.text = title; + _label.numberOfLines = 0; + _label.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:_label]; + [self setUpConstraints]; + } + return self; +} + +- (void)setUpConstraints { + const CGFloat LabelFirstBaselineToTop = _firstSection ? 20.0 : 40.0; + const CGFloat LabelLastBaselineToBottom = -10.0; + const CGFloat LabelRightMargin = -4.0; + + NSMutableArray *constraints = [NSMutableArray new]; + [constraints addObject:[NSLayoutConstraint constraintWithItem:_label + attribute:NSLayoutAttributeFirstBaseline + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:LabelFirstBaselineToTop]]; + + self.leftMarginConstraint = [NSLayoutConstraint constraintWithItem:_label + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeLeft + multiplier:1.0 + constant:0.0]; + + [constraints addObject:self.leftMarginConstraint]; + + [constraints addObject:[NSLayoutConstraint constraintWithItem:_label + attribute:NSLayoutAttributeLastBaseline + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:LabelLastBaselineToBottom]]; + + [constraints addObject:[NSLayoutConstraint constraintWithItem:_label + attribute:NSLayoutAttributeRight + relatedBy:NSLayoutRelationEqual + toItem:self + attribute:NSLayoutAttributeRight + multiplier:1.0 + constant:LabelRightMargin]]; + + [NSLayoutConstraint activateConstraints:constraints]; +} + +- (void)updateConstraints { + [super updateConstraints]; + self.leftMarginConstraint.constant = _tableView.layoutMargins.left; +} + +@end + + +@interface ORKFormStepViewController () + +@property (nonatomic, strong) ORKTableContainerView *tableContainer; +@property (nonatomic, strong) UITableView *tableView; +@property (nonatomic, strong) UITableViewDiffableDataSource *diffableDataSource; +@property (nonatomic, strong) ORKStepContentView *headerView; + +@property (nonatomic, strong) NSMutableDictionary *savedAnswers; +@property (nonatomic, strong) NSMutableDictionary *savedAnswerDates; +@property (nonatomic, strong) NSMutableDictionary *savedSystemCalendars; +@property (nonatomic, strong) NSMutableDictionary *savedSystemTimeZones; +@property (nonatomic, strong) NSDictionary *originalAnswers; + +@property (nonatomic, strong) NSMutableDictionary *savedDefaults; + +@end + + +@implementation ORKFormStepViewController { + ORKAnswerDefaultSource *_defaultSource; + NSMutableSet *_formItemCells; + + NSMutableSet *_identifiersOfAnsweredSections; + BOOL _skipped; + BOOL _autoScrollCancelled; + UITableViewCell *_currentFirstResponderCell; + NSArray *_constraints; + NSInteger _maxLabelWidth; +} + +- (instancetype)ORKFormStepViewController_initWithResult:(ORKResult *)result { +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + _defaultSource = [ORKAnswerDefaultSource sourceWithHealthStore:[HKHealthStore new]]; +#endif + + if (result) { + NSAssert([result isKindOfClass:[ORKStepResult class]], @"Expect a ORKStepResult instance"); + + NSArray *resultsArray = [(ORKStepResult *)result results]; + for (ORKQuestionResult *currentResult in resultsArray) { + id answer = currentResult.answer ? : ORKNullAnswerValue(); + [self setAnswer:answer forIdentifier:currentResult.identifier]; + } + self.originalAnswers = [[NSDictionary alloc] initWithDictionary:self.savedAnswers]; + } + return self; +} + +- (instancetype)initWithStep:(ORKStep *)step { + self = [super initWithStep:step]; + return [self ORKFormStepViewController_initWithResult:nil]; +} + +- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result { + + self = [super initWithStep:step]; + return [self ORKFormStepViewController_initWithResult:result]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self stepDidChange]; + + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; + + self.view.accessibilityIdentifier = ORKFormStepViewAccessibilityIdentifier; +} + +- (BOOL)isContentSizeWithinFrame { + return _tableView.contentSize.height <= _tableView.bounds.size.height; +} + +- (BOOL)isContentSizeLargerThanFrame { + BOOL isContentSizeLargerThanBounds = _tableView.contentSize.height > _tableView.bounds.size.height; + BOOL multipleCells = [self visibleFormItems].count >= 2; + return (isContentSizeLargerThanBounds && multipleCells); +} + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + [_tableContainer sizeHeaderToFit]; + [_tableContainer resizeFooterToFitUsingMinHeight:NO]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [self updateAnsweredSections]; + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + NSMutableSet *types = [NSMutableSet set]; + for (ORKFormItem *item in [self answerableFormItems]) { + ORKAnswerFormat *format = [item answerFormat]; + HKObjectType *objType = [format healthKitObjectTypeForAuthorization]; + if (objType) { + [types addObject:objType]; + } + } + + BOOL refreshDefaultsPending = NO; + if (types.count) { + NSSet *alreadyRequested = [[self taskViewController] requestedHealthTypesForRead]; + if (![types isSubsetOfSet:alreadyRequested]) { + refreshDefaultsPending = YES; + [_defaultSource.healthStore requestAuthorizationToShareTypes:nil readTypes:types completion:^(BOOL success, NSError *error) { + if (!success) { + ORK_Log_Debug("Authorization: %@",error); + } + dispatch_async(dispatch_get_main_queue(), ^{ + [self refreshDefaults]; + }); + }]; + } + } + if (!refreshDefaultsPending) { + [self refreshDefaults]; + } +#endif + + // Reset skipped flag - result can now be non-empty + _skipped = NO; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil); + _autoScrollCancelled = NO; +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + _autoScrollCancelled = YES; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIContentSizeCategoryDidChangeNotification object:nil]; +} + +/// returns YES if the answeredSections changed +- (BOOL)updateAnsweredSections { + NSSet *oldValue = [_identifiersOfAnsweredSections copy]; + NSMutableSet *newValue = [NSMutableSet new]; + + NSDiffableDataSourceSnapshot *snapshot = [_diffableDataSource snapshot]; + for (NSString *eachSectionIdentifier in [snapshot sectionIdentifiers]) { + + for (ORKTableCellItemIdentifier *itemIdentifier in [snapshot itemIdentifiersInSectionWithIdentifier:eachSectionIdentifier]) { + id answer = _savedAnswers[itemIdentifier.formItemIdentifier]; + if (ORKIsAnswerEmpty(answer) == NO) { + + [newValue addObject:eachSectionIdentifier]; + } + } + + } + + _identifiersOfAnsweredSections = [newValue mutableCopy]; + + BOOL answeredSectionsChanged = [oldValue isEqualToSet:newValue] ? NO : YES; + return answeredSectionsChanged; +} + +- (void)updateDefaults:(NSMutableDictionary *)defaults { + _savedDefaults = defaults; + + __auto_type snapshot = [_diffableDataSource snapshot]; + NSMutableArray *itemIdentifiersToReload = [NSMutableArray array]; + + for (ORKFormItemCell *cell in [_tableView visibleCells]) { + NSIndexPath *indexPath = [_tableView indexPathForCell:cell]; + + ORKFormItem *formItem = [self _formItemForIndexPath:indexPath]; + NSString *formItemIdentifier = formItem.identifier; + if ([cell isKindOfClass:[ORKChoiceViewCell class]]) { + + // Answers need to be saved. + id answer = _savedAnswers[formItemIdentifier]; + answer = answer ? : _savedDefaults[formItemIdentifier]; + [self setAnswer:answer forIdentifier:formItemIdentifier]; + + } else { + cell.defaultAnswer = _savedDefaults[formItemIdentifier]; + } + [itemIdentifiersToReload addObject:[_diffableDataSource itemIdentifierForIndexPath:indexPath]]; + } + + _skipped = NO; + + [snapshot reloadItemsWithIdentifiers:itemIdentifiersToReload]; + [_diffableDataSource applySnapshot:snapshot animatingDifferences:NO]; + + [self updateButtonStates]; + [self notifyDelegateOnResultChange]; +} + +- (void)refreshDefaults { + // defaults only come from HealthKit + + NSArray *formItems = [self allFormItems]; + ORKAnswerDefaultSource *source = _defaultSource; + ORKWeakTypeOf(self) weakSelf = self; + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ + dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); + __block NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; + for (ORKFormItem *formItem in formItems) { + [source fetchDefaultValueForAnswerFormat:formItem.answerFormat handler:^(id defaultValue, NSError *error) { + if (defaultValue != nil) { + defaults[formItem.identifier] = defaultValue; + } else if (error != nil) { + ORK_Log_Error("Error fetching default for %@: %@", formItem, error); + } + dispatch_semaphore_signal(semaphore); + }]; + } + for (__unused ORKFormItem *formItem in formItems) { + dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); + } + + // All fetches have completed. + dispatch_async(dispatch_get_main_queue(), ^{ + ORKStrongTypeOf(weakSelf) strongSelf = weakSelf; + [strongSelf updateDefaults:defaults]; + }); + }); +} + +- (void)removeAnswerForIdentifier:(NSString *)identifier { + if (identifier == nil) { + return; + } + [_savedAnswers removeObjectForKey:identifier]; + _savedAnswerDates[identifier] = [NSDate date]; +} + +- (void)setAnswer:(id)answer forIdentifier:(NSString *)identifier { + if (answer == nil || identifier == nil) { + return; + } + if (_savedAnswers == nil) { + _savedAnswers = [NSMutableDictionary new]; + } + if (_savedAnswerDates == nil) { + _savedAnswerDates = [NSMutableDictionary new]; + } + if (_savedSystemCalendars == nil) { + _savedSystemCalendars = [NSMutableDictionary new]; + } + if (_savedSystemTimeZones == nil) { + _savedSystemTimeZones = [NSMutableDictionary new]; + } + _savedAnswers[identifier] = answer; + _savedAnswerDates[identifier] = [NSDate date]; + _savedSystemCalendars[identifier] = [NSCalendar currentCalendar]; + _savedSystemTimeZones[identifier] = [NSTimeZone systemTimeZone]; +} + +// Override to monitor button title change +- (void)setContinueButtonItem:(UIBarButtonItem *)continueButtonItem { + [super setContinueButtonItem:continueButtonItem]; + _navigationFooterView.continueButtonItem = continueButtonItem; + [self updateButtonStates]; +} + +- (void)setSkipButtonItem:(UIBarButtonItem *)skipButtonItem { + [super setSkipButtonItem:skipButtonItem]; + + _navigationFooterView.skipButtonItem = skipButtonItem; + [self updateButtonStates]; +} + +- (CGFloat)heightForText:(NSString *)text withFont:(UIFont *)font withLearnMorePadding:(BOOL)useLearnMorePadding { + CGFloat textPaddingMargin = 0; + if (useLearnMorePadding) { + // the learnmore button blocks off another (ORKSurveyItemMargin) padding + textPaddingMargin = ((ORKSurveyTableContainerLeftRightPadding + (ORKSurveyItemMargin * 3)) * 2); + } else { + textPaddingMargin = ((ORKSurveyTableContainerLeftRightPadding + ORKSurveyItemMargin) * 2); + } + CGFloat textScreenWidth = self.view.frame.size.width - textPaddingMargin; + CGRect frame = [text boundingRectWithSize:CGSizeMake(textScreenWidth, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil]; + float height = frame.size.height; + return height; +} + +- (CGFloat)heightForFormItem:(ORKFormItem *)formItem { + + CGFloat headerHeight = 0.0; + + if (formItem.text) { + headerHeight = headerHeight + [self heightForText:formItem.text withFont:[ORKSurveyCardHeaderView titleLabelFont] withLearnMorePadding:NO]; + } + + if (formItem.detailText) { + headerHeight = headerHeight + [self heightForText:formItem.detailText withFont:[ORKSurveyCardHeaderView detailTextLabelFont] withLearnMorePadding:(formItem.learnMoreItem != nil)] + ORKStepContainerTitleToBodyTopPaddingStandard; + } + + if (formItem.tagText) { + headerHeight = headerHeight + [self heightForText:formItem.tagText withFont:[ORKTagLabel font] withLearnMorePadding:NO] + ORKStepContainerTitleToBodyTopPaddingStandard; + } + + return headerHeight; +} + +- (void)stepDidChange { + [super stepDidChange]; + + [_tableContainer removeFromSuperview]; + _tableContainer = nil; + + _tableView.delegate = nil; + _tableView.dataSource = nil; + _tableView = nil; + _formItemCells = nil; + _headerView = nil; + _navigationFooterView = nil; + + if (self.isViewLoaded && self.step) { + _formItemCells = [NSMutableSet new]; + + _tableContainer = [[ORKTableContainerView alloc] initWithStyle:UITableViewStyleGrouped pinNavigationContainer:NO]; + _tableContainer.tableContainerDelegate = self; + [self.view addSubview:_tableContainer]; + _tableContainer.tapOffView = self.view; + _tableView = _tableContainer.tableView; + _tableView.delegate = self; + [self _registerCellClassesInTableView:_tableView]; + + ORKWeakTypeOf(self) weakSelf = self; + _diffableDataSource = [[UITableViewDiffableDataSource alloc] initWithTableView:_tableView cellProvider:^UITableViewCell * _Nullable(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id _Nonnull itemIdentifier) { + return [weakSelf _tableView:tableView cellForIndexPath:indexPath itemIdentifier:itemIdentifier]; + }]; + [self buildDataSource:_diffableDataSource withCompletion:nil]; + _tableView.dataSource = _diffableDataSource; + + + _tableView.clipsToBounds = YES; + _tableView.rowHeight = UITableViewAutomaticDimension; + _tableView.sectionHeaderHeight = UITableViewAutomaticDimension; + _tableView.estimatedRowHeight = ORKGetMetricForWindow(ORKScreenMetricTableCellDefaultHeight, self.view.window); + + if ([self formStep].useCardView) { + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + + if (ORKNeedWideScreenDesign(self.view)) { + [_tableView setBackgroundColor:[UIColor clearColor]]; + [self.taskViewController setNavigationBarColor:ORKColor(ORKBackgroundColorKey)]; + [self.view setBackgroundColor:ORKColor(ORKBackgroundColorKey)]; + } + else { + [_tableView setBackgroundColor:[UIColor systemGroupedBackgroundColor]]; + [self.taskViewController setNavigationBarColor:[_tableView backgroundColor]]; + [self.view setBackgroundColor:[_tableView backgroundColor]]; + } + } else { + [_tableView setBackgroundColor:[UIColor clearColor]]; + } + _headerView = _tableContainer.stepContentView; + _headerView.stepTopContentImage = self.step.image; + _headerView.titleIconImage = self.step.iconImage; + _headerView.stepTitle = self.step.title; + _headerView.stepText = self.step.text; + _headerView.stepDetailText = self.step.detailText; + _headerView.stepHeaderTextAlignment = self.step.headerTextAlignment; + _headerView.bodyItems = self.step.bodyItems; + _tableContainer.stepTopContentImageContentMode = self.step.imageContentMode; + + _navigationFooterView = _tableContainer.navigationFooterView; + _navigationFooterView.skipButtonItem = self.skipButtonItem; + _navigationFooterView.continueEnabled = [self continueButtonEnabled]; + _navigationFooterView.continueButtonItem = self.continueButtonItem; + _navigationFooterView.optional = self.step.optional; + _navigationFooterView.footnoteLabel.text = [self formStep].footnote; + + // Form steps should always force the navigation controller to be scrollable + // therefore we should always remove the styling. + [_navigationFooterView removeStyling]; + + if (self.readOnlyMode) { + _navigationFooterView.optional = YES; + [_navigationFooterView setNeverHasContinueButton:YES]; + _navigationFooterView.skipEnabled = [self skipButtonEnabled]; + _navigationFooterView.skipButton.accessibilityTraits = UIAccessibilityTraitStaticText; + } + [self setupConstraints]; + } +} + +- (void)_registerCellClassesInTableView:(UITableView *)tableView { + + // Register all of the row cells for our formItems + for (ORKFormItem *eachItem in [self allFormItems]) { + + // our cell choices are based on answerFormat + ORKAnswerFormat *answerFormat = eachItem.impliedAnswerFormat; + NSString *reuseIdentifier = eachItem.identifier; + Class class = answerFormat.formStepViewControllerCellClass; + if ((class != nil) && (reuseIdentifier != nil)) { + [tableView registerClass:class forCellReuseIdentifier:reuseIdentifier]; + } else if (answerFormat.choices.count > 0) { + for (id eachChoice in answerFormat.choices) { + if ([eachChoice isKindOfClass:[ORKTextChoiceOther class]]) { + [tableView registerClass:[ORKChoiceOtherViewCell class] forCellReuseIdentifier:NSStringFromClass([eachChoice class])]; + } else { + [tableView registerClass:[ORKChoiceViewCell class] forCellReuseIdentifier:NSStringFromClass([eachChoice class])]; + } + } + } else { + ORK_Log_Debug("Not registering cell class '%@' for formItem with identifier '%@' answerFormat: %@", class, reuseIdentifier, answerFormat); + } + } + + // Now register the header cells + [_tableView registerClass:[ORKSurveyCardHeaderView class] forHeaderFooterViewReuseIdentifier:ORKSurveyCardHeaderViewIdentifier]; + +} + +- (void)setupConstraints { + if (_constraints) { + [NSLayoutConstraint deactivateConstraints:_constraints]; + } + _tableContainer.translatesAutoresizingMaskIntoConstraints = NO; + _constraints = nil; + + + _constraints = @[ + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:0.0], + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeLeft + multiplier:1.0 + constant:0.0], + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeRight + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeRight + multiplier:1.0 + constant:0.0], + [NSLayoutConstraint constraintWithItem:_tableContainer + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:self.view + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:0.0] + ]; + [NSLayoutConstraint activateConstraints:_constraints]; +} + +- (void)buildDataSource:(UITableViewDiffableDataSource *)dataSource withCompletion:(void (^ _Nullable)(void))completion { + NSDiffableDataSourceSnapshot *snapshot = dataSource.snapshot; + NSArray *formItems = [[self visibleFormItems] copy]; + + _maxLabelWidth = -1; + + + // make a brand new snapshot that holds the section and item identifiers that result from analyzing the formItems + NSDiffableDataSourceSnapshot *newSnapshot = [[NSDiffableDataSourceSnapshot alloc] init]; + for (ORKFormItem *eachItem in formItems) { + + NSString *formItemIdentifier = eachItem.identifier; + ORKAnswerFormat *answerFormat = eachItem.impliedAnswerFormat; + + if (formItemIdentifier == nil) { + ORK_Log_Info("%@ Refusing to deal with formItem missing identifier", self); + } else if (answerFormat == nil) { + // has no answerFormat + // treat these as sections + [newSnapshot appendSectionsWithIdentifiers:@[formItemIdentifier]]; + } else { + NSAssert((answerFormat != nil), @"building tableView data source: assumed answerFormat was nonnull"); + NSAssert((formItemIdentifier != nil), @"building tableView data source: assumed formItemIdentifier was nonnull"); + // if we're here, we expect to add at least one new itemIdentifier + + // Step 1/2: Do we need to make a section for this item to land in? + if ((eachItem.requiresSingleSection) || ([newSnapshot numberOfSections] == 0)) { + [newSnapshot appendSectionsWithIdentifiers:@[formItemIdentifier]]; + } + + // Step 2/2: Are we adding a single identifier for this formItem or exploding the formItem into an identifier per choice? + if (ORKDynamicCast(answerFormat, ORKTextChoiceAnswerFormat) != nil || ORKDynamicCast(answerFormat, ORKColorChoiceAnswerFormat) != nil) { + // Make one row per choice, we probably made a section already since formItems with choice answerFormats are requiresSingleSection==YES + NSArray *choices = answerFormat.choices; + [choices enumerateObjectsUsingBlock:^(id eachChoice, NSUInteger index, BOOL *stop) { + ORKTableCellItemIdentifier *itemIdentifier = [[ORKTableCellItemIdentifier alloc] initWithFormItemIdentifier:formItemIdentifier choiceIndex:index]; + [newSnapshot appendItemsWithIdentifiers:@[itemIdentifier]]; + }]; + } else { + // has answerFormat but no choices + // Convert the formItem itself into a row + ORKTableCellItemIdentifier *itemIdentifier = [[ORKTableCellItemIdentifier alloc] initWithFormItemIdentifier:formItemIdentifier choiceIndex:NSNotFound]; + [newSnapshot appendItemsWithIdentifiers:@[itemIdentifier]]; + } + } + } + + // remove stale sections + { + NSMutableSet *originalSectionIdentifiers = [NSMutableSet setWithArray:[snapshot sectionIdentifiers]]; + NSSet *newSectionIdentifiers = [NSSet setWithArray:[newSnapshot sectionIdentifiers]]; + [originalSectionIdentifiers minusSet:newSectionIdentifiers]; + [snapshot deleteSectionsWithIdentifiers:[originalSectionIdentifiers allObjects]]; + } + + // remove stale items + { + NSMutableSet *originalItemIdentifiers = [NSMutableSet setWithArray:[snapshot itemIdentifiers]]; + NSSet *newItemIdentifiers = [NSSet setWithArray:[newSnapshot itemIdentifiers]]; + [originalItemIdentifiers minusSet:newItemIdentifiers]; + [snapshot deleteItemsWithIdentifiers:[originalItemIdentifiers allObjects]]; + } + + // Now we can run through the original snapshot and update it based on our new snapshot + for (NSString *eachSectionIdentifier in [newSnapshot sectionIdentifiers]) { + + // put the section in the right spot + // yes, we could keep a counter outside the for loop. Computing index here so there's less state to manage + NSInteger index = [newSnapshot indexOfSectionIdentifier:eachSectionIdentifier]; + + NSUInteger originalCountOfSections = [snapshot numberOfSections]; + if (originalCountOfSections > index) { + NSString *originalSectionIdentiferAtIndex = [[snapshot sectionIdentifiers] objectAtIndex:index]; + if ([originalSectionIdentiferAtIndex isEqual:eachSectionIdentifier]) { + // the same section identifier lives at the same index, no-op + } else if ([snapshot indexOfSectionIdentifier:eachSectionIdentifier] != NSNotFound) { + // the same section identifier lives in both, but at different index in each: move + [snapshot moveSectionWithIdentifier:eachSectionIdentifier beforeSectionWithIdentifier:originalSectionIdentiferAtIndex]; + } else { + // the sectionIdentifer doesn't exist in the original snapshot, insert ahead of whatever's currently at this index + [snapshot insertSectionsWithIdentifiers:@[eachSectionIdentifier] beforeSectionWithIdentifier:originalSectionIdentiferAtIndex]; + } + } else { + // More sections in the new snapshot than the old, just append + [snapshot appendSectionsWithIdentifiers:@[eachSectionIdentifier]]; + } + + for (ORKTableCellItemIdentifier *eachItemIdentifier in [newSnapshot itemIdentifiersInSectionWithIdentifier:eachSectionIdentifier]) { + + // put the items in the right spot + // yes, we could keep a counter outside this for loop. Computing this index so there's less state to manage + NSInteger itemIndex = [newSnapshot indexOfItemIdentifier:eachItemIdentifier]; + + NSUInteger originalCountOfItems = [snapshot numberOfItems]; + if (originalCountOfItems > itemIndex) { + ORKTableCellItemIdentifier *originalItemIdentiferAtIndex = [[snapshot itemIdentifiers] objectAtIndex:itemIndex]; + if ([originalItemIdentiferAtIndex isEqual:eachItemIdentifier]) { + // the same itemIdentifier lives at the same index, no-op + } else if ([snapshot indexOfItemIdentifier:eachItemIdentifier] != NSNotFound) { + // the same itemIdentifier lives in both, but at different index in each: move + [snapshot moveItemWithIdentifier:eachItemIdentifier beforeItemWithIdentifier:originalItemIdentiferAtIndex]; + } else if ([eachItemIdentifier.formItemIdentifier isEqual:originalItemIdentiferAtIndex.formItemIdentifier]) { + // the itemIdentifer doesn't exist in the original snapshot, insert ahead of whatever's currently at this index + [snapshot insertItemsWithIdentifiers:@[eachItemIdentifier] beforeItemWithIdentifier:originalItemIdentiferAtIndex]; + } else { + // the itemIdentifier doesn't exist in the original snapshot, append to current section + [snapshot appendItemsWithIdentifiers:@[eachItemIdentifier] intoSectionWithIdentifier:eachSectionIdentifier]; + } + + // There may be a case where we don't support items moving between sections, but that shouldn't happen since the only way formItems can move around like that is if you feed the stepViewController a new step. Resetting the step builds a brand new tableView and datasource, so you shouldn't hit that problem. + } else { + if ([snapshot indexOfItemIdentifier:eachItemIdentifier] != NSNotFound) { + // item was there in original snapshot, moved in new snapshot, beyond the range of old snapshot's last item + id lastItemIdentifier = [[snapshot itemIdentifiers] lastObject]; + [snapshot moveItemWithIdentifier:eachItemIdentifier afterItemWithIdentifier:lastItemIdentifier]; + } else { + // the itemIdentifer doesn't exist in the original snapshot + [snapshot appendItemsWithIdentifiers:@[eachItemIdentifier] intoSectionWithIdentifier:eachSectionIdentifier]; + } + } + } + + } + + NSDiffableDataSourceSnapshot *originalSnapshot = dataSource.snapshot; + + if ([originalSnapshot isEqual:snapshot] == NO) { + BOOL shouldAnimateDifferences = YES; + + // don't bother animating if there was nothing in the original snapshot to start with + shouldAnimateDifferences = shouldAnimateDifferences && (originalSnapshot.numberOfItems > 0); + + // update progress text of section header views + NSUInteger totalSections = [snapshot numberOfSections]; + if (totalSections > 1) { + for (int i = 0; i < totalSections; i++) { + ORKSurveyCardHeaderView *cardHeaderView = (ORKSurveyCardHeaderView *)[_tableView headerViewForSection:i]; + + NSString *sectionProgressText = [NSString localizedStringWithFormat:ORKLocalizedString(@"FORM_ITEM_PROGRESS", nil) ,ORKLocalizedStringFromNumber(@(i + 1)), ORKLocalizedStringFromNumber(@(snapshot.numberOfSections))]; + + [cardHeaderView setProgressText:sectionProgressText]; + } + } else { + ORKSurveyCardHeaderView *cardHeaderView = (ORKSurveyCardHeaderView *)[_tableView headerViewForSection:0]; + [cardHeaderView setProgressText:nil]; + } + + // If the footer needs to go back to a larger size, we need to resize here, before applying the snapshot. + if (![self isContentSizeLargerThanFrame]) { + [_tableContainer resizeFooterToFitUsingMinHeight:NO]; + } + + [dataSource applySnapshot:snapshot animatingDifferences:shouldAnimateDifferences completion:^{ + if (completion != nil) { + completion(); + } + }]; + } else { + dispatch_async(dispatch_get_main_queue(), ^{ + if (completion != nil) { + completion(); + } + }); + } +} + +- (NSInteger)numberOfAnsweredFormItemsInDictionary:(NSDictionary *)dictionary { + __block NSInteger nonNilCount = 0; + [dictionary enumerateKeysAndObjectsUsingBlock:^(id key, id answer, BOOL *stop) { + if (ORKIsAnswerEmpty(answer) == NO) { + nonNilCount ++; + } + }]; + return nonNilCount; +} + +- (NSInteger)numberOfAnsweredFormItems { + return [self numberOfAnsweredFormItemsInDictionary:self.savedAnswers]; +} + +- (BOOL)allAnsweredFormItemsAreValid { + for (ORKFormItem *item in [self answerableFormItems]) { + id answer = _savedAnswers[item.identifier]; + if (ORKIsAnswerEmpty(answer) == NO && ![item.impliedAnswerFormat isAnswerValid:answer]) { + return NO; + } + } + return YES; +} + +- (BOOL)allNonOptionalFormItemsHaveAnswers { + for (ORKFormItem *item in [self answerableFormItems]) { + if (!item.optional) { + id answer = _savedAnswers[item.identifier]; + if (ORKIsAnswerEmpty(answer) || ![item.impliedAnswerFormat isAnswerValid:answer]) { + return NO; + } + } + } + return YES; +} + +- (nullable ORKFormItem *)fetchFirstUnansweredNonOptionalFormItem:(NSArray *)formItems { + for (ORKFormItem *item in formItems) { + if (!item.optional) { + id answer = _savedAnswers[item.identifier]; + if (ORKIsAnswerEmpty(answer) || ![item.impliedAnswerFormat isAnswerValid:answer]) { + return item; + } + } + } + + return nil; +} + +- (nullable NSString *)fetchSectionThatContainsFormItem:(ORKFormItem *)formItem { + ORKTableCellItemIdentifier *identifier = [[ORKTableCellItemIdentifier alloc] initWithFormItemIdentifier:formItem.identifier choiceIndex:NSNotFound]; + __auto_type snapshot = [_diffableDataSource snapshot]; + NSString *result = [snapshot sectionIdentifierForSectionContainingItemIdentifier:identifier]; + + // in case the formItem turned into a section with choices instead, try looking for the formItemIdentifier as a sectionIdentifier + result = result ? : formItem.identifier; + + return result; +} + +- (BOOL)continueButtonEnabled { + BOOL enabled = ([self allAnsweredFormItemsAreValid] && [self allNonOptionalFormItemsHaveAnswers]); + if (self.isBeingReviewed) { + enabled = enabled && ![self.savedAnswers isEqualToDictionary:self.originalAnswers]; + } + return enabled; +} + +- (BOOL)skipButtonEnabled { + BOOL enabled = self.formStep.optional; + if (self.isBeingReviewed) { + enabled = self.readOnlyMode ? NO : enabled && [self numberOfAnsweredFormItemsInDictionary:self.originalAnswers] > 0; + } + return enabled; +} + +- (void)updateButtonStates { + _navigationFooterView.continueEnabled = [self continueButtonEnabled]; + _navigationFooterView.skipEnabled = [self skipButtonEnabled]; + + if (self.shouldPresentInReview && self.navigationItem.rightBarButtonItem) { + self.navigationItem.rightBarButtonItem.enabled = [self continueButtonEnabled]; + } +} + +- (void)setShouldPresentInReview:(BOOL)shouldPresentInReview { + [super setShouldPresentInReview:shouldPresentInReview]; + [_navigationFooterView setHidden:YES]; +} + +#pragma mark Helpers + +- (ORKFormStep *)formStep { + NSAssert(!self.step || [self.step isKindOfClass:[ORKFormStep class]], nil); + return (ORKFormStep *)self.step; +} + +- (NSArray *)allFormItems { + return [[self formStep] formItems]; +} + + +- (BOOL)isFormItemVisible:(ORKFormItem *)formItem withResult:(ORKTaskResult *)result { + ORKFormItemVisibilityRule *rule = formItem.visibilityRule; + BOOL shouldAllowVisibility = (rule == nil) || ([rule formItemVisibilityForTaskResult:result] == YES); + return shouldAllowVisibility; +} + +- (NSArray *)visibleFormItemsFromResult:(ORKTaskResult *)ongoingTaskResult { + NSMutableArray *visibleItemsMutableArray = [NSMutableArray new]; + + for (ORKFormItem *eachItem in [self allFormItems]) { + if ([self isFormItemVisible:eachItem withResult:ongoingTaskResult] == YES) { + [visibleItemsMutableArray addObject:eachItem]; + } + } + + return [visibleItemsMutableArray copy]; +} + +- (NSArray *)visibleFormItems { + ORKTaskResult *taskResult = [self _ongoingTaskResult]; + NSArray *visibileFormItems = [self visibleFormItemsFromResult:taskResult]; + return visibileFormItems; +} + +- (NSArray *)answerableFormItems { + NSMutableArray *array = [NSMutableArray new]; + for (ORKFormItem *item in [self visibleFormItems]) { + if (item.answerFormat != nil) { + [array addObject:item]; + } + } + + return [array copy]; +} + +- (nullable ORKFormItem *)_formItemForIndexPath:(NSIndexPath *)indexPath { + ORKFormItem *result; + + ORKTableCellItemIdentifier *itemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:indexPath]; + result = [self _formItemForFormItemIdentifier:itemIdentifier.formItemIdentifier]; + + return result; +} + +- (nullable ORKFormItem *)_formItemForFormItemIdentifier:(NSString *)formItemIdentifier { + ORKFormItem *result; + + NSArray *allFormItems = [self allFormItems]; + + NSInteger formItemIndex = [allFormItems indexOfObjectPassingTest:^BOOL(ORKFormItem * testItem, NSUInteger testIndex, BOOL *stop) { + BOOL foundIndex = [testItem.identifier isEqualToString:formItemIdentifier]; + return foundIndex; + }]; + result = (formItemIndex != NSNotFound) ? [allFormItems objectAtIndex:formItemIndex] : nil; + + return result; +} + +- (NSSet *)hiddenFormItemIdentifiersForTaskResult:(ORKTaskResult *)taskResult { + // make a set of all the identifiers of formItems we want to hide + NSMutableSet *mutableSet = [NSMutableSet new]; + + // start with all the formItems + [[self allFormItems] enumerateObjectsUsingBlock:^(ORKFormItem *eachItem, NSUInteger idx, BOOL *stop) { + NSString *identifier = eachItem.identifier; + if (identifier != nil) { + [mutableSet addObject:identifier]; + } + }]; + + // Now remove the visible formItem identifiers. The remaining set are the hidden ones + [[self visibleFormItemsFromResult:taskResult] enumerateObjectsUsingBlock:^(ORKFormItem *eachItem, NSUInteger idx, BOOL *stop) { + NSString *identifier = eachItem.identifier; + if (identifier != nil) { + [mutableSet removeObject:identifier]; + } + }]; + + return [mutableSet copy]; +} + +- (BOOL)showValidityAlertWithMessage:(NSString *)text { + // Ignore if our answer is null + if (_skipped) { + return NO; + } + + return [super showValidityAlertWithMessage:text]; +} + +- (BOOL)hasAnswer { + return (self.savedAnswers != nil); +} + +/// Returns the combination of the delegate's stepViewControllerOngoingResult: ORKTaskResult and the full ORKStepResult for this stepViewController (regardless of formItem visibilityRules) +- (nonnull ORKTaskResult *)_ongoingTaskResult { + ORKTaskResult *taskResult = nil; + + id delegate = [self delegate]; + if ([delegate respondsToSelector:@selector(stepViewControllerOngoingResult:)]) { + // make a copy of the taskResult since we're going to change its results + taskResult = [[delegate stepViewControllerOngoingResult:self] copy]; + } + + // in case no taskResult was returned, make one up + if (taskResult == nil) { + taskResult = [[ORKTaskResult alloc] initWithTaskIdentifier:@"" taskRunUUID:[NSUUID new] outputDirectory:nil]; + } + + // start with all the stepResults regardless of visibilityRules + ORKStepResult *stepResult = [self _stepResultFromFormItems:[self allFormItems]]; + + // merge the results with the current ongoing task result. + taskResult.results = [taskResult.results arrayByAddingObject:stepResult]; + + return taskResult; +} + +// Not to use `ImmediateNavigation` when current step already has an answer. +// So user is able to review the answer when it is present. +- (BOOL)isStepImmediateNavigation { +// return [[self formStep] isFormatImmediateNavigation] && [self hasAnswer] == NO && !self.isBeingReviewed; + return NO; +} + +- (ORKStepResult *)result { + ORKTaskResult *taskResult = [self _ongoingTaskResult]; + + // get the stepResult, which should be the last result in the taskResult.results array + // this stepResult contains everything regardless of visibility rules + ORKStepResult *stepResult = ORKDynamicCast(taskResult.results.lastObject, ORKStepResult); + + // Make a mutable copy of the stepResult's results array. We're going to remove items from this array + // rather than build a new array from an empty one. This way we preserve the results that may + // have been added through ORKStepViewController's `addResult:` API + NSMutableArray *mutableResults = [stepResult.results mutableCopy]; + + // walk through the array in reverse so we can use cheap removeObjectAtIndex: to remove results that should be hidden + NSSet *hiddenFormItemIdentifiers = [self hiddenFormItemIdentifiersForTaskResult:taskResult]; + [stepResult.results enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(ORKResult *eachResult, NSUInteger index, BOOL *stop) { + NSString *identifier = eachResult.identifier; + if ([hiddenFormItemIdentifiers containsObject:identifier]) { + [mutableResults removeObjectAtIndex:index]; + } + }]; + + stepResult.results = [mutableResults copy]; + return stepResult; +} + +- (ORKStepResult *)_stepResultFromFormItems:(NSArray *)formItems { + ORKStepResult *parentResult = [super result]; + + // "Now" is the end time of the result, which is either actually now, + // or the last time we were in the responder chain. + NSDate *now = parentResult.endDate; + + NSMutableArray *qResults = [NSMutableArray new]; + for (ORKFormItem *item in formItems) { + + // Only process formItems for which we would have an answerFormat + if (item.answerFormat == nil) { + continue; + } + + // Skipped forms report a "null" value for every item -- by skipping, the user has explicitly said they don't want + // to report any values from this form. + + id answer = ORKNullAnswerValue(); + NSDate *answerDate = now; + NSCalendar *systemCalendar = [NSCalendar currentCalendar]; + NSTimeZone *systemTimeZone = [NSTimeZone systemTimeZone]; + if (!_skipped) { + answer = _savedAnswers[item.identifier]; + answerDate = _savedAnswerDates[item.identifier] ? : now; + systemCalendar = _savedSystemCalendars[item.identifier]; + NSAssert(answer == nil || answer == ORKNullAnswerValue() || systemCalendar != nil, @"systemCalendar NOT saved"); + systemTimeZone = _savedSystemTimeZones[item.identifier]; + NSAssert(answer == nil || answer == ORKNullAnswerValue() || systemTimeZone != nil, @"systemTimeZone NOT saved"); + } + + ORKQuestionResult *result = [item.answerFormat resultWithIdentifier:item.identifier answer:answer]; + ORKAnswerFormat *impliedAnswerFormat = [item impliedAnswerFormat]; + + if ([impliedAnswerFormat isKindOfClass:[ORKDateAnswerFormat class]]) { + ORKDateQuestionResult *dqr = (ORKDateQuestionResult *)result; + if (dqr.dateAnswer) { + NSCalendar *usedCalendar = [(ORKDateAnswerFormat *)impliedAnswerFormat calendar] ? : systemCalendar; + dqr.calendar = [NSCalendar calendarWithIdentifier:usedCalendar.calendarIdentifier]; + dqr.timeZone = systemTimeZone; + } + } else if ([impliedAnswerFormat isKindOfClass:[ORKNumericAnswerFormat class]]) { + ORKNumericQuestionResult *nqr = (ORKNumericQuestionResult *)result; + if (nqr.unit == nil) { + nqr.unit = [(ORKNumericAnswerFormat *)impliedAnswerFormat unit]; + nqr.displayUnit = [(ORKNumericAnswerFormat *)impliedAnswerFormat displayUnit]; + } + } + + result.startDate = answerDate; + result.endDate = answerDate; + + [qResults addObject:result]; + } + + parentResult.results = [parentResult.results arrayByAddingObjectsFromArray:qResults] ? : qResults; + + return parentResult; +} + +- (void)skipForward { + // This _skipped flag is a hack so that the -result method can return an empty + // result after the skip action, without having to generate the result + // in advance. + _skipped = YES; + [self notifyDelegateOnResultChange]; + + [super skipForward]; +} + +- (void)goBackward { + if (self.isBeingReviewed) { + self.savedAnswers = [[NSMutableDictionary alloc] initWithDictionary:self.originalAnswers]; + } + [super goBackward]; +} + +- (NSInteger)maxLabelWidth { + if (_maxLabelWidth == -1) { + NSInteger labelWidth = 0; + for (ORKFormItem* formItemForMaxWidth in [self allFormItems]) { + labelWidth = MAX(labelWidth, ORKLabelWidth(formItemForMaxWidth.text)); + } + _maxLabelWidth = labelWidth; + } + + return _maxLabelWidth; +} + +// Return NO if we didn't autoscroll +- (BOOL)didAutoScrollToNextItem:(ORKFormItemCell *)cell { + if (![self _isAutoScrollEnabled]) { + return NO; + } + + NSIndexPath *currentIndexPath = [self.tableView indexPathForCell:cell]; + + if (cell.isLastItem) { + return NO; + } else { + NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:currentIndexPath.row + 1 inSection:currentIndexPath.section]; + ORKQuestionType type = [self _formItemForIndexPath:nextIndexPath].impliedAnswerFormat.questionType; + + if ([self doesTableCellTypeUseKeyboard:type]) { + [_tableView deselectRowAtIndexPath:currentIndexPath animated:NO]; + return [self focusUnansweredCell:cell]; + } else { + return NO; + } + } + + return YES; +} + +- (BOOL)shouldAutoScrollToNextSection:(NSIndexPath *)indexPath { + if (![self _isAutoScrollEnabled]) { + return NO; + } + + BOOL result = YES; + + NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:0 inSection:(indexPath.section + 1)]; + + // Technically, cellForRowAtIndexPath could return nil if the tableView hasn't decided to cache the cell + // Guarantee ourselves a cell by using dequeueReusableCellWithIdentifier—the only reason we need the cell is to test + // the cell's type, not for actual display, so using any cell paired with the reuseIdentifier should be fine + // do *not* use dequeueReusableCellWithIdentifier:indexPath: since that method should only be called within the dataSource + // tableView:cellForRowAtIndexPath: method + ORKFormItem *nextFormItem = [self _formItemForIndexPath:nextIndexPath]; + ORKTableCellItemIdentifier *nextItemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:nextIndexPath]; + NSString *nextReuseIdentifier = [self cellReuseIdentifierFromFormItem:nextFormItem cellItemIdentifier:nextItemIdentifier]; + + result = result && (_autoScrollCancelled == NO); + + // can't autoscroll to something that doesn't exist + UITableViewCell *nextCell = [_tableView dequeueReusableCellWithIdentifier:nextReuseIdentifier]; + result = result && (nextCell != nil); + + // don't autoscroll to a cell that already has an answer + result = result && (self.savedAnswers[nextFormItem.identifier] == nil); + + return result; +} + +- (void)autoScrollToNextSection:(NSIndexPath *)indexPath { + if (![self _isAutoScrollEnabled]) { + return; + } + + NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:0 inSection:(indexPath.section + 1)]; + UITableView *tableView = self.tableView; + UITableViewCell *nextCell = [tableView cellForRowAtIndexPath:nextIndexPath]; + BOOL didChangeFocus = [self focusUnansweredCell:nextCell]; + + if (didChangeFocus == YES) { + // if we did change focus, then that will perform the scrolling + } else { + // if we didn't change focus, then we need to handle the scrolling here + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [tableView scrollToRowAtIndexPath:nextIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; + }); + } +} + +- (void)scrollToFirstUnansweredSection { + if (![self _isAutoScrollEnabled]) { + return; + } + + ORKFormItem *formItem = [self fetchFirstUnansweredNonOptionalFormItem:[self answerableFormItems]]; + [self scrollToFormItem:formItem]; +} + +- (void)scrollToFooter { + if (![self _isAutoScrollEnabled]) { + return; + } + + CGRect tableFooterRect = [self.tableView convertRect:self.tableView.tableFooterView.bounds fromView:self.tableView.tableFooterView]; + [self.tableView scrollRectToVisible:tableFooterRect animated:YES]; +} + +- (void)scrollToFormItem:(ORKFormItem *)formItem { + if (![self _isAutoScrollEnabled]) { + return; + } + + NSString *sectionIdentifier = [self fetchSectionThatContainsFormItem:formItem]; + NSInteger section = [[_diffableDataSource snapshot] indexOfSectionIdentifier:sectionIdentifier]; + if (section != NSNotFound) { + NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:0 inSection:section]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [_tableView scrollToRowAtIndexPath:nextIndexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; + }); + } +} + +- (BOOL)_isAutoScrollEnabled { + ORKFormStep *formStep = [self formStep]; + return formStep.autoScrollEnabled; +} + +- (nullable ORKTextChoiceAnswerFormat *)textChoiceAnswerFormatForIndexPath:(NSIndexPath *)indexPath { + ORKTextChoiceAnswerFormat *result = nil; + + ORKTableCellItemIdentifier *itemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:indexPath]; + ORKFormItem *formItem = [self _formItemForFormItemIdentifier:itemIdentifier.formItemIdentifier]; + result = ORKDynamicCast(formItem.impliedAnswerFormat, ORKTextChoiceAnswerFormat); + + return result; +} + +- (BOOL)exclusiveChoiceSelectedForSectionIdentifier:(NSString *)sectionIdentifier withCell:(UITableViewCell *)cell { + BOOL result = NO; + + ORKChoiceViewCell *choiceViewCell = ORKDynamicCast(cell, ORKChoiceViewCell); + if (choiceViewCell != nil) { + // section identifiers are formItem identifiers, and formItem identifiers are the keys into answers + id answer = _savedAnswers[sectionIdentifier]; + result = (answer != nil && choiceViewCell.isExclusive); + } + + return result; +} + +- (BOOL)doesTableCellTypeUseKeyboard:(ORKQuestionType)questionType { + switch (questionType) { + case ORKQuestionTypeDecimal: + case ORKQuestionTypeInteger: + case ORKQuestionTypeText: + return YES; + + default: + return NO; + } +} + +- (void)saveAnswer:(id)answer forItemIdentifier:(ORKTableCellItemIdentifier *)itemIdentifier { + NSString *formItemIdentifier = [itemIdentifier formItemIdentifier]; + if (formItemIdentifier != nil) { + if (answer != nil) { + [self setAnswer:answer forIdentifier:formItemIdentifier]; + } else { + [self removeAnswerForIdentifier:formItemIdentifier]; + } + } + + NSIndexPath *indexPath = [_diffableDataSource indexPathForItemIdentifier:itemIdentifier]; + [self answerChangedForIndexPath:indexPath]; +} + +/// returns NO if we couldn't make the cell become first responder, or the cell has an answer already +- (BOOL)focusUnansweredCell:(UITableViewCell *)cell { + BOOL result = NO; + + ORKFormItemCell *formItemCell = ORKDynamicCast(cell, ORKFormItemCell); + + // don't try to make cell first responder if it already has an answer + BOOL cellNeedsBecomeFirstResponder = (self.savedAnswers[formItemCell.formItem.identifier] == nil); + if (cellNeedsBecomeFirstResponder == YES) { + result = [formItemCell becomeFirstResponder]; + } + + return result; +} + +#pragma mark NSNotification methods + +- (void)keyboardWillShow:(NSNotification *)notification { + + if (_currentFirstResponderCell) { + if ([_currentFirstResponderCell isKindOfClass:[ORKChoiceOtherViewCell class]]) { + CGRect keyboardFrame = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; + CGRect convertedKeyboardFrame = [self.view convertRect:keyboardFrame fromView:nil]; + + if (CGRectGetMaxY(_currentFirstResponderCell.frame) >= CGRectGetMinY(convertedKeyboardFrame)) { + UITableView *tableView = self.tableView; + + [tableView setContentInset:UIEdgeInsetsMake(0, 0, CGRectGetHeight(convertedKeyboardFrame), 0)]; + + NSIndexPath *currentFirstResponderCellIndex = [tableView indexPathForCell:_currentFirstResponderCell]; + + if (currentFirstResponderCellIndex && [self _isAutoScrollEnabled]) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [tableView scrollToRowAtIndexPath:currentFirstResponderCellIndex atScrollPosition:UITableViewScrollPositionBottom animated:YES]; + }); + } + } + } else { + CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size; + + if ((_currentFirstResponderCell.frame.origin.y + CGRectGetHeight(_currentFirstResponderCell.frame)) >= (CGRectGetHeight(self.view.frame) - keyboardSize.height)) { + _tableView.contentInset = UIEdgeInsetsMake(0, 0, keyboardSize.height + TableViewYOffsetStandard, 0); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [_tableContainer scrollCellVisible:_currentFirstResponderCell animated:YES]; + }); + } + } + } +} + +- (void)keyboardWillHide:(NSNotification *)notification { + _tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); +} + +- (void)resizeORKChoiceOtherViewCell:(ORKChoiceOtherViewCell *)choiceOtherViewCell withTextChoice:(ORKTextChoiceOther *)textChoice { + [_tableView beginUpdates]; + [choiceOtherViewCell setupWithText:textChoice.textViewText placeholderText:textChoice.textViewPlaceholderText]; + [_tableView endUpdates]; +} + +- (BOOL)isChoiceSelected:(id)value atIndex:(NSUInteger)index answer:(id)answer { + BOOL isSelected = NO; + if (answer != nil && answer != ORKNullAnswerValue()) { + if ([answer isKindOfClass:[NSArray class]]) { + if (value) { + isSelected = [(NSArray *)answer containsObject:value]; + } else { + isSelected = [(NSArray *)answer containsObject:@(index)]; + } + } else { + if (value) { + isSelected = ([answer isEqual:value]); + } else { + isSelected = (((NSNumber *)answer).integerValue == index); + } + } + } + return isSelected; +} + +- (NSString *)cellReuseIdentifierFromFormItem:(ORKFormItem *)formItem cellItemIdentifier:(ORKTableCellItemIdentifier *)itemIdentifier { + NSString *result; + + NSString *formItemIdentifier = itemIdentifier.formItemIdentifier; + if (itemIdentifier.choiceIndex == NSNotFound) { + result = formItemIdentifier; + } else { + ORKAnswerFormat *answerFormat = formItem.impliedAnswerFormat; + id choice = [answerFormat.choices objectAtIndex:itemIdentifier.choiceIndex]; + result = NSStringFromClass([choice class]); + } + + return result; +} + +- (UITableViewCell *)_tableView:(UITableView *)tableView cellForIndexPath:(NSIndexPath *)indexPath itemIdentifier:(ORKTableCellItemIdentifier *)itemIdentifier { + NSString *formItemIdentifier = itemIdentifier.formItemIdentifier; + + ORKFormItem *formItem = [self _formItemForFormItemIdentifier:formItemIdentifier]; + + NSString *reuseIdentifier = [self cellReuseIdentifierFromFormItem:formItem cellItemIdentifier:itemIdentifier]; + NSAssert((reuseIdentifier != nil), @"reuseIdentifier cannot be nil"); + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier forIndexPath:indexPath]; + cell.userInteractionEnabled = !self.readOnlyMode; + cell.accessibilityIdentifier = [NSString stringWithFormat:@"%@_%ld", formItemIdentifier, (long)indexPath.row]; + + ORKFormItemCell *formCell = ORKDynamicCast(cell, ORKFormItemCell); + ORKChoiceViewCell *choiceViewCell = ORKDynamicCast(cell, ORKChoiceViewCell); + __auto_type snapshot = [_diffableDataSource snapshot]; + if (formCell != nil) { + id answer = _savedAnswers[formItemIdentifier]; + + NSInteger maxLabelWidth = [self maxLabelWidth]; + [formCell configureWithFormItem:formItem answer:answer maxLabelWidth:maxLabelWidth delegate:self]; + + [formCell setExpectedLayoutWidth:tableView.bounds.size.width]; + formCell.selectionStyle = UITableViewCellSelectionStyleNone; + formCell.defaultAnswer = _savedDefaults[formItemIdentifier]; + if (!_savedAnswers) { + _savedAnswers = [NSMutableDictionary new]; + } + formCell.savedAnswers = _savedAnswers; + formCell.useCardView = [self formStep].useCardView; + formCell.cardViewStyle = [self formStep].cardViewStyle; + + formCell.isLastItem = ^{ + NSInteger section = indexPath.section; + NSInteger rowCountInSection = [_diffableDataSource tableView:tableView numberOfRowsInSection:section]; + BOOL isLastItem = rowCountInSection == indexPath.row + 1; + return isLastItem; + }(); + + formCell.isFirstItemInSectionWithoutTitle = ^{ + NSString *sectionFormItemIdentifier = [snapshot sectionIdentifierForSectionContainingItemIdentifier:itemIdentifier]; + ORKFormItem *sectionFormItem = [self _formItemForFormItemIdentifier:sectionFormItemIdentifier]; + BOOL isFirstItemWithSectionWithoutTitle = (indexPath.row == 0) && (sectionFormItem.text == nil); // formItem.text is section.title + return isFirstItemWithSectionWithoutTitle; + }(); + } else if (choiceViewCell != nil) { + + // check whether this cell should be selected, based on answer + ORKAnswerFormat *answerFormat = formItem.impliedAnswerFormat; + NSInteger choiceIndex = itemIdentifier.choiceIndex; + if (choiceIndex != NSNotFound) { + BOOL isLastItem = (choiceIndex + 1) == answerFormat.choices.count; + if ([answerFormat isKindOfClass:[ORKTextChoiceAnswerFormat class]]) { + ORKTextChoice *textChoice = [answerFormat.choices objectAtIndex:choiceIndex]; + [choiceViewCell configureWithTextChoice:textChoice isLastItem:isLastItem]; + } + + if ([answerFormat isKindOfClass:[ORKColorChoiceAnswerFormat class]]) { + ORKColorChoice *colorChoice = [answerFormat.choices objectAtIndex:choiceIndex]; + [choiceViewCell configureWithColorChoice:colorChoice isLastItem:isLastItem]; + } + + id answer = _savedAnswers[formItemIdentifier]; + ORKChoiceAnswerFormatHelper *helper = [[ORKChoiceAnswerFormatHelper alloc] initWithAnswerFormat:answerFormat]; + NSArray *selectedIndexes = [helper selectedIndexesForAnswer:answer]; + if ([selectedIndexes containsObject:@(choiceIndex)]) { + [choiceViewCell setCellSelected:YES highlight:NO]; + } else { + [choiceViewCell setCellSelected:NO highlight:NO]; + } + + } else { + ORK_Log_Debug("[FORMSTEP] choiceIndex was NSNotFound"); + } + + ORKChoiceOtherViewCell *choiceOtherViewCell = ORKDynamicCast(choiceViewCell, ORKChoiceOtherViewCell); + // This code used to be executed only once, when the cell was being created. + // Now that we use dequeue to always create a cell, that logic doesn't apply anymore + if (choiceOtherViewCell != nil) { + ORKTextChoice *textChoice = [answerFormat.choices objectAtIndex:choiceIndex]; + ORKTextChoiceOther *textChoiceOther = ORKDynamicCast(textChoice, ORKTextChoiceOther); + if (textChoiceOther != nil) { + [choiceOtherViewCell setupWithText:textChoiceOther.textViewText placeholderText:textChoiceOther.textViewPlaceholderText]; + } + } + choiceOtherViewCell.delegate = self; + + choiceViewCell.tintColor = ORKViewTintColor(self.view); + choiceViewCell.useCardView = [self formStep].useCardView; + choiceViewCell.cardViewStyle = [self formStep].cardViewStyle; + +// choiceViewCell.isLastItem = isLastItem; +// choiceViewCell.isFirstItemInSectionWithoutTitle = isFirstItemWithSectionWithoutTitle; + [choiceViewCell layoutSubviews]; + + } else { + NSString *sectionIdentifier = [[snapshot sectionIdentifiers] objectAtIndex:indexPath.section]; + ORK_Log_Debug("[FORMSTEP] _tableView:CellForIndexPath: at index: %@ for section: '%@' cell type is '%@'", @(indexPath.row), sectionIdentifier, NSStringFromClass([cell class])); + + } + + return cell; +} + +static CGFloat ORKLabelWidth(NSString *text) { + static ORKCaption1Label *sharedLabel; + + if (sharedLabel == nil) { + sharedLabel = [ORKCaption1Label new]; + } + + sharedLabel.text = text; + + return [sharedLabel textRectForBounds:CGRectInfinite limitedToNumberOfLines:1].size.width; +} + + +#pragma mark UITableViewDelegate + +- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath { + return YES; +} + +- (void)didSelectChoiceOtherViewCellWithItemIdentifier:(ORKTableCellItemIdentifier *)itemIdentifier + choiceOtherViewCell:(ORKChoiceOtherViewCell *)choiceOtherViewCell { + if (choiceOtherViewCell.textView.text.length <= 0) { + [self reloadItems:@[itemIdentifier]]; + [_tableContainer resizeFooterToFitUsingMinHeight:([self isContentSizeWithinFrame])]; + } +} + +- (void)reloadItems:(NSArray *)itemIdentifiers { + NSDiffableDataSourceSnapshot * snapshot = [_diffableDataSource snapshot]; + [snapshot reloadItemsWithIdentifiers:itemIdentifiers]; + [_diffableDataSource applySnapshot:snapshot animatingDifferences:false]; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [tableView deselectRowAtIndexPath:indexPath animated:NO]; + + ORKTableCellItemIdentifier *itemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:indexPath]; + ORKFormItem *formItem = [self _formItemForFormItemIdentifier:itemIdentifier.formItemIdentifier]; + + UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; + + ORKFormItemCell *formItemCell = ORKDynamicCast(cell, ORKFormItemCell); + if (formItemCell != nil) { + [formItemCell becomeFirstResponder]; + if ([self _isAutoScrollEnabled]) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [_tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; + }); + } + } + + ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = ORKDynamicCast(formItem.impliedAnswerFormat, ORKTextChoiceAnswerFormat); + ORKChoiceViewCell *choiceViewCell = ORKDynamicCast(cell, ORKChoiceViewCell); + if (choiceViewCell != nil) { + // Dismiss other textField's keyboard + [tableView endEditing:NO]; + + // find all the row/cell peers to this indexPath + // the formItem + BOOL shouldAllowMultiSelection = YES; // assume multiple selection by default + + ORKColorChoiceAnswerFormat *colorChoiceAnswerFormat = ORKDynamicCast(formItem.impliedAnswerFormat, ORKColorChoiceAnswerFormat); + if (textChoiceAnswerFormat != nil || colorChoiceAnswerFormat != nil) { + ORKChoiceAnswerFormatHelper *helper = [[ORKChoiceAnswerFormatHelper alloc] initWithAnswerFormat:textChoiceAnswerFormat ? : colorChoiceAnswerFormat]; + + // does the answerFormat want multiple selection? + BOOL answerFormatAllowsMultiSelection = textChoiceAnswerFormat ? (textChoiceAnswerFormat.style == ORKChoiceAnswerStyleMultipleChoice) : (colorChoiceAnswerFormat.style == ORKChoiceAnswerStyleMultipleChoice); + + id answer = _savedAnswers[itemIdentifier.formItemIdentifier]; + NSMutableSet* selectedIndexes = [[NSMutableSet alloc] initWithArray:[helper selectedIndexesForAnswer:answer]]; + + shouldAllowMultiSelection = shouldAllowMultiSelection && answerFormatAllowsMultiSelection; + + // does the selected cell allow multiple choice? + shouldAllowMultiSelection = shouldAllowMultiSelection && (choiceViewCell.isExclusive == NO); + + // does the cell representing the current answer allow multiple choice? + NSNumber *previousSingleSelectionValue = [helper selectedIndexForAnswer:_savedAnswers[itemIdentifier.formItemIdentifier]]; + NSInteger previousSingleSelection = previousSingleSelectionValue ? previousSingleSelectionValue.integerValue : NSNotFound; + BOOL choiceIsExclusive = NO; + if (textChoiceAnswerFormat) { + ORKTextChoice *selectedChoice = (previousSingleSelection != NSNotFound) ? [helper textChoiceAtIndex:previousSingleSelection] : nil; + choiceIsExclusive = selectedChoice.exclusive; + } + + if (!textChoiceAnswerFormat) { + ORKColorChoice *selectedChoice = (previousSingleSelection != NSNotFound) ? [helper colorChoiceAtIndex:previousSingleSelection] : nil; + choiceIsExclusive = selectedChoice.exclusive; + } + + shouldAllowMultiSelection = shouldAllowMultiSelection && !choiceIsExclusive; + + NSRange range = NSMakeRange(0, helper.choiceCount); + NSIndexSet *relatedChoiceRows = [NSIndexSet indexSetWithIndexesInRange:range]; + NSInteger eachIndex = relatedChoiceRows.firstIndex; + while (eachIndex != NSNotFound) { + NSIndexPath *testIndexPath = [NSIndexPath indexPathForRow:eachIndex inSection:indexPath.section]; + ORKChoiceViewCell *testCell = [tableView cellForRowAtIndexPath:testIndexPath]; + + if (shouldAllowMultiSelection) { + // allowing multi selection means allowing toggling cells on and off when tapped + if (testCell == choiceViewCell) { + BOOL newSelectedState = !choiceViewCell.isCellSelected; + [testCell setCellSelected:newSelectedState highlight:YES]; + } + if (testCell.isCellSelected) { + ORK_Log_Debug("[MULTI SELECTION] adding index %@", @(eachIndex)); + [selectedIndexes addObject:@(eachIndex)]; + ORK_Log_Debug("[MULTI SELECTION] selected indexes are %@", selectedIndexes); + } else if (testCell && testCell.isCellSelected == NO) { + ORK_Log_Debug("[SELECTION] removing index %@", @(eachIndex)); + [selectedIndexes removeObject:@(eachIndex)]; + } + } else if (testCell == choiceViewCell) { + // only allow a single cell to be selected at a time + ORK_Log_Debug("[SELECTION] setting cell selected"); + [testCell setCellSelected:YES highlight:YES]; + [selectedIndexes addObject:@(eachIndex)]; + } else { + // we're not allowing multi-selection, but this isn't the selected cell either, unhighlight + [testCell setCellSelected:NO highlight:NO]; + ORK_Log_Debug("[SELECTION] removing index %@", @(eachIndex)); + [selectedIndexes removeObject:@(eachIndex)]; + } + eachIndex = [relatedChoiceRows indexGreaterThanIndex:eachIndex]; + } + + NSArray *uniqueSelectedIndexes = [selectedIndexes allObjects]; + uniqueSelectedIndexes = [uniqueSelectedIndexes sortedArrayUsingComparator:^NSComparisonResult(NSNumber *obj1, NSNumber *obj2) { + return [obj1 compare:obj2]; + }]; + + int textChoiceOtherIndex = 0; + for (ORKTextChoice *textChoice in formItem.impliedAnswerFormat.choices) { + ORKTextChoiceOther *textChoiceOther = ORKDynamicCast(textChoice, ORKTextChoiceOther); + if (textChoiceOther != nil) { + ORKChoiceOtherViewCell *choiceOtherViewCell = [_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:textChoiceOtherIndex inSection:indexPath.section]]; + [self resizeORKChoiceOtherViewCell:choiceOtherViewCell withTextChoice:textChoiceOther]; + } + textChoiceOtherIndex = textChoiceOtherIndex + 1; + } + + answer = [helper answerForSelectedIndexes:uniqueSelectedIndexes]; + [self saveAnswer:answer forItemIdentifier:itemIdentifier]; + ORK_Log_Debug("saved answers are now %@'", [self savedAnswers]); + } else { + ORK_Log_Debug("[FORMSTEP] NOT textChoice: row for item %@ selected: answerFormat is '%@'", itemIdentifier, formItem.impliedAnswerFormat); + } + + } else { + ORK_Log_Debug("[FORMSTEP] NOT ORKChoiceViewCell: row for indexPath %@ selected. Cell: %@", indexPath, cell); + } + + ORKChoiceOtherViewCell *choiceOtherViewCell = ORKDynamicCast(cell, ORKChoiceOtherViewCell); + if (choiceOtherViewCell != nil && textChoiceAnswerFormat != nil) { + // we need to call this at the end of didSelect, because the cell will have `_selected` property to `YES` + // calling this earlier, would cause us to + // [reload tableView] -> which calls -> layoutSubviews on ORKChoiceViewCell -> which calls -> + // updateSelectedItem, which has `_checked` as false, and sets the checkmark to grey + // if we defer this call to the end, it works nice, and by using diffabledatasource to reload it animates nicely + [self didSelectChoiceOtherViewCellWithItemIdentifier:itemIdentifier choiceOtherViewCell:choiceOtherViewCell]; + } + +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return UITableViewAutomaticDimension; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + __auto_type snapshot = [_diffableDataSource snapshot]; + NSString *sectionIdentifier = [[snapshot sectionIdentifiers] objectAtIndex:section]; + ORKFormItem *sectionFormItem = [self _formItemForFormItemIdentifier:sectionIdentifier]; + NSString *title = sectionFormItem.text; + + // Make first section header view zero height when there is no title + return [self formStep].useCardView ? UITableViewAutomaticDimension : (title.length > 0) ? UITableViewAutomaticDimension : ((section == 0) ? 0 : UITableViewAutomaticDimension); +} + +- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForHeaderInSection:(NSInteger)section { + __auto_type snapshot = [_diffableDataSource snapshot]; + NSString *sectionIdentifier = [[snapshot sectionIdentifiers] objectAtIndex:section]; + ORKFormItem *sectionFormItem = [self _formItemForFormItemIdentifier:sectionIdentifier]; + + return [self heightForFormItem:sectionFormItem] + (ORKIsAccessibilityLargeTextEnabled() ? ORKFormStepLargeTextMinimumHeaderHeight : ORKFormStepMinimumHeaderHeight); +} + +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { + __auto_type snapshot = [_diffableDataSource snapshot]; + NSArray *sectionIdentifiers = [snapshot sectionIdentifiers]; + NSString *sectionIdentifier = [sectionIdentifiers objectAtIndex:section]; + ORKFormItem *sectionFormItem = [self _formItemForFormItemIdentifier:sectionIdentifier]; + + NSString *title = sectionFormItem.text; + NSString *detailText = sectionFormItem.detailText; + NSString *sectionProgressText = nil; + ORKLearnMoreView *learnMoreView; + NSString *tagText = sectionFormItem.tagText; + BOOL hasMultipleChoiceFormItem = NO; + BOOL shouldIgnoreDarkMode = NO; + + if (sectionFormItem.showsProgress) { + if ([self.delegate respondsToSelector:@selector(stepViewControllerTotalProgressInfoForStep:currentStep:)]) { + ORKTaskTotalProgress progressInfo = [self.delegate stepViewControllerTotalProgressInfoForStep:self currentStep:self.step]; + if (progressInfo.stepShouldShowTotalProgress) { + sectionProgressText = [NSString localizedStringWithFormat:ORKLocalizedString(@"FORM_ITEM_PROGRESS", nil) ,ORKLocalizedStringFromNumber(@(section + progressInfo.currentStepStartingProgressPosition)), ORKLocalizedStringFromNumber(@(progressInfo.total))]; + } + } + + if (!sectionProgressText) { + // only display progress label if there are more than 1 sections in the form step + if (snapshot.numberOfSections > 1) { + sectionProgressText = [NSString localizedStringWithFormat:ORKLocalizedString(@"FORM_ITEM_PROGRESS", nil) ,ORKLocalizedStringFromNumber(@(section + 1)), ORKLocalizedStringFromNumber(@(snapshot.numberOfSections))]; + } + } + } + + if (sectionFormItem.learnMoreItem) { + learnMoreView = [ORKLearnMoreView learnMoreViewWithItem:sectionFormItem.learnMoreItem]; + learnMoreView.delegate = self; + } + + hasMultipleChoiceFormItem = (sectionFormItem.impliedAnswerFormat.questionType == ORKQuestionTypeMultipleChoice) ? YES : NO; + shouldIgnoreDarkMode = [sectionFormItem.impliedAnswerFormat isKindOfClass:[ORKColorChoiceAnswerFormat class]]; + + ORKSurveyCardHeaderView *cardHeaderView = (ORKSurveyCardHeaderView *)[tableView dequeueReusableHeaderFooterViewWithIdentifier: ORKSurveyCardHeaderViewIdentifier]; + + [cardHeaderView configureWithTitle:title + detailText:detailText + learnMoreView:learnMoreView + progressText:sectionProgressText + tagText:tagText + showBorder:([self formStep].cardViewStyle == ORKCardViewStyleBordered) + hasMultipleChoiceItem:hasMultipleChoiceFormItem + shouldIgnoreDarkMode:shouldIgnoreDarkMode]; + + return cardHeaderView; +} + +- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { + ORKFormStep *formStep = [self formStep]; + if (formStep.footerText != nil && (section == (tableView.numberOfSections - 1))) { + return formStep.footerText; + } + + return nil; +} + +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { + return nil; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { + return section == tableView.numberOfSections - 1 ? UITableViewAutomaticDimension : 10; +} + +#pragma mark ORKFormItemCellDelegate + +- (void)formItemCellDidBecomeFirstResponder:(ORKFormItemCell *)cell { + if (_currentFirstResponderCell) { + ORKFormItemTextFieldBasedCell *previousSelectedCell = (ORKFormItemTextFieldBasedCell*)_currentFirstResponderCell; + if (previousSelectedCell != nil && [previousSelectedCell respondsToSelector:@selector(removeEditingHighlight)]) { + [previousSelectedCell removeEditingHighlight]; + } + } + + _currentFirstResponderCell = cell; + NSIndexPath *path = [_tableView indexPathForCell:cell]; + if (path) { + ORKTableContainerView *tableContainer = _tableContainer; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [tableContainer scrollCellVisible:cell animated:YES]; + }); + } +} + +- (void)formItemCellDidResignFirstResponder:(ORKFormItemCell *)cell { + if (_currentFirstResponderCell == cell) { + _currentFirstResponderCell = nil; + } + + NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; + ORKTableCellItemIdentifier *cellItemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:indexPath]; + if ([cell isKindOfClass:[ORKFormItemPickerCell class]] || [cell isKindOfClass:[ORKFormItemTextCell class]]) { + + __weak typeof(self) weakSelf = self; + [self buildDataSource:_diffableDataSource withCompletion:^{ + [weakSelf finishHandlingFormItemCellDidResignFirstResponder:cellItemIdentifier]; + }]; + } else { + [self finishHandlingFormItemCellDidResignFirstResponder:cellItemIdentifier]; + } +} + +- (void)finishHandlingFormItemCellDidResignFirstResponder:(ORKTableCellItemIdentifier *)cellItemIdentifier { + //determines if the table should autoscroll to the next section + __auto_type snapshot = [_diffableDataSource snapshot]; + NSIndexPath *indexPath = [_diffableDataSource indexPathForItemIdentifier:cellItemIdentifier]; + NSString *sectionIdentifier = [[snapshot sectionIdentifiers] objectAtIndex:indexPath.section]; + ORKFormItemCell *cell = ORKDynamicCast([self.tableView cellForRowAtIndexPath:indexPath], ORKFormItemCell); + + if (cell.isLastItem && [self shouldAutoScrollToNextSection:indexPath]) { + [self autoScrollToNextSection:indexPath]; + return; + } else if (cell.isLastItem && indexPath.section == (snapshot.numberOfSections - 1) && ![_identifiersOfAnsweredSections containsObject:sectionIdentifier]) { + if (![self allNonOptionalFormItemsHaveAnswers]) { + [self scrollToFirstUnansweredSection]; + } else { + [self scrollToFooter]; + } + } + + if (indexPath) { + NSInteger numberOfItemsInSection = [snapshot numberOfItemsInSection:sectionIdentifier]; + if (indexPath.row < numberOfItemsInSection - 1) { + NSIndexPath *nextPath = [NSIndexPath indexPathForRow:(indexPath.row + 1) inSection:indexPath.section]; + NSString *nextFormItemIdentifier = [[_diffableDataSource itemIdentifierForIndexPath:nextPath] formItemIdentifier]; + BOOL cellNeedsBecomeFirstResponder = (self.savedAnswers[nextFormItemIdentifier] == nil); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + if (_currentFirstResponderCell == nil) { + if (cellNeedsBecomeFirstResponder == YES) { + ORKFormItemCell *formItemCell = ORKDynamicCast([_tableView cellForRowAtIndexPath:nextPath], ORKFormItemCell); + [formItemCell becomeFirstResponder]; + } + + if ([self _isAutoScrollEnabled]) { + [_tableView scrollToRowAtIndexPath:nextPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; + } + } + }); + } + } +} + +- (void)formItemCell:(ORKFormItemCell *)cell invalidInputAlertWithMessage:(NSString *)input { + [self showValidityAlertWithMessage:input]; +} + +- (void)formItemCell:(ORKFormItemCell *)cell invalidInputAlertWithTitle:(NSString *)title message:(NSString *)message { + [self showValidityAlertWithTitle:title message:message]; +} + +- (void)formItemCell:(ORKFormItemCell *)cell answerDidChangeTo:(id)answer { + if (cell.superview != nil) { + ORKTableCellItemIdentifier *cellItemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:[_tableView indexPathForCell:cell]]; + [self saveAnswer:answer forItemIdentifier:cellItemIdentifier]; + } else { + // if the cell isn't in the view hierarchy, this change is coming from configuring the cell + // ignore + } +} + +- (BOOL)formItemCellShouldDismissKeyboard:(ORKFormItemCell *)cell { + if ([self didAutoScrollToNextItem:cell]) { + return NO; + } + return YES; +} + +#pragma mark ORKTableContainerViewDelegate + +- (UITableViewCell *)currentFirstResponderCellForTableContainerView:(ORKTableContainerView *)tableContainerView { + return _currentFirstResponderCell; +} + +#pragma mark UIStateRestoration + +static NSString *const _ORKSavedAnswersRestoreKey = @"savedAnswers"; +static NSString *const _ORKSavedAnswerDatesRestoreKey = @"savedAnswerDates"; +static NSString *const _ORKSavedSystemCalendarsRestoreKey = @"savedSystemCalendars"; +static NSString *const _ORKSavedSystemTimeZonesRestoreKey = @"savedSystemTimeZones"; +static NSString *const _ORKOriginalAnswersRestoreKey = @"originalAnswers"; +static NSString *const _ORKAnsweredSectionIdentifiersRestoreKey = @"answeredSectionIdentifiers"; + +- (void)encodeRestorableStateWithCoder:(NSCoder *)coder { + [super encodeRestorableStateWithCoder:coder]; + + [coder encodeObject:_savedAnswers forKey:_ORKSavedAnswersRestoreKey]; + [coder encodeObject:_savedAnswerDates forKey:_ORKSavedAnswerDatesRestoreKey]; + [coder encodeObject:_savedSystemCalendars forKey:_ORKSavedSystemCalendarsRestoreKey]; + [coder encodeObject:_savedSystemTimeZones forKey:_ORKSavedSystemTimeZonesRestoreKey]; + [coder encodeObject:_originalAnswers forKey:_ORKOriginalAnswersRestoreKey]; + [coder encodeObject:_identifiersOfAnsweredSections forKey:_ORKAnsweredSectionIdentifiersRestoreKey]; +} + +- (void)decodeRestorableStateWithCoder:(NSCoder *)coder { + [super decodeRestorableStateWithCoder:coder]; + + NSSet *decodableAnswerTypes = [NSSet setWithObjects:NSMutableDictionary.self, NSString.self, NSNumber.self, NSDate.self, nil]; + _savedAnswers = [coder decodeObjectOfClasses:decodableAnswerTypes forKey:_ORKSavedAnswersRestoreKey]; + [self removeInvalidSavedAnswers]; + + _savedAnswerDates = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, NSDate.self]] forKey:_ORKSavedAnswerDatesRestoreKey]; + _savedSystemCalendars = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, NSCalendar.self]] forKey:_ORKSavedSystemCalendarsRestoreKey]; + _savedSystemTimeZones = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, NSTimeZone.self]] forKey:_ORKSavedSystemTimeZonesRestoreKey]; + _originalAnswers = [coder decodeObjectOfClasses:decodableAnswerTypes forKey:_ORKOriginalAnswersRestoreKey]; + _identifiersOfAnsweredSections = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableSet.self, NSString.self]] forKey:_ORKAnsweredSectionIdentifiersRestoreKey]; +} + +- (void)removeInvalidSavedAnswers { + for (ORKFormItem *item in [self allFormItems]) { + id answer = _savedAnswers[item.identifier]; + ORKAnswerFormat *answerFormat = item.impliedAnswerFormat; + ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = ORKDynamicCast(answerFormat, ORKTextChoiceAnswerFormat); + if ([textChoiceAnswerFormat isAnswerInvalid:answer]) { + ORK_Log_Error("unexpected answer %@ on answerFormat of %@", answer, item.impliedAnswerFormat); + _savedAnswers[item.identifier] = nil; + _savedAnswerDates[item.identifier] = nil; + } + } +} + +#pragma mark Rotate + +- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { + [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; + for (ORKFormItemCell *cell in _formItemCells) { + [cell setExpectedLayoutWidth:size.width]; + } +} + +#pragma mark FormItemCell AnswerChanged Updates + +- (void)answerChangedForIndexPath:(NSIndexPath *)indexPath { + // stash the itemIdentifier before buildDataSource + // We do not expect that editing a formItem would remove that same formItem from the dataSource + ORKTableCellItemIdentifier *itemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:indexPath]; + + UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; + if (cell.superview == nil) { + return; + } + + _skipped = NO; + [self updateButtonStates]; + [self notifyDelegateOnResultChange]; + + BOOL skipRebuildDataSource = NO; + + //For picker cells, wait for the "done" button to resign first responder before trying to rebuild + skipRebuildDataSource = skipRebuildDataSource || [cell isKindOfClass:[ORKFormItemPickerCell class]]; + + // For text cells, don't rebuild during typing + skipRebuildDataSource = skipRebuildDataSource || [cell isKindOfClass:[ORKFormItemTextCell class]]; + + // Only allow skipping if the answer was changed to something non-nil. The answer will be nullAnswer when users + // hit the 'clear' button on the textCell. Normally, the answer changes multiple times to different non-nil values + // before we're given the chance to process the new value through formItemCellDidResignFirstResponder + skipRebuildDataSource = skipRebuildDataSource && (_savedAnswers[itemIdentifier.formItemIdentifier] != ORKNullAnswerValue()); + + if (skipRebuildDataSource == YES) { + [self finishHandlingAnswerChangedForItemIdentifier:itemIdentifier]; + } else { + __weak typeof(self) weakSelf = self; + [self buildDataSource:_diffableDataSource withCompletion:^{ + [weakSelf finishHandlingAnswerChangedForItemIdentifier:itemIdentifier]; + }]; + } +} + +- (void)finishHandlingAnswerChangedForItemIdentifier:(ORKTableCellItemIdentifier *)itemIdentifier { + // find the new indexPath of the saved itemIdentifier (almost certainly the same indexPath as before) + NSIndexPath *updatedIndexPath = [_diffableDataSource indexPathForItemIdentifier:itemIdentifier]; + ORKFormItemCell *cell = [self.tableView cellForRowAtIndexPath:updatedIndexPath]; + + BOOL handled = NO; + + // avoid auto-scrolling when typing in the ORKChoiceOtherViewCell changes the answer + handled = handled || [cell isKindOfClass:[ORKChoiceOtherViewCell class]]; + + handled = handled || [self scrollNextSectionToVisibleFromIndexPath:updatedIndexPath]; + handled = handled || [self scrollFirstUnansweredSectionToVisibleFromIndexPath:updatedIndexPath]; + handled = handled || [self scrollFooterToVisibleFromIndexPath:updatedIndexPath]; + NSAssert(handled == YES, @"Answer change went unhandled"); + + if (handled && [self isContentSizeLargerThanFrame]) { + [_tableContainer resizeFooterToFitUsingMinHeight:YES]; + } + // Delay updating answered sections so our autoscroll logic can check for the case where a section is answered for the first time + // This way we don't try to autoscroll if you've changed an answer in a section. Instead we only autoscroll the first time you put an answer in for a section. + [self updateAnsweredSections]; +} + +- (BOOL)scrollNextSectionToVisibleFromIndexPath:(NSIndexPath *)indexPath { + BOOL handledAutoScroll = NO; + + __auto_type snapshot = [_diffableDataSource snapshot]; + ORKTableCellItemIdentifier *cellItemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:indexPath]; + NSString *formItemIdentifier = cellItemIdentifier.formItemIdentifier; + ORKFormItem *formItem = [self _formItemForFormItemIdentifier:formItemIdentifier]; + id savedAnswer = self.savedAnswers[formItemIdentifier]; + + BOOL allowAutoScrolling = NO; + + // allow autoscroll if you hit don't know + allowAutoScrolling = allowAutoScrolling || [savedAnswer isKindOfClass:[ORKDontKnowAnswer class]]; + + // allow autoscroll if the question is SES + allowAutoScrolling = allowAutoScrolling || (formItem.impliedAnswerFormat.questionType == ORKQuestionTypeSES); + + ORKTextChoiceAnswerFormat *answerFormat = [self textChoiceAnswerFormatForIndexPath:indexPath]; + if (answerFormat != nil) { + // allow scrolling for single-choice answer formats + allowAutoScrolling = allowAutoScrolling || (answerFormat.style == ORKChoiceAnswerStyleSingleChoice); + + // allow scrolling after choosing an exclusive choice + allowAutoScrolling = allowAutoScrolling || answerFormat.textChoices[cellItemIdentifier.choiceIndex].exclusive; + } + + if (allowAutoScrolling == YES) { + + // only allow autoscroll to the next section if this was the first time providing an answer in this section + // this test works because we expect updateAnsweredSections runs *after* we do + NSString *sectionIdentifier = [snapshot sectionIdentifierForSectionContainingItemIdentifier:cellItemIdentifier]; + allowAutoScrolling = allowAutoScrolling && ([_identifiersOfAnsweredSections containsObject:sectionIdentifier] == NO); + + ORKFormItem *nextUnansweredFormItem = nil; + { + NSArray *sectionCellItemIdentifiers = [snapshot itemIdentifiersInSectionWithIdentifier:sectionIdentifier]; + + // Get the index of the cell whose indexPath was just answered. + NSUInteger index = [sectionCellItemIdentifiers indexOfObject:cellItemIdentifier]; + NSAssert(index != NSNotFound, @"Expected cellItemIdentifier to be present in section"); + + // find the next answerable unanswered formItem in this section + while (index < sectionCellItemIdentifiers.count) { + // Find the formItemIdentifier. Check to see whether there is an answer for this identifier. + NSString *testFormItemIdentifier = sectionCellItemIdentifiers[index].formItemIdentifier; + id testAnswer = self.savedAnswers[testFormItemIdentifier]; + ORKFormItem *testFormItem = [self _formItemForFormItemIdentifier:testFormItemIdentifier]; + + // Find formItems that are answerable, but not yet answered + if ((testFormItem.impliedAnswerFormat != nil) && (testAnswer == nil)) { + nextUnansweredFormItem = testFormItem; + break; + } + + index += 1; + } + } + + // only allow autoscrolling if this formItem is the last unanswered answerable formItem in this section + allowAutoScrolling = allowAutoScrolling && (nextUnansweredFormItem == nil); + } + + if (allowAutoScrolling == YES) { + // only allow autoscrolling to the next section if the next section exists + if ((indexPath.section + 1) < [snapshot numberOfSections]) { + [self autoScrollToNextSection:indexPath]; + handledAutoScroll = YES; + } else { + // We would go to the next section, but we literally can't + // Let the caller come up with a backup plan + } + } else { + // allowAutoScrolling == NO means prevent autoscrolling completely + // so we claim we handled autoscroll + handledAutoScroll = YES; + } + + return handledAutoScroll; +} + +- (BOOL)scrollFirstUnansweredSectionToVisibleFromIndexPath:(NSIndexPath *)indexPath { + BOOL handled = NO; + + BOOL shouldScroll = YES; + + // only allow scrolling if this is the last section in the tableView + shouldScroll = shouldScroll && ((indexPath.section + 1) == [_tableView numberOfSections]); + + if (shouldScroll == YES) { + if ([self allNonOptionalFormItemsHaveAnswers] == NO) { + [self scrollToFirstUnansweredSection]; + handled = YES; + } else { + // we would scroll to the first unanswered section, but none exist + // not handled + } + } else { + // Decided we should not scroll at all + handled = YES; + } + + return handled; +} + +- (BOOL)scrollFooterToVisibleFromIndexPath:(NSIndexPath *)indexPath { + BOOL shouldScroll = YES; + + // only allow scrolling if this is the last section in the tableView + shouldScroll = shouldScroll && ((indexPath.section + 1) == [_tableView numberOfSections]); + + // only allow scrolling if all non-optional questions are answered + shouldScroll = shouldScroll && ([self allNonOptionalFormItemsHaveAnswers] == YES); + + if (shouldScroll == YES) { + [self scrollToFooter]; + } + + // nothing we can't handle + return YES; +} + +#pragma mark - ORKChoiceOtherViewCellDelegate + +- (void)textChoiceOtherCellDidBecomeFirstResponder:(ORKChoiceOtherViewCell *)choiceOtherViewCell { + _currentFirstResponderCell = choiceOtherViewCell; + NSIndexPath *path = [_tableView indexPathForCell:choiceOtherViewCell]; + if (path) { + ORKTableContainerView *tableContainer = _tableContainer; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, DelayBeforeAutoScroll * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + [tableContainer scrollCellVisible:choiceOtherViewCell animated:YES]; + }); + } +} + +- (void)updateTextChoiceOtherWithText:(NSString *)text choiceOtherCell:(ORKChoiceOtherViewCell *)choiceOtherViewCell { + if (_currentFirstResponderCell == choiceOtherViewCell) { + _currentFirstResponderCell = nil; + } + + // we need to use `indexPathForRowAtPoint` because `indexPathForCell` + // will return nil if the cell is off the screen, which will happen if we are scrolling + NSIndexPath *indexPath = [_tableView indexPathForRowAtPoint:choiceOtherViewCell.center]; + + ORKTableCellItemIdentifier *itemIdentifier = [_diffableDataSource itemIdentifierForIndexPath:indexPath]; + ORKFormItem *formItem = [self _formItemForFormItemIdentifier:itemIdentifier.formItemIdentifier]; + ORKTextChoiceOther *textChoice = [[[formItem answerFormat] choices] objectAtIndex:itemIdentifier.choiceIndex]; + + ORK_Log_Debug("[FORMSTEP] textChoiceOtherCellDidResignFirstResponder found textChoice %@ with value of %@", textChoice, textChoice.textViewText); + + id answer; + if (text.length > 0) { + textChoice.textViewText = text; + [self didSelectChoiceOtherViewCellWithItemIdentifier:itemIdentifier choiceOtherViewCell:choiceOtherViewCell]; + answer = @[textChoice.textViewText]; + } else { + textChoice.textViewText = nil; + if (!textChoice.textViewInputOptional) { + [choiceOtherViewCell setCellSelected:NO highlight:NO]; + } + + // textChoice doesn't have any custom text from the textView + // the answer should be the default text option + answer = @[textChoice.text]; + } + if (answer) { + [self saveTextChoiceAnswer:answer + formItem:formItem + indexPath:indexPath + itemIdentifier:itemIdentifier]; + } + + [self resizeORKChoiceOtherViewCell:choiceOtherViewCell withTextChoice:textChoice]; +} + +- (void)textChoiceOtherCellDidChangeText:(NSString *)text choiceOtherCell:(ORKChoiceOtherViewCell *)choiceOtherViewCell { + [self updateTextChoiceOtherWithText:text choiceOtherCell:choiceOtherViewCell]; +} + +- (void)textChoiceOtherCellDidResignFirstResponder:(ORKChoiceOtherViewCell *)choiceOtherViewCell { + [self updateTextChoiceOtherWithText:choiceOtherViewCell.textView.text choiceOtherCell:choiceOtherViewCell]; +} + +- (void)saveTextChoiceAnswer:(id)answer + formItem:(ORKFormItem*)formItem + indexPath:(NSIndexPath*)indexPath + itemIdentifier:(ORKTableCellItemIdentifier*)itemIdentifier { + ORKTextChoiceAnswerFormat *textChoiceAnswerFormat = ORKDynamicCast(formItem.impliedAnswerFormat, ORKTextChoiceAnswerFormat); + ORKChoiceAnswerFormatHelper *helper = [[ORKChoiceAnswerFormatHelper alloc] initWithAnswerFormat:textChoiceAnswerFormat]; + NSArray *selectedIndexes = [helper selectedIndexesForAnswer:answer]; + // regenerate answer to pick up the changed text from choiceOtherViewCell + answer = [helper answerForSelectedIndexes:selectedIndexes]; + _savedAnswers[itemIdentifier.formItemIdentifier] = answer; + [self answerChangedForIndexPath:indexPath]; +} + +#pragma mark - ORKlearnMoreStepViewControllerDelegate + +- (void)learnMoreButtonPressedWithStep:(ORKLearnMoreInstructionStep *)learnMoreStep { + [self.taskViewController learnMoreButtonPressedWithStep:learnMoreStep fromStepViewController:self]; +} + +@end + +@implementation ORKFormItem (FormStepViewControllerExtensions) + +- (BOOL)requiresSingleSection { + ORKAnswerFormat *answerFormat = [self impliedAnswerFormat]; + + ORKQuestionType questionType = answerFormat.questionType; + NSArray *singleSectionTypes = @[@(ORKQuestionTypeBoolean), + @(ORKQuestionTypeSingleChoice), + @(ORKQuestionTypeMultipleChoice), + @(ORKQuestionTypeLocation), + @(ORKQuestionTypeSES)]; + + BOOL multiCellChoices = ([singleSectionTypes containsObject:@(questionType)] && + NO == [answerFormat isKindOfClass:[ORKValuePickerAnswerFormat class]]); + + BOOL scale = (questionType == ORKQuestionTypeScale); + + // Items require individual section + if (multiCellChoices || scale) { + return YES; + } + + return NO; +} + +@end diff --git a/ResearchKit/Common/ORKFormStepViewController_Internal.h b/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController_Internal.h similarity index 100% rename from ResearchKit/Common/ORKFormStepViewController_Internal.h rename to ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController_Internal.h diff --git a/ResearchKit/Common/ORKFormStepViewController_Private.h b/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController_Private.h similarity index 97% rename from ResearchKit/Common/ORKFormStepViewController_Private.h rename to ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController_Private.h index 5821e7386e..6ad3ebfa46 100644 --- a/ResearchKit/Common/ORKFormStepViewController_Private.h +++ b/ResearchKitUI/Common/Step/Form Step/ORKFormStepViewController_Private.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKImageCaptureCameraPreviewView.h b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureCameraPreviewView.h similarity index 100% rename from ResearchKit/Common/ORKImageCaptureCameraPreviewView.h rename to ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureCameraPreviewView.h diff --git a/ResearchKit/Common/ORKImageCaptureCameraPreviewView.m b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureCameraPreviewView.m similarity index 100% rename from ResearchKit/Common/ORKImageCaptureCameraPreviewView.m rename to ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureCameraPreviewView.m diff --git a/ResearchKit/Common/ORKImageCaptureStepViewController.h b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKImageCaptureStepViewController.h rename to ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureStepViewController.h index 782cad53b2..b0ed981822 100644 --- a/ResearchKit/Common/ORKImageCaptureStepViewController.h +++ b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKImageCaptureStepViewController.m b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureStepViewController.m similarity index 95% rename from ResearchKit/Common/ORKImageCaptureStepViewController.m rename to ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureStepViewController.m index b795d7a5db..75c432147c 100644 --- a/ResearchKit/Common/ORKImageCaptureStepViewController.m +++ b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureStepViewController.m @@ -178,9 +178,8 @@ - (AVCapturePhotoSettings *)createRawPhotoSettings { photoSettings = [AVCapturePhotoSettings photoSettingsWithRawPixelFormatType:rawPixelFormatType processedFormat:@{AVVideoCodecKey: AVVideoCodecTypeJPEG}]; } - - [photoSettings setPhotoQualityPrioritization:AVCapturePhotoQualityPrioritizationSpeed]; - [photoSettings setFlashMode:(([_photoOutput.supportedFlashModes containsObject:[NSNumber numberWithInt:AVCaptureFlashModeOn]] ? AVCaptureFlashModeAuto : AVCaptureFlashModeOff))]; + photoSettings.photoQualityPrioritization = AVCapturePhotoQualityPrioritizationBalanced; + [photoSettings setFlashMode:(AVCaptureFlashModeAuto)]; return photoSettings; } @@ -196,8 +195,8 @@ - (AVCapturePhotoSettings *)generatePhotoSetting { _imageDataExtension = @"jpeg"; } - [photoSettings setPhotoQualityPrioritization:AVCapturePhotoQualityPrioritizationSpeed]; - [photoSettings setFlashMode:(([_photoOutput.supportedFlashModes containsObject:[NSNumber numberWithInt:AVCaptureFlashModeOn]] ? AVCaptureFlashModeAuto : AVCaptureFlashModeOff))]; + [photoSettings setFlashMode:(AVCaptureFlashModeAuto)]; + photoSettings.photoQualityPrioritization = AVCapturePhotoQualityPrioritizationBalanced; return photoSettings; } @@ -292,14 +291,6 @@ - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - - if (_imageCaptureView) { - [_imageCaptureView orientationDidChange]; - } -} - - (void)queue_SetupCaptureSession { // Create the session _captureSession = [[AVCaptureSession alloc] init]; diff --git a/ResearchKit/Common/ORKImageCaptureView.h b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureView.h similarity index 98% rename from ResearchKit/Common/ORKImageCaptureView.h rename to ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureView.h index 1d0e5ab9be..788ae0401b 100644 --- a/ResearchKit/Common/ORKImageCaptureView.h +++ b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureView.h @@ -56,8 +56,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong, nullable) UIImage *capturedImage; @property (nonatomic, strong, nullable) NSError *error; -- (void)orientationDidChange; - @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKImageCaptureView.m b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureView.m similarity index 88% rename from ResearchKit/Common/ORKImageCaptureView.m rename to ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureView.m index e8d5452fc2..4ba63fb5df 100644 --- a/ResearchKit/Common/ORKImageCaptureView.m +++ b/ResearchKitUI/Common/Step/Image Capture Step/ORKImageCaptureView.m @@ -100,29 +100,24 @@ - (void)queue_sessionRunning { - (void)orientationDidChange { dispatch_async(dispatch_get_main_queue(), ^{ AVCaptureVideoOrientation orientation = AVCaptureVideoOrientationPortrait; - - UIWindowScene *windowScene = self.window.windowScene; - - if (windowScene) { - switch (windowScene.interfaceOrientation) { - case UIInterfaceOrientationLandscapeRight: - orientation = AVCaptureVideoOrientationLandscapeRight; - break; - case UIInterfaceOrientationLandscapeLeft: - orientation = AVCaptureVideoOrientationLandscapeLeft; - break; - case UIInterfaceOrientationPortraitUpsideDown: - orientation = AVCaptureVideoOrientationPortraitUpsideDown; - break; - case UIInterfaceOrientationPortrait: - orientation = AVCaptureVideoOrientationPortrait; - break; - case UIInterfaceOrientationUnknown: - // Do nothing in these cases, since we don't need to change display orientation. - return; - } + switch (self.window.windowScene.interfaceOrientation) { + case UIInterfaceOrientationLandscapeRight: + orientation = AVCaptureVideoOrientationLandscapeRight; + break; + case UIInterfaceOrientationLandscapeLeft: + orientation = AVCaptureVideoOrientationLandscapeLeft; + break; + case UIInterfaceOrientationPortraitUpsideDown: + orientation = AVCaptureVideoOrientationPortraitUpsideDown; + break; + case UIInterfaceOrientationPortrait: + orientation = AVCaptureVideoOrientationPortrait; + break; + case UIInterfaceOrientationUnknown: + // Do nothing in these cases, since we don't need to change display orientation. + return; } - + [_previewView setVideoOrientation:orientation]; [self.delegate videoOrientationDidChange:orientation]; [self setNeedsUpdateConstraints]; @@ -230,13 +225,7 @@ - (void)updateConstraints { views:views]]; // Float the continue view over the previewView if in landscape to give more room for the preview - - UIWindowScene *windowScene = self.window.windowScene; - if (windowScene == nil){ - return; - } - - if (UIInterfaceOrientationIsLandscape(windowScene.interfaceOrientation)) { + if (UIInterfaceOrientationIsLandscape(self.window.windowScene.interfaceOrientation)) { [_variableConstraints addObjectsFromArray: [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_previewView]|" options:NSLayoutFormatDirectionLeadingToTrailing metrics:nil @@ -258,13 +247,6 @@ - (void)updateConstraints { _navigationFooterView.backgroundColor = [_navigationFooterView.backgroundColor colorWithAlphaComponent:NavigationFooterViewOpaqueAlpha]; } - [_variableConstraints addObjectsFromArray: - [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_previewView]-[_navigationFooterView]|" - options:NSLayoutFormatDirectionLeadingToTrailing - metrics:nil - views:views]]; - _navigationFooterView.backgroundColor = [_navigationFooterView.backgroundColor colorWithAlphaComponent:NavigationFooterViewOpaqueAlpha]; - [NSLayoutConstraint activateConstraints:_variableConstraints]; [super updateConstraints]; } diff --git a/ResearchKit/Common/ORKCompletionCheckmarkView.h b/ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionCheckmarkView.h similarity index 100% rename from ResearchKit/Common/ORKCompletionCheckmarkView.h rename to ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionCheckmarkView.h diff --git a/ResearchKit/Common/ORKCompletionCheckmarkView.m b/ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionCheckmarkView.m similarity index 100% rename from ResearchKit/Common/ORKCompletionCheckmarkView.m rename to ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionCheckmarkView.m diff --git a/ResearchKit/Common/ORKCompletionStepViewController.h b/ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionStepViewController.h similarity index 95% rename from ResearchKit/Common/ORKCompletionStepViewController.h rename to ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionStepViewController.h index 9b5fa99af4..7093a17066 100644 --- a/ResearchKit/Common/ORKCompletionStepViewController.h +++ b/ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -48,7 +48,6 @@ NS_ASSUME_NONNULL_BEGIN ORK_CLASS_AVAILABLE @interface ORKCompletionStepViewController : ORKInstructionStepViewController -// FIXME:Deprecate this property /** Optional property to allow showing the "Done/Next" button rather than moving this button to the `rightBarButtonItem`. diff --git a/ResearchKit/Common/ORKCompletionStepViewController.m b/ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionStepViewController.m similarity index 94% rename from ResearchKit/Common/ORKCompletionStepViewController.m rename to ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionStepViewController.m index 13865bc8cd..70d734c4a0 100644 --- a/ResearchKit/Common/ORKCompletionStepViewController.m +++ b/ResearchKitUI/Common/Step/Instruction Step/Completion Step/ORKCompletionStepViewController.m @@ -31,9 +31,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKCompletionStepViewController.h" -#import "ORKCustomStepView_Internal.h" #import "ORKInstructionStepContainerView.h" -#import "ORKInstructionStepView.h" #import "ORKNavigationContainerView.h" #import "ORKStepHeaderView_Internal.h" #import "ORKStepView_Private.h" @@ -51,7 +49,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKCompletionStepViewController { ORKCompletionCheckmarkView *_completionCheckmarkView; - ORKTaskViewControllerFinishReason _reasonForCompletion; + ORKTaskFinishReason _reasonForCompletion; } - (void)stepDidChange { @@ -62,7 +60,7 @@ - (void)stepDidChange { self.cancelButtonItem = nil; - if (_reasonForCompletion == ORKTaskViewControllerFinishReasonCompleted) { + if (_reasonForCompletion == ORKTaskFinishReasonCompleted) { _completionCheckmarkView = [self.stepView.stepContentView completionCheckmarkView]; [_completionCheckmarkView setNeedsLayout]; if (self.checkmarkColor) { @@ -74,7 +72,6 @@ - (void)stepDidChange { } self.stepView.customContentFillsAvailableSpace = YES; - } - (void)continueWasPressed { @@ -95,7 +92,6 @@ - (void)viewWillAppear:(BOOL)animated { - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; - if (animated && _completionCheckmarkView) { [_completionCheckmarkView setAnimationPoint:1 animated:YES]; } @@ -103,7 +99,6 @@ - (void)viewDidAppear:(BOOL)animated { - (void)setCheckmarkColor:(UIColor *)checkmarkColor { _checkmarkColor = [checkmarkColor copy]; - if (_completionCheckmarkView) { _completionCheckmarkView.tintColor = checkmarkColor; } diff --git a/ResearchKit/Common/ORKLearnMoreStepViewController.h b/ResearchKitUI/Common/Step/Instruction Step/LearnMore Step/ORKLearnMoreStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKLearnMoreStepViewController.h rename to ResearchKitUI/Common/Step/Instruction Step/LearnMore Step/ORKLearnMoreStepViewController.h index a79066d366..e76cf6be72 100644 --- a/ResearchKit/Common/ORKLearnMoreStepViewController.h +++ b/ResearchKitUI/Common/Step/Instruction Step/LearnMore Step/ORKLearnMoreStepViewController.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKLearnMoreStepViewController.m b/ResearchKitUI/Common/Step/Instruction Step/LearnMore Step/ORKLearnMoreStepViewController.m similarity index 82% rename from ResearchKit/Common/ORKLearnMoreStepViewController.m rename to ResearchKitUI/Common/Step/Instruction Step/LearnMore Step/ORKLearnMoreStepViewController.m index 09b87c1e20..718542d6b8 100644 --- a/ResearchKit/Common/ORKLearnMoreStepViewController.m +++ b/ResearchKitUI/Common/Step/Instruction Step/LearnMore Step/ORKLearnMoreStepViewController.m @@ -38,11 +38,16 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const CGFloat ORKScrollViewCustomContentInset = 40.0; +NSString * const ORKLearnMoreStepViewAccessibilityIdentifier = @"ORKLearnMoreStepView"; +NSString * const ORKLearnMoreViewDoneButtonAccessibilityIdentifier = @"ORKLearnMoreStepViewDoneButton"; + @implementation ORKLearnMoreStepViewController - (void)stepDidChange { [super stepDidChange]; [self.stepView.navigationFooterView setHidden:YES]; + + self.stepView.accessibilityIdentifier = ORKLearnMoreStepViewAccessibilityIdentifier; } - (void)viewWillAppear:(BOOL)animated { @@ -50,18 +55,16 @@ - (void)viewWillAppear:(BOOL)animated { if (self.navigationItem.leftBarButtonItem) { self.navigationItem.leftBarButtonItem = nil; } - if (@available(iOS 13.0, *)) { - self.view.backgroundColor = [UIColor systemBackgroundColor]; - self.navigationController.navigationBar.backgroundColor = UIColor.systemBackgroundColor; - } else { - self.view.backgroundColor = [UIColor whiteColor]; - self.navigationController.navigationBar.backgroundColor = UIColor.whiteColor; - } + self.view.backgroundColor = [UIColor systemBackgroundColor]; + self.navigationController.navigationBar.backgroundColor = UIColor.systemBackgroundColor; + self.navigationController.navigationBar.tintColor = self.view.tintColor; + [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; self.navigationController.navigationBar.shadowImage = [UIImage new]; self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:ORKLocalizedString(@"BUTTON_DONE", nil) style:UIBarButtonItemStyleDone target:self action:@selector(doneButtonPressed:)]; + self.navigationItem.rightBarButtonItem.accessibilityIdentifier = ORKLearnMoreViewDoneButtonAccessibilityIdentifier; if (self.stepView.navigationFooterView.isHidden) { [self.stepView setScrollViewCustomContentInset: ORKScrollViewCustomContentInset]; diff --git a/ResearchKit/Common/ORKInstructionStepContainerView.h b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepContainerView.h similarity index 97% rename from ResearchKit/Common/ORKInstructionStepContainerView.h rename to ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepContainerView.h index b04fb17b96..cd654c0aca 100644 --- a/ResearchKit/Common/ORKInstructionStepContainerView.h +++ b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepContainerView.h @@ -30,7 +30,7 @@ #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKInstructionStepContainerView.m b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepContainerView.m similarity index 94% rename from ResearchKit/Common/ORKInstructionStepContainerView.m rename to ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepContainerView.m index 00c4be40e8..c05a74e3d2 100644 --- a/ResearchKit/Common/ORKInstructionStepContainerView.m +++ b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepContainerView.m @@ -32,6 +32,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKInstructionStepContainerView.h" #import "ORKBodyItem.h" +NSString * const ORKInstructionStepViewAccessibilityIdentifier = @"ORKInstructionStepView"; + @implementation ORKInstructionStepContainerView @@ -57,6 +59,8 @@ - (void)setVariables { self.auxiliaryImage = _instructionStep.auxiliaryImage; self.titleIconImage = _instructionStep.iconImage; + self.accessibilityIdentifier = ORKInstructionStepViewAccessibilityIdentifier; + [super updatePaddingConstraints]; if (_instructionStep.centerImageVertically) { self.centeredVerticallyImage = _instructionStep.image; diff --git a/ResearchKit/Common/ORKInstructionStepViewController.h b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKInstructionStepViewController.h rename to ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController.h index 9e2ce127c3..ec009d43ae 100644 --- a/ResearchKit/Common/ORKInstructionStepViewController.h +++ b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKInstructionStepViewController.m b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController.m similarity index 97% rename from ResearchKit/Common/ORKInstructionStepViewController.m rename to ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController.m index efe748a53f..07db903668 100644 --- a/ResearchKit/Common/ORKInstructionStepViewController.m +++ b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController.m @@ -28,7 +28,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - #import "ORKInstructionStepViewController.h" #import "ORKLearnMoreStepViewController.h" @@ -71,6 +70,7 @@ - (void)stepDidChange { if (self.step && [self isViewLoaded]) { self.stepView = [[ORKInstructionStepContainerView alloc] initWithInstructionStep:[self instructionStep]]; _stepView.delegate = self; + _stepView.stepContentView.shouldAutomaticallyAdjustImageTintColor = [self instructionStep].shouldAutomaticallyAdjustImageTintColor; _stepView.stepContentView.bodyContainerView.bodyItemDelegate = self; [self.view addSubview:self.stepView]; [self setNavigationFooterView]; @@ -201,6 +201,12 @@ - (void)stepViewLearnMoreButtonPressed:(ORKLearnMoreInstructionStep *)learnMoreS If not implemented, default to showing the learnMore view controller for the the step. */ + + [self handleLearnMoreButtonPressed:learnMoreStep]; +} + +- (void)handleLearnMoreButtonPressed:(ORKLearnMoreInstructionStep *)learnMoreStep { + if ([self.taskViewController.delegate respondsToSelector:@selector(taskViewController:learnMoreButtonPressedWithStep:forStepViewController:)]) { [self.taskViewController.delegate taskViewController:self.taskViewController learnMoreButtonPressedWithStep:learnMoreStep forStepViewController:self]; } else { diff --git a/ResearchKit/Common/ORKInstructionStepViewController_Internal.h b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController_Internal.h similarity index 91% rename from ResearchKit/Common/ORKInstructionStepViewController_Internal.h rename to ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController_Internal.h index 14784cba4e..f1cb2fa856 100644 --- a/ResearchKit/Common/ORKInstructionStepViewController_Internal.h +++ b/ResearchKitUI/Common/Step/Instruction Step/ORKInstructionStepViewController_Internal.h @@ -29,8 +29,8 @@ */ -#import - +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -46,6 +46,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)stepDidChange; +- (void)handleLearnMoreButtonPressed:(ORKLearnMoreInstructionStep *)learnMoreStep; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/ActiveTasks/ORKSecondaryTaskStepViewController.h b/ResearchKitUI/Common/Step/Instruction Step/SecondaryTask/ORKSecondaryTaskStepViewController.h similarity index 96% rename from ResearchKit/ActiveTasks/ORKSecondaryTaskStepViewController.h rename to ResearchKitUI/Common/Step/Instruction Step/SecondaryTask/ORKSecondaryTaskStepViewController.h index c387e6087e..189628b44c 100644 --- a/ResearchKit/ActiveTasks/ORKSecondaryTaskStepViewController.h +++ b/ResearchKitUI/Common/Step/Instruction Step/SecondaryTask/ORKSecondaryTaskStepViewController.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/ActiveTasks/ORKSecondaryTaskStepViewController.m b/ResearchKitUI/Common/Step/Instruction Step/SecondaryTask/ORKSecondaryTaskStepViewController.m similarity index 96% rename from ResearchKit/ActiveTasks/ORKSecondaryTaskStepViewController.m rename to ResearchKitUI/Common/Step/Instruction Step/SecondaryTask/ORKSecondaryTaskStepViewController.m index c3aae964e8..a4b564139c 100644 --- a/ResearchKit/ActiveTasks/ORKSecondaryTaskStepViewController.m +++ b/ResearchKitUI/Common/Step/Instruction Step/SecondaryTask/ORKSecondaryTaskStepViewController.m @@ -112,8 +112,8 @@ - (void)updateButtonState { #pragma mark ORKTaskViewControllerDelegate -- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskViewControllerFinishReason)reason error:(NSError *)error { - if (reason == ORKTaskViewControllerFinishReasonCompleted) { +- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskFinishReason)reason error:(NSError *)error { + if (reason == ORKTaskFinishReasonCompleted) { [self taskCompleted]; [self resetSecondaryTaskViewController]; diff --git a/ResearchKit/Common/ORKVideoInstructionStepViewController.h b/ResearchKitUI/Common/Step/Instruction Step/Video Instruction Step/ORKVideoInstructionStepViewController.h similarity index 97% rename from ResearchKit/Common/ORKVideoInstructionStepViewController.h rename to ResearchKitUI/Common/Step/Instruction Step/Video Instruction Step/ORKVideoInstructionStepViewController.h index 26922ddf5a..991ea91de1 100644 --- a/ResearchKit/Common/ORKVideoInstructionStepViewController.h +++ b/ResearchKitUI/Common/Step/Instruction Step/Video Instruction Step/ORKVideoInstructionStepViewController.h @@ -30,6 +30,7 @@ #import +#import /** diff --git a/ResearchKit/Common/ORKVideoInstructionStepViewController.m b/ResearchKitUI/Common/Step/Instruction Step/Video Instruction Step/ORKVideoInstructionStepViewController.m similarity index 96% rename from ResearchKit/Common/ORKVideoInstructionStepViewController.m rename to ResearchKitUI/Common/Step/Instruction Step/Video Instruction Step/ORKVideoInstructionStepViewController.m index b878b003fe..942765852d 100644 --- a/ResearchKit/Common/ORKVideoInstructionStepViewController.m +++ b/ResearchKitUI/Common/Step/Instruction Step/Video Instruction Step/ORKVideoInstructionStepViewController.m @@ -32,7 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKVideoInstructionStepViewController.h" #import "ORKInstructionStepViewController_Internal.h" #import "ORKStepViewController_Internal.h" -#import "ORKInstructionStepView.h" #import "ORKVideoInstructionStepResult.h" #import "AVFoundation/AVFoundation.h" #import @@ -128,6 +127,13 @@ - (void)setThumbnailImageFromAsset { - (void)play { AVAsset* asset = [AVAsset assetWithURL:[self assetURL]]; AVPlayerItem* playerItem = [AVPlayerItem playerItemWithAsset:asset]; + + NSError* error = nil; + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error]; + if(error != nil) { + ORK_Log_Error("Could not start audio session: %@", error); + } + ORKRateObservedPlayer* player = [[ORKRateObservedPlayer alloc] initWithPlayerItem:playerItem andObserver:self]; player.actionAtItemEnd = AVPlayerActionAtItemEndPause; AVPlayerViewController *playerViewController = [[AVPlayerViewController alloc] init]; diff --git a/ResearchKit/Common/ORKCustomStepView.h b/ResearchKitUI/Common/Step/ORKCustomStepView.h similarity index 99% rename from ResearchKit/Common/ORKCustomStepView.h rename to ResearchKitUI/Common/Step/ORKCustomStepView.h index 986e7867bd..3795a9147b 100644 --- a/ResearchKit/Common/ORKCustomStepView.h +++ b/ResearchKitUI/Common/Step/ORKCustomStepView.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import #import diff --git a/ResearchKit/Common/ORKCustomStepView.m b/ResearchKitUI/Common/Step/ORKCustomStepView.m similarity index 93% rename from ResearchKit/Common/ORKCustomStepView.m rename to ResearchKitUI/Common/Step/ORKCustomStepView.m index 6cd418cb1d..f3b3efde63 100644 --- a/ResearchKit/Common/ORKCustomStepView.m +++ b/ResearchKitUI/Common/Step/ORKCustomStepView.m @@ -30,7 +30,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKCustomStepView.h" -#import "ORKCustomStepView_Internal.h" #import "ORKSurveyAnswerCell.h" #import "ORKSurveyCardHeaderView.h" @@ -40,29 +39,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSkin.h" -@implementation ORKActiveStepCustomView - -- (void)resetStep:(ORKStepViewController *)viewController { -} - -- (void)startStep:(ORKStepViewController *)viewController { -} - -- (void)suspendStep:(ORKStepViewController *)viewController { -} - -- (void)resumeStep:(ORKStepViewController *)viewController { -} - -- (void)finishStep:(ORKStepViewController *)viewController { -} - -- (void)updateDisplay:(ORKActiveStepViewController *)viewController { -} - -@end - - @implementation ORKQuestionStepCustomView @end @@ -103,7 +79,7 @@ - (void)setupContainerView { - (void)setupHeaderViewWithTitle:(NSString *)title detailText:(nullable NSString *)detailText learnMoreView:(nullable ORKLearnMoreView *)learnMoreView progressText:(nullable NSString *)progressText hasMultipleChoiceFormItem:(BOOL)hasMultipleChoiceFormItem { if (!_cardHeaderView) { - _cardHeaderView = [[ORKSurveyCardHeaderView alloc]initWithTitle:title detailText:detailText learnMoreView:learnMoreView progressText:progressText tagText:nil showBorder:NO hasMultipleChoiceItem:hasMultipleChoiceFormItem]; + _cardHeaderView = [[ORKSurveyCardHeaderView alloc]initWithTitle:title detailText:detailText learnMoreView:learnMoreView progressText:progressText tagText:nil showBorder:NO hasMultipleChoiceItem:hasMultipleChoiceFormItem shouldIgnoreDarkMode:NO]; } _cardHeaderView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:_cardHeaderView]; @@ -285,20 +261,11 @@ - (void)setMaskLayers { } _contentMaskLayer = [[CAShapeLayer alloc] init]; - UIColor *fillColor; - if (@available(iOS 13.0, *)) { - fillColor = UIColor.secondarySystemGroupedBackgroundColor; - } else { - fillColor = [UIColor ork_borderGrayColor]; - } + UIColor *fillColor = UIColor.secondarySystemGroupedBackgroundColor;; [_contentMaskLayer setFillColor:[fillColor CGColor]]; CAShapeLayer *foreLayer = [CAShapeLayer layer]; - if (@available(iOS 13.0, *)) { - [foreLayer setFillColor:[[UIColor secondarySystemGroupedBackgroundColor] CGColor]]; - } else { - [foreLayer setFillColor:[[UIColor whiteColor] CGColor]]; - } + [foreLayer setFillColor:[[UIColor secondarySystemGroupedBackgroundColor] CGColor]]; foreLayer.zPosition = 0.0f; CAShapeLayer *lineLayer = [CAShapeLayer layer]; @@ -319,11 +286,7 @@ - (void)setMaskLayers { [_contentMaskLayer addSublayer:foreLayer]; [_contentMaskLayer addSublayer:lineLayer]; - if (@available(iOS 13.0, *)) { - _contentMaskLayer.fillColor = UIColor.separatorColor.CGColor; - } else { - _contentMaskLayer.fillColor = [UIColor ork_midGrayTintColor].CGColor; - } + _contentMaskLayer.fillColor = UIColor.separatorColor.CGColor; [_containerView.layer insertSublayer:_contentMaskLayer atIndex:0]; } } @@ -371,7 +334,7 @@ - (void)setupContainerView { - (void)setupHeaderViewWithTitle:(NSString *)title detailText:(nullable NSString *)detailText learnMoreView:(nullable ORKLearnMoreView *)learnMoreView progressText:(nullable NSString *)progressText hasMultipleChoiceFormItem:(BOOL)hasMultipleChoiceFormItem { if (!_cardHeaderView) { - _cardHeaderView = [[ORKSurveyCardHeaderView alloc]initWithTitle:title detailText:detailText learnMoreView:learnMoreView progressText:progressText tagText:nil showBorder:NO hasMultipleChoiceItem:hasMultipleChoiceFormItem]; + _cardHeaderView = [[ORKSurveyCardHeaderView alloc]initWithTitle:title detailText:detailText learnMoreView:learnMoreView progressText:progressText tagText:nil showBorder:NO hasMultipleChoiceItem:hasMultipleChoiceFormItem shouldIgnoreDarkMode:NO]; } _cardHeaderView.translatesAutoresizingMaskIntoConstraints = NO; [self addSubview:_cardHeaderView]; @@ -541,20 +504,11 @@ - (void)setMaskLayers { } _contentMaskLayer = [[CAShapeLayer alloc] init]; - UIColor *fillColor; - if (@available(iOS 13.0, *)) { - fillColor = UIColor.secondarySystemGroupedBackgroundColor; - } else { - fillColor = [UIColor ork_borderGrayColor]; - } + UIColor *fillColor = UIColor.secondarySystemGroupedBackgroundColor;; [_contentMaskLayer setFillColor:[fillColor CGColor]]; CAShapeLayer *foreLayer = [CAShapeLayer layer]; - if (@available(iOS 13.0, *)) { - [foreLayer setFillColor:[[UIColor secondarySystemGroupedBackgroundColor] CGColor]]; - } else { - [foreLayer setFillColor:[[UIColor whiteColor] CGColor]]; - } + [foreLayer setFillColor:[[UIColor secondarySystemGroupedBackgroundColor] CGColor]]; foreLayer.zPosition = 0.0f; CAShapeLayer *lineLayer = [CAShapeLayer layer]; @@ -575,11 +529,7 @@ - (void)setMaskLayers { [_contentMaskLayer addSublayer:foreLayer]; [_contentMaskLayer addSublayer:lineLayer]; - if (@available(iOS 13.0, *)) { - _contentMaskLayer.fillColor = UIColor.separatorColor.CGColor; - } else { - _contentMaskLayer.fillColor = [UIColor ork_midGrayTintColor].CGColor; - } + _contentMaskLayer.fillColor = UIColor.separatorColor.CGColor; [_containerView.layer insertSublayer:_contentMaskLayer atIndex:0]; } } diff --git a/ResearchKitUI/Common/Step/ORKStep+ResearchKitUI.m b/ResearchKitUI/Common/Step/ORKStep+ResearchKitUI.m new file mode 100644 index 0000000000..f552c7772b --- /dev/null +++ b/ResearchKitUI/Common/Step/ORKStep+ResearchKitUI.m @@ -0,0 +1,241 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import "ResearchKitUI.h" +#import "ResearchKitUI_Private.h" + +#import "ORKViewControllerProviding.h" + +@implementation ORKCompletionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKCompletionStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKConsentReviewStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKConsentReviewStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKConsentSharingStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKConsentSharingStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKCustomStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKCustomStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKFamilyHistoryStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKFamilyHistoryStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKFormStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKFormStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKImageCaptureStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKImageCaptureStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKInstructionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKInstructionStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKLearnMoreInstructionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKLearnMoreStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKLoginStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + NSAssert([self.loginViewControllerClass isSubclassOfClass:ORKLoginStepViewController.class], @"loginViewControllerClass should be subclass of ORKLoginStepViewController!"); + return [[self.loginViewControllerClass alloc] initWithStep:self result:result]; +} + +@end + +// ORKNavigablePageStep is intentionally omitted, as it didn't have its own `stepViewControllerClass implementation`. + +@implementation ORKPDFViewerStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKPDFViewerStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKPageStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKPageStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKPasscodeStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKPasscodeStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKQuestionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKQuestionStepViewController alloc] initWithStep:self result:result]; +} + +@end + +// ORKRegistrationStep is intentionally omitted, as it didn't have its own `stepViewControllerClass implementation`. + +@implementation ORKRequestPermissionsStep(ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKRequestPermissionsStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKReviewStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKReviewStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKSecondaryTaskStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKSecondaryTaskStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKSignatureStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKSignatureStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKTableStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKTableStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKVerificationStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + NSAssert([self.verificationViewControllerClass isSubclassOfClass:ORKVerificationStepViewController.class], @"verificationViewControllerClass should be subclass of ORKVerificationStepViewController!"); + return (ORKStepViewController *)[[self.verificationViewControllerClass alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKVideoCaptureStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKVideoCaptureStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKVideoInstructionStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKVideoInstructionStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKWaitStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKWaitStepViewController alloc] initWithStep:self result:result]; +} + +@end + +@implementation ORKWebViewStep (ViewControllerProviding) + +- (ORKStepViewController *)makeViewControllerWithResult:(ORKResult *)result { + return [[ORKWebViewStepViewController alloc] initWithStep:self result:result]; +} + +@end diff --git a/ResearchKit/Common/ORKStepView.h b/ResearchKitUI/Common/Step/ORKStepView.h similarity index 100% rename from ResearchKit/Common/ORKStepView.h rename to ResearchKitUI/Common/Step/ORKStepView.h diff --git a/ResearchKit/Common/ORKStepView.m b/ResearchKitUI/Common/Step/ORKStepView.m similarity index 95% rename from ResearchKit/Common/ORKStepView.m rename to ResearchKitUI/Common/Step/ORKStepView.m index ed194328f8..10e06fa413 100644 --- a/ResearchKit/Common/ORKStepView.m +++ b/ResearchKitUI/Common/Step/ORKStepView.m @@ -32,7 +32,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKStepContentView_Private.h" #import "ORKNavigationContainerView_Internal.h" #import "ORKSkin.h" -#import "ORKQuestionStepView.h" @interface ORKStepView () @@ -53,12 +52,7 @@ - (instancetype)init { - (void)setupStepContentView { if (!self.stepContentView) { - - if ([[self class] isSubclassOfClass:[ORKQuestionStepView class]]) { - self.stepContentView = [[ORKStepContentView alloc] initWithStandardPadding]; - } else { - self.stepContentView = [ORKStepContentView new]; - } + self.stepContentView = [ORKStepContentView new]; } self.stepContentView.delegate = self; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stepContentViewImageChanged:) name:ORKStepTopContentImageChangedKey object:nil]; diff --git a/ResearchKit/Common/ORKStepViewController.h b/ResearchKitUI/Common/Step/ORKStepViewController.h similarity index 95% rename from ResearchKit/Common/ORKStepViewController.h rename to ResearchKitUI/Common/Step/ORKStepViewController.h index 776df19b66..0e71c95643 100644 --- a/ResearchKit/Common/ORKStepViewController.h +++ b/ResearchKitUI/Common/Step/ORKStepViewController.h @@ -29,21 +29,10 @@ */ -@import UIKit; +#import #import #import -#import - -NS_ASSUME_NONNULL_BEGIN - -@class ORKEditableResult; -@class ORKRecorder; -@class ORKResult; -@class ORKReviewStep; -@class ORKStep; -@class ORKStepResult; -@class ORKStepViewController; -@class ORKTaskViewController; +#import /** An enumeration of values used in `ORKStepViewControllerDelegate` to indicate the direction of navigation @@ -58,6 +47,18 @@ typedef NS_ENUM(NSInteger, ORKStepViewControllerNavigationDirection) { ORKStepViewControllerNavigationDirectionReverse } ORK_ENUM_AVAILABLE; +#import + +NS_ASSUME_NONNULL_BEGIN + +@class ORKEditableResult; +@class ORKRecorder; +@class ORKResult; +@class ORKReviewStep; +@class ORKStep; +@class ORKStepResult; +@class ORKStepViewController; +@class ORKTaskViewController; /** The primary implementer of the `ORKStepViewControllerDelegate` protocol is the @@ -69,6 +70,7 @@ typedef NS_ENUM(NSInteger, ORKStepViewControllerNavigationDirection) { can be helpful to implement this protocol to facilitate navigation and results collection. */ +ORK_CLASS_AVAILABLE @protocol ORKStepViewControllerDelegate @required @@ -170,6 +172,15 @@ typedef NS_ENUM(NSInteger, ORKStepViewControllerNavigationDirection) { */ - (ORKTaskTotalProgress)stepViewControllerTotalProgressInfoForStep:(ORKStepViewController *)stepViewController currentStep:(ORKStep *)currentStep; +/** + Allows the stepViewController delegate to provide the ongoing result for the task. + + StepViewController subclasses use this result to drive behavior that is conditional on responses to other steps in the task. + + @param stepViewController The step view controller providing the callback. + */ +- (nullable ORKTaskResult *)stepViewControllerOngoingResult:(ORKStepViewController *)stepViewController; + @end @@ -260,6 +271,14 @@ ORK_CLASS_AVAILABLE */ @property (nonatomic, assign) BOOL continueButtonEnabled; +/** + The enabled state of the skip button. + + The default state is enabled. Setting the skip button to disabled will add a visual treatment + to the button, and prevent it from being selectable. + */ +@property (nonatomic, assign) BOOL skipButtonEnabled; + /** A localized string that represents the title of the Learn More button. diff --git a/ResearchKit/Common/ORKStepViewController.m b/ResearchKitUI/Common/Step/ORKStepViewController.m similarity index 97% rename from ResearchKit/Common/ORKStepViewController.m rename to ResearchKitUI/Common/Step/ORKStepViewController.m index c9640e8a6f..f38ff56be5 100644 --- a/ResearchKit/Common/ORKStepViewController.m +++ b/ResearchKitUI/Common/Step/ORKStepViewController.m @@ -43,6 +43,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKSkin.h" #import "ORKStepContentView.h" #import "ORKEarlyTerminationConfiguration.h" +#import "UIBarButtonItem+ORKBarButtonItem.h" static const CGFloat iPadStepTitleLabelPadding = 15.0; static const CGFloat iPadStepTitleLabelFontSize = 50.0; @@ -91,6 +92,8 @@ - (instancetype)initWithStep:(ORKStep *)step { _wasSkipped = false; [self initializeInternalButtonItems]; [self setStep:step]; + self.restorationIdentifier = step.identifier; + self.restorationClass = self.class; } return self; } @@ -355,6 +358,10 @@ - (void)setContinueButtonEnabled:(BOOL)continueButtonEnabled { _navigationFooterView.continueEnabled = continueButtonEnabled; } +- (void)setSkipButtonEnabled:(BOOL)skipButtonEnabled { + _navigationFooterView.skipEnabled = skipButtonEnabled; +} + - (void)setNavigationDetailText:(NSString *)navigationDetailText { _navigationFooterView.navigationDetailText = navigationDetailText; } @@ -382,6 +389,16 @@ - (NSString *)skipButtonTitle { return self.skipButtonItem.title; } +- (void)enableBackNavigation { + [self setBackButtonItem:[self goToPreviousPageButtonItem]]; +} + +- (UIBarButtonItem *)goToPreviousPageButtonItem { + UIBarButtonItem *button = [UIBarButtonItem ork_backBarButtonItemWithTarget:self action:@selector(goBackward)]; + button.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_BACK", nil); + return button; +} + - (void)setBackButtonItem:(UIBarButtonItem *)backButton { backButton.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_BACK", nil); _backButtonItem = backButton; @@ -452,7 +469,7 @@ + (UIInterfaceOrientationMask)supportedInterfaceOrientations { // The default values for a view controller'€™s supported interface orientations is set to // UIInterfaceOrientationMaskAll for the iPad idiom and UIInterfaceOrientationMaskAllButUpsideDown for the iPhone idiom. UIInterfaceOrientationMask supportedOrientations = UIInterfaceOrientationMaskAllButUpsideDown; - if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { supportedOrientations = UIInterfaceOrientationMaskAll; } return supportedOrientations; diff --git a/ResearchKit/Common/ORKStepViewController_Internal.h b/ResearchKitUI/Common/Step/ORKStepViewController_Internal.h similarity index 96% rename from ResearchKit/Common/ORKStepViewController_Internal.h rename to ResearchKitUI/Common/Step/ORKStepViewController_Internal.h index 7ea6f5b265..e35168c725 100644 --- a/ResearchKit/Common/ORKStepViewController_Internal.h +++ b/ResearchKitUI/Common/Step/ORKStepViewController_Internal.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -97,6 +97,9 @@ NS_ASSUME_NONNULL_BEGIN // internal method for updating iPadBackgroundViewColor. - (void)setiPadBackgroundViewColor:(UIColor *)color; +// internal method for enabling back navigation. +- (void)enableBackNavigation; + @end #endif diff --git a/ResearchKit/Common/ORKStepView_Private.h b/ResearchKitUI/Common/Step/ORKStepView_Private.h similarity index 97% rename from ResearchKit/Common/ORKStepView_Private.h rename to ResearchKitUI/Common/Step/ORKStepView_Private.h index 84544ccb8d..d69faa50a3 100644 --- a/ResearchKit/Common/ORKStepView_Private.h +++ b/ResearchKitUI/Common/Step/ORKStepView_Private.h @@ -28,8 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKitUI/Common/Step/ORKViewControllerProviding.h b/ResearchKitUI/Common/Step/ORKViewControllerProviding.h new file mode 100644 index 0000000000..7fedf0c28e --- /dev/null +++ b/ResearchKitUI/Common/Step/ORKViewControllerProviding.h @@ -0,0 +1,46 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol ORKViewControllerProviding + +- (ORKStepViewController *)makeViewControllerWithResult:(nullable ORKResult *)result; + +@end + +@interface ORKStep (ViewControllerProviding) + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKFreehandDrawingView.h b/ResearchKitUI/Common/Step/PDFStep/ORKFreehandDrawingView.h similarity index 98% rename from ResearchKit/Common/ORKFreehandDrawingView.h rename to ResearchKitUI/Common/Step/PDFStep/ORKFreehandDrawingView.h index 08f53ce88c..66bdcc0a2b 100644 --- a/ResearchKit/Common/ORKFreehandDrawingView.h +++ b/ResearchKitUI/Common/Step/PDFStep/ORKFreehandDrawingView.h @@ -30,8 +30,8 @@ */ -@import UIKit; -@import PDFKit; +#import +#import #import diff --git a/ResearchKit/Common/ORKFreehandDrawingView.m b/ResearchKitUI/Common/Step/PDFStep/ORKFreehandDrawingView.m similarity index 100% rename from ResearchKit/Common/ORKFreehandDrawingView.m rename to ResearchKitUI/Common/Step/PDFStep/ORKFreehandDrawingView.m diff --git a/ResearchKit/Common/ORKPDFViewerStepView.h b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView.h similarity index 95% rename from ResearchKit/Common/ORKPDFViewerStepView.h rename to ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView.h index 88c7cd085a..a89547c035 100644 --- a/ResearchKit/Common/ORKPDFViewerStepView.h +++ b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView.h @@ -28,7 +28,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import "ORKCustomStepView_Internal.h" @import PDFKit; @@ -40,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface ORKPDFViewerStepView : ORKActiveStepCustomView +@interface ORKPDFViewerStepView : UIView @property (nonatomic) NSURL *pdfURL; diff --git a/ResearchKit/Common/ORKPDFViewerStepView.m b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView.m similarity index 94% rename from ResearchKit/Common/ORKPDFViewerStepView.m rename to ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView.m index 1d5a8ac4ca..245e29b87f 100644 --- a/ResearchKit/Common/ORKPDFViewerStepView.m +++ b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView.m @@ -45,6 +45,16 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE const CGFloat PDFhideViewAnimationDuration = 0.5; +NSString * const ORKPDFViewerStepShowPDFThumbnailActionButtonAccessibilityIdentifier = @"ORKPDFViewerStep_showPDF_thumbnailActionButton"; +NSString * const ORKPDFViewerStepHidePDFThumbnailActionButtonAccessibilityIdentifier = @"ORKPDFViewerStep_hidePDF_thumbnailActionButton"; +NSString * const ORKPDFViewerStepAnnotationActionButtonAccessibilityIdentifier = @"ORKPDFViewerStep_annotationActionButton"; +NSString * const ORKPDFViewerStepShowSearchActionButtonAccessibilityIdentifier = @"ORKPDFViewerStep_showSearchActionButton"; +NSString * const ORKPDFViewerStepHideSearchActionButtonAccessibilityIdentifier = @"ORKPDFViewerStep_hideSearchActionButton"; +NSString * const ORKPDFViewerStepShareActionButtonAccessibilityIdentifier = @"ORKPDFViewerStep_shareActionButton"; +NSString * const ORKPDFViewerActionViewExitButtonAccessibilityIdentifier = @"ORKPDFViewerActionView_exitButton"; +NSString * const ORKPDFViewerActionViewApplyButtonAccessibilityIdentifier = @"ORKPDFViewerActionView_applyButton"; +NSString * const ORKPDFViewerActionViewClearButtonAccessibilityIdentifier = @"ORKPDFViewerActionView_clearButton"; + @interface ORKPDFViewerActionsView: UIView @property (nonatomic, nonnull) UIView *thumbnailActionView; @@ -161,10 +171,11 @@ - (void)setupClearAnnotationsButton { if (!_clearAnnotationsButton) { _clearAnnotationsButton = [ORKBorderedButton new]; } - [_clearAnnotationsButton updateContentInsets:NSDirectionalEdgeInsetsMake(0, 6, 0, 6)]; + _clearAnnotationsButton.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; _clearAnnotationsButton.translatesAutoresizingMaskIntoConstraints = NO; _clearButtonView = [UIView new]; _clearButtonView.translatesAutoresizingMaskIntoConstraints = NO; + _clearButtonView.accessibilityIdentifier = ORKPDFViewerActionViewClearButtonAccessibilityIdentifier; [_clearAnnotationsButton setTitle:ORKLocalizedString(@"BUTTON_CLEAR", nil) forState:UIControlStateNormal]; [_clearButtonView addSubview:_clearAnnotationsButton]; [_stackView addArrangedSubview:_clearButtonView]; @@ -197,10 +208,11 @@ - (void)setupApplyAnnotationsButton { if (!_applyAnnotationsButton) { _applyAnnotationsButton = [ORKBorderedButton new]; } - [_applyAnnotationsButton updateContentInsets:NSDirectionalEdgeInsetsMake(0, 6, 0, 6)]; + _applyAnnotationsButton.contentEdgeInsets = (UIEdgeInsets){.left = 6, .right = 6}; _applyAnnotationsButton.translatesAutoresizingMaskIntoConstraints = NO; _applyButtonView = [UIView new]; _applyButtonView.translatesAutoresizingMaskIntoConstraints = NO; + _applyButtonView.accessibilityIdentifier = ORKPDFViewerActionViewApplyButtonAccessibilityIdentifier; [_applyAnnotationsButton setTitle:ORKLocalizedString(@"BUTTON_APPLY", nil) forState:UIControlStateNormal]; [_applyButtonView addSubview:_applyAnnotationsButton]; [_stackView addArrangedSubview:_applyButtonView]; @@ -238,6 +250,7 @@ - (void)setupExitAnnotationsButton { _exitAnnotationsButton.translatesAutoresizingMaskIntoConstraints = NO; _exitButtonView = [UIView new]; _exitButtonView.translatesAutoresizingMaskIntoConstraints = NO; + _exitButtonView.accessibilityIdentifier = ORKPDFViewerActionViewExitButtonAccessibilityIdentifier; [_exitButtonView addSubview:_exitAnnotationsButton]; [_stackView addArrangedSubview:_exitButtonView]; [self activateConstraintsForButton:_exitAnnotationsButton withView:_exitButtonView]; @@ -521,6 +534,11 @@ - (void)updateActionButtonAccessibilityLabels { _pdfActionsView.annotationActionButton.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_ANNOTATE" , nil); _pdfActionsView.searchActionButton.accessibilityLabel = _searchBar.isHidden ? ORKLocalizedString(@"AX_BUTTON_SHOW_SEARCH", nil) : ORKLocalizedString(@"AX_BUTTON_HIDE_SEARCH", nil); _pdfActionsView.shareActionButton.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_SHARE", nil); + + _pdfActionsView.thumbnailActionButton.accessibilityIdentifier = _pdfThumbnailView.isHidden ?ORKPDFViewerStepShowPDFThumbnailActionButtonAccessibilityIdentifier : ORKPDFViewerStepHidePDFThumbnailActionButtonAccessibilityIdentifier; + _pdfActionsView.annotationActionButton.accessibilityIdentifier = ORKPDFViewerStepAnnotationActionButtonAccessibilityIdentifier; + _pdfActionsView.searchActionButton.accessibilityIdentifier = _searchBar.isHidden ? ORKPDFViewerStepShowSearchActionButtonAccessibilityIdentifier : ORKPDFViewerStepHideSearchActionButtonAccessibilityIdentifier; + _pdfActionsView.shareActionButton.accessibilityIdentifier = ORKPDFViewerStepShareActionButtonAccessibilityIdentifier; } - (void)shareButtonAction { diff --git a/ResearchKit/Common/ORKPDFViewerStepViewController.h b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKPDFViewerStepViewController.h rename to ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepViewController.h index 50cceb8bcc..0117134d20 100644 --- a/ResearchKit/Common/ORKPDFViewerStepViewController.h +++ b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKPDFViewerStepViewController.m b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepViewController.m similarity index 98% rename from ResearchKit/Common/ORKPDFViewerStepViewController.m rename to ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepViewController.m index 88e2620023..2b9321e367 100644 --- a/ResearchKit/Common/ORKPDFViewerStepViewController.m +++ b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepViewController.m @@ -43,6 +43,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKSkin.h" +NSString * const ORKPDFViewerStepViewAccessibilityIdentifier = @"ORKPDFViewerStepView"; + @interface ORKPDFViewerStepViewController() @end @@ -68,6 +70,7 @@ - (void)stepDidChange { _pdfView = [ORKPDFViewerStepView new]; [self hidePDFViewerButtons]; _pdfView.delegate = self; + _pdfView.accessibilityIdentifier = ORKPDFViewerStepViewAccessibilityIdentifier; [self.view addSubview:_pdfView]; [self setNavigationFooterView]; [self setupConstraints]; diff --git a/ResearchKit/Common/ORKPDFViewerStepView_Internal.h b/ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView_Internal.h similarity index 100% rename from ResearchKit/Common/ORKPDFViewerStepView_Internal.h rename to ResearchKitUI/Common/Step/PDFStep/ORKPDFViewerStepView_Internal.h diff --git a/ResearchKit/Common/ORKPageStepViewController.h b/ResearchKitUI/Common/Step/Page Step/ORKPageStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKPageStepViewController.h rename to ResearchKitUI/Common/Step/Page Step/ORKPageStepViewController.h index 3220d08885..48128dd656 100644 --- a/ResearchKit/Common/ORKPageStepViewController.h +++ b/ResearchKitUI/Common/Step/Page Step/ORKPageStepViewController.h @@ -28,7 +28,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKPageStepViewController.m b/ResearchKitUI/Common/Step/Page Step/ORKPageStepViewController.m similarity index 98% rename from ResearchKit/Common/ORKPageStepViewController.m rename to ResearchKitUI/Common/Step/Page Step/ORKPageStepViewController.m index 7a41505be3..512e3ce655 100644 --- a/ResearchKit/Common/ORKPageStepViewController.m +++ b/ResearchKitUI/Common/Step/Page Step/ORKPageStepViewController.m @@ -37,6 +37,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTaskViewController_Internal.h" #import "ORKResult_Private.h" #import "ORKStep_Private.h" +#import "ORKViewControllerProviding.h" typedef NS_ENUM(NSInteger, ORKPageNavigationDirection) { ORKPageNavigationDirectionNone = 0, @@ -250,7 +251,7 @@ - (ORKStepViewController *)stepViewControllerForStep:(ORKStep *)step { // If the pageResult does not carry a step result, then check the initial result stepResult = [self.initialResult stepResultForStepIdentifier:step.identifier]; } - ORKStepViewController *viewController = [step instantiateStepViewControllerWithResult:stepResult]; + ORKStepViewController *viewController = [step makeViewControllerWithResult:stepResult]; return viewController; } diff --git a/ResearchKit/Common/ORKPasscodeStepView.h b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepView.h similarity index 100% rename from ResearchKit/Common/ORKPasscodeStepView.h rename to ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepView.h diff --git a/ResearchKit/Common/ORKPasscodeStepView.m b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepView.m similarity index 100% rename from ResearchKit/Common/ORKPasscodeStepView.m rename to ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepView.m diff --git a/ResearchKit/Common/ORKPasscodeStepViewController.h b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKPasscodeStepViewController.h rename to ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController.h index b32f4e92a0..28653d9ba0 100644 --- a/ResearchKit/Common/ORKPasscodeStepViewController.h +++ b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKPasscodeStepViewController.m b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController.m similarity index 97% rename from ResearchKit/Common/ORKPasscodeStepViewController.m rename to ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController.m index 1fd9cc8ced..91cfab7260 100644 --- a/ResearchKit/Common/ORKPasscodeStepViewController.m +++ b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController.m @@ -57,6 +57,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static CGFloat const kForgotPasscodeHorizontalPadding = 30.0f; static CGFloat const kForgotPasscodeHeight = 100.0f; +NSString * const ORKPasscodeStepViewAccessibilityIdentifier = @"ORKPasscodeStepView"; + @implementation ORKPasscodeStepViewController { ORKPasscodeStepView *_passcodeStepView; CGFloat _originalForgotPasscodeY; @@ -103,6 +105,7 @@ - (void)stepDidChange { _passcodeStepView = [ORKPasscodeStepView new]; _passcodeStepView.stepText = [self passcodeStep].text; _passcodeStepView.textField.delegate = self; + _passcodeStepView.accessibilityIdentifier = ORKPasscodeStepViewAccessibilityIdentifier; [_passcodeStepView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showHideKeyboard)]]; @@ -130,8 +133,8 @@ - (void)stepDidChange { _originalForgotPasscodeY = self.view.bounds.size.height - kForgotPasscodeVerticalPadding - kForgotPasscodeHeight; CGFloat width = self.view.bounds.size.width - 2 * kForgotPasscodeHorizontalPadding; - ORKTextButton *forgotPasscodeButton = [ORKTextButton new]; - [forgotPasscodeButton updateContentInsets: NSDirectionalEdgeInsetsMake(12, 10, 8, 10)]; + UIButton *forgotPasscodeButton = [ORKTextButton new]; + forgotPasscodeButton.contentEdgeInsets = (UIEdgeInsets){12, 10, 8, 10}; forgotPasscodeButton.frame = CGRectMake(x, _originalForgotPasscodeY, width, kForgotPasscodeHeight); NSString *buttonTitle = [self forgotPasscodeButtonText]; @@ -529,9 +532,9 @@ + (void)savePasscode:(NSString *)passcode withTouchIdEnabled:(BOOL)touchIdEnable - (void)removePasscodeFromKeychain { NSError *error; - id storedValue = [ORKKeychainWrapper objectOfClass:NSDictionary.self forKey:PasscodeKey error:&error]; + [ORKKeychainWrapper objectForKey:PasscodeKey error:&error]; - if (storedValue != nil) { + if (!error) { [ORKKeychainWrapper removeObjectForKey:PasscodeKey error:&error]; if (error) { @@ -542,10 +545,8 @@ - (void)removePasscodeFromKeychain { - (BOOL)passcodeMatchesKeychain { NSError *error; - NSDictionary *dictionary = (NSDictionary *) [ORKKeychainWrapper objectOfClass:NSDictionary.self - forKey:PasscodeKey - error:&error]; - if (dictionary == nil) { + NSDictionary *dictionary = (NSDictionary *) [ORKKeychainWrapper objectForKey:PasscodeKey error:&error]; + if (error) { [self throwExceptionWithKeychainError:error]; } @@ -555,11 +556,8 @@ - (BOOL)passcodeMatchesKeychain { - (void)setValuesFromKeychain { NSError *error; - NSDictionary *dictionary = (NSDictionary*) [ORKKeychainWrapper objectOfClass:NSDictionary.self - forKey:PasscodeKey - error:&error]; - - if (dictionary == nil) { + NSDictionary *dictionary = (NSDictionary*) [ORKKeychainWrapper objectForKey:PasscodeKey error:&error]; + if (error) { [self throwExceptionWithKeychainError:error]; } diff --git a/ResearchKit/Common/ORKPasscodeStepViewController_Internal.h b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController_Internal.h similarity index 97% rename from ResearchKit/Common/ORKPasscodeStepViewController_Internal.h rename to ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController_Internal.h index 2b32a9e0c0..75611f3f2b 100644 --- a/ResearchKit/Common/ORKPasscodeStepViewController_Internal.h +++ b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeStepViewController_Internal.h @@ -29,7 +29,7 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKPasscodeViewController.h b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeViewController.h similarity index 98% rename from ResearchKit/Common/ORKPasscodeViewController.h rename to ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeViewController.h index 7d9e175c98..5f99a994b8 100644 --- a/ResearchKit/Common/ORKPasscodeViewController.h +++ b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKPasscodeViewController.m b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeViewController.m similarity index 94% rename from ResearchKit/Common/ORKPasscodeViewController.m rename to ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeViewController.m index a272cbdc7d..d86a0c672c 100644 --- a/ResearchKit/Common/ORKPasscodeViewController.m +++ b/ResearchKitUI/Common/Step/Passcode Step/ORKPasscodeViewController.m @@ -100,15 +100,7 @@ + (instancetype)passcodeViewControllerWithText:(NSString *)text } + (BOOL)isPasscodeStoredInKeychain { - NSError *error; - NSDictionary *dictionary = (NSDictionary *)[ORKKeychainWrapper objectOfClass:NSDictionary.self - forKey:PasscodeKey - error:&error]; - - if (dictionary == nil) { - return NO; - } - + NSDictionary *dictionary = (NSDictionary *)[ORKKeychainWrapper objectForKey:PasscodeKey error:nil]; return ([dictionary objectForKey:KeychainDictionaryPasscodeKey]) ? YES : NO; } diff --git a/ResearchKit/Common/ORKRequestPermissionButton.h b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionButton.h similarity index 84% rename from ResearchKit/Common/ORKRequestPermissionButton.h rename to ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionButton.h index 70fe9183c1..da646a3723 100644 --- a/ResearchKit/Common/ORKRequestPermissionButton.h +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionButton.h @@ -30,19 +30,13 @@ @import UIKit; @import Foundation; +#import NS_ASSUME_NONNULL_BEGIN -typedef NS_ENUM(NSInteger, ORKRequestPermissionsButtonState) { - ORKRequestPermissionsButtonStateDefault = 0, - ORKRequestPermissionsButtonStateConnected, - ORKRequestPermissionsButtonStateNotSupported, - ORKRequestPermissionsButtonStateError, -}; - @interface ORKRequestPermissionButton : UIControl -- (void)setState:(ORKRequestPermissionsButtonState)state; +- (void)setState:(ORKRequestPermissionsState)state; @end diff --git a/ResearchKit/Common/ORKRequestPermissionButton.m b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionButton.m similarity index 78% rename from ResearchKit/Common/ORKRequestPermissionButton.m rename to ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionButton.m index 4388807184..2578497af4 100644 --- a/ResearchKit/Common/ORKRequestPermissionButton.m +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionButton.m @@ -36,9 +36,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE static const CGFloat StandardPadding = 15.0; static const CGFloat HighlightedOpacity = 0.5; +NSString * const ORKRequestPermissionButtonDefaultLabelAccessibilityIdentifier = @"ORKRequestPermissionButtonDefaultLabel"; +NSString * const ORKRequestPermissionButtonConnectedLabelAccessibilityIdentifier = @"ORKRequestPermissionButtonConnectedLabel"; +NSString * const ORKRequestPermissionButtonAccessibilityIdentifier = @"ORKRequestPermissionButton"; + @implementation ORKRequestPermissionButton { UILabel *_titleLabel; - ORKRequestPermissionsButtonState _state; + ORKRequestPermissionsState _state; UIViewPropertyAnimator *highlightAnimator; } @@ -48,9 +52,10 @@ - (instancetype)init { highlightAnimator = [[UIViewPropertyAnimator alloc] initWithDuration:0.1 curve:UIViewAnimationCurveEaseOut animations:nil]; [self setupTitleLabel]; - [self setState:ORKRequestPermissionsButtonStateDefault]; + [self setState:ORKRequestPermissionsStateDefault]; [self updateFonts]; } + self.accessibilityIdentifier = ORKRequestPermissionButtonAccessibilityIdentifier; return self; } @@ -83,24 +88,26 @@ - (void)setHighlighted:(BOOL)highlighted { [highlightAnimator startAnimation]; } -- (void)setState:(ORKRequestPermissionsButtonState)state { +- (void)setState:(ORKRequestPermissionsState)state { _state = state; switch (state) { - case ORKRequestPermissionsButtonStateDefault: + case ORKRequestPermissionsStateDefault: _titleLabel.text = ORKLocalizedString(@"REQUEST_PERMISSION_BUTTON_STATE_DEFAULT", nil); + _titleLabel.accessibilityIdentifier = ORKRequestPermissionButtonDefaultLabelAccessibilityIdentifier; break; - case ORKRequestPermissionsButtonStateConnected: + case ORKRequestPermissionsStateConnected: _titleLabel.text = ORKLocalizedString(@"REQUEST_PERMISSION_BUTTON_STATE_CONNECTED", nil); + _titleLabel.accessibilityIdentifier = ORKRequestPermissionButtonConnectedLabelAccessibilityIdentifier; break; - case ORKRequestPermissionsButtonStateNotSupported: + case ORKRequestPermissionsStateNotSupported: _titleLabel.text = ORKLocalizedString(@"REQUEST_PERMISSION_BUTTON_STATE_NOT_SUPPORTED", nil); break; - case ORKRequestPermissionsButtonStateError: + case ORKRequestPermissionsStateError: _titleLabel.text = ORKLocalizedString(@"REQUEST_PERMISSION_BUTTON_STATE_ERROR", nil); break; } @@ -108,25 +115,20 @@ - (void)setState:(ORKRequestPermissionsButtonState)state { [self setStyleForState:state]; } -- (void)setStyleForState:(ORKRequestPermissionsButtonState)state { +- (void)setStyleForState:(ORKRequestPermissionsState)state { switch (state) { - case ORKRequestPermissionsButtonStateDefault: + case ORKRequestPermissionsStateDefault: [self setBackgroundColor:self.tintColor]; _titleLabel.textColor = UIColor.whiteColor; [self setEnabled:YES]; break; - case ORKRequestPermissionsButtonStateConnected: - case ORKRequestPermissionsButtonStateNotSupported: - case ORKRequestPermissionsButtonStateError: + case ORKRequestPermissionsStateConnected: + case ORKRequestPermissionsStateNotSupported: + case ORKRequestPermissionsStateError: _titleLabel.textColor = UIColor.systemGrayColor; - - if (@available(iOS 13.0, *)) { - [self setBackgroundColor:UIColor.tertiarySystemFillColor]; - } else { - [self setBackgroundColor:UIColor.lightGrayColor]; - } + [self setBackgroundColor:UIColor.tertiarySystemFillColor]; [self setEnabled:NO]; break; } @@ -151,7 +153,7 @@ - (UIFont *)fontWithTextStyle:(UIFontTextStyle)textStyle weight:(UIFontWeight)we } - (void)tintColorDidChange { - if (_state == ORKRequestPermissionsButtonStateDefault) { + if (_state == ORKRequestPermissionsStateDefault) { [self setBackgroundColor:self.tintColor]; } } diff --git a/ResearchKit/Common/ORKRequestPermissionView.h b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionView.h similarity index 98% rename from ResearchKit/Common/ORKRequestPermissionView.h rename to ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionView.h index 05a899bfb5..f2322a341a 100644 --- a/ResearchKit/Common/ORKRequestPermissionView.h +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionView.h @@ -31,7 +31,7 @@ @import UIKit; @import Foundation; -@class ORKRequestPermissionButton; +#import "ORKRequestPermissionButton.h" NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKRequestPermissionView.m b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionView.m similarity index 89% rename from ResearchKit/Common/ORKRequestPermissionView.m rename to ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionView.m index d3fd987df4..8c7293b3d9 100644 --- a/ResearchKit/Common/ORKRequestPermissionView.m +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionView.m @@ -29,15 +29,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKRequestPermissionView.h" -#import "ORKStepContainerView_Private.h" #import "ORKHelpers_Internal.h" #import "ORKSkin.h" -#import "ORKRequestPermissionButton.h" ORKRequestPermissionsNotification const ORKRequestPermissionsNotificationCardViewStatusChanged = @"ORKRequestPermissionsNotificationCardViewStatusChanged"; static const CGFloat StandardPadding = 15.0; -static const CGFloat IconImageViewWidthHeight = 40.0; static const CGFloat IconImageViewBottomPadding = 10.0; static const CGFloat TitleTextLabelBottomPadding = 6.0; static const CGFloat DetailTextLabelBottomPadding = 12; @@ -64,7 +61,7 @@ @implementation ORKRequestPermissionView { - (instancetype)initWithIconImage:(nullable UIImage *)iconImage title:(NSString *)title detailText:(NSString *)detailText { self = [self initWithFrame:CGRectZero]; - + if (self) { _iconImage = iconImage; _title = title; @@ -72,19 +69,14 @@ - (instancetype)initWithIconImage:(nullable UIImage *)iconImage title:(NSString _enableContinueButton = YES; [self commonInit]; } - + return self; } - (void)commonInit { - if (@available(iOS 13.0, *)) { - self.layer.borderColor = [[UIColor separatorColor] CGColor]; - [self setBackgroundColor:[UIColor systemBackgroundColor]]; - } else { - self.layer.borderColor = [[UIColor ork_midGrayTintColor] CGColor]; - [self setBackgroundColor:[UIColor whiteColor]]; - } - + self.layer.borderColor = [[UIColor separatorColor] CGColor]; + [self setBackgroundColor:[UIColor systemBackgroundColor]]; + self.clipsToBounds = false; self.layer.cornerRadius = CornerRadius; @@ -212,15 +204,7 @@ - (void)setUpConstraints { _constraints = [NSMutableArray array]; - if (@available(iOS 13.0, *)) { - [_iconImageView setPreferredSymbolConfiguration:[UIImageSymbolConfiguration configurationWithTextStyle:UIFontTextStyleLargeTitle]]; - } else { - _iconImageView.translatesAutoresizingMaskIntoConstraints = NO; - [_constraints addObjectsFromArray:@[ - [_iconImageView.widthAnchor constraintEqualToConstant:IconImageViewWidthHeight], - [_iconImageView.heightAnchor constraintEqualToConstant:IconImageViewWidthHeight] - ]]; - } + [_iconImageView setPreferredSymbolConfiguration:[UIImageSymbolConfiguration configurationWithTextStyle:UIFontTextStyleLargeTitle]]; // Note, the button width is updated when the AX size changes _buttonWidthConstraint = [_requestPermissionButton.widthAnchor constraintGreaterThanOrEqualToConstant:ButtonWidth]; diff --git a/ResearchKit/Common/ORKRequestPermissionsStepContainerView.h b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepContainerView.h similarity index 93% rename from ResearchKit/Common/ORKRequestPermissionsStepContainerView.h rename to ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepContainerView.h index 8f9f653a60..a0f02b8100 100644 --- a/ResearchKit/Common/ORKRequestPermissionsStepContainerView.h +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepContainerView.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import NS_ASSUME_NONNULL_BEGIN @@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN @interface ORKRequestPermissionsStepContainerView : ORKStepContainerView -- (instancetype)initWithCardViews:(NSMutableArray *)cardViews; +- (instancetype)initWithCardViews:(NSArray *)cardViews; @property (nonatomic) NSArray *cardViews; diff --git a/ResearchKit/Common/ORKRequestPermissionsStepContainerView.m b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepContainerView.m similarity index 96% rename from ResearchKit/Common/ORKRequestPermissionsStepContainerView.m rename to ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepContainerView.m index 045cfbab66..75e613d8a1 100644 --- a/ResearchKit/Common/ORKRequestPermissionsStepContainerView.m +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepContainerView.m @@ -40,7 +40,7 @@ @implementation ORKRequestPermissionsStepContainerView { UIView *_contentView; } -- (instancetype)initWithCardViews:(NSMutableArray *)cardViews { +- (instancetype)initWithCardViews:(NSArray *)cardViews { self = [super init]; if (self) { @@ -71,11 +71,11 @@ - (void)setupCardViewConstraints { [[cardView.topAnchor constraintEqualToAnchor:lastView ? lastView.bottomAnchor : _contentView.topAnchor constant:10.0] setActive:YES]; [[cardView.leadingAnchor constraintEqualToAnchor:_contentView.leadingAnchor] setActive:YES]; [[cardView.trailingAnchor constraintEqualToAnchor:_contentView.trailingAnchor] setActive:YES]; - + lastView = cardView; } - if (lastView != nil) { + if (lastView) { [[_contentView.bottomAnchor constraintEqualToAnchor:lastView.bottomAnchor constant:10.0] setActive:YES]; } } diff --git a/ResearchKit/Common/ORKRequestPermissionsStepViewController.h b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepViewController.h similarity index 97% rename from ResearchKit/Common/ORKRequestPermissionsStepViewController.h rename to ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepViewController.h index d0e657ddd7..8ce8579ebd 100644 --- a/ResearchKit/Common/ORKRequestPermissionsStepViewController.h +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepViewController.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepViewController.m b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepViewController.m new file mode 100644 index 0000000000..ee28c005dd --- /dev/null +++ b/ResearchKitUI/Common/Step/Request Permissions Step/ORKRequestPermissionsStepViewController.m @@ -0,0 +1,228 @@ +/* + Copyright (c) 2020, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "ORKRequestPermissionsStepViewController.h" +#import "ORKRequestPermissionsStep.h" +#import "ORKRequestPermissionView.h" +#import "ORKPermissionType.h" + +#import "ORKNavigationContainerView_Internal.h" +#import "ORKStepHeaderView_Internal.h" +#import "ORKStepViewController_Internal.h" +#import "ORKTaskViewController_Internal.h" +#import "ORKStepContainerView_Private.h" +#import "ORKStepView_Private.h" +#import "ORKRequestPermissionsStepContainerView.h" + +#import "ORKResult_Private.h" +#import "ORKCollectionResult_Private.h" +#import "ORKStep.h" + +#import "ORKHelpers_Internal.h" +#import "ORKSkin.h" + +NSString * const ORKRequestPermissionsStepViewAccessibilityIdentifier = @"ORKRequestPermissionsStepView"; + +@interface ORKRequestPermissionsStepViewController () + +@property (nonatomic, copy, readonly) NSArray *cardViews; + +@end + +@implementation ORKRequestPermissionsStepViewController { + NSMutableArray *_constraints; + ORKRequestPermissionsStepContainerView *_requestPermissionsStepContainerView; + NSArray *_cardViews; +} + +- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result { + self = [super initWithStep:step result:result]; + + return self; +} + +- (NSArray *)cardViews { + if (_cardViews == nil) { + _cardViews = [self fetchCardViews]; + } + return _cardViews; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + if (_requestPermissionsStepContainerView) { + [_requestPermissionsStepContainerView layoutSubviews]; + } + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(cardViewStatusDidChange:) + name:ORKRequestPermissionsNotificationCardViewStatusChanged + object:nil]; + + [self checkCardViewsStatus]; +} + +- (void)dealloc { + [self _cleanupPermissionTypes]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:ORKRequestPermissionsNotificationCardViewStatusChanged object:nil]; +} + +- (void)_cleanupPermissionTypes { + ORKRequestPermissionsStep *requestPermissionStep = [self requestPermissionsStep]; + + for (ORKPermissionType *permissionType in requestPermissionStep.permissionTypes) { + [permissionType cleanUp]; + } +} + +- (ORKStepResult *)result { + ORKStepResult *parentResult = [super result]; + + return parentResult; +} + +- (void)setContinueButtonItem:(UIBarButtonItem *)continueButtonItem { + [super setContinueButtonItem:continueButtonItem]; + _navigationFooterView.continueButtonItem = continueButtonItem; +} + +- (void)setSkipButtonItem:(UIBarButtonItem *)skipButtonItem { + [super setSkipButtonItem:skipButtonItem]; + _navigationFooterView.skipButtonItem = skipButtonItem; +} + +- (void)stepDidChange { + [super stepDidChange]; + + [_requestPermissionsStepContainerView removeFromSuperview]; + + _requestPermissionsStepContainerView = [[ORKRequestPermissionsStepContainerView alloc] initWithCardViews:self.cardViews]; + [_requestPermissionsStepContainerView placeNavigationContainerInsideScrollView]; + _requestPermissionsStepContainerView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; + _requestPermissionsStepContainerView.frame = self.view.bounds; + _requestPermissionsStepContainerView.stepTitle = self.step.title; + _requestPermissionsStepContainerView.stepText = self.step.text; + _requestPermissionsStepContainerView.stepDetailText = self.step.detailText; + _requestPermissionsStepContainerView.stepHeaderTextAlignment = self.step.headerTextAlignment; + _requestPermissionsStepContainerView.stepTopContentImage = self.step.image; + _requestPermissionsStepContainerView.stepTopContentImageContentMode = self.step.imageContentMode; + _requestPermissionsStepContainerView.bodyItems = self.step.bodyItems; + + _requestPermissionsStepContainerView.accessibilityIdentifier = ORKRequestPermissionsStepViewAccessibilityIdentifier; + + [self setupNavigationFooterView]; + + [self.view addSubview:_requestPermissionsStepContainerView]; + [self setupConstraints]; +} + +- (void)setupNavigationFooterView { + if (!_navigationFooterView && _requestPermissionsStepContainerView) { + _navigationFooterView = _requestPermissionsStepContainerView.navigationFooterView; + } + _navigationFooterView.skipButtonItem = self.skipButtonItem; + _navigationFooterView.continueButtonItem = self.continueButtonItem; + + _navigationFooterView.optional = NO; + [_navigationFooterView updateContinueAndSkipEnabled]; +} + +- (void)setupConstraints { + if (_constraints) { + [NSLayoutConstraint deactivateConstraints:_constraints]; + } + + _constraints = [NSMutableArray new]; + + [_constraints addObject:[_requestPermissionsStepContainerView.topAnchor constraintEqualToAnchor:self.view.topAnchor]]; + [_constraints addObject:[_requestPermissionsStepContainerView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor]]; + [_constraints addObject:[_requestPermissionsStepContainerView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor]]; + [_constraints addObject:[_requestPermissionsStepContainerView.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]]; + + [NSLayoutConstraint activateConstraints:_constraints]; +} + +- (void)cardViewStatusDidChange:(NSNotification *)notification { + [self checkCardViewsStatus]; +} + +- (void)checkCardViewsStatus { + for (ORKRequestPermissionView *cardView in self.cardViews) { + if (!cardView.enableContinueButton) { + _navigationFooterView.continueEnabled = NO; + return; + } + } + + _navigationFooterView.continueEnabled = YES; +} + +- (ORKRequestPermissionsStep *)requestPermissionsStep { + return (ORKRequestPermissionsStep *)self.step; +} + +- (NSMutableArray *)fetchCardViews { + ORKRequestPermissionsStep *requestPermissionStep = [self requestPermissionsStep]; + NSMutableArray *cardViews = [NSMutableArray new]; + + for (ORKPermissionType *permissionType in requestPermissionStep.permissionTypes) { + ORKRequestPermissionView *cardView = [[ORKRequestPermissionView alloc] initWithIconImage:permissionType.image + title:permissionType.localizedTitle + detailText:permissionType.localizedDetailText]; + [cardView updateIconTintColor:permissionType.iconTintColor]; + [cardView.requestPermissionButton addTarget:permissionType + action:@selector(requestPermission) + forControlEvents:UIControlEventTouchUpInside]; + [self permissionStatusUpdatedForPermissionType:permissionType cardView:cardView]; + + // create the update callback + __weak typeof(self) weakSelf = self; + __weak ORKPermissionType *weakPermission = permissionType; + permissionType.permissionsStatusUpdateCallback = ^{ + typeof(weakSelf) strongSelf = weakSelf; + ORKPermissionType *strongPermission = weakPermission; + if (strongSelf == nil || strongPermission == nil) return; + + [strongSelf permissionStatusUpdatedForPermissionType:strongPermission cardView:cardView]; + }; + + [cardViews addObject:cardView]; + } + + return cardViews.copy; +} + +- (void)permissionStatusUpdatedForPermissionType:(ORKPermissionType *)permissionType cardView:(ORKRequestPermissionView *)cardView { + [cardView.requestPermissionButton setState:permissionType.permissionState]; + [cardView setEnableContinueButton:permissionType.canContinue]; +} + +@end diff --git a/ResearchKit/Common/ORKReviewStepViewController.h b/ResearchKitUI/Common/Step/Review Step/ORKReviewStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKReviewStepViewController.h rename to ResearchKitUI/Common/Step/Review Step/ORKReviewStepViewController.h index 122764c966..9838465562 100644 --- a/ResearchKit/Common/ORKReviewStepViewController.h +++ b/ResearchKitUI/Common/Step/Review Step/ORKReviewStepViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKReviewStepViewController.m b/ResearchKitUI/Common/Step/Review Step/ORKReviewStepViewController.m similarity index 100% rename from ResearchKit/Common/ORKReviewStepViewController.m rename to ResearchKitUI/Common/Step/Review Step/ORKReviewStepViewController.m diff --git a/ResearchKit/Common/ORKReviewStepViewController_Internal.h b/ResearchKitUI/Common/Step/Review Step/ORKReviewStepViewController_Internal.h similarity index 100% rename from ResearchKit/Common/ORKReviewStepViewController_Internal.h rename to ResearchKitUI/Common/Step/Review Step/ORKReviewStepViewController_Internal.h diff --git a/ResearchKit/Common/ORKCustomSignatureFooterView.h b/ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView.h similarity index 99% rename from ResearchKit/Common/ORKCustomSignatureFooterView.h rename to ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView.h index c9cf6bcc7b..7f5c7a8100 100644 --- a/ResearchKit/Common/ORKCustomSignatureFooterView.h +++ b/ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView.h @@ -46,6 +46,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic) BOOL enabled; - (BOOL)isComplete; + - (ORKSignatureResult * _Nullable)resultWithIdentifier:(NSString *)identifier; - (void)clear; - (void)cancelAutoScrollTimer; diff --git a/ResearchKit/Common/ORKCustomSignatureFooterView.m b/ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView.m similarity index 97% rename from ResearchKit/Common/ORKCustomSignatureFooterView.m rename to ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView.m index c233e0c68b..306ea6d58d 100644 --- a/ResearchKit/Common/ORKCustomSignatureFooterView.m +++ b/ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView.m @@ -37,6 +37,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKResult_Private.h" static const CGFloat ORKSignatureToClearPadding = 15.0; +NSString * const SignatureViewAccessibilityIdentifier = @"ORKSignatureView"; +NSString * const ORKSignatureViewClearButtonAccessibilityIdentifier = @"ORKSignatureViewClearButton"; @implementation ORKCustomSignatureFooterView { NSMutableArray *_constraints; @@ -57,6 +59,7 @@ - (instancetype)init { - (void)configure { if (!_signatureView) { _signatureView = [[ORKSignatureView alloc] initWithoutDefaultWidth]; + _signatureView.accessibilityIdentifier = SignatureViewAccessibilityIdentifier; [self addSubview:_signatureView]; } @@ -65,6 +68,7 @@ - (void)configure { [_clearButton.titleLabel setFont:[UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]]; [_clearButton setTitle:ORKLocalizedString(@"BUTTON_CLEAR_SIGNATURE", nil) forState:UIControlStateNormal]; [_clearButton addTarget:self action:@selector(clear) forControlEvents:UIControlEventTouchUpInside]; + _clearButton.accessibilityIdentifier = ORKSignatureViewClearButtonAccessibilityIdentifier; [self addSubview:_clearButton]; } @@ -268,7 +272,6 @@ - (ORKSignatureResult * _Nullable)resultWithIdentifier:(NSString *)identifier { ORKSignatureResult *parentResult = [[ORKSignatureResult alloc] initWithIdentifier:identifier signatureImage:_signatureView.signatureImage signaturePath:_signatureView.signaturePath]; - if (_customHeaderView || _customFooterView) { NSMutableDictionary *userInfo = [parentResult.userInfo mutableCopy]; if (!userInfo) { diff --git a/ResearchKit/Common/ORKCustomSignatureFooterView_Private.h b/ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView_Private.h similarity index 97% rename from ResearchKit/Common/ORKCustomSignatureFooterView_Private.h rename to ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView_Private.h index da79fb6b52..69bd406ead 100644 --- a/ResearchKit/Common/ORKCustomSignatureFooterView_Private.h +++ b/ResearchKitUI/Common/Step/Signature Step/ORKCustomSignatureFooterView_Private.h @@ -28,7 +28,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import +#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSignatureStepViewController.h b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKSignatureStepViewController.h rename to ResearchKitUI/Common/Step/Signature Step/ORKSignatureStepViewController.h index 2371db5172..606d04b17e 100644 --- a/ResearchKit/Common/ORKSignatureStepViewController.h +++ b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureStepViewController.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSignatureStepViewController.m b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureStepViewController.m similarity index 98% rename from ResearchKit/Common/ORKSignatureStepViewController.m rename to ResearchKitUI/Common/Step/Signature Step/ORKSignatureStepViewController.m index 913d06698e..1d1abda84b 100644 --- a/ResearchKit/Common/ORKSignatureStepViewController.m +++ b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureStepViewController.m @@ -72,9 +72,7 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self) { { _clearButton = [ORKTextButton new]; - - // insets adjusted to get correct vertical height from bottom of screen when aligned to margin - [_clearButton updateContentInsets:NSDirectionalEdgeInsetsMake(12, 10, 8, 10)]; + _clearButton.contentEdgeInsets = (UIEdgeInsets){12,10,8,10}; // insets adjusted to get correct vertical height from bottom of screen when aligned to margin _clearButton.exclusiveTouch = YES; [_clearButton setTitle:ORKLocalizedString(@"BUTTON_CLEAR", nil) forState:UIControlStateNormal]; _clearButton.translatesAutoresizingMaskIntoConstraints = NO; diff --git a/ResearchKit/Common/ORKSignatureView.h b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureView.h similarity index 99% rename from ResearchKit/Common/ORKSignatureView.h rename to ResearchKitUI/Common/Step/Signature Step/ORKSignatureView.h index cd203d0f17..4492c8d3ad 100644 --- a/ResearchKit/Common/ORKSignatureView.h +++ b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureView.h @@ -30,7 +30,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKSignatureView.m b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureView.m similarity index 97% rename from ResearchKit/Common/ORKSignatureView.m rename to ResearchKitUI/Common/Step/Signature Step/ORKSignatureView.m index d160f4d3d8..aa2ccec4d5 100644 --- a/ResearchKit/Common/ORKSignatureView.m +++ b/ResearchKitUI/Common/Step/Signature Step/ORKSignatureView.m @@ -179,11 +179,7 @@ - (void)commonInit { _lineWidth = DefaultLineWidth; _lineWidthVariation = DefaultLineWidthVariation; - if (@available(iOS 13.0, *)) { - self.layer.borderColor = [[UIColor separatorColor] CGColor]; - } else { - self.layer.borderColor = [[UIColor ork_midGrayTintColor] CGColor]; - } + self.layer.borderColor = [[UIColor separatorColor] CGColor]; self.layer.borderWidth = 1.0; self.layer.cornerRadius = 10.0; self.clipsToBounds = YES; @@ -266,11 +262,7 @@ - (void)makeSignatureGestureRecognizer { - (UIColor *)lineColor { if (_lineColor == nil) { - if (@available(iOS 13.0, *)) { - _lineColor = [UIColor labelColor]; - } else { - _lineColor = ORKColor(ORKSignatureColorKey); - } + _lineColor = [UIColor labelColor]; } return _lineColor; } @@ -484,13 +476,9 @@ - (void)commitCurrentPath { - (void)drawRect:(CGRect)rect { UIColor *fillColor; - if (@available(iOS 13.0, *)) { - fillColor = [UIColor systemBackgroundColor]; - } else { - fillColor = [UIColor whiteColor]; - } - + fillColor = [UIColor systemBackgroundColor]; [fillColor setFill]; + CGContextFillRect(UIGraphicsGetCurrentContext(), rect); for (UIBezierPath *path in self.pathArray) { diff --git a/ResearchKit/Common/ORKTableStepViewController.h b/ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController.h similarity index 98% rename from ResearchKit/Common/ORKTableStepViewController.h rename to ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController.h index 6288951d96..a3f4b9d202 100644 --- a/ResearchKit/Common/ORKTableStepViewController.h +++ b/ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController.h @@ -30,8 +30,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKTableStepViewController.m b/ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController.m similarity index 97% rename from ResearchKit/Common/ORKTableStepViewController.m rename to ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController.m index ac43562579..18cce54efb 100644 --- a/ResearchKit/Common/ORKTableStepViewController.m +++ b/ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController.m @@ -1,3 +1,4 @@ + /* Copyright (c) 2016, Sage Bionetworks Copyright (c) 2016, Apple Inc. All rights reserved. @@ -41,6 +42,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTableStep.h" #import "ORKStepContentView.h" +#import "ORKStepContentView_Private.h" #import "ORKBodyItem.h" #import "ORKHelpers_Internal.h" #import "ORKSkin.h" @@ -73,8 +75,7 @@ - (void)viewWillAppear:(BOOL)animated { if (_tableContainer) { [_tableContainer sizeHeaderToFit]; - [_tableContainer resizeFooterToFit]; - [_tableContainer layoutIfNeeded]; + [_tableContainer resizeFooterToFitUsingMinHeight:NO]; } if (_tableView) { @@ -84,6 +85,7 @@ - (void)viewWillAppear:(BOOL)animated { - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; + [_tableContainer layoutIfNeeded]; UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil); } @@ -181,6 +183,10 @@ - (void)stepDidChange { if (self.tableStepRef.pinNavigationContainer == NO) { [_navigationFooterView removeStyling]; } + + if ([self tableStepRef].bottomPadding) { + [_headerView setStepContentViewBottomConstraint:[self tableStepRef].bottomPadding.doubleValue]; + } } } @@ -279,11 +285,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N // Only set the background color if it is using the default cell type if ([reuseIdentifier isEqualToString:ORKBasicCellReuseIdentifier]) { - if (@available(iOS 13.0, *)) { - [cell setBackgroundColor:[UIColor clearColor]]; - } else { - [cell setBackgroundColor:[UIColor whiteColor]]; - } + [cell setBackgroundColor:[UIColor clearColor]]; } return cell; diff --git a/ResearchKit/Common/ORKTableStepViewController_Internal.h b/ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController_Internal.h similarity index 100% rename from ResearchKit/Common/ORKTableStepViewController_Internal.h rename to ResearchKitUI/Common/Step/Table Step/ORKTableStepViewController_Internal.h diff --git a/ResearchKit/Common/ORKVideoCaptureCameraPreviewView.h b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureCameraPreviewView.h similarity index 100% rename from ResearchKit/Common/ORKVideoCaptureCameraPreviewView.h rename to ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureCameraPreviewView.h diff --git a/ResearchKit/Common/ORKVideoCaptureCameraPreviewView.m b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureCameraPreviewView.m similarity index 100% rename from ResearchKit/Common/ORKVideoCaptureCameraPreviewView.m rename to ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureCameraPreviewView.m diff --git a/ResearchKit/Common/ORKVideoCaptureStepViewController.h b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureStepViewController.h similarity index 100% rename from ResearchKit/Common/ORKVideoCaptureStepViewController.h rename to ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureStepViewController.h diff --git a/ResearchKit/Common/ORKVideoCaptureStepViewController.m b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureStepViewController.m similarity index 97% rename from ResearchKit/Common/ORKVideoCaptureStepViewController.m rename to ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureStepViewController.m index 57fd52661c..bb5210a3e0 100644 --- a/ResearchKit/Common/ORKVideoCaptureStepViewController.m +++ b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureStepViewController.m @@ -137,7 +137,6 @@ - (void)stepDidChange { if (self.step && [self isViewLoaded]) { [_videoCaptureView removeFromSuperview]; - [_videoCaptureView.playerViewController removeFromParentViewController]; _videoCaptureView = nil; _movieFileOutput = nil; @@ -145,7 +144,6 @@ - (void)stepDidChange { _videoCaptureView.videoCaptureStep = (ORKVideoCaptureStep *)self.step; _videoCaptureView.delegate = self; _videoCaptureView.cancelButtonItem = self.cancelButtonItem; - [self addChildViewController:_videoCaptureView.playerViewController]; [self.view addSubview:_videoCaptureView]; @@ -196,14 +194,6 @@ - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - - if (_videoCaptureView) { - [_videoCaptureView orientationDidChange]; - } -} - - (void)queue_SetupCaptureSession { // Create the session _captureSession = [AVCaptureSession new]; diff --git a/ResearchKit/Common/ORKVideoCaptureView.h b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureView.h similarity index 98% rename from ResearchKit/Common/ORKVideoCaptureView.h rename to ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureView.h index bbca032176..ccd1636692 100644 --- a/ResearchKit/Common/ORKVideoCaptureView.h +++ b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureView.h @@ -61,8 +61,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong, nullable) ORKVideoCaptureCameraPreviewView *previewView; @property (nonatomic, strong, readonly) AVPlayerViewController *playerViewController; -- (void)orientationDidChange; - @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKVideoCaptureView.m b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureView.m similarity index 95% rename from ResearchKit/Common/ORKVideoCaptureView.m rename to ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureView.m index 9d8e7ca70f..37238a18d1 100644 --- a/ResearchKit/Common/ORKVideoCaptureView.m +++ b/ResearchKitUI/Common/Step/Video Capture Step/ORKVideoCaptureView.m @@ -120,30 +120,24 @@ - (void)queue_sessionRunning { } - (void)orientationDidChange { - __weak typeof(self) weakSelf = self; dispatch_async(dispatch_get_main_queue(), ^{ AVCaptureVideoOrientation orientation = AVCaptureVideoOrientationPortrait; - - UIWindowScene *windowScene = weakSelf.window.windowScene; - - if (windowScene) { - switch (windowScene.interfaceOrientation) { - case UIInterfaceOrientationLandscapeRight: - orientation = AVCaptureVideoOrientationLandscapeRight; - break; - case UIInterfaceOrientationLandscapeLeft: - orientation = AVCaptureVideoOrientationLandscapeLeft; - break; - case UIInterfaceOrientationPortraitUpsideDown: - orientation = AVCaptureVideoOrientationPortraitUpsideDown; - break; - case UIInterfaceOrientationPortrait: - orientation = AVCaptureVideoOrientationPortrait; - break; - case UIInterfaceOrientationUnknown: - // Do nothing in these cases, since we don't need to change display orientation. - return; - } + switch (self.window.windowScene.interfaceOrientation) { + case UIInterfaceOrientationLandscapeRight: + orientation = AVCaptureVideoOrientationLandscapeRight; + break; + case UIInterfaceOrientationLandscapeLeft: + orientation = AVCaptureVideoOrientationLandscapeLeft; + break; + case UIInterfaceOrientationPortraitUpsideDown: + orientation = AVCaptureVideoOrientationPortraitUpsideDown; + break; + case UIInterfaceOrientationPortrait: + orientation = AVCaptureVideoOrientationPortrait; + break; + case UIInterfaceOrientationUnknown: + // Do nothing in these cases, since we don't need to change display orientation. + return; } [_previewView setVideoOrientation:orientation]; diff --git a/ResearchKit/Common/ORKWaitStepView.h b/ResearchKitUI/Common/Step/Wait Step/ORKWaitStepView.h similarity index 100% rename from ResearchKit/Common/ORKWaitStepView.h rename to ResearchKitUI/Common/Step/Wait Step/ORKWaitStepView.h diff --git a/ResearchKit/Common/ORKWaitStepView.m b/ResearchKitUI/Common/Step/Wait Step/ORKWaitStepView.m similarity index 100% rename from ResearchKit/Common/ORKWaitStepView.m rename to ResearchKitUI/Common/Step/Wait Step/ORKWaitStepView.m diff --git a/ResearchKit/Common/ORKWaitStepViewController.h b/ResearchKitUI/Common/Step/Wait Step/ORKWaitStepViewController.h similarity index 97% rename from ResearchKit/Common/ORKWaitStepViewController.h rename to ResearchKitUI/Common/Step/Wait Step/ORKWaitStepViewController.h index 7d43d3b267..4ceabb13e8 100644 --- a/ResearchKit/Common/ORKWaitStepViewController.h +++ b/ResearchKitUI/Common/Step/Wait Step/ORKWaitStepViewController.h @@ -38,8 +38,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKWaitStepViewController.m b/ResearchKitUI/Common/Step/Wait Step/ORKWaitStepViewController.m similarity index 97% rename from ResearchKit/Common/ORKWaitStepViewController.m rename to ResearchKitUI/Common/Step/Wait Step/ORKWaitStepViewController.m index f6767efe92..a61e4e8a50 100644 --- a/ResearchKit/Common/ORKWaitStepViewController.m +++ b/ResearchKitUI/Common/Step/Wait Step/ORKWaitStepViewController.m @@ -50,6 +50,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" +NSString * const ORKWaitStepViewAccessibilityIdentifier = @"ORKWaitStepView"; + @implementation ORKWaitStepViewController { ORKWaitStepView *_waitStepView; @@ -87,6 +89,7 @@ - (void)stepDidChange { _waitStepView.stepHeaderTextAlignment = self.step.headerTextAlignment; _waitStepView.bodyItems = self.step.bodyItems; _waitStepView.stepTopContentImageContentMode = self.step.imageContentMode; + _waitStepView.accessibilityIdentifier = ORKWaitStepViewAccessibilityIdentifier; [self.taskViewController setNavigationBarColor:[self.view backgroundColor]]; } diff --git a/ResearchKit/Common/ORKWebViewStepViewController.h b/ResearchKitUI/Common/Step/WebView Step/ORKWebViewStepViewController.h similarity index 95% rename from ResearchKit/Common/ORKWebViewStepViewController.h rename to ResearchKitUI/Common/Step/WebView Step/ORKWebViewStepViewController.h index f879b6abbf..e1cfb604e5 100644 --- a/ResearchKit/Common/ORKWebViewStepViewController.h +++ b/ResearchKitUI/Common/Step/WebView Step/ORKWebViewStepViewController.h @@ -28,10 +28,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -@import UIKit; -@import WebKit; -#import -#import +#import +#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKWebViewStepViewController.m b/ResearchKitUI/Common/Step/WebView Step/ORKWebViewStepViewController.m similarity index 96% rename from ResearchKit/Common/ORKWebViewStepViewController.m rename to ResearchKitUI/Common/Step/WebView Step/ORKWebViewStepViewController.m index 56354dd8ba..d563b09aa6 100644 --- a/ResearchKit/Common/ORKWebViewStepViewController.m +++ b/ResearchKitUI/Common/Step/WebView Step/ORKWebViewStepViewController.m @@ -29,18 +29,22 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */ #import "ORKWebViewStepViewController.h" -#import "ORKStepViewController_Internal.h" -#import "ORKWebViewStep.h" -#import "ORKResult_Private.h" #import "ORKCollectionResult_Private.h" -#import "ORKWebViewStepResult.h" -#import "ORKNavigationContainerView_Internal.h" -#import "ORKSkin.h" +#import "ORKCustomSignatureFooterView_Private.h" #import "ORKHelpers_Internal.h" +#import "ORKNavigationContainerView_Internal.h" +#import "ORKResult_Private.h" +#import "ORKSignatureFormatter.h" #import "ORKSignatureResult_Private.h" -#import "ORKCustomSignatureFooterView_Private.h" +#import "ORKSkin.h" +#import "ORKStepViewController_Internal.h" #import "ORKTaskViewController_Internal.h" +#import "ORKWebViewStep.h" +#import "ORKWebViewStepResult.h" +#import "ORKWebViewStepResult_Private.h" + + static const CGFloat ORKSignatureTopPadding = 37.0; @@ -51,7 +55,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @implementation ORKWebViewStepViewController { UIScrollView *_scrollView; WKWebView *_webView; - NSString *_receivedMessageBody; NSMutableArray *_constraints; @@ -101,12 +104,7 @@ - (void)refreshHTML { if (!css) { UIColor *backgroundColor = ORKColor(ORKBackgroundColorKey); - UIColor *textColor; - if (@available(iOS 13.0, *)) { - textColor = [UIColor labelColor]; - } else { - textColor = [UIColor blackColor]; - } + UIColor *textColor = [UIColor labelColor]; NSString *backgroundColorString = [self hexStringForColor:backgroundColor]; NSString *textColorString = [self hexStringForColor:textColor]; @@ -134,7 +132,6 @@ - (void)refreshHTML { [_webView loadHTMLString:[self webViewStep].html baseURL:nil]; } - - (CGFloat)horizontalPadding { return self.step.useExtendedPadding ? ORKStepContainerExtendedLeftRightPaddingForWindow(self.view.window) : @@ -170,11 +167,9 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { // We need to re-render the HTML if the interface style has changed // so that the CSS adopts the new color scheme. - if (@available(iOS 13, *)) { - if (self.traitCollection.userInterfaceStyle != previousTraitCollection.userInterfaceStyle || - self.traitCollection.preferredContentSizeCategory != previousTraitCollection.preferredContentSizeCategory) { - [self refreshHTML]; - } + if (self.traitCollection.userInterfaceStyle != previousTraitCollection.userInterfaceStyle || + self.traitCollection.preferredContentSizeCategory != previousTraitCollection.preferredContentSizeCategory) { + [self refreshHTML]; } } @@ -243,7 +238,6 @@ - (void)setSkipButtonItem:(UIBarButtonItem *)skipButtonItem { } - (void)setupConstraints { - if (_constraints) { [NSLayoutConstraint deactivateConstraints:_constraints]; } @@ -393,6 +387,7 @@ - (void)viewDidLoad { // until the HTML is loaded [self setupSubviews]; [self refreshHTML]; + [self.taskViewController setNavigationBarColor:[self.view backgroundColor]]; } @@ -442,6 +437,7 @@ - (CGFloat)bottomOffset { - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; + [_scrollView setContentInset:UIEdgeInsetsMake(0, 0, _bottomOffset, 0)]; } @@ -473,13 +469,18 @@ - (ORKStepResult *)result { ORKWebViewStepResult *webViewResult = [[ORKWebViewStepResult alloc] initWithIdentifier:webViewResultIdentifier]; webViewResult.result = _receivedMessageBody; webViewResult.endDate = stepResult.endDate; - webViewResult.userInfo = @{@"html": [self webViewStep].html}; stepResult.results = [stepResult.results arrayByAddingObject:webViewResult] ? : @[webViewResult]; if ([[self webViewStep] showSignatureAfterContent] && [_signatureFooterView isComplete]) { NSString *signatureResultIdentifier = @"Signature"; ORKSignatureResult *signatureResult = [_signatureFooterView resultWithIdentifier: signatureResultIdentifier]; stepResult.results = [stepResult.results arrayByAddingObject:signatureResult] ? : @[signatureResult]; + + ORKSignatureFormatter *signatureFormatter = [ORKSignatureFormatter new]; + NSString *htmlWithSignature = [signatureFormatter appendSignatureToHTML:[self webViewStep].html signatureResult:signatureResult]; + webViewResult.userInfo = @{[ORKWebViewStepResult getHTMLKey]: [self webViewStep].html, [ORKWebViewStepResult getHTMLWithDictionaryKey]: htmlWithSignature}; + } else { + webViewResult.userInfo = @{[ORKWebViewStepResult getHTMLKey]: [self webViewStep].html}; } } return stepResult; @@ -487,10 +488,6 @@ - (ORKStepResult *)result { // MARK: WKWebViewDelegate -- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(null_unspecified WKNavigation *)navigation { - -} - - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation { [webView evaluateJavaScript:@"document.readyState" completionHandler:^(id complete, NSError *readyError) { if (complete != nil) { @@ -507,8 +504,6 @@ - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNav [self didFinishLoadingHTML]; } }]; - - [UIApplication sharedApplication].networkActivityIndicatorVisible = false; } - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { diff --git a/ResearchKit/Common/ORKTaskReviewViewController.h b/ResearchKitUI/Common/Task/ORKTaskReviewViewController.h similarity index 100% rename from ResearchKit/Common/ORKTaskReviewViewController.h rename to ResearchKitUI/Common/Task/ORKTaskReviewViewController.h diff --git a/ResearchKit/Common/ORKTaskReviewViewController.m b/ResearchKitUI/Common/Task/ORKTaskReviewViewController.m similarity index 93% rename from ResearchKit/Common/ORKTaskReviewViewController.m rename to ResearchKitUI/Common/Task/ORKTaskReviewViewController.m index 18d3261e33..f226c217ee 100644 --- a/ResearchKit/Common/ORKTaskReviewViewController.m +++ b/ResearchKitUI/Common/Task/ORKTaskReviewViewController.m @@ -93,11 +93,7 @@ - (void)setQuestion:(NSString *)question { - (void)setAnswer:(NSString *)answer { _answer = answer; - if (@available(iOS 13.0, *)) { - _answerLabel.textColor = _answer ? UIColor.secondaryLabelColor : UIColor.tertiaryLabelColor; - } else { - _answerLabel.textColor = _answer ? UIColor.blackColor : UIColor.lightGrayColor; - } + _answerLabel.textColor = _answer ? UIColor.secondaryLabelColor : UIColor.tertiaryLabelColor; _answerLabel.text = _answer ? : ORKLocalizedString(@"REVIEW_SKIPPED_ANSWER", nil); } @@ -110,15 +106,9 @@ - (void)setMaskLayers { _contentMaskLayer = nil; } _contentMaskLayer = [[CAShapeLayer alloc] init]; - UIColor *fillColor; - UIColor *borderColor; - if (@available(iOS 13.0, *)) { - fillColor = [UIColor secondarySystemGroupedBackgroundColor]; - borderColor = UIColor.separatorColor; - } else { - fillColor = [UIColor ork_borderGrayColor]; - borderColor = [UIColor ork_midGrayTintColor]; - } + UIColor *fillColor = [UIColor secondarySystemGroupedBackgroundColor]; + UIColor *borderColor = UIColor.separatorColor; + [_contentMaskLayer setFillColor:[fillColor CGColor]]; CAShapeLayer *foreLayer = [CAShapeLayer layer]; [foreLayer setFillColor:[fillColor CGColor]]; @@ -145,11 +135,8 @@ - (void)setupContainerView { if (!_containerView) { _containerView = [UIView new]; } - if (@available(iOS 13.0, *)) { - _containerView.backgroundColor = UIColor.systemBackgroundColor; - } else { - _containerView.backgroundColor = UIColor.whiteColor; - } + + _containerView.backgroundColor = UIColor.systemBackgroundColor; _containerView.translatesAutoresizingMaskIntoConstraints = NO; [self.contentView addSubview:_containerView]; } @@ -161,11 +148,8 @@ - (void)setupLabels { if (!_answerLabel) { _answerLabel = [UILabel new]; } - if (@available(iOS 13.0, *)) { - _questionLabel.textColor = [UIColor labelColor]; - } else { - _questionLabel.textColor = [UIColor blackColor]; - } + + _questionLabel.textColor = [UIColor labelColor]; _questionLabel.numberOfLines = 0; _questionLabel.textAlignment = NSTextAlignmentLeft; _questionLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; @@ -236,16 +220,9 @@ - (void)layoutSubviews { cornerRadii: (CGSize){ORKCardDefaultCornerRadii, ORKCardDefaultCornerRadii}].CGPath; CAShapeLayer *foreLayer = [CAShapeLayer layer]; - UIColor *fillColor; - UIColor *borderColor; - - if (@available(iOS 13.0, *)) { - fillColor = [UIColor secondarySystemGroupedBackgroundColor]; - borderColor = UIColor.separatorColor; - } else { - fillColor = [UIColor whiteColor]; - borderColor = [UIColor ork_midGrayTintColor]; - } + UIColor *fillColor = [UIColor secondarySystemGroupedBackgroundColor]; + UIColor *borderColor = UIColor.separatorColor; + [foreLayer setFillColor:[fillColor CGColor]]; CGFloat foreLayerCornerRadii = ORKCardDefaultCornerRadii >= ORKCardDefaultBorderWidth ? ORKCardDefaultCornerRadii - ORKCardDefaultBorderWidth : ORKCardDefaultCornerRadii; @@ -260,7 +237,7 @@ - (void)layoutSubviews { [_contentLayer addSublayer:foreLayer]; [_contentLayer setFillColor:[borderColor CGColor]]; [_containerView.layer insertSublayer:_contentLayer atIndex:0]; - + _button.layer.cornerRadius = _button.bounds.size.height == 0 ? EditAnswerButtonCornerRadius : (_button.bounds.size.height / 2); } @@ -271,11 +248,7 @@ - (void)setupContainerView { [_containerView setBackgroundColor:[UIColor clearColor]]; _separator = [UIView new]; - if (@available(iOS 13.0, *)) { - _separator.backgroundColor = UIColor.separatorColor; - } else { - _separator.backgroundColor = UIColor.lightGrayColor; - } + _separator.backgroundColor = UIColor.separatorColor; [_containerView addSubview:_separator]; _containerView.translatesAutoresizingMaskIntoConstraints = NO; @@ -290,12 +263,7 @@ - (void)setupButton { } [_button setTitle:ORKLocalizedString(@"REVIEW_EDIT_ANSWER", nil) forState:UIControlStateNormal]; [_button setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal]; - - if (@available(iOS 13.0, *)) { - [_button setBackgroundColor:[UIColor tertiarySystemFillColor]]; - } else { - [_button setBackgroundColor:[UIColor lightGrayColor]]; - } + [_button setBackgroundColor:[UIColor tertiarySystemFillColor]]; [_button setContentEdgeInsets:UIEdgeInsetsMake(EditAnswerButtonTopBottomInsetSpacing, EditAnswerButtomLeftRightInsetSpacing, EditAnswerButtonTopBottomInsetSpacing, EditAnswerButtomLeftRightInsetSpacing)]; _button.clipsToBounds = YES; @@ -536,7 +504,7 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger if (cardHeaderView == nil) { ORKReviewSection *reviewSection = _reviewSections[section]; - cardHeaderView = [[ORKSurveyCardHeaderView alloc] initWithTitle:reviewSection.title detailText:reviewSection.text learnMoreView:nil progressText:[NSString stringWithFormat:@"%@ %@", ORKLocalizedString(@"REVIEW_STEP_PAGE", nil), ORKLocalizedStringFromNumber(@(section + 1))] tagText:nil showBorder:YES hasMultipleChoiceItem:NO]; + cardHeaderView = [[ORKSurveyCardHeaderView alloc] initWithTitle:reviewSection.title detailText:reviewSection.text learnMoreView:nil progressText:[NSString stringWithFormat:@"%@ %@", ORKLocalizedString(@"REVIEW_STEP_PAGE", nil), ORKLocalizedStringFromNumber(@(section + 1))] tagText:nil showBorder:YES hasMultipleChoiceItem:NO shouldIgnoreDarkMode:NO]; } return cardHeaderView; diff --git a/ResearchKit/Common/ORKTaskViewController.h b/ResearchKitUI/Common/Task/ORKTaskViewController.h similarity index 93% rename from ResearchKit/Common/ORKTaskViewController.h rename to ResearchKitUI/Common/Task/ORKTaskViewController.h index 2cfc66dadc..e373e0b814 100644 --- a/ResearchKit/Common/ORKTaskViewController.h +++ b/ResearchKitUI/Common/Task/ORKTaskViewController.h @@ -29,9 +29,9 @@ */ -@import UIKit; -#import - +#import +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -47,7 +47,6 @@ NS_ASSUME_NONNULL_BEGIN @protocol ORKTaskResultSource; @class ORKInstructionStep; - /** The `ORKTaskViewControllerReviewMode` value indicates how the task view controller reviews the task. */ @@ -58,28 +57,6 @@ typedef NS_ENUM(NSInteger, ORKTaskViewControllerReviewMode) { ORKTaskViewControllerReviewModeStandalone }; -/** - The `ORKTaskViewControllerFinishReason` value indicates how the task view controller has finished - the task. - */ -typedef NS_ENUM(NSInteger, ORKTaskViewControllerFinishReason) { - - /// The task was canceled by the participant or the developer, and the participant asked to save the current result. - ORKTaskViewControllerFinishReasonSaved, - - /// The task was canceled by the participant or the developer, and the participant asked to discard the current result. - ORKTaskViewControllerFinishReasonDiscarded, - - /// The task has completed successfully, because all steps have been completed. - ORKTaskViewControllerFinishReasonCompleted, - - /// An error was detected during the current step. - ORKTaskViewControllerFinishReasonFailed, - - /// Interntional early termination of a task - ORKTaskViewControllerFinishReasonEarlyTermination -}; - /** The `ORKTaskViewControllerProgressMode` value indicates how the question progress labels will be presented during the task */ @@ -116,7 +93,7 @@ typedef NS_ENUM(NSInteger, ORKTaskViewControllerProgressMode) { @param reason An `ORKTaskViewControllerFinishReason` value indicating how the user chose to complete the task. @param error If failure occurred, an `NSError` object indicating the reason for the failure. The value of this parameter is `nil` if `result` does not indicate failure. */ -- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskViewControllerFinishReason)reason error:(nullable NSError *)error; +- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskFinishReason)reason error:(nullable NSError *)error; @optional /** @@ -296,7 +273,6 @@ task view controller and pass that data to `initWithTask:restorationData:` when /** */ - (void)taskViewController:(ORKTaskViewController *)taskViewController learnMoreButtonPressedWithStep:(ORKLearnMoreInstructionStep *)learnMoreStep forStepViewController:(ORKStepViewController *)stepViewController; - @end @@ -329,7 +305,10 @@ task view controller and pass that data to `initWithTask:restorationData:` when objects in the result hierarchy. */ ORK_CLASS_AVAILABLE +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Weverything" @interface ORKTaskViewController : UIViewController +#pragma clang diagnostic pop /** Returns a newly initialized task view controller. @@ -382,7 +361,25 @@ ORK_CLASS_AVAILABLE @return A new task view controller. */ -- (instancetype)initWithTask:(id)task restorationData:(NSData *)data delegate:(id)delegate error:(NSError* __autoreleasing *)errorOut; +- (instancetype)initWithTask:(id)task restorationData:(NSData *)data delegate:(id)delegate error:(NSError* __autoreleasing *)errorOut NS_DESIGNATED_INITIALIZER; + +/** + Creates a new task view controller that starts the task at the step that has the specified step identifier. + + Call this method to start a task from a specific step. Additionally, you can supply a defaultResultSource to resume a + partially completed task, or to provide your own prefilled results. + + @param task The task to be presented. + @param ongoingResult An optional task result from a previous run of the task. If you provide an ongoingResult, the task will start at the step corresponding to the last result. + @param defaultResultSource A source that the task view controller can consult to obtain default answers for questions provided in question steps and form steps. + @param delegate The delegate for the task view controller. + + @return A new task view controller. + */ +- (instancetype)initWithTask:(id)task + ongoingResult:(nullable ORKTaskResult *)ongoingResult + defaultResultSource:(nullable id)defaultResultSource + delegate:(nullable id)delegate NS_DESIGNATED_INITIALIZER; /** Creates a new task view controller that starts the task at the step that has the specified step identifier. @@ -392,6 +389,7 @@ ORK_CLASS_AVAILABLE @param task The task to be presented. @param ongoingResult An optional task result from a previous run of the task. If you provide an ongoingResult, the task will start at the step corresponding to the last result. + @param restoreAtFirstStep A boolean that determines if the restored task starts from the last or first step. @param defaultResultSource A source that the task view controller can consult to obtain default answers for questions provided in question steps and form steps. @param delegate The delegate for the task view controller. @@ -399,8 +397,9 @@ ORK_CLASS_AVAILABLE */ - (instancetype)initWithTask:(id)task ongoingResult:(nullable ORKTaskResult *)ongoingResult + restoreAtFirstStep:(BOOL)restoreAtFirstStep defaultResultSource:(nullable id)defaultResultSource - delegate:(id)delegate NS_DESIGNATED_INITIALIZER; + delegate:(nullable id)delegate; /** The delegate for the task view controller. @@ -513,7 +512,6 @@ ORK_CLASS_AVAILABLE */ @property (nonatomic, strong, readonly, nullable) ORKStepViewController *currentStepViewController; - /** Forces navigation to the next step. @@ -577,6 +575,8 @@ ORK_CLASS_AVAILABLE */ @property (nonatomic, assign) BOOL discardable; +@property (nonatomic, assign) BOOL skipSaveResultsConfirmation; + @property (nonatomic) ORKTaskViewControllerReviewMode reviewMode; @property (nonatomic, nullable) ORKInstructionStep * reviewInstructionStep; @@ -589,6 +589,7 @@ ORK_CLASS_AVAILABLE @property (nonatomic) ORKTaskViewControllerProgressMode progressMode; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/ORKTaskViewController.m b/ResearchKitUI/Common/Task/ORKTaskViewController.m similarity index 85% rename from ResearchKit/Common/ORKTaskViewController.m rename to ResearchKitUI/Common/Task/ORKTaskViewController.m index dea72392a6..7c1a82b7dc 100644 --- a/ResearchKit/Common/ORKTaskViewController.m +++ b/ResearchKitUI/Common/Task/ORKTaskViewController.m @@ -31,13 +31,10 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTaskViewController.h" -#import "ORKActiveStepViewController.h" #import "ORKInstructionStepViewController_Internal.h" #import "ORKFormStepViewController.h" -#import "ORKQuestionStepViewController.h" #import "ORKReviewStepViewController_Internal.h" #import "ORKStepViewController_Internal.h" -#import "ORKTappingIntervalStepViewController.h" #import "ORKTaskViewController_Internal.h" #import "ORKLearnMoreStepViewController.h" @@ -50,7 +47,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKResult_Private.h" #import "ORKReviewStep_Internal.h" #import "ORKStep_Private.h" -#import "ORKTappingIntervalStep.h" +#import "ORKViewControllerProviding.h" #import "ORKHelpers_Internal.h" #import "ORKObserver.h" @@ -58,10 +55,16 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKBorderedButton.h" #import "ORKTaskReviewViewController.h" - @import AVFoundation; @import CoreMotion; -#import + + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION +#import +#import + + + typedef void (^_ORKLocationAuthorizationRequestHandler)(BOOL success); @@ -72,8 +75,10 @@ - (instancetype)initWithHandler:(_ORKLocationAuthorizationRequestHandler)handler - (void)resume; @end +#endif +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @implementation ORKLocationAuthorizationRequester { CLLocationManager *_manager; _ORKLocationAuthorizationRequestHandler _handler; @@ -100,28 +105,22 @@ - (void)resume { } _started = YES; - - NSString *allowedWhenInUse = (NSString *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"]; - NSString *allowedAlways = (NSString *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysAndWhenInUseUsageDescription"]; - - if (_manager) { - CLAuthorizationStatus status = kCLAuthorizationStatusNotDetermined; - - if (@available(iOS 14.0, *)) { - status = _manager.authorizationStatus; + NSString *whenInUseKey = (NSString *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationWhenInUseUsageDescription"]; + NSString *alwaysKey = (NSString *)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"NSLocationAlwaysAndWhenInUseUsageDescription"]; + + CLAuthorizationStatus status = [CLLocationManager authorizationStatus]; + if ((status == kCLAuthorizationStatusNotDetermined) && (whenInUseKey || alwaysKey)) { + BOOL requestWasDelivered = YES; + if (alwaysKey) { + requestWasDelivered = [_manager ork_requestAlwaysAuthorization]; } else { - status = [CLLocationManager authorizationStatus]; + requestWasDelivered = [_manager ork_requestWhenInUseAuthorization]; } - - if ((status == kCLAuthorizationStatusNotDetermined) && (allowedWhenInUse || allowedAlways)) { - if (allowedAlways) { - [_manager requestAlwaysAuthorization]; - } else { - [_manager requestWhenInUseAuthorization]; - } - } else { - [self finishWithResult:(status != kCLAuthorizationStatusDenied)]; + if (requestWasDelivered == NO) { + [self finishWithResult:NO]; } + } else { + [self finishWithResult:(status != kCLAuthorizationStatusDenied)]; } } @@ -132,23 +131,18 @@ - (void)finishWithResult:(BOOL)result { } } -- (void)locationManagerDidChangeAuthorization:(CLLocationManager *)manager { - CLAuthorizationStatus status = kCLAuthorizationStatusNotDetermined; - - if (@available(iOS 14.0, *)) { - status = manager.authorizationStatus; - } else { - status = [CLLocationManager authorizationStatus]; +- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { + if (_handler && _started && status != kCLAuthorizationStatusNotDetermined) { + [self finishWithResult:(status != kCLAuthorizationStatusDenied)]; } - - if (_started && status != kCLAuthorizationStatusNotDetermined) { - [self finishWithResult:(status != kCLAuthorizationStatusDenied)]; - } } @end +#endif - +/// An interface for managing a task in a view. +/// +//// Some task workflows may be longer than others, so participants might switch to another app. To keep continuity between steps in a task, ``ORKTaskViewController`` supports saving and restoring a task's progress and user state. @interface ORKTaskViewController () { ORKScrollViewObserver *_scrollViewObserver; BOOL _hasBeenPresented; @@ -168,6 +162,7 @@ @interface ORKTaskViewController () )task taskRunUUID:(NSUUID *)taskR self.showsProgressInNavigationBar = YES; self.discardable = NO; + self.skipSaveResultsConfirmation = NO; self.progressMode = ORKTaskViewControllerProgressModeQuestionsPerStep; _managedResults = [NSMutableDictionary dictionary]; _managedStepIdentifiers = [NSMutableArray array]; self.taskRunUUID = taskRunUUID ?: [NSUUID UUID]; + + // Ensure taskRunUUID has non-nil valuetaskRunUUID + (void)[self taskRunUUID]; self.restorationClass = [ORKTaskViewController class]; return self; @@ -250,25 +243,20 @@ - (instancetype)initWithTask:(id)task taskRunUUID:(NSUUID *)taskRunUUID } - (instancetype)initWithTask:(id)task restorationData:(NSData *)data delegate:(id)delegate error:(NSError* __autoreleasing *)errorOut { - - self = [self initWithTask:task taskRunUUID:nil]; + self = [[super initWithNibName:nil bundle:nil] commonInitWithTask:task taskRunUUID:nil]; if (self) { self.delegate = delegate; if (data != nil) { self.restorationClass = [self class]; - NSError *unarchiverInitError = nil; - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:&unarchiverInitError]; + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:errorOut]; + [self decodeRestorableStateWithCoder:unarchiver]; + [unarchiver finishDecoding]; + [self applicationFinishedRestoringState]; if (unarchiver == nil && errorOut != nil) { - *errorOut = [NSError errorWithDomain:ORKErrorDomain code:ORKErrorException userInfo:@{ - NSLocalizedDescriptionKey: ORKLocalizedString(@"RESTORE_ERROR_CANNOT_DECODE", nil), - NSUnderlyingErrorKey: unarchiverInitError - }]; + *errorOut = [NSError errorWithDomain:ORKErrorDomain code:ORKErrorException userInfo:@{NSLocalizedDescriptionKey: ORKLocalizedString(@"RESTORE_ERROR_CANNOT_DECODE", nil)}]; } - - [self decodeRestorableStateWithCoder:unarchiver]; - [self applicationFinishedRestoringState]; } } return self; @@ -278,7 +266,6 @@ - (instancetype)initWithTask:(id)task ongoingResult:(nullable ORKTaskResult *)ongoingResult defaultResultSource:(nullable id)defaultResultSource delegate:(id)delegate { - self = [[super initWithNibName:nil bundle:nil] commonInitWithTask:task taskRunUUID:nil]; if (self) { @@ -288,7 +275,8 @@ - (instancetype)initWithTask:(id)task for (ORKResult *stepResult in ongoingResult.results) { NSString *stepResultIdentifier = stepResult.identifier; if ([task stepWithIdentifier:stepResultIdentifier] == nil) { - @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"ongoingResults has results for identifiers not found within the task steps" userInfo:nil]; + ORK_Log_Error("ongoingResults has results for identifiers not found within the task steps, skipping adding result for step %@", stepResultIdentifier); + continue; } [_managedStepIdentifiers addObject:stepResultIdentifier]; _managedResults[stepResultIdentifier] = stepResult; @@ -299,6 +287,21 @@ - (instancetype)initWithTask:(id)task return self; } +- (instancetype)initWithTask:(id)task + ongoingResult:(ORKTaskResult *)ongoingResult + restoreAtFirstStep:(BOOL)restoreAtFirstStep + defaultResultSource:(id)defaultResultSource + delegate:(id)delegate { + self = [self initWithTask:task ongoingResult:ongoingResult defaultResultSource:defaultResultSource delegate:delegate]; + + if (self) { + if (restoreAtFirstStep && ongoingResult != nil) { + _restoredStepIdentifier = ongoingResult.results.firstObject.identifier; + } + } + return self; +} + - (void)setTaskRunUUID:(NSUUID *)taskRunUUID { if (_hasBeenPresented) { @throw [NSException exceptionWithName:NSGenericException reason:@"Cannot change task instance UUID after presenting task controller" userInfo:nil]; @@ -325,6 +328,7 @@ - (void)setTask:(id)task { } _hasRequestedHealthData = NO; + _task = task; } @@ -340,16 +344,24 @@ - (void)requestHealthStoreAccessWithReadTypes:(NSSet *)readTypes writeTypes:(NSSet *)writeTypes handler:(void (^)(void))handler { NSParameterAssert(handler != nil); - if ((![HKHealthStore isHealthDataAvailable]) || (!readTypes && !writeTypes)) { + BOOL needsHealthKitAuthRequest = NO; + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + needsHealthKitAuthRequest = ([HKHealthStore isHealthDataAvailable]); + needsHealthKitAuthRequest = needsHealthKitAuthRequest && ((readTypes != nil) || (writeTypes != nil)); +#endif + + if (needsHealthKitAuthRequest == NO) { _requestedHealthTypesForRead = nil; _requestedHealthTypesForWrite = nil; - handler(); + dispatch_async(dispatch_get_main_queue(), handler); return; } _requestedHealthTypesForRead = readTypes; _requestedHealthTypesForWrite = writeTypes; +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION __block HKHealthStore *healthStore = [HKHealthStore new]; [healthStore requestAuthorizationToShareTypes:writeTypes readTypes:readTypes completion:^(BOOL success, NSError *error) { ORK_Log_Error("Health access: error=%@", error); @@ -358,6 +370,8 @@ - (void)requestHealthStoreAccessWithReadTypes:(NSSet *)readTypes // Clear self-ref. healthStore = nil; }]; +#endif + } - (void)requestPedometerAccessWithHandler:(void (^)(BOOL success))handler { @@ -414,6 +428,7 @@ - (void)requestCameraAccessWithHandler:(void (^)(BOOL success))handler { }]; } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION - (void)requestLocationAccessWithHandler:(void (^)(BOOL success))handler { NSParameterAssert(handler != nil); @@ -428,6 +443,7 @@ - (void)requestLocationAccessWithHandler:(void (^)(BOOL success))handler { [requester resume]; } +#endif - (ORKPermissionMask)desiredPermissions { ORKPermissionMask permissions = ORKPermissionNone; @@ -439,10 +455,15 @@ - (ORKPermissionMask)desiredPermissions { - (void)requestHealthAuthorizationWithCompletion:(void (^)(void))completion { if (_hasRequestedHealthData) { - if (completion) completion(); + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(); + }); + } return; } +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION NSSet *readTypes = nil; if ([self.task respondsToSelector:@selector(requestedHealthKitTypesForReading)]) { readTypes = [self.task requestedHealthKitTypesForReading]; @@ -452,19 +473,22 @@ - (void)requestHealthAuthorizationWithCompletion:(void (^)(void))completion { if ([self.task respondsToSelector:@selector(requestedHealthKitTypesForWriting)]) { writeTypes = [self.task requestedHealthKitTypesForWriting]; } - +#endif + ORKPermissionMask permissions = [self desiredPermissions]; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ dispatch_async(dispatch_get_main_queue(), ^{ +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION ORK_Log_Debug("Requesting health access"); [self requestHealthStoreAccessWithReadTypes:readTypes writeTypes:writeTypes handler:^{ dispatch_semaphore_signal(semaphore); }]; +#endif }); dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); if (permissions & ORKPermissionCoreMotionAccelerometer) { @@ -489,17 +513,15 @@ - (void)requestHealthAuthorizationWithCompletion:(void (^)(void))completion { dispatch_async(dispatch_get_main_queue(), ^{ ORK_Log_Debug("Requesting audio access"); [self requestAudioRecordingAccessWithHandler:^(BOOL success) { - if (success) { - _grantedPermissions |= ORKPermissionAudioRecording; - } else { - _grantedPermissions &= ~ORKPermissionAudioRecording; - } + [self handleResponseFromAudioRequest: success]; dispatch_semaphore_signal(semaphore); }]; }); dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); } + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION if (permissions & ORKPermissionCoreLocation) { dispatch_async(dispatch_get_main_queue(), ^{ ORK_Log_Debug("Requesting location access"); @@ -515,6 +537,7 @@ - (void)requestHealthAuthorizationWithCompletion:(void (^)(void))completion { dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER); } +#endif if (permissions & ORKPermissionCamera) { dispatch_async(dispatch_get_main_queue(), ^{ ORK_Log_Debug("Requesting camera access"); @@ -539,6 +562,14 @@ - (void)requestHealthAuthorizationWithCompletion:(void (^)(void))completion { }); } +- (void)handleResponseFromAudioRequest:(BOOL)success { + if (success) { + _grantedPermissions |= ORKPermissionAudioRecording; + } else { + _grantedPermissions &= ~ORKPermissionAudioRecording; + } +} + - (void)startAudioPromptSessionIfNeeded { id task = self.task; if ([task isKindOfClass:[ORKOrderedTask class]]) { @@ -615,11 +646,7 @@ - (void)viewDidLoad { [self applicationFinishedRestoringState]; } - if (@available(iOS 13.0, *)) { - [self setNavigationBarColor:[UIColor systemGroupedBackgroundColor]]; - } else { - [self setNavigationBarColor:ORKColor(ORKBackgroundColorKey)]; - } + [self setNavigationBarColor:[UIColor systemGroupedBackgroundColor]]; } @@ -655,13 +682,11 @@ - (void)viewWillAppear:(BOOL)animated { // Clear endDate if current TaskVC got presented again _dismissedDate = nil; - - if (@available(iOS 13.0, *)) { - if ([self canDiscardResults] == NO) { - self.modalInPresentation = YES; - } + + if ([self isSafeToSkipConfirmation] == NO) { + self.modalInPresentation = YES; } - + if (_taskReviewViewController) { [_childNavigationController setViewControllers:@[_taskReviewViewController] animated:NO]; [self setTaskReviewViewControllerNavbar]; @@ -676,7 +701,7 @@ - (void)viewWillAppear:(BOOL)animated { - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; - + // Set endDate on TaskVC is dismissed, // because nextResponder is not nil when current TaskVC is covered by another modal view if (self.nextResponder == nil) { @@ -721,16 +746,38 @@ - (void)setManagedResult:(ORKStepResult *)result forKey:(NSString *)aKey { } - (ORKTaskResult *)result { + ORKTaskResult *result = [self _resultIncludingUpdatedCurrentStepViewControllerResult:YES]; + return result; +} + +- (ORKTaskResult *)_resultIncludingUpdatedCurrentStepViewControllerResult:(BOOL)shouldIncludeUpdatedCurrentStepViewControllerResult { // TODO: update current implementation. // setManagedResult for currentStepViewController should not be called every single time this method is called. ORKTaskResult *result = [[ORKTaskResult alloc] initWithTaskIdentifier:[self.task identifier] taskRunUUID:self.taskRunUUID outputDirectory:self.outputDirectory]; result.startDate = _presentedDate ? : [NSDate date]; result.endDate = _dismissedDate ? : [NSDate date]; - // Update current step result - [self setManagedResult:[self.currentStepViewController result] forKey:self.currentStepViewController.step.identifier]; - - result.results = [self managedResultsArray]; + if (shouldIncludeUpdatedCurrentStepViewControllerResult) { + [self setManagedResult:[self.currentStepViewController result] forKey:self.currentStepViewController.step.identifier]; + result.results = [self managedResultsArray]; + } else { + + // we may have saved results from the currentStepViewController, but we don't want to include stale results either, + // so go through and remove that result from our local copy before returning + NSString *targetIdentifier = self.currentStepViewController.step.identifier; + NSMutableArray *mutableResultsArray = [[self managedResultsArray] mutableCopy]; + NSUInteger index = [mutableResultsArray indexOfObjectPassingTest:^BOOL(ORKResult *eachResult, NSUInteger idx, BOOL * _Nonnull stop) { + if ([eachResult.identifier isEqualToString:targetIdentifier]) { + *stop = YES; + return YES; + } + return NO; + }]; + if (index != NSNotFound) { + [mutableResultsArray removeObjectAtIndex:index]; + } + result.results = [mutableResultsArray copy]; + } return result; } @@ -740,7 +787,7 @@ - (NSData *)restorationData { [self encodeRestorableStateWithCoder:archiver]; [archiver finishEncoding]; - return [archiver.encodedData copy]; + return [archiver encodedData]; } - (void)ensureDirectoryExists:(NSURL *)outputDirectory { @@ -789,16 +836,6 @@ - (void)learnMoreButtonPressedWithStep:(ORKLearnMoreInstructionStep *)learnMoreI } } -- (void)suspend { - [self finishAudioPromptSession]; - [ORKDynamicCast(_currentStepViewController, ORKActiveStepViewController) suspend]; -} - -- (void)resume { - [self startAudioPromptSessionIfNeeded]; - [ORKDynamicCast(_currentStepViewController, ORKActiveStepViewController) resume]; -} - - (void)goForward { [_currentStepViewController goForward]; } @@ -825,14 +862,13 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations { if (self.currentStepViewController) { supportedOrientations = self.currentStepViewController.supportedInterfaceOrientations; } else { - supportedOrientations = [[self nextStep].stepViewControllerClass supportedInterfaceOrientations]; + supportedOrientations = [self.nextStep makeViewControllerWithResult:nil].supportedInterfaceOrientations; } return supportedOrientations; } #pragma mark - internal helpers - - (void)updateLastBeginningInstructionStepIdentifierForStep:(ORKStep *)step goForward:(BOOL)goForward { if (NO == goForward) { @@ -870,18 +906,28 @@ - (BOOL)grantedAtLeastOnePermission { return (desiredMask == 0 || ((desiredMask & _grantedPermissions) != 0)); } +- (BOOL)handlePermissionRequestsDeniedForStep:(ORKStep *)step error:(NSError **)outError { + if (outError != nil) { + *outError = [NSError errorWithDomain:NSCocoaErrorDomain + code:NSUserCancelledError + userInfo:@{@"reason": @"Required permissions not granted."}]; + } + return NO; +} + - (void)showStepViewController:(ORKStepViewController *)stepViewController goForward:(BOOL)goForward animated:(BOOL)animated { if (nil == stepViewController) { return; } ORKStep *step = stepViewController.step; + [self updateLastBeginningInstructionStepIdentifierForStep:step goForward:goForward]; ORKStepViewController *fromController = self.currentStepViewController; if (fromController && animated && [self isStepLastBeginningInstructionStep:fromController.step]) { + [self startAudioPromptSessionIfNeeded]; - if ( [self grantedAtLeastOnePermission] == NO) { // Do the health request and THEN proceed. [self requestHealthAuthorizationWithCompletion:^{ @@ -891,21 +937,30 @@ - (void)showStepViewController:(ORKStepViewController *)stepViewController goFor // However, since iOS does not re-present requests for access, we // can easily fail even if the user does not see a dialog, which would // be highly unexpected. - if ([self grantedAtLeastOnePermission] == NO) { - - [self reportError:[NSError errorWithDomain:NSCocoaErrorDomain - code:NSUserCancelledError - userInfo:@{@"reason": @"Required permissions not granted."}] - onStep:fromController.step]; - } else { + BOOL canRetryShowStepViewController = YES; + + // if we were granted at least one permission, it's worth trying again to show the step + canRetryShowStepViewController = canRetryShowStepViewController && [self grantedAtLeastOnePermission]; + + // even if we weren't granted permission, maybe step doesn't require it or the task can handle it some other way? + NSError *handlerErrorOrNil = nil; + if (canRetryShowStepViewController == NO) { + BOOL handledRequestsDenied = [self handlePermissionRequestsDeniedForStep:fromController.step error:&handlerErrorOrNil]; + canRetryShowStepViewController = canRetryShowStepViewController && handledRequestsDenied; + } + + if (canRetryShowStepViewController == YES) { [self showStepViewController:stepViewController goForward:goForward animated:animated]; + } else { + [self reportError:handlerErrorOrNil onStep:fromController.step]; } }]; + return; } } - + if (step.identifier && ![_managedStepIdentifiers.lastObject isEqualToString:step.identifier]) { [_managedStepIdentifiers addObject:step.identifier]; } @@ -949,8 +1004,16 @@ - (void)showStepViewController:(ORKStepViewController *)stepViewController goFor [newViewControllers addObject:previousStepViewController]; } } + + ORKStepViewController *lastStepViewController = (ORKStepViewController *)_childNavigationController.viewControllers.lastObject; + if (!goForward && [stepViewController.step.identifier isEqual:lastStepViewController.step.identifier]) { + stepViewController = lastStepViewController; + _currentStepViewController = lastStepViewController; + } + [newViewControllers addObject:stepViewController]; - if (newViewControllers != _childNavigationController.viewControllers) { + + if ([newViewControllers isEqual:_childNavigationController.viewControllers] == NO) { [_childNavigationController setViewControllers:newViewControllers animated:animated]; } } @@ -1021,7 +1084,9 @@ -(ORKLearnMoreStepViewController *)learnMoreViewControllerForStep:(ORKLearnMoreI if (!learnMoreViewController) { learnMoreViewController = [[ORKLearnMoreStepViewController alloc] initWithStep:step]; } - + + learnMoreViewController.view.tintColor = ORKViewTintColor(self.view); + return learnMoreViewController; } @@ -1031,6 +1096,9 @@ - (ORKStepViewController *)viewControllerForStep:(ORKStep *)step isPreviousViewC } ORKStepViewController *stepViewController = nil; + + UIColor *tintColor = ORKViewTintColor(self.view); + if ([self.delegate respondsToSelector:@selector(taskViewController:viewControllerForStep:)]) { // NOTE: While the delegate does not have direct access to the defaultResultSource, // it is assumed that it can set results as needed on the custom implementation of an @@ -1048,6 +1116,7 @@ - (ORKStepViewController *)viewControllerForStep:(ORKStep *)step isPreviousViewC id resultSource = reviewStep.isStandalone ? reviewStep.resultSource : self.result; stepViewController = [[ORKReviewStepViewController alloc] initWithReviewStep:(ORKReviewStep *) step steps:steps resultSource:resultSource]; ORKReviewStepViewController *reviewStepViewController = (ORKReviewStepViewController *) stepViewController; + reviewStepViewController.view.tintColor = tintColor; reviewStepViewController.reviewDelegate = self; } else { @@ -1068,10 +1137,7 @@ - (ORKStepViewController *)viewControllerForStep:(ORKStep *)step isPreviousViewC result = previousResult ? : [[ORKStepResult alloc] initWithIdentifier:step.identifier]; } - // Allow the step to instantiate the view controller. This will allow either the default - // implementation using an override of the internal method `-stepViewControllerClass` or - // allow for storyboard implementations. - stepViewController = [step instantiateStepViewControllerWithResult:result]; + stepViewController = [step makeViewControllerWithResult:result]; } } @@ -1095,6 +1161,8 @@ - (ORKStepViewController *)viewControllerForStep:(ORKStep *)step isPreviousViewC } stepViewController.outputDirectory = self.outputDirectory; + stepViewController.delegate = self; + if (!isPreviousViewController) { [self setManagedResult:stepViewController.result forKey:step.identifier]; } @@ -1110,10 +1178,31 @@ - (ORKStepViewController *)viewControllerForStep:(ORKStep *)step isPreviousViewC stepViewController.learnMoreButtonItem = [self defaultLearnMoreButtonItem]; } - stepViewController.delegate = self; return stepViewController; } +- (nullable ORKResult *)getCurrentStepResult:(ORKStep *)step { + ORKResult *result = [self.result resultForIdentifier:step.identifier]; + if (result) { + return result; + } + ORKStepResult *previousResult = _managedResults[step.identifier]; + + // Check the default source first + BOOL alwaysCheckForDefaultResult = ([self.defaultResultSource respondsToSelector:@selector(alwaysCheckForDefaultResult)] && + [self.defaultResultSource alwaysCheckForDefaultResult]); + if ((previousResult == nil) || alwaysCheckForDefaultResult) { + result = [self.defaultResultSource stepResultForStepIdentifier:step.identifier]; + } + + // If nil, assign to the previous result (if available) otherwise create new instance + if (!result) { + result = previousResult ? : [[ORKStepResult alloc] initWithIdentifier:step.identifier]; + } + + return result; +} + - (ORKStepViewController *)viewControllerForStep:(ORKStep *)step { return [self viewControllerForStep:step isPreviousViewController:NO]; } @@ -1135,28 +1224,22 @@ - (void)setUpProgressLabelForStepViewController:(ORKStepViewController *)stepVie #pragma mark - internal action Handlers -- (void)finishWithReason:(ORKTaskViewControllerFinishReason)reason error:(nullable NSError *)error { +- (void)finishWithReason:(ORKTaskFinishReason)reason error:(nullable NSError *)error { ORKStrongTypeOf(self.delegate) strongDelegate = self.delegate; if ([strongDelegate respondsToSelector:@selector(taskViewController:didFinishWithReason:error:)]) { [strongDelegate taskViewController:self didFinishWithReason:reason error:error]; } + [self didFinishWithReason:reason error:error]; } -- (void)presentCancelOptions:(BOOL)saveable sender:(id)sender { - - if ([self.delegate respondsToSelector:@selector(taskViewControllerShouldConfirmCancel:)] && - ![self.delegate taskViewControllerShouldConfirmCancel:self]) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self finishWithReason:ORKTaskViewControllerFinishReasonDiscarded error:nil]; - }); - return; - } - - BOOL supportSaving = NO; - if ([self.delegate respondsToSelector:@selector(taskViewControllerSupportsSaveAndRestore:)]) { - supportSaving = [self.delegate taskViewControllerSupportsSaveAndRestore:self]; - } - +// For subclasses +- (void)didFinishWithReason:(ORKTaskFinishReason)reason error:(nullable NSError *)error { + // no-op +} + +- (void)showRestorationStateAlertControllerWithSender:(id)sender + saveable:(BOOL)saveable + supportSaving:(BOOL)supportSaving { UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; @@ -1170,50 +1253,74 @@ - (void)presentCancelOptions:(BOOL)saveable sender:(id)sender { alert.popoverPresentationController.barButtonItem = sender; } + + NSString *discardTitle = saveable ? ORKLocalizedString(@"BUTTON_OPTION_DISCARD", nil) : ORKLocalizedString(@"BUTTON_OPTION_STOP_TASK", nil); + if (supportSaving && saveable) { [alert addAction:[UIAlertAction actionWithTitle:ORKLocalizedString(@"BUTTON_OPTION_SAVE", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { dispatch_async(dispatch_get_main_queue(), ^{ - [self finishWithReason:ORKTaskViewControllerFinishReasonSaved error:nil]; + [self finishWithReason:ORKTaskFinishReasonSaved error:nil]; }); }]]; } - NSString *discardTitle = saveable ? ORKLocalizedString(@"BUTTON_OPTION_DISCARD", nil) : ORKLocalizedString(@"BUTTON_OPTION_STOP_TASK", nil); - [alert addAction:[UIAlertAction actionWithTitle:discardTitle - style:UIAlertActionStyleDestructive - handler:^(UIAlertAction *action) { - dispatch_async(dispatch_get_main_queue(), ^{ - [self finishWithReason:ORKTaskViewControllerFinishReasonDiscarded error:nil]; - }); - }]]; - + style:UIAlertActionStyleDestructive + handler:^(UIAlertAction *action) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self finishWithReason:ORKTaskFinishReasonDiscarded error:nil]; + }); + }]]; + [alert addAction:[UIAlertAction actionWithTitle:ORKLocalizedString(@"BUTTON_CANCEL", nil) style:UIAlertActionStyleCancel handler:nil]]; - [self presentViewController:alert animated:YES completion:nil]; } +- (void)presentCancelOptionsWithSender:(id)sender { + BOOL saveable = [self hasSaveableResults]; + if ([self.delegate respondsToSelector:@selector(taskViewControllerShouldConfirmCancel:)] && + ![self.delegate taskViewControllerShouldConfirmCancel:self]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self finishWithReason:ORKTaskFinishReasonDiscarded error:nil]; + }); + return; + } + + BOOL supportSaving = NO; + if ([self.delegate respondsToSelector:@selector(taskViewControllerSupportsSaveAndRestore:)]) { + supportSaving = [self.delegate taskViewControllerSupportsSaveAndRestore:self]; + } + + if (_skipSaveResultsConfirmation && supportSaving && saveable) { + [self finishWithReason:ORKTaskFinishReasonSaved error:nil]; + } else { + [self showRestorationStateAlertControllerWithSender:self + saveable:saveable + supportSaving:supportSaving]; + } +} + - (IBAction)cancelAction:(UIBarButtonItem *)sender { if (self.discardable) { - [self finishWithReason:ORKTaskViewControllerFinishReasonDiscarded error:nil]; + [self finishWithReason:ORKTaskFinishReasonDiscarded error:nil]; } else { - [self presentCancelOptions:[self hasSaveableResults] sender:sender]; + [self presentCancelOptionsWithSender:sender]; } } -/// Compute whether it's safe to discard results because there wouldn't be any user data to lose. When `canDiscardResults` returns +/// Compute whether it's safe to discard results because there wouldn't be any user data to lose. When `isSafeToSkipConfirmation` returns /// YES, we know there's no need to present a confirmation dialog about potential data loss from ending the task. -- (BOOL)canDiscardResults { +- (BOOL)isSafeToSkipConfirmation { BOOL result = NO; ORKStep *currentStep = self.currentStepViewController.step; // true if currentStep is NOT capable of contributing results, AND there are no other saveable results - result = result || (([self currentStepContributesResults] == NO) && ([self hasSaveableResults] == NO)); + result = result || (([self.currentStepViewController.step isKindOfClass:[ORKInstructionStep class]]) && ([self hasSaveableResults] == NO)); // true if currentStep is a standalone reviewStep. No results will be lost by dismissing. result = result || (ORKDynamicCast(currentStep, ORKReviewStep).isStandalone); @@ -1224,17 +1331,6 @@ - (BOOL)canDiscardResults { return result; } -/// Returns whether or not to expect the current step to be one that has the potential of contributing results. -- (BOOL)currentStepContributesResults { - BOOL result = YES; - ORKStep *currentStep = self.currentStepViewController.step; - - // Instruction step does not and will not, itself, contribute results - result = result && (ORKDynamicCast(currentStep, ORKInstructionStep) == nil); - - return result; -} - - (BOOL)hasSaveableResults { /* [self result] would not include any results beyond current step, because managedResultsArray [self result] depends on only iterates over _managedStepIdentifiers. If the user hits the back button @@ -1244,17 +1340,14 @@ - (BOOL)hasSaveableResults { So, instead, use _managedResults to check all completed results for isSaveable. */ NSArray *results = _managedResults.allValues; - - BOOL result = NO; for (ORKStepResult *stepResult in results) { if ([stepResult isSaveable]) { - result = YES; - break; + return YES; } } - return result; + return NO; } - (IBAction)learnMoreAction:(id)sender { @@ -1264,7 +1357,7 @@ - (IBAction)learnMoreAction:(id)sender { } - (void)reportError:(NSError *)error onStep:(ORKStep *)step { - [self finishWithReason:ORKTaskViewControllerFinishReasonFailed error:error]; + [self finishWithReason:ORKTaskFinishReasonFailed error:error]; } - (void)flipToNextPageFrom:(ORKStepViewController *)fromController animated:(BOOL)animated { @@ -1302,11 +1395,10 @@ - (void)flipToNextPageFrom:(ORKStepViewController *)fromController animated:(BOO } } else { - if (fromController.isEarlyTerminationStep == YES) { - [self finishWithReason:ORKTaskViewControllerFinishReasonEarlyTermination error:nil]; + [self finishWithReason:ORKTaskFinishReasonEarlyTermination error:nil]; } else { - [self finishWithReason:ORKTaskViewControllerFinishReasonCompleted error:nil]; + [self finishWithReason:ORKTaskFinishReasonCompleted error:nil]; } } } else if ([self shouldPresentStep:step]) { @@ -1340,6 +1432,14 @@ - (void)restartTask { } } +- (void)flipToFirstPage { + ORKStep *firstStep = [_task stepAfterStep:nil withResult:[self result]]; + if (firstStep) { + [self.managedStepIdentifiers removeAllObjects]; + [self showStepViewController:[self viewControllerForStep:firstStep] goForward:NO animated:NO]; + } +} + - (void)flipToLastPage { ORKStep *initialCurrentStep = _currentStepViewController.step; ORKStep *lastStep = nil; @@ -1354,7 +1454,6 @@ - (void)flipToLastPage { } - (void)flipToPreviousPageFrom:(ORKStepViewController *)fromController animated:(BOOL)animated { - if (fromController != _currentStepViewController) { return; } @@ -1427,7 +1526,7 @@ - (void)stepViewController:(ORKStepViewController *)stepViewController didFinish } - (void)stepViewControllerDidFail:(ORKStepViewController *)stepViewController withError:(NSError *)error { - [self finishWithReason:ORKTaskViewControllerFinishReasonFailed error:error]; + [self finishWithReason:ORKTaskFinishReasonFailed error:error]; } - (void)stepViewControllerResultDidChange:(ORKStepViewController *)stepViewController { @@ -1485,6 +1584,10 @@ - (ORKTaskTotalProgress)stepViewControllerTotalProgressInfoForStep:(ORKStepViewC return progressData; } +- (nullable ORKTaskResult *)stepViewControllerOngoingResult:(ORKTaskViewController *)taskViewController { + return [self _resultIncludingUpdatedCurrentStepViewControllerResult:NO]; +} + #pragma mark - ORKReviewStepViewControllerDelegate - (void)reviewStepViewController:(ORKReviewStepViewController *)reviewStepViewController @@ -1498,6 +1601,8 @@ - (void)reviewStepViewController:(ORKReviewStepViewController *)reviewStepViewCo NSAssert(stepViewController != nil, @"A non-nil step should always generate a step view controller"); stepViewController.continueButtonTitle = ORKLocalizedString(@"BUTTON_SAVE", nil); stepViewController.parentReviewStep = (ORKReviewStep *) reviewStepViewController.step; + + [stepViewController enableBackNavigation]; stepViewController.skipButtonTitle = stepViewController.readOnlyMode ? ORKLocalizedString(@"BUTTON_READ_ONLY_MODE", nil) : ORKLocalizedString(@"BUTTON_CLEAR_ANSWER", nil); if (stepViewController.parentReviewStep.isStandalone) { stepViewController.navigationItem.title = stepViewController.parentReviewStep.title; @@ -1568,9 +1673,7 @@ - (void)decodeRestorableStateWithCoder:(NSCoder *)coder { // Must have a task object already provided by this point in the restoration, in order to restore any other state. if (_task) { - - // Recover partially entered results, even if we may not be able to jump to the desired step. - _managedResults = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, ORKResult.self]] forKey:_ORKManagedResultsRestoreKey]; + _managedResults = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableDictionary.self, NSString.self, ORKResult.self, ORKStepResult.self]] forKey:_ORKManagedResultsRestoreKey]; _managedStepIdentifiers = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSMutableArray.self, NSString.self]] forKey:_ORKManagedStepIdentifiersRestoreKey]; _restoredTaskIdentifier = [coder decodeObjectOfClass:[NSString class] forKey:_ORKTaskIdentifierRestoreKey]; @@ -1583,11 +1686,15 @@ - (void)decodeRestorableStateWithCoder:(NSCoder *)coder { } if ([_task respondsToSelector:@selector(stepWithIdentifier:)]) { +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION _requestedHealthTypesForRead = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSSet.self, HKObjectType.self]] forKey:_ORKRequestedHealthTypesForReadRestoreKey]; _requestedHealthTypesForWrite = [coder decodeObjectOfClasses:[NSSet setWithArray:@[NSSet.self, HKObjectType.self]] forKey:_ORKRequestedHealthTypesForWriteRestoreKey]; +#else + _requestedHealthTypesForRead = nil; + _requestedHealthTypesForWrite = nil; +#endif _presentedDate = [coder decodeObjectOfClass:[NSDate class] forKey:_ORKPresentedDate]; _lastBeginningInstructionStepIdentifier = [coder decodeObjectOfClass:[NSString class] forKey:_ORKLastBeginningInstructionStepIdentifierKey]; - _restoredStepIdentifier = [coder decodeObjectOfClass:[NSString class] forKey:_ORKStepIdentifierRestoreKey]; } else { ORK_Log_Info("Not restoring current step of task %@ because it does not implement -stepWithIdentifier:", _task.identifier); @@ -1597,7 +1704,7 @@ - (void)decodeRestorableStateWithCoder:(NSCoder *)coder { - (void)applicationFinishedRestoringState { [super applicationFinishedRestoringState]; - + if (!_task) { @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:@"Task must be provided to restore task view controller" @@ -1667,7 +1774,7 @@ - (UINavigationBar *)navigationBar { #pragma mark Review mode - (void)addStepResultsUntilStepWithIdentifier:(NSString *)stepIdentifier { - ORKTaskResult * taskResult = (ORKTaskResult *) _defaultResultSource; + ORKTaskResult *taskResult = (ORKTaskResult *)_defaultResultSource; for (ORKStepResult * stepResult in taskResult.results) { if (![stepIdentifier isEqualToString: stepResult.identifier]) { if (![_managedStepIdentifiers containsObject:stepResult.identifier]) { @@ -1682,7 +1789,7 @@ - (void)addStepResultsUntilStepWithIdentifier:(NSString *)stepIdentifier { } - (void)updateResultWithSource:(id)resultSource { - ORKTaskResult * taskResult = (ORKTaskResult *) resultSource; + ORKTaskResult *taskResult = (ORKTaskResult *)resultSource; for (ORKStepResult * stepResult in taskResult.results) { if (![_managedStepIdentifiers containsObject:stepResult.identifier]) { [_managedStepIdentifiers addObject:stepResult.identifier]; @@ -1731,9 +1838,8 @@ - (void)setReviewInstructionStep:(ORKInstructionStep *)reviewInstructionStep { #pragma mark ORKTaskReviewViewControllerDelegate - (void)doneButtonTappedWithResultSource:(id)resultSource { - // FIXME: might need to queue the operations if the number of steps are too many. open to debate. [self updateResultWithSource:resultSource]; - [self finishWithReason:ORKTaskViewControllerFinishReasonCompleted error:nil]; + [self finishWithReason:ORKTaskFinishReasonCompleted error:nil]; } - (void)editAnswerTappedForStepWithIdentifier:(NSString *)stepIdentifier { @@ -1764,23 +1870,19 @@ - (void)navigationController:(UINavigationController *)navigationController didS - (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController { // If dismissed with a swipe, `finishWithReason:error:` should be called with `discarded` - [self finishWithReason:ORKTaskViewControllerFinishReasonDiscarded error:nil]; + [self finishWithReason:ORKTaskFinishReasonDiscarded error:nil]; } #pragma mark - UINavigationBarAppearance - (void)setNavigationBarColor:(UIColor *)color { - if (@available(iOS 13.0, *)) { - UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init]; - [appearance configureWithOpaqueBackground]; - appearance.shadowColor = nil; - appearance.backgroundColor = color; - self.navigationBar.standardAppearance = appearance; - self.navigationBar.scrollEdgeAppearance = appearance; - self.navigationBar.compactAppearance = appearance; - } else { - [self.navigationBar setBarTintColor:color]; - } + UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc] init]; + [appearance configureWithOpaqueBackground]; + appearance.shadowColor = nil; + appearance.backgroundColor = color; + self.navigationBar.standardAppearance = appearance; + self.navigationBar.scrollEdgeAppearance = appearance; + self.navigationBar.compactAppearance = appearance; } @end diff --git a/ResearchKit/Common/ORKTaskViewController_Internal.h b/ResearchKitUI/Common/Task/ORKTaskViewController_Internal.h similarity index 93% rename from ResearchKit/Common/ORKTaskViewController_Internal.h rename to ResearchKitUI/Common/Task/ORKTaskViewController_Internal.h index dad7d08ffb..bce1b51ae3 100644 --- a/ResearchKit/Common/ORKTaskViewController_Internal.h +++ b/ResearchKitUI/Common/Task/ORKTaskViewController_Internal.h @@ -29,11 +29,13 @@ */ -#import -#import #import -@import HealthKit; +#import +#import +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION +#import +#endif NS_ASSUME_NONNULL_BEGIN @@ -49,6 +51,7 @@ NS_ASSUME_NONNULL_BEGIN // Any StepVC contains a vertical scroll view should register here. // So taskVC can monitor scroll view's content offset and update hairline's alpha. @property (nonatomic, weak, nullable) UIScrollView *registeredScrollView; + @property (nonatomic, weak, nullable) NSString *restoredStepIdentifier; @property (nonatomic, nullable) NSMutableArray *managedStepIdentifiers; @property (nonatomic, nullable) NSMutableDictionary *managedResults; @@ -59,6 +62,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)restartTask; +- (void)flipToFirstPage; - (void)flipToLastPage; @end diff --git a/ResearchKit/Common/ORKTaskViewController_Private.h b/ResearchKitUI/Common/Task/ORKTaskViewController_Private.h similarity index 77% rename from ResearchKit/Common/ORKTaskViewController_Private.h rename to ResearchKitUI/Common/Task/ORKTaskViewController_Private.h index 4ccecda6d8..b7a8b2ddb3 100644 --- a/ResearchKit/Common/ORKTaskViewController_Private.h +++ b/ResearchKitUI/Common/Task/ORKTaskViewController_Private.h @@ -29,45 +29,25 @@ */ -#import +#import NS_ASSUME_NONNULL_BEGIN @interface ORKTaskViewController (ORKActiveTaskSupport) -/** - Suspends the task. - - Call this method to suspend an active step. To resume later, call - `resume`. Not all active steps will respond to `suspend` / `resume`, so test - thoroughly to verify correct behavior in your tasks. - - This method will disable any background audio prompt session, and suspend - any active step in progress. - */ -- (void)suspend; - -/** - Resumes any current active step. - - Call this method to force resuming an active step may call this - method. Should be paired with a call to `suspend`. - - This method re-enables background audio prompts, if needed, and resumes - any active step. If not in an active step, it has no effect. - - See also: `suspend` - */ -- (void)resume; - - /** Creates a default step view controller suitable for presenting the passed step, and, if applicable, prefills its results using the `defaultResultSource`. */ - (ORKStepViewController *)viewControllerForStep:(ORKStep *)step; +- (void)didFinishWithReason:(ORKTaskFinishReason)reason error:(nullable NSError *)error; + +- (BOOL)handlePermissionRequestsDeniedForStep:(ORKStep *)step error:(NSError **)outError; + +- (BOOL)canPerformAnimatedNavigationFromStep:(ORKStep *)step; + - (void)stepViewController:(ORKStepViewController *)stepViewController didFinishWithNavigationDirection:(ORKStepViewControllerNavigationDirection)direction animated:(BOOL)animated; @@ -80,6 +60,8 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)goToStepWithIdentifier:(NSString *)identifier; +- (void)handleResponseFromAudioRequest:(BOOL)success; + @end NS_ASSUME_NONNULL_END diff --git a/ResearchKit/Common/UIBarButtonItem+ORKBarButtonItem.h b/ResearchKitUI/Common/UIKitCategories/UIBarButtonItem+ORKBarButtonItem.h similarity index 98% rename from ResearchKit/Common/UIBarButtonItem+ORKBarButtonItem.h rename to ResearchKitUI/Common/UIKitCategories/UIBarButtonItem+ORKBarButtonItem.h index 2e44e8693b..aef3843e64 100644 --- a/ResearchKit/Common/UIBarButtonItem+ORKBarButtonItem.h +++ b/ResearchKitUI/Common/UIKitCategories/UIBarButtonItem+ORKBarButtonItem.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKitUI/Common/UIKitCategories/UIBarButtonItem+ORKBarButtonItem.m b/ResearchKitUI/Common/UIKitCategories/UIBarButtonItem+ORKBarButtonItem.m new file mode 100644 index 0000000000..7e2810b04a --- /dev/null +++ b/ResearchKitUI/Common/UIKitCategories/UIBarButtonItem+ORKBarButtonItem.m @@ -0,0 +1,55 @@ +/* + Copyright (c) 2015, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#import "UIBarButtonItem+ORKBarButtonItem.h" + +#import "ORKHelpers_Internal.h" + + +@implementation UIBarButtonItem (ORKBarButtonItem) + ++ (UIBarButtonItem *)ork_backBarButtonItemWithTarget:(id)target action:(SEL)selector { + NSString *imageName = @"chevron.left"; + if ([UIApplication sharedApplication].userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft ) { + imageName = @"chevron.right"; + } + + UIImage *image = [UIImage systemImageNamed:imageName]; + UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:image + landscapeImagePhone:image + style:UIBarButtonItemStyleDone + target:target + action:selector]; + item.accessibilityLabel = ORKLocalizedString(@"AX_BUTTON_BACK", nil); + return item; +} + +@end diff --git a/ResearchKit/Common/UIImage+ResearchKit.h b/ResearchKitUI/Common/UIKitCategories/UIImage+ResearchKit.h similarity index 93% rename from ResearchKit/Common/UIImage+ResearchKit.h rename to ResearchKitUI/Common/UIKitCategories/UIImage+ResearchKit.h index d499f4df5c..5f50e8f2fd 100644 --- a/ResearchKit/Common/UIImage+ResearchKit.h +++ b/ResearchKitUI/Common/UIKitCategories/UIImage+ResearchKit.h @@ -35,5 +35,6 @@ @interface UIImage (ResearchKit) - (UIImage *)ork_flippedImage:(UIImageOrientation)orientation; +- (UIImage *)ork_imageWithRenderingModeForUserInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle API_AVAILABLE(ios(12.0)); @end diff --git a/ResearchKit/Common/UIImage+ResearchKit.m b/ResearchKitUI/Common/UIKitCategories/UIImage+ResearchKit.m similarity index 95% rename from ResearchKit/Common/UIImage+ResearchKit.m rename to ResearchKitUI/Common/UIKitCategories/UIImage+ResearchKit.m index 9f5d1e18c7..d20cf0d9ff 100644 --- a/ResearchKit/Common/UIImage+ResearchKit.m +++ b/ResearchKitUI/Common/UIKitCategories/UIImage+ResearchKit.m @@ -116,4 +116,8 @@ - (UIImage *)ork_flippedImage:(UIImageOrientation)orientation { } } +- (UIImage *)ork_imageWithRenderingModeForUserInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle { + return userInterfaceStyle == UIUserInterfaceStyleDark ? [self imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] : [self imageWithRenderingMode:UIImageRenderingModeAutomatic]; +} + @end diff --git a/ResearchKitUI/Common/UIKitCategories/UIImageView+ResearchKit.h b/ResearchKitUI/Common/UIKitCategories/UIImageView+ResearchKit.h new file mode 100644 index 0000000000..30b0647c9f --- /dev/null +++ b/ResearchKitUI/Common/UIKitCategories/UIImageView+ResearchKit.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIImageView (ResearchKit) + +- (void)updateRenderingModeForUserInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle API_AVAILABLE(ios(12.0)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/ResearchKitUI/Common/UIKitCategories/UIImageView+ResearchKit.m b/ResearchKitUI/Common/UIKitCategories/UIImageView+ResearchKit.m new file mode 100644 index 0000000000..11bf43dc03 --- /dev/null +++ b/ResearchKitUI/Common/UIKitCategories/UIImageView+ResearchKit.m @@ -0,0 +1,40 @@ +/* + Copyright (c) 2023, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "UIImage+ResearchKit.h" +#import "UIImageView+ResearchKit.h" + +@implementation UIImageView (ResearchKit) + +- (void)updateRenderingModeForUserInterfaceStyle:(UIUserInterfaceStyle)userInterfaceStyle { + self.image = [self.image ork_imageWithRenderingModeForUserInterfaceStyle:userInterfaceStyle]; +} + +@end diff --git a/ResearchKit/Common/UIResponder+ResearchKit.h b/ResearchKitUI/Common/UIKitCategories/UIResponder+ResearchKit.h similarity index 98% rename from ResearchKit/Common/UIResponder+ResearchKit.h rename to ResearchKitUI/Common/UIKitCategories/UIResponder+ResearchKit.h index 1e17c38861..89771b51aa 100644 --- a/ResearchKit/Common/UIResponder+ResearchKit.h +++ b/ResearchKitUI/Common/UIKitCategories/UIResponder+ResearchKit.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/UIResponder+ResearchKit.m b/ResearchKitUI/Common/UIKitCategories/UIResponder+ResearchKit.m similarity index 100% rename from ResearchKit/Common/UIResponder+ResearchKit.m rename to ResearchKitUI/Common/UIKitCategories/UIResponder+ResearchKit.m diff --git a/ResearchKitUI/Info-iOS.plist b/ResearchKitUI/Info-iOS.plist new file mode 100644 index 0000000000..a495e5e6bb --- /dev/null +++ b/ResearchKitUI/Info-iOS.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + ResearchKitUI + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ResearchKitUI + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(ORK_FRAMEWORK_BUILD_NUMBER) + + diff --git a/ResearchKitUI/Info.plist b/ResearchKitUI/Info.plist new file mode 100644 index 0000000000..9bcb244429 --- /dev/null +++ b/ResearchKitUI/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/ResearchKitUI/Localized/en.lproj/ResearchKitUI.strings b/ResearchKitUI/Localized/en.lproj/ResearchKitUI.strings new file mode 100644 index 0000000000..bd90420601 --- /dev/null +++ b/ResearchKitUI/Localized/en.lproj/ResearchKitUI.strings @@ -0,0 +1,31 @@ +/* + Copyright (c) 2020, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +"BUTTON_CANCEL" = "Cancel"; diff --git a/ResearchKit/Onboarding/ORKLoginStepViewController.h b/ResearchKitUI/Onboarding/Account/ORKLoginStepViewController.h similarity index 96% rename from ResearchKit/Onboarding/ORKLoginStepViewController.h rename to ResearchKitUI/Onboarding/Account/ORKLoginStepViewController.h index eb35117c6e..911456c50a 100644 --- a/ResearchKit/Onboarding/ORKLoginStepViewController.h +++ b/ResearchKitUI/Onboarding/Account/ORKLoginStepViewController.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Onboarding/ORKLoginStepViewController.m b/ResearchKitUI/Onboarding/Account/ORKLoginStepViewController.m similarity index 97% rename from ResearchKit/Onboarding/ORKLoginStepViewController.m rename to ResearchKitUI/Onboarding/Account/ORKLoginStepViewController.m index 82edc1df40..8e0bdd96f0 100644 --- a/ResearchKit/Onboarding/ORKLoginStepViewController.m +++ b/ResearchKitUI/Onboarding/Account/ORKLoginStepViewController.m @@ -62,7 +62,7 @@ - (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem { - (void)cancelButtonHandler:(id)sender { ORKStrongTypeOf(self.taskViewController.delegate) strongDelegate = self.taskViewController.delegate; if ([strongDelegate respondsToSelector:@selector(taskViewController:didFinishWithReason:error:)]) { - [strongDelegate taskViewController:self.taskViewController didFinishWithReason:ORKTaskViewControllerFinishReasonDiscarded error:nil]; + [strongDelegate taskViewController:self.taskViewController didFinishWithReason:ORKTaskFinishReasonDiscarded error:nil]; } } diff --git a/ResearchKit/Onboarding/ORKVerificationStepView.h b/ResearchKitUI/Onboarding/Account/ORKVerificationStepView.h similarity index 100% rename from ResearchKit/Onboarding/ORKVerificationStepView.h rename to ResearchKitUI/Onboarding/Account/ORKVerificationStepView.h diff --git a/ResearchKit/Onboarding/ORKVerificationStepView.m b/ResearchKitUI/Onboarding/Account/ORKVerificationStepView.m similarity index 100% rename from ResearchKit/Onboarding/ORKVerificationStepView.m rename to ResearchKitUI/Onboarding/Account/ORKVerificationStepView.m diff --git a/ResearchKit/Onboarding/ORKVerificationStepViewController.h b/ResearchKitUI/Onboarding/Account/ORKVerificationStepViewController.h similarity index 96% rename from ResearchKit/Onboarding/ORKVerificationStepViewController.h rename to ResearchKitUI/Onboarding/Account/ORKVerificationStepViewController.h index e3f1948390..8d01c12250 100644 --- a/ResearchKit/Onboarding/ORKVerificationStepViewController.h +++ b/ResearchKitUI/Onboarding/Account/ORKVerificationStepViewController.h @@ -29,8 +29,8 @@ */ -@import UIKit; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Onboarding/ORKVerificationStepViewController.m b/ResearchKitUI/Onboarding/Account/ORKVerificationStepViewController.m similarity index 93% rename from ResearchKit/Onboarding/ORKVerificationStepViewController.m rename to ResearchKitUI/Onboarding/Account/ORKVerificationStepViewController.m index 29e35fdc59..ab3263b840 100644 --- a/ResearchKit/Onboarding/ORKVerificationStepViewController.m +++ b/ResearchKitUI/Onboarding/Account/ORKVerificationStepViewController.m @@ -41,6 +41,9 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKHelpers_Internal.h" #import "ORKSkin.h" +NSString * const ORKVerificationStepViewAccessibilityIdentifier = @"ORKVerificationStepView"; +NSString * const ORKVerificationStepViewResendEmailButtonAccessibilityIdentifier = @"ORKVerificationStepViewResendEmailButton"; + @implementation ORKVerificationStepViewController { ORKVerificationStepView *_verificationStepView; NSArray *_constraints; @@ -59,6 +62,7 @@ - (void)stepDidChange { _verificationStepView = [ORKVerificationStepView new]; _verificationStepView.headerView.instructionLabel.text = [[self verificationStep].text stringByAppendingString:[NSString stringWithFormat:@"\n\n%@", ORKLocalizedString(@"RESEND_EMAIL_LABEL_MESSAGE", nil)]]; + _verificationStepView.accessibilityIdentifier = ORKVerificationStepViewAccessibilityIdentifier; _iPadContentView = [self viewForiPadLayoutConstraints]; if (_iPadContentView) { @@ -71,6 +75,7 @@ - (void)stepDidChange { [_verificationStepView.resendEmailButton addTarget:self action:@selector(resendEmailButtonHandler:) forControlEvents:UIControlEventTouchUpInside]; + _verificationStepView.resendEmailButton.accessibilityIdentifier = ORKVerificationStepViewResendEmailButtonAccessibilityIdentifier; } } diff --git a/ResearchKitUI/PrivacyInfo.xcprivacy b/ResearchKitUI/PrivacyInfo.xcprivacy new file mode 100644 index 0000000000..42deda33af --- /dev/null +++ b/ResearchKitUI/PrivacyInfo.xcprivacy @@ -0,0 +1,63 @@ + + + + + NSPrivacyAccessedAPITypes + + NSPrivacyTracking + + NSPrivacyTrackingDomains + + NSPrivacyCollectedDataTypes + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePhotosorVideos + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeSensitiveInfo + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypeHealth + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + NSPrivacyCollectedDataType + NSPrivacyCollectedDataTypePreciseLocation + NSPrivacyCollectedDataTypeLinked + + NSPrivacyCollectedDataTypeTracking + + NSPrivacyCollectedDataTypePurposes + + NSPrivacyCollectedDataTypePurposeAppFunctionality + + + + + diff --git a/ResearchKitUI/ResearchKitUI.docc/ResearchKitUI.md b/ResearchKitUI/ResearchKitUI.docc/ResearchKitUI.md new file mode 100644 index 0000000000..4e00b181d5 --- /dev/null +++ b/ResearchKitUI/ResearchKitUI.docc/ResearchKitUI.md @@ -0,0 +1,53 @@ +# ``ResearchKitUI`` + +Present ResearchKit model objects. + +## Overview + +ResearchKitUI contains UI to present your configured ResearchKit task. + +## Topics + +### View Controllers + +- ``ORKCompletionStepViewController`` +- ``ORKCustomStepViewController`` +- ``ORKFormStepViewController`` +- ``ORKInstructionStepViewController`` +- ``ORKLearnMoreStepViewController`` +- ``ORKLoginStepViewController`` +- ``ORKPageStepViewController`` +- ``ORKPasscodeViewController`` +- ``ORKPDFViewerStepViewController`` +- ``ORKReviewViewController`` +- ``ORKStepViewController`` +- ``ORKTableStepViewController`` +- ``ORKTaskViewController`` +- ``ORKVerificationStepViewController`` +- ``ORKWaitStepViewController`` +- ``ORKWebViewStepViewController`` + +### Delegates + +- ``ORKCustomSignatureFooterViewStatusDelegate`` +- ``ORKPasscodeDelegate`` +- ``ORKReviewViewControllerDelegate`` +- ``ORKSignatureViewDelegate`` +- ``ORKStepViewControllerDelegate`` +- ``ORKTaskViewControllerDelegate`` +- ``ORKWebViewStepDelegate`` + +### Other + +- ``ORKBorderedButton`` +- ``ORKBorderedButtonDisabledStyle`` +- ``ORKCompletionStepIdentifier`` +- ``ORKContinueButton`` +- ``ORKPlaybackButton`` +- ``ORKSignatureView`` +- ``ORKStepViewControllerNavigationDirection`` +- ``ORKTaskViewControllerFinishReason`` +- ``ORKTaskViewControllerProgressMode`` +- ``ORKTaskViewControllerReviewMode`` +- ``ORKTextButton`` +- ``SwiftUIViewFactory`` diff --git a/ResearchKitUI/ResearchKitUI.h b/ResearchKitUI/ResearchKitUI.h new file mode 100644 index 0000000000..7cfc609518 --- /dev/null +++ b/ResearchKitUI/ResearchKitUI.h @@ -0,0 +1,124 @@ +/* + Copyright (c) 2020, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ResearchKitUI/ResearchKitUI.modulemap b/ResearchKitUI/ResearchKitUI.modulemap new file mode 100644 index 0000000000..bc24f67f20 --- /dev/null +++ b/ResearchKitUI/ResearchKitUI.modulemap @@ -0,0 +1,8 @@ +framework module ResearchKitUI { + umbrella header "ResearchKitUI.h" + module iOS { + exclude header "ORKColorChoiceCellGroup.h" + } + export * + module * { export * } +} diff --git a/ResearchKitUI/ResearchKitUI_Private.h b/ResearchKitUI/ResearchKitUI_Private.h new file mode 100644 index 0000000000..49e09aa60e --- /dev/null +++ b/ResearchKitUI/ResearchKitUI_Private.h @@ -0,0 +1,58 @@ +/* + Copyright (c) 2022, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/ResearchKitUI/ResearchKitUI_Private.modulemap b/ResearchKitUI/ResearchKitUI_Private.modulemap new file mode 100644 index 0000000000..b490d6475b --- /dev/null +++ b/ResearchKitUI/ResearchKitUI_Private.modulemap @@ -0,0 +1,36 @@ +/* + Copyright (c) 2024, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +framework module ResearchKitUI_Private { + umbrella header "ResearchKitUI_Private.h" + + export * + module * { export * } +} diff --git a/ResearchKit/Consent/ORKConsentLearnMoreViewController.h b/ResearchKitUI/Stale/ORKConsentLearnMoreViewController.h similarity index 98% rename from ResearchKit/Consent/ORKConsentLearnMoreViewController.h rename to ResearchKitUI/Stale/ORKConsentLearnMoreViewController.h index 6129c43264..facc4b3d85 100644 --- a/ResearchKit/Consent/ORKConsentLearnMoreViewController.h +++ b/ResearchKitUI/Stale/ORKConsentLearnMoreViewController.h @@ -29,7 +29,7 @@ */ -@import UIKit; +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Consent/ORKConsentLearnMoreViewController.m b/ResearchKitUI/Stale/ORKConsentLearnMoreViewController.m similarity index 100% rename from ResearchKit/Consent/ORKConsentLearnMoreViewController.m rename to ResearchKitUI/Stale/ORKConsentLearnMoreViewController.m diff --git a/ResearchKit/Consent/ORKConsentReviewController.h b/ResearchKitUI/Stale/ORKConsentReviewController.h similarity index 98% rename from ResearchKit/Consent/ORKConsentReviewController.h rename to ResearchKitUI/Stale/ORKConsentReviewController.h index deadb54dba..d778169441 100644 --- a/ResearchKit/Consent/ORKConsentReviewController.h +++ b/ResearchKitUI/Stale/ORKConsentReviewController.h @@ -29,8 +29,8 @@ */ -@import UIKit; -@import WebKit; +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Consent/ORKConsentReviewController.m b/ResearchKitUI/Stale/ORKConsentReviewController.m similarity index 100% rename from ResearchKit/Consent/ORKConsentReviewController.m rename to ResearchKitUI/Stale/ORKConsentReviewController.m diff --git a/ResearchKit/Consent/ORKConsentReviewStepViewController.h b/ResearchKitUI/Stale/ORKConsentReviewStepViewController.h similarity index 97% rename from ResearchKit/Consent/ORKConsentReviewStepViewController.h rename to ResearchKitUI/Stale/ORKConsentReviewStepViewController.h index 4e6d0c16a7..d96ed86c6f 100644 --- a/ResearchKit/Consent/ORKConsentReviewStepViewController.h +++ b/ResearchKitUI/Stale/ORKConsentReviewStepViewController.h @@ -29,9 +29,9 @@ */ -@import Foundation; +#import #import -#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Consent/ORKConsentReviewStepViewController.m b/ResearchKitUI/Stale/ORKConsentReviewStepViewController.m similarity index 98% rename from ResearchKit/Consent/ORKConsentReviewStepViewController.m rename to ResearchKitUI/Stale/ORKConsentReviewStepViewController.m index 4fc350dd14..88410c5efa 100644 --- a/ResearchKit/Consent/ORKConsentReviewStepViewController.m +++ b/ResearchKitUI/Stale/ORKConsentReviewStepViewController.m @@ -252,7 +252,10 @@ - (ORKConsentReviewController *)makeDocumentReviewViewController { NSString *html = [document mobileHTMLWithTitle:ORKLocalizedString(@"CONSENT_REVIEW_TITLE", nil) detail:ORKLocalizedString(@"CONSENT_REVIEW_INSTRUCTION", nil)]; - ORKConsentReviewController *reviewViewController = [[ORKConsentReviewController alloc] initWithHTML:html delegate:self requiresScrollToBottom:[[self consentReviewStep] requiresScrollToBottom]]; + ORKConsentReviewController *reviewViewController = [[ORKConsentReviewController alloc] + initWithHTML:html + delegate:self + requiresScrollToBottom:[[self consentReviewStep] requiresScrollToBottom]]; if (ORKNeedWideScreenDesign(self.view)) { [reviewViewController setTextForiPadStepTitleLabel:self.title]; } diff --git a/ResearchKit/Consent/ORKConsentSharingStepViewController.h b/ResearchKitUI/Stale/ORKConsentSharingStepViewController.h similarity index 92% rename from ResearchKit/Consent/ORKConsentSharingStepViewController.h rename to ResearchKitUI/Stale/ORKConsentSharingStepViewController.h index 4447ea66d3..705ec12d36 100644 --- a/ResearchKit/Consent/ORKConsentSharingStepViewController.h +++ b/ResearchKitUI/Stale/ORKConsentSharingStepViewController.h @@ -29,8 +29,8 @@ */ -@import Foundation; -#import +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN task. */ ORK_CLASS_AVAILABLE -@interface ORKConsentSharingStepViewController : ORKQuestionStepViewController +@interface ORKConsentSharingStepViewController : ORKFormStepViewController @end diff --git a/ResearchKit/Consent/ORKConsentSharingStepViewController.m b/ResearchKitUI/Stale/ORKConsentSharingStepViewController.m similarity index 100% rename from ResearchKit/Consent/ORKConsentSharingStepViewController.m rename to ResearchKitUI/Stale/ORKConsentSharingStepViewController.m diff --git a/ResearchKit/Common/ORKQuestionStepView.h b/ResearchKitUI/Stale/ORKQuestionStepView.h similarity index 100% rename from ResearchKit/Common/ORKQuestionStepView.h rename to ResearchKitUI/Stale/ORKQuestionStepView.h diff --git a/ResearchKit/Common/ORKQuestionStepView.m b/ResearchKitUI/Stale/ORKQuestionStepView.m similarity index 100% rename from ResearchKit/Common/ORKQuestionStepView.m rename to ResearchKitUI/Stale/ORKQuestionStepView.m diff --git a/ResearchKit/Common/ORKQuestionStepViewController.h b/ResearchKitUI/Stale/ORKQuestionStepViewController.h similarity index 96% rename from ResearchKit/Common/ORKQuestionStepViewController.h rename to ResearchKitUI/Stale/ORKQuestionStepViewController.h index 7367376859..df64e7be82 100644 --- a/ResearchKit/Common/ORKQuestionStepViewController.h +++ b/ResearchKitUI/Stale/ORKQuestionStepViewController.h @@ -29,9 +29,8 @@ */ -@import UIKit; -#import -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/ResearchKit/Common/ORKQuestionStepViewController.m b/ResearchKitUI/Stale/ORKQuestionStepViewController.m similarity index 96% rename from ResearchKit/Common/ORKQuestionStepViewController.m rename to ResearchKitUI/Stale/ORKQuestionStepViewController.m index 9759be87b8..464f54c13e 100644 --- a/ResearchKit/Common/ORKQuestionStepViewController.m +++ b/ResearchKitUI/Stale/ORKQuestionStepViewController.m @@ -46,12 +46,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKTableContainerView.h" #import "ORKSurveyCardHeaderView.h" #import "ORKTextChoiceCellGroup.h" -#import "ORKBodyItem.h" #import "ORKNavigationContainerView_Internal.h" #import "ORKStepViewController_Internal.h" #import "ORKTaskViewController_Internal.h" +#import "ORKBodyItem.h" #import "ORKAnswerFormat_Internal.h" #import "ORKCollectionResult_Private.h" #import "ORKQuestionResult_Private.h" @@ -60,13 +60,13 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #import "ORKResult_Private.h" #import "ORKStep_Private.h" #import "ORKStepContentView.h" +#import "ORKChoiceViewCell+ORKTextChoice.h" #import "ORKHelpers_Internal.h" #import "ORKSkin.h" - #import -#import +#import typedef NS_ENUM(NSInteger, ORKQuestionSection) { @@ -147,7 +147,9 @@ - (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result { - (instancetype)initWithStep:(ORKStep *)step { self = [super initWithStep:step]; if (self) { +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION _defaultSource = [ORKAnswerDefaultSource sourceWithHealthStore:[HKHealthStore new]]; +#endif } return self; } @@ -193,7 +195,6 @@ - (void)stepDidChange { } else { [_tableView setBackgroundColor:ORKColor(ORKBackgroundColorKey)]; } - [self.taskViewController setNavigationBarColor:[_tableView backgroundColor]]; [self.view setBackgroundColor:[_tableView backgroundColor]]; } @@ -314,7 +315,6 @@ - (void)stepDidChange { } else { [_questionView setBackgroundColor:ORKColor(ORKBackgroundColorKey)]; } - [self.taskViewController setNavigationBarColor:[_questionView backgroundColor]]; [self.view setBackgroundColor:[_questionView backgroundColor]]; ORKLearnMoreView *learnMoreView; @@ -377,7 +377,7 @@ - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; if (_tableContainer) { [_tableContainer sizeHeaderToFit]; - [_tableContainer resizeFooterToFit]; + [_tableContainer resizeFooterToFitUsingMinHeight:NO]; } } @@ -432,8 +432,10 @@ - (void)viewDidLoad { } - (BOOL)showValidityAlertWithMessage:(NSString *)text { - // Ignore if our answer is null - if (self.answer == ORKNullAnswerValue()) { + BOOL isTextAnswerFormat = [self.answerFormat isKindOfClass:[ORKTextAnswerFormat class]]; + // If isTextAnswerFormat, we still want to show the error if the answer is null + // Otherwise ignore if our answer is null, + if (!isTextAnswerFormat && self.answer == ORKNullAnswerValue()) { return NO; } @@ -447,7 +449,7 @@ - (void)viewWillAppear:(BOOL)animated { [self.taskViewController setRegisteredScrollView:_tableView]; } - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION NSMutableSet *types = [NSMutableSet set]; ORKAnswerFormat *format = [[self questionStep] answerFormat]; HKObjectType *objType = [format healthKitObjectTypeForAuthorization]; @@ -472,7 +474,7 @@ - (void)viewWillAppear:(BOOL)animated { if (!scheduledRefresh) { [self refreshDefaults]; } - +#endif if (_tableView) { [_tableView reloadData]; } @@ -556,10 +558,6 @@ - (void)setCustomQuestionView:(ORKQuestionStepCustomView *)customQuestionView { } - (void)updateButtonStates { - if ([self isStepImmediateNavigation]) { -// _navigationFooterView.neverHasContinueButton = YES; -// _navigationFooterView.continueButtonItem = nil; - } _navigationFooterView.continueEnabled = [self continueButtonEnabled]; _navigationFooterView.skipEnabled = [self skipButtonEnabled]; @@ -583,11 +581,9 @@ - (void)setSkipButtonItem:(UIBarButtonItem *)skipButtonItem { [self updateButtonStates]; } -- (ORKStepResult *)result -{ +- (ORKStepResult *)result { ORKStepResult *parentResult = [super result]; - ORKQuestionStep *questionStep = self.questionStep; if (self.answer) { @@ -700,6 +696,7 @@ - (BOOL)allowContinue { // Not to use `ImmediateNavigation` when current step already has an answer. // So user is able to review the answer when it is present. - (BOOL)isStepImmediateNavigation { +// return [self.questionStep isFormatImmediateNavigation] && [self hasAnswer] == NO && !self.isBeingReviewed; return NO; } @@ -775,7 +772,7 @@ - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger hasMultipleChoiceFormItem = YES; } - return [[ORKSurveyCardHeaderView alloc] initWithTitle:self.questionStep.question detailText:self.questionStep.detailText learnMoreView:learnMoreView progressText:sectionProgressText tagText:self.questionStep.tagText showBorder:NO hasMultipleChoiceItem:hasMultipleChoiceFormItem]; + return [[ORKSurveyCardHeaderView alloc] initWithTitle:self.questionStep.question detailText:self.questionStep.detailText learnMoreView:learnMoreView progressText:sectionProgressText tagText:self.questionStep.tagText showBorder:NO hasMultipleChoiceItem:hasMultipleChoiceFormItem shouldIgnoreDarkMode:NO]; } return nil; } @@ -787,9 +784,9 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger if (!_choiceCellGroup) { ORKTextChoiceCellGroup *extractedExpr = [ORKTextChoiceCellGroup alloc]; _choiceCellGroup = [extractedExpr initWithTextChoiceAnswerFormat:(ORKTextChoiceAnswerFormat *)impliedAnswerFormat - answer:self.answer - beginningIndexPath:[NSIndexPath indexPathForRow:0 inSection:section] - immediateNavigation:[self isStepImmediateNavigation]]; + answer:self.answer + beginningIndexPath:[NSIndexPath indexPathForRow:0 inSection:section] + immediateNavigation:[self isStepImmediateNavigation]]; _choiceCellGroup.delegate = self; _choiceCellGroup.presentationStyle = [[self questionStep] presentationStyle]; @@ -816,7 +813,9 @@ - (ORKSurveyAnswerCell *)answerCellForTableView:(UITableView *)tableView { @(ORKQuestionTypeWeight) : [ORKSurveyAnswerCellForPicker class], @(ORKQuestionTypeMultiplePicker) : [ORKSurveyAnswerCellForPicker class], @(ORKQuestionTypeInteger): [ORKSurveyAnswerCellForNumber class], +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION @(ORKQuestionTypeLocation): [ORKSurveyAnswerCellForLocation class], +#endif @(ORKQuestionTypeSES): [ORKSurveyAnswerCellForSES class]}; }); @@ -873,10 +872,15 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N identifier = [NSStringFromClass([self class]) stringByAppendingFormat:@"%@", @(indexPath.row)]; ORKChoiceViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; + BOOL isLastItem = indexPath.row == _choiceCellGroup.size - 1; if (!cell) { cell = [_choiceCellGroup cellAtIndexPath:indexPath withReuseIdentifier:identifier]; } + if ([cell isKindOfClass:[ORKChoiceViewCell class]]) { + [cell configureWithTextChoice:[_choiceCellGroup textChoiceForIndex:indexPath.row] isLastItem:isLastItem]; + } + if ([cell isKindOfClass:[ORKChoiceOtherViewCell class]]) { ORKChoiceOtherViewCell *otherCell = (ORKChoiceOtherViewCell *)cell; otherCell.delegate = self; @@ -885,7 +889,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.userInteractionEnabled = !self.readOnlyMode; cell.useCardView = self.questionStep.useCardView; - cell.isLastItem = indexPath.row == _choiceCellGroup.size - 1; + cell.isLastItem = isLastItem; cell.isFirstItemInSectionWithoutTitle = (indexPath.row == 0 && ![self questionStep].question); return cell; } @@ -1089,6 +1093,10 @@ - (void)textChoiceOtherCellDidResignFirstResponder:(ORKChoiceOtherViewCell *)cho [_choiceCellGroup textViewDidResignResponderForCellAtIndexPath:indexPath]; } +- (void)textChoiceOtherCellDidChangeText:(NSString *)text choiceOtherCell:(ORKChoiceOtherViewCell *)choiceOtherViewCell { + // Satisfies protocol conformance +} + #pragma mark - ORKLearnViewDelegate - (void)learnMoreButtonPressedWithStep:(ORKLearnMoreInstructionStep *)learnMoreStep { diff --git a/ResearchKit/Common/ORKQuestionStepViewController_Private.h b/ResearchKitUI/Stale/ORKQuestionStepViewController_Private.h similarity index 95% rename from ResearchKit/Common/ORKQuestionStepViewController_Private.h rename to ResearchKitUI/Stale/ORKQuestionStepViewController_Private.h index 204bed44d4..cc25508925 100644 --- a/ResearchKit/Common/ORKQuestionStepViewController_Private.h +++ b/ResearchKitUI/Stale/ORKQuestionStepViewController_Private.h @@ -29,8 +29,8 @@ */ -#import -#import +#import +#import NS_ASSUME_NONNULL_BEGIN diff --git a/Testing/ORKTest/ORKTest.xcodeproj/project.pbxproj b/Testing/ORKTest/ORKTest.xcodeproj/project.pbxproj deleted file mode 100644 index d64c4b5b07..0000000000 --- a/Testing/ORKTest/ORKTest.xcodeproj/project.pbxproj +++ /dev/null @@ -1,857 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 24D002781BA2268D001BF82F /* ORKKeychainWrapperTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 24D002771BA2268D001BF82F /* ORKKeychainWrapperTests.m */; }; - 335418E91B118EAD00A38F5E /* SAMPLE_PDF_TEST.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 335418E81B118EAD00A38F5E /* SAMPLE_PDF_TEST.pdf */; }; - 5D2DEA6324DB618B000A2A5B /* ORKESerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D2DEA5D24DB618A000A2A5B /* ORKESerialization.m */; }; - 712977A922B0917A0049213B /* ResearchKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 712977A622B091500049213B /* ResearchKit.framework */; }; - 712977AA22B0917A0049213B /* ResearchKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 712977A622B091500049213B /* ResearchKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 866DA52E1D63D1EE00C9AF3F /* ORKDataCollectionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 866DA52D1D63D1EE00C9AF3F /* ORKDataCollectionTests.m */; }; - 86717A901AC0C0FE00AC2A23 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 86717A8F1AC0C0FE00AC2A23 /* main.m */; }; - 86717A931AC0C0FE00AC2A23 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 86717A921AC0C0FE00AC2A23 /* AppDelegate.m */; }; - 86717A9B1AC0C0FE00AC2A23 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 86717A9A1AC0C0FE00AC2A23 /* Images.xcassets */; }; - 86717A9E1AC0C0FE00AC2A23 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 86717A9C1AC0C0FE00AC2A23 /* LaunchScreen.xib */; }; - 86717AE51AC0C53800AC2A23 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 86717AD71AC0C53800AC2A23 /* MainViewController.m */; }; - 86717AEA1AC0C53800AC2A23 /* image_example.png in Resources */ = {isa = PBXBuildFile; fileRef = 86717AE01AC0C53800AC2A23 /* image_example.png */; }; - 86717AED1AC0C53800AC2A23 /* signature.png in Resources */ = {isa = PBXBuildFile; fileRef = 86717AE31AC0C53800AC2A23 /* signature.png */; }; - 86717AFD1AC0C86000AC2A23 /* ORKJSONSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 86717AFC1AC0C86000AC2A23 /* ORKJSONSerializationTests.m */; }; - 86717B071AC0CC0400AC2A23 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 86717B091AC0CC0400AC2A23 /* Localizable.strings */; }; - 86D347FA1AC0E1B4006DB02B /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86D347F91AC0E1B4006DB02B /* HealthKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - B119F055229BD4B6001402F9 /* samples.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B119F054229BD4B6001402F9 /* samples.bundle */; }; - BCEDC7E41E8A45EE00C5405F /* ContinueButtonExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7DD1E8A45EE00C5405F /* ContinueButtonExampleViewController.m */; }; - BCEDC7E51E8A45EE00C5405F /* DragonPokerStep.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7DF1E8A45EE00C5405F /* DragonPokerStep.m */; }; - BCEDC7E61E8A45EE00C5405F /* DynamicTask.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7E11E8A45EE00C5405F /* DynamicTask.m */; }; - BCEDC7E71E8A45EE00C5405F /* FooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7E31E8A45EE00C5405F /* FooterView.m */; }; - BCEDC7FC1E8A469D00C5405F /* TaskFactory+ActiveTasks.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7EA1E8A469D00C5405F /* TaskFactory+ActiveTasks.m */; }; - BCEDC7FD1E8A469D00C5405F /* TaskFactory+Forms.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7EC1E8A469D00C5405F /* TaskFactory+Forms.m */; }; - BCEDC7FE1E8A469D00C5405F /* TaskFactory+Onboarding.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7EE1E8A469D00C5405F /* TaskFactory+Onboarding.m */; }; - BCEDC7FF1E8A469D00C5405F /* TaskFactory+PasscodeManagement.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7F01E8A469D00C5405F /* TaskFactory+PasscodeManagement.m */; }; - BCEDC8001E8A469D00C5405F /* TaskFactory+QuestionSteps.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7F21E8A469D00C5405F /* TaskFactory+QuestionSteps.m */; }; - BCEDC8011E8A469D00C5405F /* TaskFactory+TaskCustomization.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7F41E8A469D00C5405F /* TaskFactory+TaskCustomization.m */; }; - BCEDC8021E8A469D00C5405F /* TaskFactory+TaskReview.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7F61E8A469D00C5405F /* TaskFactory+TaskReview.m */; }; - BCEDC8031E8A469D00C5405F /* TaskFactory+UtilitySteps.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7F81E8A469D00C5405F /* TaskFactory+UtilitySteps.m */; }; - BCEDC8041E8A469D00C5405F /* TaskFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7FA1E8A469D00C5405F /* TaskFactory.m */; }; - BCEDC8051E8A469D00C5405F /* TaskFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = BCEDC7FB1E8A469D00C5405F /* TaskFactory.swift */; }; - CAF31DCF1BC6AEA200041163 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CAF31DCE1BC6AEA200041163 /* MapKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - FFF010751D21F2030054B430 /* ContinueButtonExample.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FFF010741D21F2030054B430 /* ContinueButtonExample.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 712977A522B091500049213B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 7129779F22B091500049213B /* ResearchKit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = B183A5951A8535D100C76870; - remoteInfo = ResearchKit; - }; - 712977A722B091500049213B /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 7129779F22B091500049213B /* ResearchKit.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 86CC8E9A1AC09332001CCD89; - remoteInfo = ResearchKitTests; - }; - 86717AA41AC0C0FE00AC2A23 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 86717A821AC0C0FE00AC2A23 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 86717A891AC0C0FE00AC2A23; - remoteInfo = ORKTest; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 71B4927C24981533001F9598 /* Embed Watch Content */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = "$(CONTENTS_FOLDER_PATH)/Watch"; - dstSubfolderSpec = 16; - files = ( - ); - name = "Embed Watch Content"; - runOnlyForDeploymentPostprocessing = 0; - }; - BC2A3CE31C58F1EE00DA64B7 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 712977AA22B0917A0049213B /* ResearchKit.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 24D002771BA2268D001BF82F /* ORKKeychainWrapperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKKeychainWrapperTests.m; sourceTree = ""; }; - 335418E81B118EAD00A38F5E /* SAMPLE_PDF_TEST.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = SAMPLE_PDF_TEST.pdf; sourceTree = ""; }; - 5D2DEA5D24DB618A000A2A5B /* ORKESerialization.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ORKESerialization.m; sourceTree = ""; }; - 5D2DEA6224DB618B000A2A5B /* ORKESerialization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ORKESerialization.h; sourceTree = ""; }; - 7129779F22B091500049213B /* ResearchKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ResearchKit.xcodeproj; path = ../../ResearchKit.xcodeproj; sourceTree = ""; }; - 866DA52D1D63D1EE00C9AF3F /* ORKDataCollectionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKDataCollectionTests.m; sourceTree = ""; }; - 86717A8A1AC0C0FE00AC2A23 /* ORKTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ORKTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 86717A8E1AC0C0FE00AC2A23 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 86717A8F1AC0C0FE00AC2A23 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 86717A911AC0C0FE00AC2A23 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 86717A921AC0C0FE00AC2A23 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 86717A9A1AC0C0FE00AC2A23 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; - 86717A9D1AC0C0FE00AC2A23 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 86717AA31AC0C0FE00AC2A23 /* ORKTestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ORKTestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 86717AA81AC0C0FE00AC2A23 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 86717AD71AC0C53800AC2A23 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; - 86717ADE1AC0C53800AC2A23 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; - 86717AE01AC0C53800AC2A23 /* image_example.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = image_example.png; sourceTree = ""; }; - 86717AE31AC0C53800AC2A23 /* signature.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = signature.png; sourceTree = ""; }; - 86717AFC1AC0C86000AC2A23 /* ORKJSONSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKJSONSerializationTests.m; sourceTree = ""; }; - 86717B081AC0CC0400AC2A23 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; - 86717B0A1AC0CC1A00AC2A23 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; - 86717B0B1AC0CC1C00AC2A23 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; - 86717B0C1AC0CC1D00AC2A23 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; - 86717B0F1AC0CC2500AC2A23 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; - 86717B101AC0CC2700AC2A23 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; - 86717B121AC0CC2A00AC2A23 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = ""; }; - 86717B131AC0CC2A00AC2A23 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; - 86717B141AC0CC2C00AC2A23 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; - 86717B151AC0CC2D00AC2A23 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Localizable.strings; sourceTree = ""; }; - 86717B171AC0CC2F00AC2A23 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = ""; }; - 86717B181AC0CC3000AC2A23 /* fi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fi; path = fi.lproj/Localizable.strings; sourceTree = ""; }; - 86717B191AC0CC3100AC2A23 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = ""; }; - 86717B1B1AC0CC3300AC2A23 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = ""; }; - 86717B1C1AC0CC3400AC2A23 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Localizable.strings; sourceTree = ""; }; - 86717B1D1AC0CC3500AC2A23 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Localizable.strings; sourceTree = ""; }; - 86717B1E1AC0CC3700AC2A23 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = ""; }; - 86717B1F1AC0CC3A00AC2A23 /* th */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = th; path = th.lproj/Localizable.strings; sourceTree = ""; }; - 86717B201AC0CC3B00AC2A23 /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; - 86717B211AC0CC3E00AC2A23 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; - 86717B221AC0CC3F00AC2A23 /* ms */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ms; path = ms.lproj/Localizable.strings; sourceTree = ""; }; - 86717B231AC0CC4000AC2A23 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Localizable.strings; sourceTree = ""; }; - 86717B241AC0CC4100AC2A23 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = ""; }; - 86717B251AC0CC4200AC2A23 /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/Localizable.strings; sourceTree = ""; }; - 86717B261AC0CC4300AC2A23 /* ro */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ro; path = ro.lproj/Localizable.strings; sourceTree = ""; }; - 86717B271AC0CC4400AC2A23 /* he */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = he; path = he.lproj/Localizable.strings; sourceTree = ""; }; - 86717B281AC0CC4600AC2A23 /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/Localizable.strings; sourceTree = ""; }; - 86717B291AC0CC4700AC2A23 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = ""; }; - 86717B2A1AC0CC4800AC2A23 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Localizable.strings; sourceTree = ""; }; - 86717B2B1AC0CC4A00AC2A23 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = ""; }; - 86D347F91AC0E1B4006DB02B /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; - 86D347FB1AC0E1B4006DB02B /* ORKTest.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = ORKTest.entitlements; sourceTree = ""; }; - B119F054229BD4B6001402F9 /* samples.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = samples.bundle; sourceTree = ""; }; - B1337BA01B1E709B0098AA54 /* fr-CA */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "fr-CA"; path = "fr-CA.lproj/Localizable.strings"; sourceTree = ""; }; - B1337BA11B1E709C0098AA54 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; - B1337BA21B1E70A00098AA54 /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/Localizable.strings"; sourceTree = ""; }; - B1337BA31B1E70A10098AA54 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; - B1337BA41B1E70A20098AA54 /* es-MX */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-MX"; path = "es-MX.lproj/Localizable.strings"; sourceTree = ""; }; - B1337BA51B1E70AA0098AA54 /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/Localizable.strings; sourceTree = ""; }; - B1337BA61B1E70AB0098AA54 /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Localizable.strings; sourceTree = ""; }; - B1337BA71B1E70AC0098AA54 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Localizable.strings"; sourceTree = ""; }; - B15636901B1F8A0700B28200 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Localizable.strings"; sourceTree = ""; }; - B15636931B1F8A0800B28200 /* en-AU */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-AU"; path = "en-AU.lproj/Localizable.strings"; sourceTree = ""; }; - BC2A3CA01C58E85D00DA64B7 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - BCEDC7DC1E8A45EE00C5405F /* ContinueButtonExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContinueButtonExampleViewController.h; sourceTree = ""; }; - BCEDC7DD1E8A45EE00C5405F /* ContinueButtonExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContinueButtonExampleViewController.m; sourceTree = ""; }; - BCEDC7DE1E8A45EE00C5405F /* DragonPokerStep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragonPokerStep.h; sourceTree = ""; }; - BCEDC7DF1E8A45EE00C5405F /* DragonPokerStep.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DragonPokerStep.m; sourceTree = ""; }; - BCEDC7E01E8A45EE00C5405F /* DynamicTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicTask.h; sourceTree = ""; }; - BCEDC7E11E8A45EE00C5405F /* DynamicTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DynamicTask.m; sourceTree = ""; }; - BCEDC7E21E8A45EE00C5405F /* FooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FooterView.h; sourceTree = ""; }; - BCEDC7E31E8A45EE00C5405F /* FooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FooterView.m; sourceTree = ""; }; - BCEDC7E91E8A469D00C5405F /* TaskFactory+ActiveTasks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+ActiveTasks.h"; sourceTree = ""; }; - BCEDC7EA1E8A469D00C5405F /* TaskFactory+ActiveTasks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+ActiveTasks.m"; sourceTree = ""; }; - BCEDC7EB1E8A469D00C5405F /* TaskFactory+Forms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+Forms.h"; sourceTree = ""; }; - BCEDC7EC1E8A469D00C5405F /* TaskFactory+Forms.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+Forms.m"; sourceTree = ""; }; - BCEDC7ED1E8A469D00C5405F /* TaskFactory+Onboarding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+Onboarding.h"; sourceTree = ""; }; - BCEDC7EE1E8A469D00C5405F /* TaskFactory+Onboarding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+Onboarding.m"; sourceTree = ""; }; - BCEDC7EF1E8A469D00C5405F /* TaskFactory+PasscodeManagement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+PasscodeManagement.h"; sourceTree = ""; }; - BCEDC7F01E8A469D00C5405F /* TaskFactory+PasscodeManagement.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+PasscodeManagement.m"; sourceTree = ""; }; - BCEDC7F11E8A469D00C5405F /* TaskFactory+QuestionSteps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+QuestionSteps.h"; sourceTree = ""; }; - BCEDC7F21E8A469D00C5405F /* TaskFactory+QuestionSteps.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+QuestionSteps.m"; sourceTree = ""; }; - BCEDC7F31E8A469D00C5405F /* TaskFactory+TaskCustomization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+TaskCustomization.h"; sourceTree = ""; }; - BCEDC7F41E8A469D00C5405F /* TaskFactory+TaskCustomization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+TaskCustomization.m"; sourceTree = ""; }; - BCEDC7F51E8A469D00C5405F /* TaskFactory+TaskReview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+TaskReview.h"; sourceTree = ""; }; - BCEDC7F61E8A469D00C5405F /* TaskFactory+TaskReview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+TaskReview.m"; sourceTree = ""; }; - BCEDC7F71E8A469D00C5405F /* TaskFactory+UtilitySteps.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TaskFactory+UtilitySteps.h"; sourceTree = ""; }; - BCEDC7F81E8A469D00C5405F /* TaskFactory+UtilitySteps.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TaskFactory+UtilitySteps.m"; sourceTree = ""; }; - BCEDC7F91E8A469D00C5405F /* TaskFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaskFactory.h; sourceTree = ""; }; - BCEDC7FA1E8A469D00C5405F /* TaskFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaskFactory.m; sourceTree = ""; }; - BCEDC7FB1E8A469D00C5405F /* TaskFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskFactory.swift; sourceTree = ""; }; - CAF31DCE1BC6AEA200041163 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; - FFF010741D21F2030054B430 /* ContinueButtonExample.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = ContinueButtonExample.storyboard; path = "ORKTest/Supporting Files/ContinueButtonExample.storyboard"; sourceTree = SOURCE_ROOT; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 86717A871AC0C0FE00AC2A23 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - CAF31DCF1BC6AEA200041163 /* MapKit.framework in Frameworks */, - 86D347FA1AC0E1B4006DB02B /* HealthKit.framework in Frameworks */, - 712977A922B0917A0049213B /* ResearchKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 86717AA01AC0C0FE00AC2A23 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 712977A022B091500049213B /* Products */ = { - isa = PBXGroup; - children = ( - 712977A622B091500049213B /* ResearchKit.framework */, - 712977A822B091500049213B /* ResearchKitTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 86717A811AC0C0FE00AC2A23 = { - isa = PBXGroup; - children = ( - 7129779F22B091500049213B /* ResearchKit.xcodeproj */, - BC2A3CA01C58E85D00DA64B7 /* README.md */, - BC2A3C9F1C58E83B00DA64B7 /* Frameworks */, - 86717A8C1AC0C0FE00AC2A23 /* ORKTest */, - 86717AA61AC0C0FE00AC2A23 /* ORKTestTests */, - 86717A8B1AC0C0FE00AC2A23 /* Products */, - ); - sourceTree = ""; - }; - 86717A8B1AC0C0FE00AC2A23 /* Products */ = { - isa = PBXGroup; - children = ( - 86717A8A1AC0C0FE00AC2A23 /* ORKTest.app */, - 86717AA31AC0C0FE00AC2A23 /* ORKTestTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 86717A8C1AC0C0FE00AC2A23 /* ORKTest */ = { - isa = PBXGroup; - children = ( - BCEDC7DB1E8A45EE00C5405F /* Customization */, - BCEDC7E81E8A469D00C5405F /* Tasks */, - 86717B011AC0C9D400AC2A23 /* Resources */, - 86717A8D1AC0C0FE00AC2A23 /* Supporting Files */, - 86717A911AC0C0FE00AC2A23 /* AppDelegate.h */, - 86717A921AC0C0FE00AC2A23 /* AppDelegate.m */, - 86717ADE1AC0C53800AC2A23 /* MainViewController.h */, - 86717AD71AC0C53800AC2A23 /* MainViewController.m */, - ); - path = ORKTest; - sourceTree = ""; - }; - 86717A8D1AC0C0FE00AC2A23 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 86D347FB1AC0E1B4006DB02B /* ORKTest.entitlements */, - 86717A8E1AC0C0FE00AC2A23 /* Info.plist */, - 86717A8F1AC0C0FE00AC2A23 /* main.m */, - ); - path = "Supporting Files"; - sourceTree = ""; - }; - 86717AA61AC0C0FE00AC2A23 /* ORKTestTests */ = { - isa = PBXGroup; - children = ( - 5D2DEA6224DB618B000A2A5B /* ORKESerialization.h */, - 5D2DEA5D24DB618A000A2A5B /* ORKESerialization.m */, - B119F054229BD4B6001402F9 /* samples.bundle */, - 866DA52D1D63D1EE00C9AF3F /* ORKDataCollectionTests.m */, - 86717AFC1AC0C86000AC2A23 /* ORKJSONSerializationTests.m */, - 24D002771BA2268D001BF82F /* ORKKeychainWrapperTests.m */, - 86717AA71AC0C0FE00AC2A23 /* Supporting Files */, - ); - path = ORKTestTests; - sourceTree = ""; - }; - 86717AA71AC0C0FE00AC2A23 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 86717AA81AC0C0FE00AC2A23 /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 86717B011AC0C9D400AC2A23 /* Resources */ = { - isa = PBXGroup; - children = ( - FFF010741D21F2030054B430 /* ContinueButtonExample.storyboard */, - 335418E81B118EAD00A38F5E /* SAMPLE_PDF_TEST.pdf */, - 86717AE01AC0C53800AC2A23 /* image_example.png */, - 86717AE31AC0C53800AC2A23 /* signature.png */, - 86717A9A1AC0C0FE00AC2A23 /* Images.xcassets */, - 86717A9C1AC0C0FE00AC2A23 /* LaunchScreen.xib */, - 86717B091AC0CC0400AC2A23 /* Localizable.strings */, - ); - path = Resources; - sourceTree = ""; - }; - BC2A3C9F1C58E83B00DA64B7 /* Frameworks */ = { - isa = PBXGroup; - children = ( - CAF31DCE1BC6AEA200041163 /* MapKit.framework */, - 86D347F91AC0E1B4006DB02B /* HealthKit.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - BCEDC7DB1E8A45EE00C5405F /* Customization */ = { - isa = PBXGroup; - children = ( - BCEDC7DC1E8A45EE00C5405F /* ContinueButtonExampleViewController.h */, - BCEDC7DD1E8A45EE00C5405F /* ContinueButtonExampleViewController.m */, - BCEDC7DE1E8A45EE00C5405F /* DragonPokerStep.h */, - BCEDC7DF1E8A45EE00C5405F /* DragonPokerStep.m */, - BCEDC7E01E8A45EE00C5405F /* DynamicTask.h */, - BCEDC7E11E8A45EE00C5405F /* DynamicTask.m */, - BCEDC7E21E8A45EE00C5405F /* FooterView.h */, - BCEDC7E31E8A45EE00C5405F /* FooterView.m */, - ); - path = Customization; - sourceTree = ""; - }; - BCEDC7E81E8A469D00C5405F /* Tasks */ = { - isa = PBXGroup; - children = ( - BCEDC7E91E8A469D00C5405F /* TaskFactory+ActiveTasks.h */, - BCEDC7EA1E8A469D00C5405F /* TaskFactory+ActiveTasks.m */, - BCEDC7EB1E8A469D00C5405F /* TaskFactory+Forms.h */, - BCEDC7EC1E8A469D00C5405F /* TaskFactory+Forms.m */, - BCEDC7ED1E8A469D00C5405F /* TaskFactory+Onboarding.h */, - BCEDC7EE1E8A469D00C5405F /* TaskFactory+Onboarding.m */, - BCEDC7EF1E8A469D00C5405F /* TaskFactory+PasscodeManagement.h */, - BCEDC7F01E8A469D00C5405F /* TaskFactory+PasscodeManagement.m */, - BCEDC7F11E8A469D00C5405F /* TaskFactory+QuestionSteps.h */, - BCEDC7F21E8A469D00C5405F /* TaskFactory+QuestionSteps.m */, - BCEDC7F31E8A469D00C5405F /* TaskFactory+TaskCustomization.h */, - BCEDC7F41E8A469D00C5405F /* TaskFactory+TaskCustomization.m */, - BCEDC7F51E8A469D00C5405F /* TaskFactory+TaskReview.h */, - BCEDC7F61E8A469D00C5405F /* TaskFactory+TaskReview.m */, - BCEDC7F71E8A469D00C5405F /* TaskFactory+UtilitySteps.h */, - BCEDC7F81E8A469D00C5405F /* TaskFactory+UtilitySteps.m */, - BCEDC7F91E8A469D00C5405F /* TaskFactory.h */, - BCEDC7FA1E8A469D00C5405F /* TaskFactory.m */, - BCEDC7FB1E8A469D00C5405F /* TaskFactory.swift */, - ); - path = Tasks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 86717A891AC0C0FE00AC2A23 /* ORKTest */ = { - isa = PBXNativeTarget; - buildConfigurationList = 86717AAD1AC0C0FE00AC2A23 /* Build configuration list for PBXNativeTarget "ORKTest" */; - buildPhases = ( - 86717A861AC0C0FE00AC2A23 /* Sources */, - 86717A871AC0C0FE00AC2A23 /* Frameworks */, - 86717A881AC0C0FE00AC2A23 /* Resources */, - BC2A3CE31C58F1EE00DA64B7 /* Embed Frameworks */, - 71B4927C24981533001F9598 /* Embed Watch Content */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ORKTest; - productName = ORKTest; - productReference = 86717A8A1AC0C0FE00AC2A23 /* ORKTest.app */; - productType = "com.apple.product-type.application"; - }; - 86717AA21AC0C0FE00AC2A23 /* ORKTestTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 86717AB01AC0C0FE00AC2A23 /* Build configuration list for PBXNativeTarget "ORKTestTests" */; - buildPhases = ( - 86717A9F1AC0C0FE00AC2A23 /* Sources */, - 86717AA01AC0C0FE00AC2A23 /* Frameworks */, - 86717AA11AC0C0FE00AC2A23 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 86717AA51AC0C0FE00AC2A23 /* PBXTargetDependency */, - ); - name = ORKTestTests; - productName = ORKTestTests; - productReference = 86717AA31AC0C0FE00AC2A23 /* ORKTestTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 86717A821AC0C0FE00AC2A23 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 1200; - ORGANIZATIONNAME = ResearchKit; - TargetAttributes = { - 86717A891AC0C0FE00AC2A23 = { - CreatedOnToolsVersion = 6.2; - LastSwiftMigration = 1020; - ProvisioningStyle = Manual; - SystemCapabilities = { - com.apple.BackgroundModes = { - enabled = 1; - }; - com.apple.HealthKit = { - enabled = 1; - }; - }; - }; - 86717AA21AC0C0FE00AC2A23 = { - CreatedOnToolsVersion = 6.2; - ProvisioningStyle = Manual; - TestTargetID = 86717A891AC0C0FE00AC2A23; - }; - }; - }; - buildConfigurationList = 86717A851AC0C0FE00AC2A23 /* Build configuration list for PBXProject "ORKTest" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - fr, - fr_CA, - de, - zh_CN, - zh_HK, - zh_TW, - ja, - es, - es_MX, - hi, - no, - it, - ko, - nl, - pt, - pt_PT, - da, - fi, - sv, - ru, - pl, - tr, - ar, - th, - cs, - vi, - ms, - id, - uk, - sk, - ro, - he, - hr, - ca, - el, - hu, - "fr-CA", - "zh-Hans", - "zh-HK", - "zh-Hant", - "es-MX", - nb, - "pt-PT", - "en-GB", - "en-AU", - ); - mainGroup = 86717A811AC0C0FE00AC2A23; - productRefGroup = 86717A8B1AC0C0FE00AC2A23 /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 712977A022B091500049213B /* Products */; - ProjectRef = 7129779F22B091500049213B /* ResearchKit.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 86717A891AC0C0FE00AC2A23 /* ORKTest */, - 86717AA21AC0C0FE00AC2A23 /* ORKTestTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 712977A622B091500049213B /* ResearchKit.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = ResearchKit.framework; - remoteRef = 712977A522B091500049213B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 712977A822B091500049213B /* ResearchKitTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = ResearchKitTests.xctest; - remoteRef = 712977A722B091500049213B /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 86717A881AC0C0FE00AC2A23 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - FFF010751D21F2030054B430 /* ContinueButtonExample.storyboard in Resources */, - 86717A9E1AC0C0FE00AC2A23 /* LaunchScreen.xib in Resources */, - 335418E91B118EAD00A38F5E /* SAMPLE_PDF_TEST.pdf in Resources */, - 86717AED1AC0C53800AC2A23 /* signature.png in Resources */, - 86717AEA1AC0C53800AC2A23 /* image_example.png in Resources */, - 86717B071AC0CC0400AC2A23 /* Localizable.strings in Resources */, - 86717A9B1AC0C0FE00AC2A23 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 86717AA11AC0C0FE00AC2A23 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B119F055229BD4B6001402F9 /* samples.bundle in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 86717A861AC0C0FE00AC2A23 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BCEDC7E41E8A45EE00C5405F /* ContinueButtonExampleViewController.m in Sources */, - 86717A931AC0C0FE00AC2A23 /* AppDelegate.m in Sources */, - BCEDC7FD1E8A469D00C5405F /* TaskFactory+Forms.m in Sources */, - BCEDC8021E8A469D00C5405F /* TaskFactory+TaskReview.m in Sources */, - BCEDC7E51E8A45EE00C5405F /* DragonPokerStep.m in Sources */, - BCEDC8051E8A469D00C5405F /* TaskFactory.swift in Sources */, - BCEDC7E71E8A45EE00C5405F /* FooterView.m in Sources */, - BCEDC7E61E8A45EE00C5405F /* DynamicTask.m in Sources */, - BCEDC8031E8A469D00C5405F /* TaskFactory+UtilitySteps.m in Sources */, - BCEDC7FC1E8A469D00C5405F /* TaskFactory+ActiveTasks.m in Sources */, - BCEDC7FF1E8A469D00C5405F /* TaskFactory+PasscodeManagement.m in Sources */, - 86717AE51AC0C53800AC2A23 /* MainViewController.m in Sources */, - BCEDC8011E8A469D00C5405F /* TaskFactory+TaskCustomization.m in Sources */, - 86717A901AC0C0FE00AC2A23 /* main.m in Sources */, - BCEDC8001E8A469D00C5405F /* TaskFactory+QuestionSteps.m in Sources */, - BCEDC7FE1E8A469D00C5405F /* TaskFactory+Onboarding.m in Sources */, - BCEDC8041E8A469D00C5405F /* TaskFactory.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 86717A9F1AC0C0FE00AC2A23 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 86717AFD1AC0C86000AC2A23 /* ORKJSONSerializationTests.m in Sources */, - 5D2DEA6324DB618B000A2A5B /* ORKESerialization.m in Sources */, - 866DA52E1D63D1EE00C9AF3F /* ORKDataCollectionTests.m in Sources */, - 24D002781BA2268D001BF82F /* ORKKeychainWrapperTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 86717AA51AC0C0FE00AC2A23 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 86717A891AC0C0FE00AC2A23 /* ORKTest */; - targetProxy = 86717AA41AC0C0FE00AC2A23 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 86717A9C1AC0C0FE00AC2A23 /* LaunchScreen.xib */ = { - isa = PBXVariantGroup; - children = ( - 86717A9D1AC0C0FE00AC2A23 /* Base */, - ); - name = LaunchScreen.xib; - path = Localized; - sourceTree = ""; - }; - 86717B091AC0CC0400AC2A23 /* Localizable.strings */ = { - isa = PBXVariantGroup; - children = ( - 86717B081AC0CC0400AC2A23 /* Base */, - 86717B0A1AC0CC1A00AC2A23 /* en */, - 86717B0B1AC0CC1C00AC2A23 /* fr */, - 86717B0C1AC0CC1D00AC2A23 /* de */, - 86717B0F1AC0CC2500AC2A23 /* ja */, - 86717B101AC0CC2700AC2A23 /* es */, - 86717B121AC0CC2A00AC2A23 /* it */, - 86717B131AC0CC2A00AC2A23 /* ko */, - 86717B141AC0CC2C00AC2A23 /* nl */, - 86717B151AC0CC2D00AC2A23 /* pt */, - 86717B171AC0CC2F00AC2A23 /* da */, - 86717B181AC0CC3000AC2A23 /* fi */, - 86717B191AC0CC3100AC2A23 /* sv */, - 86717B1B1AC0CC3300AC2A23 /* ru */, - 86717B1C1AC0CC3400AC2A23 /* pl */, - 86717B1D1AC0CC3500AC2A23 /* tr */, - 86717B1E1AC0CC3700AC2A23 /* ar */, - 86717B1F1AC0CC3A00AC2A23 /* th */, - 86717B201AC0CC3B00AC2A23 /* cs */, - 86717B211AC0CC3E00AC2A23 /* vi */, - 86717B221AC0CC3F00AC2A23 /* ms */, - 86717B231AC0CC4000AC2A23 /* id */, - 86717B241AC0CC4100AC2A23 /* uk */, - 86717B251AC0CC4200AC2A23 /* sk */, - 86717B261AC0CC4300AC2A23 /* ro */, - 86717B271AC0CC4400AC2A23 /* he */, - 86717B281AC0CC4600AC2A23 /* hr */, - 86717B291AC0CC4700AC2A23 /* ca */, - 86717B2A1AC0CC4800AC2A23 /* el */, - 86717B2B1AC0CC4A00AC2A23 /* hu */, - B1337BA01B1E709B0098AA54 /* fr-CA */, - B1337BA11B1E709C0098AA54 /* zh-Hans */, - B1337BA21B1E70A00098AA54 /* zh-HK */, - B1337BA31B1E70A10098AA54 /* zh-Hant */, - B1337BA41B1E70A20098AA54 /* es-MX */, - B1337BA51B1E70AA0098AA54 /* hi */, - B1337BA61B1E70AB0098AA54 /* nb */, - B1337BA71B1E70AC0098AA54 /* pt-PT */, - B15636901B1F8A0700B28200 /* en-GB */, - B15636931B1F8A0800B28200 /* en-AU */, - ); - name = Localizable.strings; - path = Localized; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 86717AAB1AC0C0FE00AC2A23 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_VERSION = 4.0; - }; - name = Debug; - }; - 86717AAC1AC0C0FE00AC2A23 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 86717AAE1AC0C0FE00AC2A23 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = "ORKTest/Supporting Files/ORKTest.entitlements"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/ORKTest/Supporting Files/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 2.1.1; - PRODUCT_BUNDLE_IDENTIFIER = "com.example.researchkit-samplecode.ORKTest"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "ORKTest/Supporting Files/ORKTest-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Debug; - }; - 86717AAF1AC0C0FE00AC2A23 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = "ORKTest/Supporting Files/ORKTest.entitlements"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "$(SRCROOT)/ORKTest/Supporting Files/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = 2.1.1; - PRODUCT_BUNDLE_IDENTIFIER = "com.example.researchkit-samplecode.ORKTest"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "ORKTest/Supporting Files/ORKTest-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = 1; - }; - name = Release; - }; - 86717AB11AC0C0FE00AC2A23 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = ORKTestTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ORKTest.app/ORKTest"; - }; - name = Debug; - }; - 86717AB21AC0C0FE00AC2A23 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; - CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - INFOPLIST_FILE = ORKTestTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ORKTest.app/ORKTest"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 86717A851AC0C0FE00AC2A23 /* Build configuration list for PBXProject "ORKTest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 86717AAB1AC0C0FE00AC2A23 /* Debug */, - 86717AAC1AC0C0FE00AC2A23 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 86717AAD1AC0C0FE00AC2A23 /* Build configuration list for PBXNativeTarget "ORKTest" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 86717AAE1AC0C0FE00AC2A23 /* Debug */, - 86717AAF1AC0C0FE00AC2A23 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 86717AB01AC0C0FE00AC2A23 /* Build configuration list for PBXNativeTarget "ORKTestTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 86717AB11AC0C0FE00AC2A23 /* Debug */, - 86717AB21AC0C0FE00AC2A23 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 86717A821AC0C0FE00AC2A23 /* Project object */; -} diff --git a/Testing/ORKTest/ORKTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Testing/ORKTest/ORKTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index c22a64ddcb..0000000000 --- a/Testing/ORKTest/ORKTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Testing/ORKTest/ORKTest.xcodeproj/xcshareddata/xcschemes/ORKTest.xcscheme b/Testing/ORKTest/ORKTest.xcodeproj/xcshareddata/xcschemes/ORKTest.xcscheme deleted file mode 100644 index 44a57af5d6..0000000000 --- a/Testing/ORKTest/ORKTest.xcodeproj/xcshareddata/xcschemes/ORKTest.xcscheme +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Testing/ORKTest/ORKTest/AppDelegate.h b/Testing/ORKTest/ORKTest/AppDelegate.h deleted file mode 100644 index ccb2aae9cd..0000000000 --- a/Testing/ORKTest/ORKTest/AppDelegate.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/Testing/ORKTest/ORKTest/AppDelegate.m b/Testing/ORKTest/ORKTest/AppDelegate.m deleted file mode 100644 index b971a89c5f..0000000000 --- a/Testing/ORKTest/ORKTest/AppDelegate.m +++ /dev/null @@ -1,69 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "AppDelegate.h" -#import "MainViewController.h" - - -@implementation AppDelegate - -/* - For UI state restoration, we must configure the app and make the window key - in willFinishLaunchingWithOptions:. Otherwise, the restored task view controller - will animate in. - */ -- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; - self.window.backgroundColor = [UIColor blackColor]; - self.window.rootViewController = [MainViewController new]; - [self.window makeKeyAndVisible]; - return YES; -} - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - return YES; -} - -#pragma mark UI state restoration - -/* - These methods are needed in order to enable UI state restoration. - */ - -- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder { - return YES; -} - -- (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder { - return YES; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Charts/ChartDataSources.swift b/Testing/ORKTest/ORKTest/Charts/ChartDataSources.swift deleted file mode 100644 index 543be944d1..0000000000 --- a/Testing/ORKTest/ORKTest/Charts/ChartDataSources.swift +++ /dev/null @@ -1,465 +0,0 @@ -/* -Copyright (c) 2015, James Cox. All rights reserved. -Copyright (c) 2015-2016, Ricardo Sánchez-Sáez. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import ResearchKit - -func randomColorArray(_ number: Int) -> [UIColor] { - - func random() -> CGFloat { - return CGFloat(Float(arc4random()) / Float(UINT32_MAX)) - } - - var colors: [UIColor] = [] - for _ in 0 ..< number { - colors.append(UIColor(red: random(), green: random(), blue: random(), alpha: 1)) - } - return colors - } - -let numberOfPieChartSegments = 13 - -class ColorlessPieChartDataSource: NSObject, ORKPieChartViewDataSource { - - func numberOfSegments(in pieChartView: ORKPieChartView ) -> Int { - return numberOfPieChartSegments - } - - func pieChartView(_ pieChartView: ORKPieChartView, valueForSegmentAt index: Int) -> CGFloat { - return CGFloat(index + 1) - } - - func pieChartView(_ pieChartView: ORKPieChartView, titleForSegmentAt index: Int) -> String? { - return "Title \(index + 1)" - } -} - -class RandomColorPieChartDataSource: ColorlessPieChartDataSource { - - lazy var backingStore: [UIColor] = { - return randomColorArray(numberOfPieChartSegments) - }() - - func pieChartView(_ pieChartView: ORKPieChartView, colorForSegmentAtIndex index: Int) -> UIColor { - return backingStore[index] - } -} - -class BaseFloatRangeGraphChartDataSource: NSObject, ORKValueRangeGraphChartViewDataSource { - var plotPoints: [[ORKValueRange]] = [[]] - - internal func numberOfPlots(in graphChartView: ORKGraphChartView) -> Int { - return plotPoints.count - } - - func graphChartView(_ graphChartView: ORKGraphChartView, dataPointForPointIndex pointIndex: Int, plotIndex: Int) -> ORKValueRange { - return plotPoints[plotIndex][pointIndex] - } - - func graphChartView(_ graphChartView: ORKGraphChartView, numberOfDataPointsForPlotIndex plotIndex: Int) -> Int { - return plotPoints[plotIndex].count - } -} - -class BaseFloatStackGraphChartDataSource: NSObject, ORKValueStackGraphChartViewDataSource { - - var plotPoints: [[ORKValueStack]] = [[]] - - public func numberOfPlots(in graphChartView: ORKGraphChartView) -> Int { - return plotPoints.count - } - - func graphChartView(_ graphChartView: ORKGraphChartView, dataPointForPointIndex pointIndex: Int, plotIndex: Int) -> ORKValueStack { - return plotPoints[plotIndex][pointIndex] - } - - func graphChartView(_ graphChartView: ORKGraphChartView, numberOfDataPointsForPlotIndex plotIndex: Int) -> Int { - return plotPoints[plotIndex].count - } -} - -class LineGraphChartDataSource: BaseFloatRangeGraphChartDataSource { - - override init() { - super.init() - plotPoints = - [ - [ - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange() - ], - [ - ORKValueRange(value: 2), - ORKValueRange(value: 4), - ORKValueRange(value: 8), - ORKValueRange(value: 16), - ORKValueRange(value: 32), - ORKValueRange(value: 50), - ORKValueRange(value: 64) - ], - [ - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange() - ] - ] - } - - func maximumValueForGraphChartView(_ graphChartView: ORKGraphChartView) -> Double { - return 70 - } - - func minimumValueForGraphChartView(_ graphChartView: ORKGraphChartView) -> Double { - return 0 - } - - func numberOfDivisionsInXAxisForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 10 - } - - func graphChartView(_ graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String? { - return (pointIndex % 2 == 0) ? nil : "\(pointIndex + 1)" - } - - func graphChartView(_ graphChartView: ORKGraphChartView, drawsVerticalReferenceLineAtPointIndex pointIndex: Int) -> Bool { - return (pointIndex % 2 == 1) ? false : true - } - - func scrubbingPlotIndexForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 2 - } -} - -class ColoredLineGraphChartDataSource: LineGraphChartDataSource { - func graphChartView(_ graphChartView: ORKGraphChartView, colorForPlotIndex plotIndex: Int) -> UIColor { - let color: UIColor - switch plotIndex { - case 0: - color = UIColor.cyan - case 1: - color = UIColor.magenta - case 2: - color = UIColor.yellow - default: - color = UIColor.red - } - return color - } - - func graphChartView(graphChartView: ORKGraphChartView, fillColorForPlotIndex plotIndex: Int) -> UIColor { - let color: UIColor - switch plotIndex { - case 0: - color = UIColor.blue.withAlphaComponent(0.6) - case 1: - color = UIColor.red.withAlphaComponent(0.6) - case 2: - color = UIColor.green.withAlphaComponent(0.6) - default: - color = UIColor.cyan.withAlphaComponent(0.6) - } - return color - } -} - -class DiscreteGraphChartDataSource: BaseFloatRangeGraphChartDataSource { - - override init() { - super.init() - plotPoints = - [ - [ - ORKValueRange(), - ORKValueRange(minimumValue: 0, maximumValue: 2), - ORKValueRange(minimumValue: 1, maximumValue: 3), - ORKValueRange(minimumValue: 2, maximumValue: 6), - ORKValueRange(minimumValue: 3, maximumValue: 9), - ORKValueRange(minimumValue: 4, maximumValue: 13) - ], - [ - ORKValueRange(value: 1), - ORKValueRange(minimumValue: 2, maximumValue: 4), - ORKValueRange(minimumValue: 3, maximumValue: 8), - ORKValueRange(minimumValue: 5, maximumValue: 11), - ORKValueRange(minimumValue: 7, maximumValue: 13), - ORKValueRange(minimumValue: 10, maximumValue: 13), - ORKValueRange(minimumValue: 12, maximumValue: 15) - ], - [ - ORKValueRange(), - ORKValueRange(minimumValue: 5, maximumValue: 6), - ORKValueRange(), - ORKValueRange(minimumValue: 2, maximumValue: 15), - ORKValueRange(minimumValue: 4, maximumValue: 11) - ] - ] - } - - func numberOfDivisionsInXAxisForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 8 - } - - func graphChartView(_ graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String { - return "\(pointIndex + 1)" - } - - func scrubbingPlotIndexForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 2 - } -} - -class ColoredDiscreteGraphChartDataSource: DiscreteGraphChartDataSource { - func graphChartView(graphChartView: ORKGraphChartView, colorForPlotIndex plotIndex: Int) -> UIColor { - let color: UIColor - switch plotIndex { - case 0: - color = UIColor.cyan - case 1: - color = UIColor.magenta - case 2: - color = UIColor.yellow - default: - color = UIColor.red - } - return color - } -} - -class BarGraphChartDataSource: BaseFloatStackGraphChartDataSource { - - override init() { - super.init() - plotPoints = - [ - [ - ORKValueStack(), - ORKValueStack(stackedValues: [0, 2, 5]), - ORKValueStack(stackedValues: [1, 3, 2]), - ORKValueStack(stackedValues: [2, 6, 1]), - ORKValueStack(stackedValues: [3, 9, 4]), - ORKValueStack(stackedValues: [4, 13, 2]) - ], - [ - ORKValueStack(stackedValues: [1]), - ORKValueStack(stackedValues: [2, 4]), - ORKValueStack(stackedValues: [3, 8]), - ORKValueStack(stackedValues: [5, 11]), - ORKValueStack(stackedValues: [7, 13]), - ORKValueStack(stackedValues: [10, 13]), - ORKValueStack(stackedValues: [12, 15]) - ], - [ - ORKValueStack(), - ORKValueStack(stackedValues: [5, 6]), - ORKValueStack(stackedValues: [2, 15]), - ORKValueStack(stackedValues: [4, 11]), - ORKValueStack(), - ORKValueStack(stackedValues: [6, 16]) - ] - ] - } - - func numberOfDivisionsInXAxisForGraphChartView(graphChartView: ORKGraphChartView) -> Int { - return 8 - } - - func graphChartView(graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String { - return "\(pointIndex + 1)" - } - - func scrubbingPlotIndexForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 2 - } -} - -class ColoredBarGraphChartDataSource: BarGraphChartDataSource { - - func graphChartView(graphChartView: ORKGraphChartView, colorForPlotIndex plotIndex: Int) -> UIColor { - let color: UIColor - switch plotIndex { - case 0: - color = UIColor.cyan - case 1: - color = UIColor.magenta - case 2: - color = UIColor.yellow - default: - color = UIColor.red - } - return color - } - - override func scrubbingPlotIndexForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 1 - } -} - -class PerformanceLineGraphChartDataSource: BaseFloatRangeGraphChartDataSource { - - override init() { - super.init() - plotPoints = - [ - [ - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange() - ], - [ - ORKValueRange(value: 2), - ORKValueRange(value: 4), - ORKValueRange(value: 8), - ORKValueRange(value: 16), - ORKValueRange(value: 32), - ORKValueRange(value: 50), - ORKValueRange(value: 64), - ORKValueRange(value: 2), - ORKValueRange(value: 4), - ORKValueRange(value: 8), - ORKValueRange(value: 16), - ORKValueRange(value: 32), - ORKValueRange(value: 50), - ORKValueRange(value: 64), - ORKValueRange(value: 2), - ORKValueRange(value: 4), - ORKValueRange(value: 8), - ORKValueRange(value: 16), - ORKValueRange(value: 32), - ORKValueRange(value: 50), - ORKValueRange(value: 64), - ORKValueRange(value: 2), - ORKValueRange(value: 4), - ORKValueRange(value: 8), - ORKValueRange(value: 16), - ORKValueRange(value: 32), - ORKValueRange(value: 50), - ORKValueRange(value: 64) - ], - [ - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40), - ORKValueRange() - ] - ] - } - - func maximumValueForGraphChartView(_ graphChartView: ORKGraphChartView) -> Double { - return 70 - } - - func minimumValueForGraphChartView(_ graphChartView: ORKGraphChartView) -> Double { - return 0 - } - - func numberOfDivisionsInXAxisForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 10 - } - - func graphChartView(_ graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String? { - return (pointIndex % 2 == 0) ? nil : "\(pointIndex + 1)" - } - - func graphChartView(_ graphChartView: ORKGraphChartView, drawsVerticalReferenceLineAtPointIndex pointIndex: Int) -> Bool { - return (pointIndex % 2 == 1) ? false : true - } - - func scrubbingPlotIndexForGraphChartView(_ graphChartView: ORKGraphChartView) -> Int { - return 2 - } -} diff --git a/Testing/ORKTest/ORKTest/Charts/ChartListViewController.swift b/Testing/ORKTest/ORKTest/Charts/ChartListViewController.swift deleted file mode 100644 index 18a43b323b..0000000000 --- a/Testing/ORKTest/ORKTest/Charts/ChartListViewController.swift +++ /dev/null @@ -1,315 +0,0 @@ -/* -Copyright (c) 2015, James Cox. All rights reserved. -Copyright (c) 2015, Ricardo Sánchez-Sáez. -Copyright (c) 2018, Brian Ganninger. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import UIKit -import ResearchKit - -func executeAfterDelay(_ delay: Double, closure: @escaping () -> Void) { - let delayTime = DispatchTime.now() + delay - let dispatchWorkItem = DispatchWorkItem(block: closure) - DispatchQueue.main.asyncAfter( - deadline: delayTime, execute: dispatchWorkItem) -} - -class ChartListViewController: UIViewController, UITableViewDataSource { - - @IBOutlet var tableView: UITableView! - - let colorlessPieChartDataSource = ColorlessPieChartDataSource() - let randomColorPieChartDataSource = RandomColorPieChartDataSource() - - let lineGraphChartDataSource = LineGraphChartDataSource() - let coloredLineGraphChartDataSource = ColoredLineGraphChartDataSource() - - let discreteGraphChartDataSource = DiscreteGraphChartDataSource() - let coloredDiscreteGraphChartDataSource = ColoredDiscreteGraphChartDataSource() - - let barGraphChartDataSource = BarGraphChartDataSource() - let coloredBarGraphChartDataSource = ColoredBarGraphChartDataSource() - - let pieChartIdentifier = "PieChartCell" - let lineGraphChartIdentifier = "LineGraphChartCell" - let discreteGraphChartIdentifier = "DiscreteGraphChartCell" - let barGraphChartIdentifier = "BarGraphChartCell" - - var pieChartTableViewCell: PieChartTableViewCell! - var lineGraphChartTableViewCell: LineGraphChartTableViewCell! - var discreteGraphChartTableViewCell: DiscreteGraphChartTableViewCell! - var barGraphChartTableViewCell: BarGraphChartTableViewCell! - var chartTableViewCells: [UITableViewCell]! - - @IBAction func dimiss(_ sender: AnyObject) { - self.dismiss(animated: true, completion: nil) - } - - override func viewDidLoad() { - super.viewDidLoad() - self.tableView.dataSource = self - - // ORKPieChartView - pieChartTableViewCell = tableView.dequeueReusableCell(withIdentifier: pieChartIdentifier) as? PieChartTableViewCell - let pieChartView = pieChartTableViewCell.pieChartView - pieChartView?.dataSource = randomColorPieChartDataSource - // Optional custom configuration - pieChartView?.title = "TITLE" - pieChartView?.text = "TEXT" - pieChartView?.lineWidth = 1000 - pieChartView?.showsTitleAboveChart = true - pieChartView?.showsPercentageLabels = false - pieChartView?.drawsClockwise = false - pieChartView?.titleFont = UIFont.systemFont(ofSize: 20, weight: UIFont.Weight.bold) - pieChartView?.subtitleFont = UIFont.systemFont(ofSize: 18, weight: UIFont.Weight.thin) - pieChartView?.noDataFont = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.black) - pieChartView?.percentageLabelFont = UIFont.systemFont(ofSize: 12, weight: UIFont.Weight.light) - pieChartView?.legendFont = UIFont.systemFont(ofSize: 8, weight: UIFont.Weight.heavy) - executeAfterDelay(2.5) { - pieChartView?.showsTitleAboveChart = false - pieChartView?.lineWidth = 12 - pieChartView?.title = "UPDATED" - pieChartView?.text = "UPDATED TEXT" - pieChartView?.titleColor = UIColor.red - pieChartView?.textColor = UIColor.orange - pieChartView?.titleFont = nil - pieChartView?.subtitleFont = nil - pieChartView?.noDataFont = nil - pieChartView?.percentageLabelFont = nil - pieChartView?.legendFont = nil - } - executeAfterDelay(3.5) { - pieChartView?.drawsClockwise = true - pieChartView?.dataSource = self.colorlessPieChartDataSource - } - executeAfterDelay(4.5) { - pieChartView?.showsPercentageLabels = true - pieChartView?.tintColor = UIColor.purple - pieChartView?.percentageLabelFont = UIFont.systemFont(ofSize: 12, weight: UIFont.Weight.light) - pieChartView?.legendFont = UIFont.systemFont(ofSize: 8, weight: UIFont.Weight.heavy) - } - executeAfterDelay(5.5) { - pieChartView?.titleColor = nil - pieChartView?.textColor = nil - pieChartView?.percentageLabelFont = nil - pieChartView?.legendFont = nil - } - - // ORKBarGraphChartView - barGraphChartTableViewCell = tableView.dequeueReusableCell(withIdentifier: barGraphChartIdentifier) as? BarGraphChartTableViewCell - let barGraphChartView = barGraphChartTableViewCell.graphChartView as! ORKBarGraphChartView - barGraphChartView.dataSource = barGraphChartDataSource - executeAfterDelay(1.5) { - barGraphChartView.tintColor = UIColor.purple - barGraphChartView.showsHorizontalReferenceLines = true - barGraphChartView.showsVerticalReferenceLines = true - } - executeAfterDelay(2.5) { - barGraphChartView.axisColor = UIColor.red - barGraphChartView.verticalAxisTitleColor = UIColor.red - barGraphChartView.referenceLineColor = UIColor.orange - barGraphChartView.scrubberLineColor = UIColor.blue - barGraphChartView.scrubberThumbColor = UIColor.green - barGraphChartView.xAxisFont = UIFont.systemFont(ofSize: 8, weight: UIFont.Weight.light) - barGraphChartView.yAxisFont = UIFont.systemFont(ofSize: 8, weight: UIFont.Weight.light) - barGraphChartView.noDataFont = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.heavy) - barGraphChartView.scrubberFont = UIFont.systemFont(ofSize: 10, weight: UIFont.Weight.medium) - } - executeAfterDelay(3.5) { - barGraphChartView.axisColor = nil - barGraphChartView.verticalAxisTitleColor = nil - barGraphChartView.referenceLineColor = nil - barGraphChartView.scrubberLineColor = nil - barGraphChartView.scrubberThumbColor = nil - barGraphChartView.xAxisFont = nil - barGraphChartView.yAxisFont = nil - barGraphChartView.noDataFont = nil - barGraphChartView.scrubberFont = nil - } - executeAfterDelay(4.5) { - barGraphChartView.dataSource = self.coloredBarGraphChartDataSource - } - executeAfterDelay(5.5) { - let maximumValueImage = UIImage(named: "GraphMaximumValueTest")! - let minimumValueImage = UIImage(named: "GraphMinimumValueTest")! - barGraphChartView.maximumValueImage = maximumValueImage - barGraphChartView.minimumValueImage = minimumValueImage - } - - // ORKLineGraphChartView - lineGraphChartTableViewCell = tableView.dequeueReusableCell(withIdentifier: lineGraphChartIdentifier) as? LineGraphChartTableViewCell - let lineGraphChartView = lineGraphChartTableViewCell.graphChartView as! ORKLineGraphChartView - lineGraphChartView.dataSource = lineGraphChartDataSource - // Optional custom configuration - executeAfterDelay(1.5) { - lineGraphChartView.tintColor = UIColor.purple - lineGraphChartView.showsHorizontalReferenceLines = true - lineGraphChartView.showsVerticalReferenceLines = true - } - executeAfterDelay(2.5) { - lineGraphChartView.axisColor = UIColor.red - lineGraphChartView.verticalAxisTitleColor = UIColor.red - lineGraphChartView.referenceLineColor = UIColor.orange - lineGraphChartView.scrubberLineColor = UIColor.blue - lineGraphChartView.scrubberThumbColor = UIColor.green - lineGraphChartView.xAxisFont = UIFont.systemFont(ofSize: 8, weight: UIFont.Weight.light) - lineGraphChartView.yAxisFont = UIFont.systemFont(ofSize: 8, weight: UIFont.Weight.light) - lineGraphChartView.noDataFont = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.heavy) - lineGraphChartView.scrubberFont = UIFont.systemFont(ofSize: 10, weight: UIFont.Weight.medium) - } - executeAfterDelay(3.5) { - lineGraphChartView.axisColor = nil - lineGraphChartView.verticalAxisTitleColor = nil - lineGraphChartView.referenceLineColor = nil - lineGraphChartView.scrubberLineColor = nil - lineGraphChartView.scrubberThumbColor = nil - } - executeAfterDelay(4.5) { - lineGraphChartView.dataSource = self.coloredLineGraphChartDataSource - lineGraphChartView.xAxisFont = nil - lineGraphChartView.yAxisFont = nil - lineGraphChartView.noDataFont = nil - lineGraphChartView.scrubberFont = nil - } - executeAfterDelay(5.5) { - let maximumValueImage = UIImage(named: "GraphMaximumValueTest")! - let minimumValueImage = UIImage(named: "GraphMinimumValueTest")! - lineGraphChartView.maximumValueImage = maximumValueImage - lineGraphChartView.minimumValueImage = minimumValueImage - } - - // ORKDiscreteGraphChartView - discreteGraphChartTableViewCell = tableView.dequeueReusableCell(withIdentifier: discreteGraphChartIdentifier) as? DiscreteGraphChartTableViewCell - let discreteGraphChartView = discreteGraphChartTableViewCell.graphChartView as! ORKDiscreteGraphChartView - discreteGraphChartView.dataSource = discreteGraphChartDataSource - // Optional custom configuration - discreteGraphChartView.showsHorizontalReferenceLines = true - discreteGraphChartView.showsVerticalReferenceLines = true - discreteGraphChartView.drawsConnectedRanges = true - discreteGraphChartView.xAxisFont = UIFont.systemFont(ofSize: 9, weight: UIFont.Weight.thin) - discreteGraphChartView.yAxisFont = UIFont.systemFont(ofSize: 8, weight: UIFont.Weight.light) - discreteGraphChartView.noDataFont = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.heavy) - discreteGraphChartView.scrubberFont = UIFont.systemFont(ofSize: 10, weight: UIFont.Weight.medium) - executeAfterDelay(2.5) { - discreteGraphChartView.tintColor = UIColor.purple - } - executeAfterDelay(3.5) { - discreteGraphChartView.drawsConnectedRanges = false - } - executeAfterDelay(4.5) { - discreteGraphChartView.dataSource = self.coloredDiscreteGraphChartDataSource - discreteGraphChartView.xAxisFont = nil - discreteGraphChartView.yAxisFont = nil - discreteGraphChartView.noDataFont = nil - discreteGraphChartView.scrubberFont = nil - } - executeAfterDelay(5.5) { - discreteGraphChartView.drawsConnectedRanges = true - } - - chartTableViewCells = [pieChartTableViewCell, barGraphChartTableViewCell, lineGraphChartTableViewCell, discreteGraphChartTableViewCell] - - tableView.tableFooterView = UIView(frame: CGRect.zero) - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return chartTableViewCells.count - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = chartTableViewCells[(indexPath as NSIndexPath).row] - return cell - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - self.view.layoutIfNeeded() - pieChartTableViewCell.pieChartView.animate(withDuration: 0.5) - lineGraphChartTableViewCell.graphChartView.animate(withDuration: 0.5) - discreteGraphChartTableViewCell.graphChartView.animate(withDuration: 0.5) - discreteGraphChartTableViewCell.graphChartView.animate(withDuration: 2.5) - } -} - -class ChartPerformanceListViewController: UIViewController, UITableViewDataSource { - - @IBOutlet var tableView: UITableView! - - let lineGraphChartIdentifier = "LineGraphChartCell" - let discreteGraphChartIdentifier = "DiscreteGraphChartCell" - let graphChartDataSource = PerformanceLineGraphChartDataSource() - var lineGraphChartTableViewCell: LineGraphChartTableViewCell! - let discreteGraphChartDataSource = DiscreteGraphChartDataSource() - var discreteGraphChartTableViewCell: DiscreteGraphChartTableViewCell! - var chartTableViewCells: [UITableViewCell]! - - @IBAction func dimiss(_ sender: AnyObject) { - self.dismiss(animated: true, completion: nil) - } - - override func viewDidLoad() { - super.viewDidLoad() - self.tableView.dataSource = self - - // ORKLineGraphChartView - lineGraphChartTableViewCell = tableView.dequeueReusableCell(withIdentifier: lineGraphChartIdentifier) as? LineGraphChartTableViewCell - let lineGraphChartView = lineGraphChartTableViewCell.graphChartView as! ORKLineGraphChartView - lineGraphChartView.dataSource = graphChartDataSource - // Optional custom configuration - lineGraphChartView.showsHorizontalReferenceLines = true - lineGraphChartView.showsVerticalReferenceLines = true - - // ORKDiscreteGraphChartView - discreteGraphChartTableViewCell = tableView.dequeueReusableCell(withIdentifier: discreteGraphChartIdentifier) as? DiscreteGraphChartTableViewCell - let discreteGraphChartView = discreteGraphChartTableViewCell.graphChartView as! ORKDiscreteGraphChartView - discreteGraphChartView.dataSource = graphChartDataSource - // Optional custom configuration - discreteGraphChartView.showsHorizontalReferenceLines = true - discreteGraphChartView.showsVerticalReferenceLines = true - discreteGraphChartView.drawsConnectedRanges = true - - chartTableViewCells = [lineGraphChartTableViewCell, discreteGraphChartTableViewCell] - - tableView.tableFooterView = UIView(frame: CGRect.zero) - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return chartTableViewCells.count - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = chartTableViewCells[(indexPath as NSIndexPath).row] - return cell - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - lineGraphChartTableViewCell.graphChartView.animate(withDuration: 0.5) - } -} diff --git a/Testing/ORKTest/ORKTest/Customization/ContinueButtonExampleViewController.h b/Testing/ORKTest/ORKTest/Customization/ContinueButtonExampleViewController.h deleted file mode 100644 index be839453f1..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/ContinueButtonExampleViewController.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (c) 2016, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -NS_ASSUME_NONNULL_BEGIN - -@interface ContinueButtonExampleViewController : UIViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/Testing/ORKTest/ORKTest/Customization/ContinueButtonExampleViewController.m b/Testing/ORKTest/ORKTest/Customization/ContinueButtonExampleViewController.m deleted file mode 100644 index c7be07ef84..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/ContinueButtonExampleViewController.m +++ /dev/null @@ -1,56 +0,0 @@ -/* - Copyright (c) 2016, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "ContinueButtonExampleViewController.h" -#import "FooterView.h" - - -@interface ContinueButtonExampleViewController () - -@property (weak, nonatomic) IBOutlet FooterView *footerView; - -@end - - -@implementation ContinueButtonExampleViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. - - [self.footerView.continueButton addTarget:self action:@selector(continueButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; -} - -- (IBAction)continueButtonTapped:(id)sender { - [self dismissViewControllerAnimated:YES completion:nil]; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Customization/DragonPokerStep.h b/Testing/ORKTest/ORKTest/Customization/DragonPokerStep.h deleted file mode 100644 index 8f4df586f7..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/DragonPokerStep.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - Copyright (c) 2016, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import Foundation; -@import ResearchKit; - -/// Example implementation of an override of the class method -instantiateStepViewControllerWithResult: -/// In this example, only show the cancel button on Tuesdays - -@interface DragonPokerStep : ORKFormStep - -@end - diff --git a/Testing/ORKTest/ORKTest/Customization/DragonPokerStep.m b/Testing/ORKTest/ORKTest/Customization/DragonPokerStep.m deleted file mode 100644 index 578f7df807..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/DragonPokerStep.m +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright (c) 2016, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "DragonPokerStep.h" - - -@interface DragonPokerStep () - -@property (nonatomic) NSDate *playDate; - -@end - - -@interface DragonPokerStepViewController : ORKFormStepViewController - -@property (nonatomic) BOOL shouldShowCancelButton; - -@end - - -@implementation DragonPokerStep - -- (instancetype)initWithIdentifier:(NSString *)identifier { - self = [super initWithIdentifier:identifier]; - if (self) { - ORKFormItem *formItem = [[ORKFormItem alloc] initWithIdentifier:@"question1" text:@"Are you tall?" answerFormat:[ORKAnswerFormat booleanAnswerFormat]]; - self.formItems = @[formItem]; - } - return self; -} - -- (NSDate *)playDate { - if (_playDate == nil) { - _playDate = [NSDate date]; - } - return _playDate; - } - -- (ORKStepViewController *)instantiateStepViewControllerWithResult:(ORKResult *)result { - - DragonPokerStepViewController *viewController = [[DragonPokerStepViewController alloc] initWithStep:self result:result]; - NSDateComponents *components = [[NSCalendar currentCalendar] components:NSCalendarUnitWeekday fromDate:self.playDate]; - viewController.shouldShowCancelButton = components.weekday == 2; - - return viewController; -} - -@end - -@implementation DragonPokerStepViewController - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - // Hide the cancel button if it should not be shown. - if (!self.shouldShowCancelButton) { - self.cancelButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIView alloc] initWithFrame:CGRectZero]]; - } -} - -@end diff --git a/Testing/ORKTest/ORKTest/Customization/DynamicTask.h b/Testing/ORKTest/ORKTest/Customization/DynamicTask.h deleted file mode 100644 index 45ccdae52e..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/DynamicTask.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -@import ResearchKit; - - -/* - This custom task is used to verify correct behavior of `ORKTaskViewController` - when it is used on a task that is not an `ORKOrderedTask` subclass. - - This also tests turning off navigation-bar progress indication for a task. - */ -@interface DynamicTask : NSObject - -@end diff --git a/Testing/ORKTest/ORKTest/Customization/DynamicTask.m b/Testing/ORKTest/ORKTest/Customization/DynamicTask.m deleted file mode 100644 index 0b17698976..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/DynamicTask.m +++ /dev/null @@ -1,177 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "DynamicTask.h" - -@import ResearchKit.Private; - - -@interface DynamicTask () - -@property (nonatomic, strong) ORKInstructionStep *step1; -@property (nonatomic, strong) ORKQuestionStep *step2; -@property (nonatomic, strong) ORKQuestionStep *step3a; -@property (nonatomic, strong) ORKQuestionStep *step3b; -@property (nonatomic, strong) ORKActiveStep *step4; - -@end - - -@implementation DynamicTask - -- (instancetype)init { - self = [super init]; - if (self) { - - } - return self; -} - -- (NSString *)identifier { - return @"DynamicTask01"; -} - -/* - A custom implementation of `ORKTask` must implement `stepAfterStep:withResult:` - and `stepBeforeStep:withResult:` so that they are internally consistent. This - can be a little tricky. In most cases we recommend subclassing `ORKOrderedTask` - and overriding it in the specific situations where you need to customize - behavior. - */ -- (ORKStep *)stepAfterStep:(ORKStep *)step withResult:(id)result { - NSString *identifier = step.identifier; - if (step == nil) { - return self.step1; - } else if ([identifier isEqualToString:self.step1.identifier]) { - return self.step2; - } else if ([identifier isEqualToString:self.step2.identifier]) { - ORKStepResult *stepResult = [result stepResultForStepIdentifier:step.identifier]; - ORKQuestionResult *result = (ORKQuestionResult *)(stepResult.results.count > 0 ? stepResult.results.firstObject : nil); - if (result.answer != nil) { - if ([((NSArray *)result.answer).firstObject isEqualToString:@"route1"]) - { - return self.step3a; - } else { - return self.step3b; - } - } - } else if ([identifier isEqualToString:self.step3a.identifier] || [identifier isEqualToString:self.step3b.identifier]) { - ORKStepResult *stepResult = [result stepResultForStepIdentifier:step.identifier]; - ORKQuestionResult *result = (ORKQuestionResult *)[stepResult firstResult]; - if (result.answer != nil) { - if (((NSNumber *)result.answer).boolValue) { - return self.step4; - } - } - } - return nil; -} - -- (ORKStep *)stepBeforeStep:(ORKStep *)step withResult:(ORKTaskResult *)result { - NSString *identifier = step.identifier; - if (identifier == nil || [identifier isEqualToString:self.step1.identifier]) { - return nil; - } else if ([identifier isEqualToString:self.step2.identifier]) { - return self.step1; - } else if ([identifier isEqualToString:self.step3a.identifier] || [identifier isEqualToString:self.step3b.identifier]) { - return self.step2; - } else if ([identifier isEqualToString:self.step4.identifier] ) { - ORKQuestionResult *questionResult = (ORKQuestionResult *)[[result stepResultForStepIdentifier:self.step3a.identifier] firstResult]; - - if (questionResult != nil) { - return self.step3a; - } else { - return self.step3b; - } - } - - return nil; -} - -// Explicitly hide progress indication for all steps in this dynamic task. -- (ORKTaskProgress)progressOfCurrentStep:(ORKStep *)step withResultProvider:(NSArray *)surveyResults { - return (ORKTaskProgress){.total = 0, .current = 0}; -} - -- (ORKInstructionStep *)step1 { - if (_step1 == nil) { - _step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - _step1.title = @"Dynamic Task"; - _step1.text = @"This is an example of a dynamic task providing a custom implementation of ORKTask."; - } - return _step1; -} - -- (ORKQuestionStep *)step2 { - if (_step2 == nil) { - _step2 = [[ORKQuestionStep alloc] initWithIdentifier:@"step2"]; - _step2.title = @"Dynamic Task"; - _step2.text = @"Please choose a route from the options below:"; - ORKTextChoice *route1 = [ORKTextChoice choiceWithText:@"route1" value:@"route1"]; - ORKTextChoice *route2 = [ORKTextChoice choiceWithText:@"route2" value:@"route2"]; - _step2.answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:@[route1, route2]]; - _step2.optional = NO; - } - return _step2; -} - -- (ORKQuestionStep *)step3a { - if (_step3a == nil) { - _step3a = [[ORKQuestionStep alloc] initWithIdentifier:@"step3a"]; - _step3a.title = @"Dynamic Task"; - _step3a.text = @"You chose route1. Was this correct?"; - _step3a.answerFormat = [ORKBooleanAnswerFormat new]; - _step3a.optional = NO; - } - return _step3a; -} - -- (ORKQuestionStep *)step3b { - if (_step3b == nil) { - _step3b = [[ORKQuestionStep alloc] initWithIdentifier:@"step3b"]; - _step3b.title = @"Dynamic Task"; - _step3b.text = @"You chose route2. Was this correct?"; - _step3b.answerFormat = [ORKBooleanAnswerFormat new]; - _step3b.optional = NO; - } - return _step3b; -} - -- (ORKActiveStep *)step4 { - if (_step4 == nil) { - _step4 = [[ORKActiveStep alloc] initWithIdentifier:@"step4"]; - _step4.title = @"Thank you."; - _step4.spokenInstruction = @"Thank you."; - } - return _step4; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Customization/FooterView.h b/Testing/ORKTest/ORKTest/Customization/FooterView.h deleted file mode 100644 index 987ffbd9c8..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/FooterView.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Copyright (c) 2016, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -@interface FooterView : UIView - -@property (nonatomic, readonly) UIButton *continueButton; - -@end diff --git a/Testing/ORKTest/ORKTest/Customization/FooterView.m b/Testing/ORKTest/ORKTest/Customization/FooterView.m deleted file mode 100644 index cdf717e5fe..0000000000 --- a/Testing/ORKTest/ORKTest/Customization/FooterView.m +++ /dev/null @@ -1,89 +0,0 @@ -/* - Copyright (c) 2016, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "FooterView.h" - -@import ResearchKit; - - -@implementation FooterView - -- (instancetype)initWithFrame:(CGRect)frame { - if ((self = [super initWithFrame:frame])) { - [self commonInit]; - } - return self; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - if ((self = [super initWithCoder:aDecoder])) { - [self commonInit]; - } - return self; -} - -- (void)commonInit { - - // Add continue button and constraints - _continueButton = [[ORKContinueButton alloc] initWithTitle:NSLocalizedString(@"Done", @"") isDoneButton:NO]; - _continueButton.exclusiveTouch = YES; - _continueButton.translatesAutoresizingMaskIntoConstraints = NO; - - [self addSubview:_continueButton]; - - NSMutableArray *constraints = [NSMutableArray new]; - - [constraints addObject:[NSLayoutConstraint constraintWithItem:_continueButton - attribute:NSLayoutAttributeCenterX - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeCenterX - multiplier:1.0 - constant:0.0]]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_continueButton - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:-20.0]]; - [constraints addObject:[NSLayoutConstraint constraintWithItem:_continueButton - attribute:NSLayoutAttributeWidth - relatedBy:NSLayoutRelationLessThanOrEqual - toItem:self - attribute:NSLayoutAttributeWidth - multiplier:1.0 - constant:0.0]]; - - [NSLayoutConstraint activateConstraints:constraints]; -} - -@end diff --git a/Testing/ORKTest/ORKTest/MainViewController.h b/Testing/ORKTest/ORKTest/MainViewController.h deleted file mode 100644 index 49823b99d4..0000000000 --- a/Testing/ORKTest/ORKTest/MainViewController.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; - - -/* - The main view controller provides a list of all the tasks that are available. - */ -@interface MainViewController : UIViewController - -@end diff --git a/Testing/ORKTest/ORKTest/MainViewController.m b/Testing/ORKTest/ORKTest/MainViewController.m deleted file mode 100644 index 8f1a1d2241..0000000000 --- a/Testing/ORKTest/ORKTest/MainViewController.m +++ /dev/null @@ -1,906 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015 - 2016, Ricardo Sanchez-Saez. - Copyright (c) 2016, Sage Bionetworks. - Copyright (c) 2017, Macro Yau. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "MainViewController.h" - -#import "AppDelegate.h" -#import "DynamicTask.h" -#import "TaskFactory.h" - -#import "ORKTest-Swift.h" - -@import ResearchKit; - -@import AVFoundation; - - -NSArray *> *> *TestButtonTable() -{ - return @[ - @{ @"Active Tasks": - @[ - @"Active Step", - @"Audio", - @"Fitness", - @"GAIT", - @"Hand Tremor", - @"Hand (Right) Tremor", - @"Hole Peg Test", - @"Memory Game", - @"PSAT", - @"Reaction Time", - @"Stroop", - @"Timed Walk", - @"Tone Audiometry", - @"Tower Of Hanoi", - @"Trail Making", - @"Two Finger Tapping", - @"Walk And Turn", - ]}, - @{ @"Forms": - @[ - @"Confirmation Form Item", - @"Mini Form", - @"Optional Form", - ]}, - @{ @"Onboarding": - @[ - @"Consent", - @"Consent Review", - @"Eligibility Form", - @"Eligibility Survey", - @"Login", - @"Registration", - @"Verification", - ]}, - @{ @"Passcode Management": - @[ - @"Authenticate Passcode", - @"Create Passcode", - @"Edit Passcode", - @"Remove Passcode", - ]}, - @{ @"Question Steps": - @[ - @"Date Pickers", - @"Image Capture", - @"Image Choice", - @"Location", - @"Scale", - @"Scale (Color Gradient)", - @"Selection Survey", - @"Video Capture", - ]}, - @{ @"Task Customization": - @[ - @"Custom View Controller", - @"Dynamic", - @"Interruptible", - @"Navigable Ordered", - @"Navigable Ordered Loop", - @"Step Will Appear", - @"Step Will Disappear", - ]}, - @{ @"Task Review": - @[ - @"Embedded Review", - @"Standalone Review", - ]}, - @{ @"Utility Steps": - @[ - @"Auxiliary Image Step", - @"Completion Step", - @"Footnote Step", - @"Icon Image Step", - @"Page Step", - @"Predicate Tests", - @"Signature Step", - @"Table Step", - @"Video Instruction Step", - @"Wait Step", - @"Web View Step" - ]}, - @{ @"Miscellaneous": - @[ - @"Continue Button", - @"Toggle Tint Color", - ]}, - ]; -} - - -@interface SectionHeader: UICollectionReusableView - -- (void)configureHeaderWithTitle:(NSString *)title; - -@end - - -@implementation SectionHeader { - UILabel *_title; -} - -- (instancetype)initWithCoder:(NSCoder *)aDecoder { - if (self = [super initWithCoder:aDecoder]) { - [self sharedInit]; - } - return self; -} - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - [self sharedInit]; - } - return self; -} - -static UIColor *HeaderColor() { - return [UIColor colorWithWhite:0.97 alpha:1.0]; -} - -static const CGFloat HeaderSideLayoutMargin = 16.0; - -- (void)sharedInit { - self.layoutMargins = UIEdgeInsetsMake(0, HeaderSideLayoutMargin, 0, HeaderSideLayoutMargin); - self.backgroundColor = HeaderColor(); - _title = [UILabel new]; - _title.font = [UIFont systemFontOfSize:17.0 weight:UIFontWeightSemibold]; // Table view header font - [self addSubview:_title]; - - _title.translatesAutoresizingMaskIntoConstraints = NO; - NSDictionary *views = @{@"title": _title}; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[title]-|" - options:NSLayoutFormatDirectionLeadingToTrailing - metrics:nil - views:views]]; - [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[title]|" - options:0 - metrics:nil - views:views]]; -} - -- (void)configureHeaderWithTitle:(NSString *)title { - _title.text = title; -} - -@end - - -@interface ButtonCell: UICollectionViewCell - -- (void)configureButtonWithTitle:(NSString *)title target:(id)target selector:(SEL)selector; - -@end - - -@implementation ButtonCell { - UIButton *_button; -} - -- (void)setUpButton { - [_button removeFromSuperview]; - _button = [UIButton buttonWithType:UIButtonTypeSystem]; - _button.titleLabel.adjustsFontSizeToFitWidth = YES; - _button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; - _button.contentEdgeInsets = UIEdgeInsetsMake(0.0, HeaderSideLayoutMargin, 0.0, 0.0); - [self.contentView addSubview:_button]; - - _button.translatesAutoresizingMaskIntoConstraints = NO; - - [NSLayoutConstraint activateConstraints:@[ - [NSLayoutConstraint constraintWithItem:_button - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:self.contentView - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_button - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self.contentView - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_button - attribute:NSLayoutAttributeLeft - relatedBy:NSLayoutRelationEqual - toItem:self.contentView.safeAreaLayoutGuide - attribute:NSLayoutAttributeLeft - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_button - attribute:NSLayoutAttributeRight - relatedBy:NSLayoutRelationEqual - toItem:self.contentView.safeAreaLayoutGuide - attribute:NSLayoutAttributeRight - multiplier:1.0 - constant:0.0] - ]]; -} - -- (void)configureButtonWithTitle:(NSString *)title target:(id)target selector:(SEL)selector { - [self setUpButton]; - [_button setTitle:title forState:UIControlStateNormal]; - [_button addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; -} - -@end - - -#define ORKTDefineStringKey(x) static NSString *const x = @#x - -ORKTDefineStringKey(CollectionViewHeaderReuseIdentifier); -ORKTDefineStringKey(CollectionViewCellReuseIdentifier); - -@interface MainViewController () - -@end - - -@implementation MainViewController { - ORKTaskViewController *_taskViewController; - id _lastRouteResult; - - NSMutableDictionary *_savedViewControllers; // Maps task identifiers to task view controller restoration data - - UICollectionView *_collectionView; - NSArray *> *> *_buttonSections; - NSMutableArray *_constraints; - UIView *_statusBarBackground; - ORKTaskResult * _miniFormTaskResult; -} - - -- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - self.restorationIdentifier = @"main"; - } - return self; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - - _savedViewControllers = [NSMutableDictionary new]; - - UICollectionViewFlowLayout *flowLayout = [UICollectionViewFlowLayout new]; - _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout]; - _collectionView.backgroundColor = [UIColor whiteColor]; - [self.view addSubview:_collectionView]; - - _collectionView.dataSource = self; - _collectionView.delegate = self; - [_collectionView registerClass:[SectionHeader class] - forSupplementaryViewOfKind:UICollectionElementKindSectionHeader - withReuseIdentifier:CollectionViewHeaderReuseIdentifier]; - [_collectionView registerClass:[ButtonCell class] - forCellWithReuseIdentifier:CollectionViewCellReuseIdentifier]; - - _statusBarBackground = [UIView new]; - _statusBarBackground.backgroundColor = HeaderColor(); - [self.view addSubview:_statusBarBackground]; - - [self setupConstraints]; - - _buttonSections = TestButtonTable(); -} - -- (void)setupConstraints { - if (_constraints) { - [NSLayoutConstraint deactivateConstraints:_constraints]; - _constraints = nil; - } - - _collectionView.translatesAutoresizingMaskIntoConstraints = NO; - _statusBarBackground.translatesAutoresizingMaskIntoConstraints = NO; - NSDictionary *views = @{@"collectionView": _collectionView, - @"statusBarBackground": _statusBarBackground}; - - _constraints = [[NSMutableArray alloc] init]; - [_constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[statusBarBackground]|" - options:NSLayoutFormatDirectionLeadingToTrailing - metrics:nil - views:views]]; - [_constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[statusBarBackground]" - options:0 - metrics:nil - views:views]]; - [_constraints addObject:[NSLayoutConstraint constraintWithItem:_statusBarBackground - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self.view.safeAreaLayoutGuide - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:0.0]]; - [_constraints addObjectsFromArray:@[ - [NSLayoutConstraint constraintWithItem:_collectionView - attribute:NSLayoutAttributeTop - relatedBy:NSLayoutRelationEqual - toItem:self.view.safeAreaLayoutGuide - attribute:NSLayoutAttributeTop - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_collectionView - attribute:NSLayoutAttributeLeft - relatedBy:NSLayoutRelationEqual - toItem:self.view - attribute:NSLayoutAttributeLeft - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_collectionView - attribute:NSLayoutAttributeRight - relatedBy:NSLayoutRelationEqual - toItem:self.view - attribute:NSLayoutAttributeRight - multiplier:1.0 - constant:0.0], - [NSLayoutConstraint constraintWithItem:_collectionView - attribute:NSLayoutAttributeBottom - relatedBy:NSLayoutRelationEqual - toItem:self.view.safeAreaLayoutGuide - attribute:NSLayoutAttributeBottom - multiplier:1.0 - constant:0.0] - ]]; - [NSLayoutConstraint activateConstraints:_constraints]; -} - -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { - [_collectionView reloadData]; -} - -- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section { - return CGSizeMake(self.view.bounds.size.width, 22.0); // Table view header height -} - -- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { - CGFloat viewWidth = self.view.bounds.size.width; - NSUInteger numberOfColums = 2; - if (viewWidth >= 667.0) { - numberOfColums = 3; - } - CGFloat width = viewWidth / numberOfColums; - return CGSizeMake(width, 44.0); -} - -- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section { - return 0.0; -} - -- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section { - return 0.0; -} - -- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { - return _buttonSections.count; -} - -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - return _buttonSections[section].allValues[0].count; -} - -- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath { - SectionHeader *sectionHeader = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:CollectionViewHeaderReuseIdentifier forIndexPath:indexPath]; - NSString *title = _buttonSections[indexPath.section].allKeys[0]; - [sectionHeader configureHeaderWithTitle:title]; - return sectionHeader; -} - -NSString *RemoveParenthesisAndCapitalizeString(NSString *string) { - // "THIS (FOO) baR title" is converted to the "This Foo Bar Title" - NSMutableString *mutableString = [string mutableCopy]; - [mutableString replaceOccurrencesOfString:@"(" withString:@"" options:0 range:NSMakeRange(0, mutableString.length)]; - [mutableString replaceOccurrencesOfString:@")" withString:@"" options:0 range:NSMakeRange(0, mutableString.length)]; - return mutableString.capitalizedString; -} - -- (SEL)selectorFromButtonTitle:(NSString *)buttonTitle { - // "THIS (FOO) baR title" is converted to the "thisFooBarTitleButtonTapped:" selector - buttonTitle = RemoveParenthesisAndCapitalizeString(buttonTitle); - NSMutableArray *titleTokens = [[buttonTitle componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] mutableCopy]; - titleTokens[0] = ((NSString *)titleTokens[0]).lowercaseString; - NSString *selectorString = [NSString stringWithFormat:@"%@ButtonTapped:", [titleTokens componentsJoinedByString:@""]]; - return NSSelectorFromString(selectorString); -} - -- (NSString *)taskIdentifierFromButtonTitle:(NSString *)buttonTitle { - // "THIS (FOO) baR title" is converted to the "ThisFooBarTitleTaskIdentifier" selector - buttonTitle = RemoveParenthesisAndCapitalizeString(buttonTitle); - NSMutableArray *titleTokens = [[buttonTitle componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] mutableCopy]; - NSString *taskIdentifier = [NSString stringWithFormat:@"%@TaskIdentifier", [titleTokens componentsJoinedByString:@""]]; - return taskIdentifier; -} - -- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - ButtonCell *buttonCell = [collectionView dequeueReusableCellWithReuseIdentifier:CollectionViewCellReuseIdentifier forIndexPath:indexPath]; - NSString *buttonTitle = _buttonSections[indexPath.section].allValues[0][indexPath.row]; - [buttonCell configureButtonWithTitle:buttonTitle target:self selector:@selector(buttonTapped:)]; - return buttonCell; -} - -- (void)buttonTapped:(UIButton *)button { - NSString *buttonTitle = button.titleLabel.text; - SEL buttonSelector = [self selectorFromButtonTitle:buttonTitle]; - if ([self respondsToSelector:buttonSelector]) { - // Equivalent to [self peformSelector:buttonSelector], but ARC safe - IMP imp = [self methodForSelector:buttonSelector]; - void (*func)(id, SEL, UIButton *button) = (void *)imp; - func(self, buttonSelector, button); - } else { - [self beginTaskWithIdentifier:[self taskIdentifierFromButtonTitle:buttonTitle]]; - } -} - -/* - Creates a task and presents it with a task view controller. - */ -- (void)beginTaskWithIdentifier:(NSString *)identifier { - /* - This is our implementation of restoration after saving during a task. - If the user saved their work on a previous run of a task with the same - identifier, we attempt to restore the view controller here. - - Since unarchiving can throw an exception, in a real application we would - need to attempt to catch that exception here. - */ - - id task = [[TaskFactory sharedInstance] makeTaskWithIdentifier:identifier]; - NSParameterAssert(task != nil); - NSError *error; - - NSData *restorationData = _savedViewControllers[identifier]; - _taskViewController = [[TaskFactory sharedInstance] makeTaskViewControllerWithIdentifier:identifier task:task restorationData:restorationData delegate:self]; - - [self beginTask]; -} - -/* - Actually presents the task view controller. - */ -- (void)beginTask { - NSObject *task = _taskViewController.task; - _taskViewController.delegate = self; - - if (_taskViewController.outputDirectory == nil) { - // Sets an output directory in Documents, using the `taskRunUUID` in the path. - NSURL *documents = [[NSFileManager defaultManager] URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil]; - NSURL *outputDir = [documents URLByAppendingPathComponent:_taskViewController.taskRunUUID.UUIDString]; - [[NSFileManager defaultManager] createDirectoryAtURL:outputDir withIntermediateDirectories:YES attributes:nil error:nil]; - _taskViewController.outputDirectory = outputDir; - } - - /* - For the dynamic task, we remember the last result and use it as a source - of default values for any optional questions. - */ - if ([task isKindOfClass:[DynamicTask class]]) { - _taskViewController.defaultResultSource = _lastRouteResult; - } - - if ([_taskViewController.task.identifier isEqualToString: @"MiniFormTaskIdentifier"] && _miniFormTaskResult) { - _taskViewController.defaultResultSource = _miniFormTaskResult; - _taskViewController.reviewMode = ORKTaskViewControllerReviewModeStandalone; - } - - /* - We set a restoration identifier so that UI state restoration is enabled - for the task view controller. We don't need to do anything else to prepare - for state restoration of a ResearchKit framework task VC. - */ - _taskViewController.restorationIdentifier = task.identifier; - - [self presentViewController:_taskViewController animated:YES completion:nil]; -} - -#pragma mark - Custom Button Actions - -// Passcode management -- (void)authenticatePasscodeButtonTapped:(id)sender { - if ([ORKPasscodeViewController isPasscodeStoredInKeychain]) { - ORKPasscodeViewController *viewController = [ORKPasscodeViewController - passcodeAuthenticationViewControllerWithText:@"Authenticate your passcode in order to proceed." - delegate:self]; - [self presentViewController:viewController animated:YES completion:nil]; - } else { - [self showAlertWithTitle:@"Error" message:@"A passcode must be created before you can authenticate it."]; - } -} - -- (void)editPasscodeButtonTapped:(id)sender { - if ([ORKPasscodeViewController isPasscodeStoredInKeychain]) { - ORKPasscodeViewController *viewController = [ORKPasscodeViewController passcodeEditingViewControllerWithText:nil - delegate:self - passcodeType:ORKPasscodeType6Digit]; - [self presentViewController:viewController animated:YES completion:nil]; - } else { - [self showAlertWithTitle:@"Error" message:@"A passcode must be created before you can edit it."]; - } -} - -- (void)removePasscodeButtonTapped:(id)sender { - if ([ORKPasscodeViewController isPasscodeStoredInKeychain]) { - if ([ORKPasscodeViewController removePasscodeFromKeychain]) { - [self showAlertWithTitle:@"Success" message:@"Passcode removed."]; - } else { - [self showAlertWithTitle:@"Error" message:@"Passcode could not be removed."]; - } - } else { - [self showAlertWithTitle:@"Error" message:@"There is no passcode stored in the keychain."]; - } -} - -// Task Review -- (IBAction)standaloneReviewButtonTapped:(UIButton *)button { - if ([TaskFactory sharedInstance].embeddedReviewTaskResult != nil) { - NSString *buttonTitle = button.titleLabel.text; - [self beginTaskWithIdentifier:[self taskIdentifierFromButtonTitle:buttonTitle]]; - } else { - [self showAlertWithTitle:@"Alert" message:@"Please run embedded review task first"]; - } -} - -// Miscellaneous -- (IBAction)continueButtonButtonTapped:(UIButton *)button { - UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"ContinueButtonExample" bundle:nil]; - UIViewController *viewcController = [storyboard instantiateInitialViewController]; - [self presentViewController:viewcController animated:YES completion:nil]; -} - -- (void)toggleTintColorButtonTapped:(UIButton *)button { - static UIColor *defaultTintColor = nil; - if (!defaultTintColor) { - defaultTintColor = self.view.tintColor; - } - if ([[UIView appearance].tintColor isEqual:[UIColor redColor]]) { - [UIView appearance].tintColor = defaultTintColor; - } else { - [UIView appearance].tintColor = [UIColor redColor]; - } - // Update appearance - UIView *superview = self.view.superview; - [self.view removeFromSuperview]; - [superview addSubview:self.view]; -} - -#pragma mark - Passcode delegate - -- (void)passcodeViewControllerDidFailAuthentication:(UIViewController *)viewController { - NSLog(@"Passcode authentication failed."); - [self showAlertWithTitle:@"Error" message:@"Passcode authentication failed"]; -} - -- (void)passcodeViewControllerDidFinishWithSuccess:(UIViewController *)viewController { - NSLog(@"New passcode saved."); - [viewController dismissViewControllerAnimated:YES completion:nil]; -} - -- (void)passcodeViewControllerDidCancel:(UIViewController *)viewController { - NSLog(@"User tapped the cancel button."); - [viewController dismissViewControllerAnimated:YES completion:nil]; -} - -- (void)passcodeViewControllerForgotPasscodeTapped:(UIViewController *)viewController { - NSLog(@"Forgot Passcode tapped."); - UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Forgot Passcode" - message:@"Forgot Passcode tapped." - preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; - [viewController presentViewController:alert animated:YES completion:nil]; -} - -#pragma mark - Helpers - -/* - Shows an alert. - - Used to display an alert with the provided title and message. - - @param title The title text for the alert. - @param message The message text for the alert. - */ -- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:title - message:message - preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; - [self presentViewController:alert animated:YES completion:nil]; -} - -#pragma mark - Managing the task view controller - -/* - Dismisses the task view controller. - */ -- (void)dismissTaskViewController:(ORKTaskViewController *)taskViewController removeOutputDirectory:(BOOL)removeOutputDirectory { - [TaskFactory sharedInstance].currentConsentDocument = nil; - - NSURL *outputDirectoryURL = taskViewController.outputDirectory; - [self dismissViewControllerAnimated:YES completion:^{ - if (outputDirectoryURL && removeOutputDirectory) - { - /* - We attempt to clean up the output directory. - - This is only useful for a test app, where we don't care about the - data after the test is complete. In a real application, only - delete your data when you've processed it or sent it to a server. - */ - NSError *error = nil; - if (![[NSFileManager defaultManager] removeItemAtURL:outputDirectoryURL error:&error]) { - NSLog(@"Error removing %@: %@", outputDirectoryURL, error); - } - } - }]; -} - -#pragma mark - ORKTaskViewControllerDelegate - -/* - Any step can have "Learn More" content. - - For testing, we return YES only for instruction steps, except on the active - tasks. - */ -- (BOOL)taskViewController:(ORKTaskViewController *)taskViewController hasLearnMoreForStep:(ORKStep *)step { - NSObject *task = taskViewController.task; - - return ([step isKindOfClass:[ORKInstructionStep class]] - && !task.hidesLearnMoreButtonOnInstructionStep); -} - -/* - When the user taps on "Learn More" on a step, respond on this delegate callback. - In this test app, we just print to the console. - */ -- (void)taskViewController:(ORKTaskViewController *)taskViewController learnMoreForStep:(ORKStepViewController *)stepViewController { - NSLog(@"Learn more tapped for step %@", stepViewController.step.identifier); -} - -- (BOOL)taskViewController:(ORKTaskViewController *)taskViewController shouldPresentStep:(ORKStep *)step { - BOOL shouldPresentStep = YES; - if (step.shouldPresentStepBlock) { - shouldPresentStep = step.shouldPresentStepBlock(taskViewController, step); - } - return shouldPresentStep; -} - -/* - In `stepViewControllerWillAppear:`, it is possible to significantly customize - the behavior of the step view controller. In this test app, we do a few funny - things to push the limits of this customization. - */ -- (void)taskViewController:(ORKTaskViewController *)taskViewController -stepViewControllerWillAppear:(ORKStepViewController *)stepViewController { - ORKStep *step = stepViewController.step; - if (step.stepViewControllerWillAppearBlock) { - step.stepViewControllerWillAppearBlock(taskViewController, stepViewController); - } -} - -- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillDisappear:(ORKStepViewController *)stepViewController navigationDirection:(ORKStepViewControllerNavigationDirection)direction { - ORKStep *step = stepViewController.step; - if (step.stepViewControllerWillDisappearBlock) { - step.stepViewControllerWillDisappearBlock(taskViewController, stepViewController, direction); - } -} - -/* - We support save and restore on all of the tasks in this test app. - - In a real app, not all tasks necessarily ought to support saving -- for example, - active tasks that can't usefully be restarted after a significant time gap - should not support save at all. - */ -- (BOOL)taskViewControllerSupportsSaveAndRestore:(ORKTaskViewController *)taskViewController { - return YES; -} - -/* - In almost all cases, we want to dismiss the task view controller. - - In this test app, we don't dismiss on a fail (we just log it). - */ -- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskViewControllerFinishReason)reason error:(NSError *)error { - switch (reason) { - case ORKTaskViewControllerFinishReasonCompleted: - { - NSObject *task = taskViewController.task; - if (task.isEmbeddedReviewTask) { - [TaskFactory sharedInstance].embeddedReviewTaskResult = taskViewController.result; - } - if ([task.identifier isEqualToString: @"MiniFormTaskIdentifier"]) { - _miniFormTaskResult = taskViewController.result; - } - [self taskViewControllerDidComplete:taskViewController]; - } - break; - case ORKTaskViewControllerFinishReasonFailed: - { - NSLog(@"Error on step %@: %@", taskViewController.currentStepViewController.step, error); - } - break; - case ORKTaskViewControllerFinishReasonDiscarded: - { - NSObject *task = taskViewController.task; - if (task.isEmbeddedReviewTask) { - [TaskFactory sharedInstance].embeddedReviewTaskResult = nil; - } - [self dismissTaskViewController:taskViewController removeOutputDirectory:YES]; - } - break; - case ORKTaskViewControllerFinishReasonSaved: - { - NSObject *task = taskViewController.task; - if (task.isEmbeddedReviewTask) { - [TaskFactory sharedInstance].embeddedReviewTaskResult = taskViewController.result; - } - /* - Save the restoration data, dismiss the task VC, and do an early return - so we don't clear the restoration data. - */ - _savedViewControllers[task.identifier] = taskViewController.restorationData; - [self dismissTaskViewController:taskViewController removeOutputDirectory:NO]; - return; - } - break; - - default: - break; - } - - [_savedViewControllers removeObjectForKey:taskViewController.task.identifier]; - _taskViewController = nil; -} - -/* - When a task completes, we pretty-print the result to the console. - - This is ok for testing, but if what you want to do is see the results of a task, - the `ORKCatalog` Swift sample app might be a better choice, since it lets - you navigate through the result structure. - */ -- (void)taskViewControllerDidComplete:(ORKTaskViewController *)taskViewController { - - NSLog(@"[ORKTest] task results: %@", taskViewController.result); - - // Validate the results - NSArray *results = taskViewController.result.results; - if (results) { - NSSet *uniqueResults = [NSSet setWithArray:results]; - BOOL allResultsUnique = (results.count == uniqueResults.count); - NSAssert(allResultsUnique, @"The returned results have duplicates of the same object."); - } - - if ([TaskFactory sharedInstance].currentConsentDocument) { - /* - This demonstrates how to take a signature result, apply it to a document, - and then generate a PDF From the document that includes the signature. - */ - - // Search for the review step. - NSArray *steps = [(ORKOrderedTask *)taskViewController.task steps]; - NSPredicate *predicate = [NSPredicate predicateWithFormat: @"self isKindOfClass: %@", [ORKConsentReviewStep class]]; - ORKStep *reviewStep = [[steps filteredArrayUsingPredicate:predicate] firstObject]; - ORKConsentSignatureResult *signatureResult = (ORKConsentSignatureResult *)[[[taskViewController result] stepResultForStepIdentifier:reviewStep.identifier] firstResult]; - - [signatureResult applyToDocument:[TaskFactory sharedInstance].currentConsentDocument]; - - [[TaskFactory sharedInstance].currentConsentDocument makePDFWithCompletionHandler:^(NSData *pdfData, NSError *error) { - NSLog(@"Created PDF of size %lu (error = %@)", (unsigned long)pdfData.length, error); - - if (!error) { - NSURL *documents = [NSURL fileURLWithPath:NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject]; - NSURL *outputUrl = [documents URLByAppendingPathComponent:[NSString stringWithFormat:@"%@.pdf", taskViewController.taskRunUUID.UUIDString]]; - - [pdfData writeToURL:outputUrl atomically:YES]; - NSLog(@"Wrote PDF to %@", [outputUrl path]); - } - }]; - - [TaskFactory sharedInstance].currentConsentDocument = nil; - } - - NSURL *dir = taskViewController.outputDirectory; - [self dismissViewControllerAnimated:YES completion:^{ - if (dir) - { - NSError *error = nil; - if (![[NSFileManager defaultManager] removeItemAtURL:dir error:&error]) { - NSLog(@"Error removing %@: %@", dir, error); - } - } - }]; -} - -/** - When a task has completed it calls this method to post the result of the task to the delegate. -*/ -- (void)taskViewController:(ORKTaskViewController *)taskViewController didChangeResult:(ORKTaskResult *)result { - /* - Upon creation of a Passcode by a user, the results of their creation - are returned by getting it from ORKPasscodeResult in this delegate call. - This is triggered upon completion/failure/or cancel - */ - ORKStepResult *stepResult = (ORKStepResult *)[[result results] firstObject]; - if ([[[stepResult results] firstObject] isKindOfClass:[ORKPasscodeResult class]]) { - ORKPasscodeResult *passcodeResult = (ORKPasscodeResult *)[[stepResult results] firstObject]; - NSLog(@"passcode saved: %d , Touch ID Enabled: %d", passcodeResult.passcodeSaved, passcodeResult.touchIdEnabled); - - } -} - -#pragma mark - UI state restoration - -/* - UI state restoration code for the MainViewController. - - The MainViewController needs to be able to re-create the exact task that - was being done, in order for the task view controller to restore correctly. - - In a real app implementation, this might mean that you would also need to save - and restore the actual task; here, since we know the tasks don't change during - testing, we just re-create the task. - */ -- (void)encodeRestorableStateWithCoder:(NSCoder *)coder { - [super encodeRestorableStateWithCoder:coder]; - - [coder encodeObject:_taskViewController forKey:@"taskVC"]; - [coder encodeObject:_lastRouteResult forKey:@"lastRouteResult"]; - [coder encodeObject:[TaskFactory sharedInstance].embeddedReviewTaskResult forKey:@"embeddedReviewTaskResult"]; -} - -- (void)decodeRestorableStateWithCoder:(NSCoder *)coder { - [super decodeRestorableStateWithCoder:coder]; - - _taskViewController = [coder decodeObjectOfClass:[UIViewController class] forKey:@"taskVC"]; - _lastRouteResult = [coder decodeObjectOfClass:[ORKTaskResult class] forKey:@"lastRouteResult"]; - - // Need to give the task VC back a copy of its task, so it can restore itself. - - // Could save and restore the task's identifier separately, but the VC's - // restoration identifier defaults to the task's identifier. - id taskForTaskViewController = [[TaskFactory sharedInstance] makeTaskWithIdentifier:_taskViewController.restorationIdentifier]; - - _taskViewController.task = taskForTaskViewController; - if ([_taskViewController.restorationIdentifier isEqualToString:@"DynamicTask01"]) - { - _taskViewController.defaultResultSource = _lastRouteResult; - } - _taskViewController.delegate = self; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index c69af42a66..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "icon_small_40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "icon_small_40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "icon_60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "icon_60@3x.png", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "icon_small_40.png", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "icon_76.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "icon_76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "icon_83.5@2x.png", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_60@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_60@2x.png deleted file mode 100644 index 0b9328356e..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_60@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_60@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_60@3x.png deleted file mode 100644 index f01e1ccc89..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_60@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_76.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_76.png deleted file mode 100644 index 954ebd88be..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_76.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_76@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_76@2x.png deleted file mode 100644 index 669c9e8630..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_76@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_83.5@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_83.5@2x.png deleted file mode 100644 index b541745cb3..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_83.5@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40.png deleted file mode 100644 index aec9ca7e15..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40@2x.png deleted file mode 100644 index abc6b7266d..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40@3x.png deleted file mode 100644 index 0b9328356e..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/AppIcon.appiconset/icon_small_40@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMaximumValueTest.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMaximumValueTest.imageset/Contents.json deleted file mode 100644 index c22b539207..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMaximumValueTest.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "GraphMaximumValueTest.pdf" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMaximumValueTest.imageset/GraphMaximumValueTest.pdf b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMaximumValueTest.imageset/GraphMaximumValueTest.pdf deleted file mode 100644 index c2ae73149d..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMaximumValueTest.imageset/GraphMaximumValueTest.pdf and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMinimumValueTest.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMinimumValueTest.imageset/Contents.json deleted file mode 100644 index d4e2907455..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMinimumValueTest.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "GraphMinimumValueTest.pdf" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMinimumValueTest.imageset/GraphMinimumValueTest.pdf b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMinimumValueTest.imageset/GraphMinimumValueTest.pdf deleted file mode 100644 index 8b61bf3e42..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/GraphMinimumValueTest.imageset/GraphMinimumValueTest.pdf and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Poppies.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Poppies.imageset/Contents.json deleted file mode 100644 index 8ce48c36c2..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Poppies.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "Poppies.jpg", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Poppies.imageset/Poppies.jpg b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Poppies.imageset/Poppies.jpg deleted file mode 100644 index e9569b8df2..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/Poppies.imageset/Poppies.jpg and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/Contents.json deleted file mode 100644 index 81e5148062..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/Contents.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "hands_solid@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "hands_solid@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "hands_solid@2x~ipad.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@2x.png deleted file mode 100644 index 6bc1aacc85..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@2x~ipad.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@2x~ipad.png deleted file mode 100644 index 262d9ca511..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@2x~ipad.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@3x.png deleted file mode 100644 index 262d9ca511..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/hands_solid.imageset/hands_solid@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/Contents.json deleted file mode 100644 index c45f431304..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/Contents.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "left_hand_outline@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "left_hand_outline@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "left_hand_outline@2x~ipad.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@2x.png deleted file mode 100644 index 75eb05db6e..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@2x~ipad.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@2x~ipad.png deleted file mode 100644 index 582c91387b..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@2x~ipad.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@3x.png deleted file mode 100644 index fcae3be022..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline.imageset/left_hand_outline@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/Contents.json deleted file mode 100644 index 8d57a337b3..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/Contents.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "left_hand_outline_big@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "left_hand_outline_big@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "left_hand_outline_big@2x~ipad.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@2x.png deleted file mode 100644 index 218d1e4c89..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@2x~ipad.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@2x~ipad.png deleted file mode 100644 index 537789ac79..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@2x~ipad.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@3x.png deleted file mode 100644 index 537789ac79..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_outline_big.imageset/left_hand_outline_big@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/Contents.json deleted file mode 100644 index 72a569372e..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/Contents.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "left_hand_solid@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "left_hand_solid@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "left_hand_solid@2x~ipad.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@2x.png deleted file mode 100644 index c66f8e9b91..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@2x~ipad.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@2x~ipad.png deleted file mode 100644 index 26810ee6cd..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@2x~ipad.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@3x.png deleted file mode 100644 index 26810ee6cd..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/left_hand_solid.imageset/left_hand_solid@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/Contents.json deleted file mode 100644 index 811a34fc05..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/Contents.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "right_hand_outline@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "right_hand_outline@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "right_hand_outline@2x~ipad.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@2x.png deleted file mode 100644 index b12a7cd1b0..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@2x~ipad.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@2x~ipad.png deleted file mode 100644 index 1f049ea378..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@2x~ipad.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@3x.png deleted file mode 100644 index a7c3db158f..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline.imageset/right_hand_outline@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/Contents.json deleted file mode 100644 index de2ffc33ae..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/Contents.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "right_hand_outline_big@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "right_hand_outline_big@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "right_hand_outline_big@2x~ipad.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@2x.png deleted file mode 100644 index f4647fc398..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@2x~ipad.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@2x~ipad.png deleted file mode 100644 index 4d9d639193..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@2x~ipad.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@3x.png deleted file mode 100644 index 4d9d639193..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_outline_big.imageset/right_hand_outline_big@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/Contents.json b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/Contents.json deleted file mode 100644 index d0c486963e..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/Contents.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "1x" - }, - { - "idiom" : "iphone", - "filename" : "right_hand_solid@2x.png", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "filename" : "right_hand_solid@3x.png", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "subtype" : "retina4", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "filename" : "right_hand_solid@2x~ipad.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@2x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@2x.png deleted file mode 100644 index 6872ebb9a2..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@2x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@2x~ipad.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@2x~ipad.png deleted file mode 100644 index fe50bd5d3b..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@2x~ipad.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@3x.png b/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@3x.png deleted file mode 100644 index fdd76f2744..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/Images.xcassets/right_hand_solid.imageset/right_hand_solid@3x.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/Base.lproj/LaunchScreen.xib b/Testing/ORKTest/ORKTest/Resources/Localized/Base.lproj/LaunchScreen.xib deleted file mode 100644 index c918d0f948..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/Base.lproj/LaunchScreen.xib +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/Base.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/Base.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/Base.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/ar.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/ar.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/ar.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/ca.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/ca.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/ca.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/cs.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/cs.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/cs.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/da.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/da.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/da.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/de.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/de.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/de.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/el.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/el.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/el.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/en-AU.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/en-AU.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/en-AU.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/en-GB.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/en-GB.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/en-GB.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/en.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/en.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/en.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/es-MX.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/es-MX.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/es-MX.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/es.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/es.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/es.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/fi.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/fi.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/fi.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/fr-CA.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/fr-CA.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/fr-CA.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/fr.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/fr.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/fr.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/he.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/he.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/he.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/hi.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/hi.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/hi.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/hr.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/hr.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/hr.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/hu.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/hu.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/hu.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/id.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/id.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/id.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/it.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/it.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/it.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/ja.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/ja.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/ja.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/ko.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/ko.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/ko.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/ms.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/ms.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/ms.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/nb.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/nb.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/nb.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/nl.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/nl.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/nl.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/pl.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/pl.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/pl.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/pt-PT.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/pt-PT.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/pt-PT.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/pt.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/pt.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/pt.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/ro.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/ro.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/ro.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/ru.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/ru.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/ru.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/sk.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/sk.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/sk.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/sv.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/sv.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/sv.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/th.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/th.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/th.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/tr.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/tr.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/tr.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/uk.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/uk.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/uk.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/vi.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/vi.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/vi.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/zh-HK.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/zh-HK.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/zh-HK.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/zh-Hans.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/zh-Hans.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/zh-Hans.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/zh-Hant.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/zh-Hant.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/zh-Hant.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/Localized/zh_TW.lproj/Localizable.strings b/Testing/ORKTest/ORKTest/Resources/Localized/zh_TW.lproj/Localizable.strings deleted file mode 100644 index 8b13789179..0000000000 --- a/Testing/ORKTest/ORKTest/Resources/Localized/zh_TW.lproj/Localizable.strings +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Testing/ORKTest/ORKTest/Resources/SAMPLE_PDF_TEST.pdf b/Testing/ORKTest/ORKTest/Resources/SAMPLE_PDF_TEST.pdf deleted file mode 100644 index 47dafc21fd..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/SAMPLE_PDF_TEST.pdf and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/image_example.png b/Testing/ORKTest/ORKTest/Resources/image_example.png deleted file mode 100644 index cab7fd92cc..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/image_example.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Resources/signature.png b/Testing/ORKTest/ORKTest/Resources/signature.png deleted file mode 100644 index b486d7413b..0000000000 Binary files a/Testing/ORKTest/ORKTest/Resources/signature.png and /dev/null differ diff --git a/Testing/ORKTest/ORKTest/Supporting Files/ContinueButtonExample.storyboard b/Testing/ORKTest/ORKTest/Supporting Files/ContinueButtonExample.storyboard deleted file mode 100644 index 7896b79020..0000000000 --- a/Testing/ORKTest/ORKTest/Supporting Files/ContinueButtonExample.storyboard +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Testing/ORKTest/ORKTest/Supporting Files/Info.plist b/Testing/ORKTest/ORKTest/Supporting Files/Info.plist deleted file mode 100644 index d86f517f6f..0000000000 --- a/Testing/ORKTest/ORKTest/Supporting Files/Info.plist +++ /dev/null @@ -1,55 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(MARKETING_VERSION) - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - LSRequiresIPhoneOS - - NSCameraUsageDescription - Test Camera related features. - NSFaceIDUsageDescription - This app uses Face ID. - NSHealthShareUsageDescription - Test HK releated features. - NSHealthUpdateUsageDescription - Test HK releated features. - NSLocationWhenInUseUsageDescription - This app records your location during certian tasks. - NSMicrophoneUsageDescription - Test audio recording features. - NSMotionUsageDescription - Use motion sensors - UIBackgroundModes - - audio - location - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - - diff --git a/Testing/ORKTest/ORKTest/Supporting Files/ORKTest-Bridging-Header.h b/Testing/ORKTest/ORKTest/Supporting Files/ORKTest-Bridging-Header.h deleted file mode 100644 index ceecb9d734..0000000000 --- a/Testing/ORKTest/ORKTest/Supporting Files/ORKTest-Bridging-Header.h +++ /dev/null @@ -1,5 +0,0 @@ -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// - -#import "TaskFactory.h" diff --git a/Testing/ORKTest/ORKTest/Supporting Files/ORKTest.entitlements b/Testing/ORKTest/ORKTest/Supporting Files/ORKTest.entitlements deleted file mode 100644 index e10f4302d5..0000000000 --- a/Testing/ORKTest/ORKTest/Supporting Files/ORKTest.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.developer.healthkit - - - diff --git a/Testing/ORKTest/ORKTest/Supporting Files/main.m b/Testing/ORKTest/ORKTest/Supporting Files/main.m deleted file mode 100644 index 286148c2da..0000000000 --- a/Testing/ORKTest/ORKTest/Supporting Files/main.m +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015, Apple Inc. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - - -@import UIKit; -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+ActiveTasks.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+ActiveTasks.h deleted file mode 100644 index 7ac6b4dde2..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+ActiveTasks.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (ActiveTasks) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+ActiveTasks.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+ActiveTasks.m deleted file mode 100644 index 02fea14625..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+ActiveTasks.m +++ /dev/null @@ -1,326 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+ActiveTasks.h" - -@import ResearchKit.Private; - - -@implementation TaskFactory (ActiveTasks) - -/* - This task demonstrates direct use of active steps, which is not particularly - well-supported by the framework. The intended use of `ORKActiveStep` is as a - base class for creating new types of active step, with matching view - controllers appropriate to the particular task that uses them. - - Nonetheless, this functions as a test-bed for basic active task functonality. - */ -- (id)makeActiveStepTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - /* - Example of a fully-fledged instruction step. - The text of this step is not appropriate to the rest of the task, but - is helpful for verifying layout. - */ - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step.title = @"Demo Study"; - step.text = @"This 12-step walkthrough will explain the study and the impact it will have on your life."; - step.detailText = @"You must complete the walkthough to participate in the study."; - [steps addObject:step]; - } - - { - /* - Audio-recording active step, configured directly using `ORKActiveStep`. - - Not a recommended way of doing audio recording with the ResearchKit framework. - */ - ORKActiveStep *step = [[ORKActiveStep alloc] initWithIdentifier:@"step2"]; - step.title = @"Audio"; - step.stepDuration = 10.0; - step.text = @"An active test recording audio"; - step.recorderConfigurations = @[[[ORKAudioRecorderConfiguration alloc] initWithIdentifier:@"aid_001d.audio" recorderSettings:@{}]]; - step.shouldUseNextAsSkipButton = YES; - [steps addObject:step]; - } - - { - /* - Audio-recording active step with lossless audio, configured directly - using `ORKActiveStep`. - - Not a recommended way of doing audio recording with the ResearchKit framework. - */ - ORKActiveStep *step = [[ORKActiveStep alloc] initWithIdentifier:@"step3"]; - step.title = @"Audio"; - step.stepDuration = 10.0; - step.text = @"An active test recording lossless audio"; - step.shouldUseNextAsSkipButton = YES; - step.recorderConfigurations = @[[[ORKAudioRecorderConfiguration alloc] - initWithIdentifier:@"aid_001e.audio" recorderSettings:@{AVFormatIDKey : @(kAudioFormatAppleLossless), - AVNumberOfChannelsKey : @(2), - AVSampleRateKey: @(44100.0) - }]]; - [steps addObject:step]; - } - - { - /* - Touch recorder active step. This should record touches on the primary - view for a 30 second period. - - Not a recommended way of collecting touch data with the ResearchKit framework. - */ - ORKActiveStep *step = [[ORKActiveStep alloc] initWithIdentifier:@"step4"]; - step.title = @"Touch"; - step.text = @"An active test, touch collection"; - step.shouldStartTimerAutomatically = NO; - step.stepDuration = 30.0; - step.spokenInstruction = @"An active test, touch collection"; - step.shouldUseNextAsSkipButton = YES; - step.recorderConfigurations = @[[[ORKTouchRecorderConfiguration alloc] initWithIdentifier:@"aid_001a.touch"]]; - [steps addObject:step]; - } - - { - /* - Test for device motion recorder directly on an active step. - - Not a recommended way of customizing active steps with the ResearchKit framework. - */ - ORKActiveStep *step = [[ORKActiveStep alloc] initWithIdentifier:@"step5"]; - step.title = @"Motion"; - step.text = @"An active test collecting device motion data"; - step.shouldUseNextAsSkipButton = YES; - step.recorderConfigurations = @[[[ORKDeviceMotionRecorderConfiguration alloc] initWithIdentifier:@"aid_001c.deviceMotion" frequency:100.0]]; - - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeAudioTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask audioTaskWithIdentifier:identifier - intendedUseDescription:nil - speechInstruction:nil - shortSpeechInstruction:nil - duration:10 - recordingSettings:nil - checkAudioLevel:YES - options:(ORKPredefinedTaskOption)0]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeFitnessTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask fitnessCheckTaskWithIdentifier:identifier - intendedUseDescription:nil - walkDuration:360 - restDuration:180 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeGaitTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask shortWalkTaskWithIdentifier:identifier - intendedUseDescription:nil - numberOfStepsPerLeg:20 - restDuration:30 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeHandTremorTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask tremorTestTaskWithIdentifier:identifier - intendedUseDescription:nil - activeStepDuration:10 - activeTaskOptions: - ORKTremorActiveTaskOptionExcludeHandAtShoulderHeight | - ORKTremorActiveTaskOptionExcludeHandAtShoulderHeightElbowBent | - ORKTremorActiveTaskOptionExcludeHandToNose - handOptions:ORKPredefinedTaskHandOptionBoth - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeHandRightTremorTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask tremorTestTaskWithIdentifier:identifier - intendedUseDescription:nil - activeStepDuration:10 - activeTaskOptions:0 - handOptions:ORKPredefinedTaskHandOptionRight - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeHolePegTestTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKNavigableOrderedTask holePegTestTaskWithIdentifier:identifier - intendedUseDescription:nil - dominantHand:ORKBodySagittalRight - numberOfPegs:9 - threshold:0.2 - rotated:NO - timeLimit:300.0 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - - -- (id)makeMemoryGameTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask spatialSpanMemoryTaskWithIdentifier:identifier - intendedUseDescription:nil - initialSpan:3 - minimumSpan:2 - maximumSpan:15 - playSpeed:1 - maximumTests:5 - maximumConsecutiveFailures:3 - customTargetImage:nil - customTargetPluralName:nil - requireReversal:NO - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makePsatTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask PSATTaskWithIdentifier:identifier - intendedUseDescription:nil - presentationMode:(ORKPSATPresentationModeAuditory | ORKPSATPresentationModeVisual) - interStimulusInterval:3.0 - stimulusDuration:1.0 - seriesLength:60 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeReactionTimeTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask reactionTimeTaskWithIdentifier:identifier - intendedUseDescription:nil - maximumStimulusInterval:8 - minimumStimulusInterval:4 - thresholdAcceleration:0.5 - numberOfAttempts:3 - timeout:10 - successSound:0 - timeoutSound:0 - failureSound:0 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeStroopTaskWithIdentifier:(NSString *)identifier { - return [ORKOrderedTask stroopTaskWithIdentifier:identifier - intendedUseDescription:nil - numberOfAttempts:15 - options:0]; -} - -- (id)makeTimedWalkTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask timedWalkTaskWithIdentifier:identifier - intendedUseDescription:nil - distanceInMeters:100 - timeLimit:180 - turnAroundTimeLimit:60 - includeAssistiveDeviceForm:YES - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeToneAudiometryTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask toneAudiometryTaskWithIdentifier:identifier - intendedUseDescription:nil - speechInstruction:nil - shortSpeechInstruction:nil - toneDuration:20 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeTowerOfHanoiTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask towerOfHanoiTaskWithIdentifier:identifier - intendedUseDescription:nil - numberOfDisks:5 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - - -- (id)makeTrailMakingTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask trailmakingTaskWithIdentifier:identifier - intendedUseDescription:nil - trailmakingInstruction:nil - trailType:ORKTrailMakingTypeIdentifierA - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeTwoFingerTappingTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:identifier - intendedUseDescription:nil - duration:20.0 - handOptions:ORKPredefinedTaskHandOptionBoth - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -- (id)makeWalkAndTurnTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = [ORKOrderedTask walkBackAndForthTaskWithIdentifier:identifier - intendedUseDescription:nil - walkDuration:30 - restDuration:30 - options:ORKPredefinedTaskOptionNone]; - task.hidesLearnMoreButtonOnInstructionStep = YES; - return task; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Forms.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Forms.h deleted file mode 100644 index c6688505fe..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Forms.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (Forms) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Forms.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Forms.m deleted file mode 100644 index 2ea1a5bb0d..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Forms.m +++ /dev/null @@ -1,949 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+Forms.h" - -@import ResearchKit; - - -@implementation TaskFactory (Forms) - -- (id)makeConfirmationFormItemTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Confirmation Form"; - step1.text = @"Proceed to register a new account."; - [steps addObject:step1]; - - // Create a step for entering password with confirmation - ORKFormStep *step2 = [[ORKFormStep alloc] initWithIdentifier:@"step2" title:@"Password" text:@"Register a new password"]; - [steps addObject:step2]; - - { - ORKTextAnswerFormat *answerFormat = [ORKAnswerFormat textAnswerFormat]; - answerFormat.multipleLines = NO; - answerFormat.secureTextEntry = YES; - answerFormat.autocapitalizationType = UITextAutocapitalizationTypeNone; - answerFormat.autocorrectionType = UITextAutocorrectionTypeNo; - answerFormat.spellCheckingType = UITextSpellCheckingTypeNo; - if (@available(iOS 12.0, *)) { - answerFormat.textContentType = UITextContentTypeNewPassword; - } else { - answerFormat.textContentType = UITextContentTypePassword; - } - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"password" - text:@"Password" - answerFormat:answerFormat - optional:NO]; - item.placeholder = @"Enter password"; - - ORKFormItem *confirmationItem = [item confirmationAnswerFormItemWithIdentifier:@"password.confirmation" - text:@"Confirm" - errorMessage:@"Passwords do not match"]; - confirmationItem.placeholder = @"Enter password again"; - - step2.formItems = @[item, confirmationItem]; - } - - // Create a step for entering participant id - ORKFormStep *step3 = [[ORKFormStep alloc] initWithIdentifier:@"step3" title:@"Participant ID" text:@"Register a new participant ID"]; - [steps addObject:step3]; - - { - ORKTextAnswerFormat *answerFormat = [ORKAnswerFormat textAnswerFormat]; - answerFormat.multipleLines = NO; - answerFormat.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; - answerFormat.autocorrectionType = UITextAutocorrectionTypeNo; - answerFormat.spellCheckingType = UITextSpellCheckingTypeNo; - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"participantID" - text:@"Participant ID" - answerFormat:answerFormat - optional:YES]; - item.placeholder = @"Enter Participant ID"; - - ORKFormItem *confirmationItem = [item confirmationAnswerFormItemWithIdentifier:@"participantID.confirmation" - text:@"Confirm" - errorMessage:@"IDs do not match"]; - confirmationItem.placeholder = @"Enter ID again"; - - step3.formItems = @[item, confirmationItem]; - } - - ORKCompletionStep *step4 = [[ORKCompletionStep alloc] initWithIdentifier:@"confirmationForm.lastStep"]; - step4.title = @"Survey Complete"; - step4.text = @"Thank you for registering."; - [steps addObject:step4]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -/* - The mini form task is used to test survey forms functionality (`ORKFormStep`). - */ -- (id)makeMiniFormTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step.title = @"Mini Form"; - [steps addObject:step]; - } - - { - /* - A short form for testing behavior when loading multiple HealthKit - default values on the same form. - */ - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step2" - title:@"Mini Form" - text:@"Mini form groups multi-entry in one page"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"weight1" - text:@"Weight" - answerFormat: - [ORKHealthKitQuantityTypeAnswerFormat answerFormatWithQuantityType:[HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass] - unit:[HKUnit unitFromMassFormatterUnit:NSMassFormatterUnitPound] - style:ORKNumericAnswerStyleDecimal]]; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"weight2" - text:@"Weight" - answerFormat: - [ORKHealthKitQuantityTypeAnswerFormat answerFormatWithQuantityType:[HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass] - unit:[HKUnit unitFromMassFormatterUnit:NSMassFormatterUnitPound] - style:ORKNumericAnswerStyleDecimal]]; - item.placeholder = @"Add weight"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"weight3" - text:@"Weight" - answerFormat: - [ORKHealthKitQuantityTypeAnswerFormat answerFormatWithQuantityType:[HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass] - unit:[HKUnit unitFromMassFormatterUnit:NSMassFormatterUnitPound] - style:ORKNumericAnswerStyleDecimal]]; - item.placeholder = @"Input your body weight here. Really long text."; - [items addObject:item]; - } - - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"weight4" - text:@"Weight" - answerFormat:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:nil]]; - item.placeholder = @"Input your body weight here"; - [items addObject:item]; - } - - [step setFormItems:items]; - } - - { - /* - A long "kitchen-sink" form with all the different types of supported - answer formats. - */ - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step3" title:@"Mini Form" text:@"Mini form groups multi-entry in one page"]; - NSMutableArray *items = [NSMutableArray new]; - - { - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"biologicalSex" text:@"Gender" answerFormat:[ORKHealthKitCharacteristicTypeAnswerFormat answerFormatWithCharacteristicType:[HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex]]]; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Basic Information"]; - [items addObject:item]; - } - - { - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"bloodType" text:@"Blood Type" answerFormat:[ORKHealthKitCharacteristicTypeAnswerFormat answerFormatWithCharacteristicType:[HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBloodType]]]; - item.placeholder = @"Choose a type"; - [items addObject:item]; - } - - { - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"dateOfBirth" text:@"Date of Birth" answerFormat:[ORKHealthKitCharacteristicTypeAnswerFormat answerFormatWithCharacteristicType:[HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierDateOfBirth]]]; - item.placeholder = @"DOB"; - [items addObject:item]; - } - - { - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"weight" - text:@"Weight" - answerFormat: - [ORKHealthKitQuantityTypeAnswerFormat answerFormatWithQuantityType:[HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass] - unit:nil - style:ORKNumericAnswerStyleDecimal]]; - item.placeholder = @"Add weight"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"headacheQuestion" text:@"Do you have a headache?" answerFormat:[ORKBooleanAnswerFormat new]]; - [items addObject:item]; - } - - { - ORKTextChoice *apple = [ORKTextChoice choiceWithText:@"Apple" value:@"Apple"]; - ORKTextChoice *orange = [ORKTextChoice choiceWithText:@"Orange" value:@"Orange"]; - ORKTextChoice *banana = [ORKTextChoice choiceWithText:@"Banana" value:@"Banana"]; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_002" - text:@"Which fruit do you like most? Please pick one from below." - answerFormat:[ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:@[apple, orange, banana]]]; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"message1" text:@"Message" - answerFormat:[ORKAnswerFormat textAnswerFormat]]; - item.placeholder = @"Your message"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"bpDiastolic" text:@"BP Diastolic" - answerFormat:[ORKAnswerFormat integerAnswerFormatWithUnit:@"mm Hg"]]; - item.placeholder = @"Enter value"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"bpSystolic" text:@"BP Systolic" - answerFormat:[ORKAnswerFormat integerAnswerFormatWithUnit:@"mm Hg"]]; - item.placeholder = @"Enter value"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"email" text:@"Email" - answerFormat:[ORKAnswerFormat emailAnswerFormat]]; - item.placeholder = @"Enter Email"; - [items addObject:item]; - } - - { - - NSRegularExpression *validationRegularExpression = - [NSRegularExpression regularExpressionWithPattern:@"^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$" - options:(NSRegularExpressionOptions)0 - error:nil]; - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithValidationRegularExpression:validationRegularExpression - invalidMessage:@"Invalid URL: %@"]; - format.multipleLines = NO; - format.keyboardType = UIKeyboardTypeURL; - format.autocapitalizationType = UITextAutocapitalizationTypeNone; - format.autocorrectionType = UITextAutocorrectionTypeNo; - format.spellCheckingType = UITextSpellCheckingTypeNo; - format.textContentType = UITextContentTypeURL; - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"url" text:@"URL" - answerFormat:format]; - item.placeholder = @"Enter URL"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"message2" text:@"Message" - answerFormat:[ORKAnswerFormat textAnswerFormatWithMaximumLength:20]]; - item.placeholder = @"Your message (limit 20 characters)."; - [items addObject:item]; - } - - { - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:12]; - format.secureTextEntry = YES; - format.multipleLines = NO; - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"passcode" text:@"Passcode" - answerFormat:format]; - item.placeholder = @"Enter Passcode"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"height1" text:@"Height" - answerFormat:[ORKAnswerFormat heightAnswerFormat]]; - item.placeholder = @"Pick a height (local system)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"height2" text:@"Height" - answerFormat:[ORKAnswerFormat heightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemMetric]]; - item.placeholder = @"Pick a height (metric system)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"height3" text:@"Height" - answerFormat:[ORKAnswerFormat heightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemUSC]]; - item.placeholder = @"Pick a height (imperial system)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_weight_001" text:@"Weight" - answerFormat:[ORKAnswerFormat weightAnswerFormat]]; - item.placeholder = @"Pick a weight (local system)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_weight_002" text:@"Weight" - answerFormat:[ORKAnswerFormat weightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemMetric]]; - item.placeholder = @"Pick a weight (metric system)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_weight_003" text:@"Weight" - answerFormat:[ORKAnswerFormat weightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemUSC]]; - item.placeholder = @"Pick a weight (USC system)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_weight_004" text:@"Weight" - answerFormat:[ORKAnswerFormat weightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemMetric - numericPrecision:ORKNumericPrecisionLow - minimumValue:10 - maximumValue:20 - defaultValue:11.5]]; - item.placeholder = @"Pick a weight (metric system, low precision)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_weight_005" text:@"Weight" - answerFormat:[ORKAnswerFormat weightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemUSC - numericPrecision:ORKNumericPrecisionLow - minimumValue:10 - maximumValue:20 - defaultValue:11.5]]; - item.placeholder = @"Pick a weight (USC system, low precision)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_weight_006" text:@"Weight" - answerFormat:[ORKAnswerFormat weightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemMetric - numericPrecision:ORKNumericPrecisionHigh - minimumValue:10 - maximumValue:20 - defaultValue:11.5]]; - item.placeholder = @"Pick a weight (metric system, high precision)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_weight_007" text:@"Weight" - answerFormat:[ORKAnswerFormat weightAnswerFormatWithMeasurementSystem:ORKMeasurementSystemUSC - numericPrecision:ORKNumericPrecisionHigh - minimumValue:10 - maximumValue:20 - defaultValue:11.5]]; - item.placeholder = @"Pick a weight (USC system, high precision)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"birthdate1" text:@"Birthdate" - answerFormat:[ORKAnswerFormat dateAnswerFormat]]; - item.placeholder = @"Pick a date"; - [items addObject:item]; - } - - { - NSDate *defaultDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitYear value:-30 toDate:[NSDate date] options:(NSCalendarOptions)0]; - NSDate *minDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitYear value:-150 toDate:[NSDate date] options:(NSCalendarOptions)0]; - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"birthdate2" text:@"Birthdate" - answerFormat:[ORKAnswerFormat dateAnswerFormatWithDefaultDate:defaultDate - minimumDate:minDate - maximumDate:[NSDate date] - calendar:nil]]; - item.placeholder = @"Pick a date (with default)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"timeOfDay1" text:@"Today sunset time?" - answerFormat:[ORKAnswerFormat timeOfDayAnswerFormat]]; - item.placeholder = @"No default time"; - [items addObject:item]; - } - - { - NSDateComponents *defaultDC = [[NSDateComponents alloc] init]; - defaultDC.hour = 14; - defaultDC.minute = 23; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"timeOfDay2" text:@"Today sunset time?" - answerFormat:[ORKAnswerFormat timeOfDayAnswerFormatWithDefaultComponents:defaultDC]]; - item.placeholder = @"Default time 14:23"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"dateTime1" text:@"Next eclipse visible in Cupertino?" - answerFormat:[ORKAnswerFormat dateTimeAnswerFormat]]; - - item.placeholder = @"No default date and range"; - [items addObject:item]; - } - - { - - NSDate *defaultDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:3 toDate:[NSDate date] options:(NSCalendarOptions)0]; - NSDate *minDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:0 toDate:[NSDate date] options:(NSCalendarOptions)0]; - NSDate *maxDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:10 toDate:[NSDate date] options:(NSCalendarOptions)0]; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"dateTime2" - text:@"Next eclipse visible in Cupertino?" - answerFormat:[ORKAnswerFormat dateTimeAnswerFormatWithDefaultDate:defaultDate - minimumDate:minDate - maximumDate:maxDate - calendar:nil]]; - - item.placeholder = @"Default date in 3 days and range(0, 10)"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"timeInterval1" text:@"Wake up interval" - answerFormat:[ORKAnswerFormat timeIntervalAnswerFormat]]; - item.placeholder = @"No default Interval and step size"; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"timeInterval2" text:@"Wake up interval" - answerFormat:[ORKAnswerFormat timeIntervalAnswerFormatWithDefaultInterval:300 step:3]]; - item.placeholder = @"Default Interval 300 and step size 3"; - [items addObject:item]; - } - - { - /* - Testbed for image choice. - - In a real application, you would use real images rather than square - colored boxes. - */ - ORKImageChoice *option1 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor redColor] size:CGSizeMake(360, 360) border:NO] - selectedImage:[self imageWithColor:[UIColor redColor] size:CGSizeMake(360, 360) border:YES] - text:@"Red" value:@"red"]; - ORKImageChoice *option2 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor orangeColor] size:CGSizeMake(360, 360) border:NO] - selectedImage:[self imageWithColor:[UIColor orangeColor] size:CGSizeMake(360, 360) border:YES] - text:nil value:@"orange"]; - ORKImageChoice *option3 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor yellowColor] size:CGSizeMake(360, 360) border:NO] - selectedImage:[self imageWithColor:[UIColor yellowColor] size:CGSizeMake(360, 360) border:YES] - text:@"Yellow" value:@"yellow"]; - - ORKFormItem *item3 = [[ORKFormItem alloc] initWithIdentifier:@"favoriteColor" text:@"What is your favorite color?" - answerFormat:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1, option2, option3]]]; - [items addObject:item3]; - } - - { - // Discrete scale - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale1" text:@"Pick an integer" answerFormat:[[ORKScaleAnswerFormat alloc] initWithMaximumValue:100 minimumValue:0 defaultValue:NSIntegerMax step:10]]; - [items addObject:item]; - } - - { - // Discrete scale, with default value - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale2" text:@"Pick an integer" answerFormat:[[ORKScaleAnswerFormat alloc] initWithMaximumValue:100 minimumValue:0 defaultValue:20 step:10]]; - [items addObject:item]; - } - - { - // Continuous scale - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale3" text:@"Pick a decimal" answerFormat:[[ORKContinuousScaleAnswerFormat alloc] initWithMaximumValue:100 minimumValue:0 defaultValue:NSIntegerMax maximumFractionDigits:2]]; - [items addObject:item]; - } - - { - // Continuous scale - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scaleFraction" text:@"Pick a decimal" answerFormat:[[ORKContinuousScaleAnswerFormat alloc] initWithMaximumValue:100 minimumValue:1 defaultValue:0.0 maximumFractionDigits:3]]; - [items addObject:item]; - } - - { - // Continuous scale, with default value - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale4" text:@"Pick a decimal" answerFormat:[[ORKContinuousScaleAnswerFormat alloc] initWithMaximumValue:100 minimumValue:0 defaultValue:87.34 maximumFractionDigits:2]]; - [items addObject:item]; - } - - { - // Vertical Discrete scale, with default value - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale5" text:@"Pick an integer" answerFormat:[[ORKScaleAnswerFormat alloc] initWithMaximumValue:100 minimumValue:0 defaultValue:90 step:10 vertical:YES]]; - [items addObject:item]; - } - - { - // Vertical Continuous scale, with default value - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale6" text:@"Pick a decimal" answerFormat:[[ORKContinuousScaleAnswerFormat alloc] initWithMaximumValue: 100 minimumValue: 0 defaultValue:12.75 maximumFractionDigits:2 vertical:YES]]; - [items addObject:item]; - } - - { - ORKTextChoice *textChoice1 = [ORKTextChoice choiceWithText:@"Poor" value:@(1)]; - ORKTextChoice *textChoice2 = [ORKTextChoice choiceWithText:@"Fair" value:@(2)]; - ORKTextChoice *textChoice3 = [ORKTextChoice choiceWithText:@"Good" value:@(3)]; - ORKTextChoice *textChoice4 = [ORKTextChoice choiceWithText:@"Above Average" value:@(4)]; - ORKTextChoice *textChoice5 = [ORKTextChoice choiceWithText:@"Excellent" value:@(5)]; - - NSArray *textChoices = @[textChoice1, textChoice2, textChoice3, textChoice4, textChoice5]; - - ORKTextScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat textScaleAnswerFormatWithTextChoices:textChoices - defaultIndex:NSIntegerMax - vertical:NO]; - scaleAnswerFormat.hideSelectedValue = YES; - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale7" - text:@"How are you feeling today?" - answerFormat:scaleAnswerFormat]; - [items addObject:item]; - } - - { - ORKTextChoice *textChoice1 = [ORKTextChoice choiceWithText:@"Poor" value:@(1)]; - ORKTextChoice *textChoice2 = [ORKTextChoice choiceWithText:@"Fair" value:@(2)]; - ORKTextChoice *textChoice3 = [ORKTextChoice choiceWithText:@"Good" value:@(3)]; - ORKTextChoice *textChoice4 = [ORKTextChoice choiceWithText:@"Above Average" value:@(4)]; - ORKTextChoice *textChoice5 = [ORKTextChoice choiceWithText:@"Excellent" value:@(5)]; - - NSArray *textChoices = @[textChoice1, textChoice2, textChoice3, textChoice4, textChoice5]; - - ORKTextScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat textScaleAnswerFormatWithTextChoices:textChoices - defaultIndex:NSIntegerMax - vertical:YES]; - scaleAnswerFormat.hideSelectedValue = YES; - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale8" - text:@"How are you feeling today?" - answerFormat:scaleAnswerFormat]; - [items addObject:item]; - } - - { - //Location - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"location" text:@"Pick a location" answerFormat:[ORKAnswerFormat locationAnswerFormat]]; - [items addObject:item]; - } - - [step setFormItems:items]; - [steps addObject:step]; - } - - { - - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step4" title:@"Required form step" text:nil]; - ORKTextChoice *one = [ORKTextChoice choiceWithText:@"1" value:@"1"]; - ORKTextChoice *two = [ORKTextChoice choiceWithText:@"2" value:@"2"]; - ORKTextChoice *three = [ORKTextChoice choiceWithText:@"3" value:@"3"]; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"fqid_001" - text:@"Value" - answerFormat:[ORKNumericAnswerFormat valuePickerAnswerFormatWithTextChoices:@[one, two, three]]]; - item.placeholder = @"Pick a value"; - [step setFormItems:@[item]]; - step.optional = NO; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"step5"]; - step.title = @"Thanks"; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -/* - The optional form task is used to test form items' optional functionality (`ORKFormStep`, `ORKFormItem`). - */ -- (id)makeOptionalFormTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step1" - title:@"Optional Form Items" - text:@"Optional form with a required scale item with a default value"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKScaleAnswerFormat *format = [ORKScaleAnswerFormat scaleAnswerFormatWithMaximumValue:10 minimumValue:1 defaultValue:4 step:1 vertical:YES maximumValueDescription:nil minimumValueDescription:nil]; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"scale" - text:@"Optional scale" - answerFormat:format]; - item.optional = NO; - [items addObject:item]; - } - - [step setFormItems:items]; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step2" title:@"Optional Form Items" text:@"Optional form with no required items"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Optional"]; - [items addObject:item]; - } - - { - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:12]; - format.multipleLines = NO; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text" - text:@"Text" - answerFormat:format]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"number" - text:@"Number" - answerFormat:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:nil]]; - item.placeholder = @"Input any number here."; - [items addObject:item]; - } - - [step setFormItems:items]; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step3" title:@"Optional Form Items" text:@"Optional form with some required items"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Optional"]; - [items addObject:item]; - } - - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:12]; - format.multipleLines = NO; - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text1" - text:@"Text A" - answerFormat:format]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text2" - text:@"Text B" - answerFormat:format]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Required"]; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text3" - text:@"Text C" - answerFormat:format - optional:NO]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"number" - text:@"Number" - answerFormat:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:nil] - optional:NO]; - item.placeholder = @"Input any number here."; - [items addObject:item]; - } - - [step setFormItems:items]; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step4" title:@"Optional Form Items" text:@"Optional form with all items required"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Required"]; - [items addObject:item]; - } - - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:12]; - format.multipleLines = NO; - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text1" - text:@"Text A" - answerFormat:format - optional:NO]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text2" - text:@"Text B" - answerFormat:format - optional:NO]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text3" - text:@"Text C" - answerFormat:format - optional:NO]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"number" - text:@"Number" - answerFormat:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:nil] - optional:NO]; - item.placeholder = @"Input any number here."; - [items addObject:item]; - } - - [step setFormItems:items]; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step5" title:@"Optional Form Items" text:@"Optional form with custom validation"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Optional"]; - [items addObject:item]; - } - - { - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:12]; - format.multipleLines = NO; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text" - text:@"Text" - answerFormat:format]; - item.placeholder = @"Input the value \"Valid\" to proceed."; - item.optional = NO; - [items addObject:item]; - } - - [step setFormItems:items]; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step6" title:@"Optional Form Items" text:@"Required form with no required items"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Optional"]; - [items addObject:item]; - } - - { - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:6]; - format.multipleLines = NO; - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text" - text:@"Text" - answerFormat:format]; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"number" - text:@"Number" - answerFormat:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:nil]]; - item.placeholder = @"Input any number here."; - [items addObject:item]; - } - - [step setFormItems:items]; - step.optional = NO; - - step.shouldPresentStepBlock = ^BOOL(ORKTaskViewController *taskViewController, ORKStep *step) { - ORKTextQuestionResult *textResult = (ORKTextQuestionResult *)[[taskViewController.result stepResultForStepIdentifier:@"step5"] resultForIdentifier:@"text"]; - BOOL isValid = [textResult.textAnswer isEqualToString:@"Valid"]; - if (!isValid) { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil - message:@"Invalid text field value." - preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; - [taskViewController presentViewController:alert animated:YES completion:nil]; - } - return isValid; - }; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step7" title:@"Optional Form Items" text:@"Required form with some required items"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Optional"]; - [items addObject:item]; - } - - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:12]; - format.multipleLines = NO; - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text1" - text:@"Text A" - answerFormat:format]; - item.placeholder = @"Input your text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text2" - text:@"Text B" - answerFormat:format]; - item.placeholder = @"Input your text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Required"]; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text3" - text:@"Text C" - answerFormat:format]; - item.optional = NO; - item.placeholder = @"Input your text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"number" - text:@"Number" - answerFormat:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:nil]]; - item.optional = NO; - item.placeholder = @"Input any number here."; - [items addObject:item]; - } - - [step setFormItems:items]; - step.optional = NO; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"step8" title:@"Optional Form Items" text:@"Required form with all items required"]; - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithSectionTitle:@"Required"]; - [items addObject:item]; - } - - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:12]; - format.multipleLines = NO; - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text1" - text:@"Text A" - answerFormat:format]; - item.optional = NO; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text2" - text:@"Text B" - answerFormat:format]; - item.optional = NO; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"text3" - text:@"Text C" - answerFormat:format]; - item.optional = NO; - item.placeholder = @"Input any text here."; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"number" - text:@"Number" - answerFormat:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:nil]]; - item.optional = NO; - item.placeholder = @"Input any number here."; - [items addObject:item]; - } - - [step setFormItems:items]; - step.optional = NO; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Onboarding.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Onboarding.h deleted file mode 100644 index fd7e817ddd..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Onboarding.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (Onboarding) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Onboarding.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Onboarding.m deleted file mode 100644 index a0cf4d12e1..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+Onboarding.m +++ /dev/null @@ -1,348 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+Onboarding.h" - -@import ResearchKit; - - -/** - A subclass is required for the login step. - - The implementation below demonstrates how to subclass and override button actions. - */ -@interface LoginViewController : ORKLoginStepViewController - -@end - - -@implementation LoginViewController - -- (void)forgotPasswordButtonTapped { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Forgot password?" - message:@"Button tapped" - preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; - [self presentViewController:alert animated:YES completion:nil]; -} - -@end - - -/** - A subclass is required for the verification step. - - The implementation below demonstrates how to subclass and override button actions. - */ -@interface VerificationViewController : ORKVerificationStepViewController - -@end - - -@implementation VerificationViewController - -- (void)resendEmailButtonTapped { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Resend Verification Email" - message:@"Button tapped" - preferredStyle:UIAlertControllerStyleAlert]; - [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; - [self presentViewController:alert animated:YES completion:nil]; -} - -@end - - -@implementation TaskFactory (Onboarding) - -#pragma mark - Consent review task - -/* - The consent review task is used to quickly verify the layout of the consent - sharing step and the consent review step. - - In a real consent process, you would substitute the text of your consent document - for the various placeholders. - */ -- (id)makeConsentReviewTaskWithIdentifier:(NSString *)identifier { - /* - Tests layout of the consent sharing step. - - This step is used when you want to obtain permission to share the data - collected with other researchers for uses beyond the present study. - */ - ORKConsentSharingStep *sharingStep = - [[ORKConsentSharingStep alloc] initWithIdentifier:@"consentSharing" - investigatorShortDescription:@"MyInstitution" - investigatorLongDescription:@"MyInstitution and its partners" - localizedLearnMoreHTMLContent:@"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."]; - - /* - Tests layout of the consent review step. - - In the consent review step, the user reviews the consent document and - optionally enters their name and/or draws a signature. - */ - ORKConsentDocument *consentDocument = [self buildConsentDocument]; - ORKConsentSignature *participantSig = consentDocument.signatures[0]; - [participantSig setSignatureDateFormatString:@"yyyy-MM-dd 'at' HH:mm"]; - self.currentConsentDocument = [consentDocument copy]; - ORKConsentReviewStep *reviewStep = [[ORKConsentReviewStep alloc] initWithIdentifier:@"consentReview" signature:participantSig inDocument:consentDocument]; - reviewStep.text = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; - reviewStep.reasonForConsent = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:@[sharingStep,reviewStep]]; - return task; -} - -/* - The eligibility form task is used to demonstrate an eligibility form (`ORKFormStep`, `ORKFormItem`). - */ -- (id)makeEligibilityFormTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"introStep"]; - step.title = @"Eligibility Form"; - [steps addObject:step]; - } - - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:@"formStep"]; - step.optional = NO; - step.title = @"Eligibility Form"; - step.text = @"Please answer the questions below."; - - NSMutableArray *items = [NSMutableArray new]; - [steps addObject:step]; - - { - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"formItem1" - text:@"Are you over 18 years of age?" - answerFormat:[ORKAnswerFormat booleanAnswerFormat]]; - item.optional = NO; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"formItem2" - text:@"Have you been diagnosed with pre-diabetes or type 2 diabetes?" - answerFormat:[ORKAnswerFormat booleanAnswerFormat]]; - item.optional = NO; - [items addObject:item]; - } - - { - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"formItem3" - text:@"Can you not read and understand English in order to provide informed consent and follow the instructions?" - answerFormat:[ORKAnswerFormat booleanAnswerFormat]]; - item.optional = NO; - [items addObject:item]; - } - - { - NSArray *textChoices = @[[ORKTextChoice choiceWithText:@"Yes" value:@1], - [ORKTextChoice choiceWithText:@"No" value:@0], - [ORKTextChoice choiceWithText:@"N/A" value:@2]]; - ORKTextChoiceAnswerFormat *answerFormat = (ORKTextChoiceAnswerFormat *)[ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice - textChoices:textChoices]; - - ORKFormItem *item = [[ORKFormItem alloc] initWithIdentifier:@"formItem4" - text:@"Are you pregnant?" - answerFormat:answerFormat]; - item.optional = NO; - [items addObject:item]; - } - - [step setFormItems:items]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"ineligibleStep"]; - step.title = @"Eligibility Form"; - step.text = @"You are ineligible to join the study."; - [steps addObject:step]; - } - - { - ORKCompletionStep *step = [[ORKCompletionStep alloc] initWithIdentifier:@"eligibleStep"]; - step.title = @"Eligibility Form"; - step.text = @"You are eligible to join the study."; - [steps addObject:step]; - } - - ORKNavigableOrderedTask *task = [[ORKNavigableOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - - // Build navigation rules. - ORKPredicateStepNavigationRule *predicateRule = nil; - ORKResultSelector *resultSelector = nil; - - resultSelector = [ORKResultSelector selectorWithStepIdentifier:@"formStep" resultIdentifier:@"formItem1"]; - NSPredicate *predicateFormItem1 = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:resultSelector expectedAnswer:YES]; - - resultSelector = [ORKResultSelector selectorWithStepIdentifier:@"formStep" resultIdentifier:@"formItem2"]; - NSPredicate *predicateFormItem2 = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:resultSelector expectedAnswer:YES]; - - resultSelector = [ORKResultSelector selectorWithStepIdentifier:@"formStep" resultIdentifier:@"formItem3"]; - NSPredicate *predicateFormItem3 = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:resultSelector expectedAnswer:NO]; - - resultSelector = [ORKResultSelector selectorWithStepIdentifier:@"formStep" resultIdentifier:@"formItem4"]; - NSPredicate *predicateFormItem4a = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector expectedAnswerValue:@0]; - NSPredicate *predicateFormItem4b = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector expectedAnswerValue:@2]; - - NSPredicate *predicateEligible1 = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicateFormItem1,predicateFormItem2, predicateFormItem3, predicateFormItem4a]]; - NSPredicate *predicateEligible2 = [NSCompoundPredicate andPredicateWithSubpredicates:@[predicateFormItem1,predicateFormItem2, predicateFormItem3, predicateFormItem4b]]; - - predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateEligible1, predicateEligible2] - destinationStepIdentifiers:@[@"eligibleStep", @"eligibleStep"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"formStep"]; - - // Add end direct rules to skip unneeded steps - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:ORKNullStepIdentifier]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"ineligibleStep"]; - - return task; -} - -/* - The eligibility survey task is used to demonstrate an eligibility survey. - */ -- (id)makeEligibilitySurveyTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"introStep"]; - step.title = @"Eligibility Survey"; - [steps addObject:step]; - } - - { - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question1" - title:@"Eligibility Survey" - question:@"Are you over 18 years of age?" - answer:[ORKAnswerFormat booleanAnswerFormat]]; - step.optional = NO; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"ineligibleStep"]; - step.title = @"Eligibility Survey"; - step.text = @"You are ineligible to join the study."; - [steps addObject:step]; - } - - { - ORKCompletionStep *step = [[ORKCompletionStep alloc] initWithIdentifier:@"eligibleStep"]; - step.title = @"Eligibility Survey"; - step.text = @"You are eligible to join the study."; - [steps addObject:step]; - } - - ORKNavigableOrderedTask *task = [[ORKNavigableOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - - // Build navigation rules. - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question1"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:resultSelector expectedAnswer:YES]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"eligibleStep"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question1"]; - - // Add end direct rules to skip unneeded steps - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:ORKNullStepIdentifier]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"ineligibleStep"]; - - return task; -} - -/* - The login task is used to demonstrate a login step. - */ - -- (id)makeLoginTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKLoginStep *step = [[ORKLoginStep alloc] initWithIdentifier:@"loginStep" - title:@"Login" - text:@"Enter your credentials" - loginViewControllerClass:[LoginViewController class]]; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -/* - The registration task is used to demonstrate a registration step. - */ -- (id)makeRegistrationTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKRegistrationStepOption options = (ORKRegistrationStepIncludeFamilyName | - ORKRegistrationStepIncludeGivenName | - ORKRegistrationStepIncludeDOB | - ORKRegistrationStepIncludeGender); - ORKRegistrationStep *step = [[ORKRegistrationStep alloc] initWithIdentifier:@"registrationStep" - title:@"Registration" - text:@"Fill out the form below" - options:options]; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -/* - The verification task is used to demonstrate a verification step. - */ -- (id)makeVerificationTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKVerificationStep *step = [[ORKVerificationStep alloc] initWithIdentifier:@"verificationStep" text:@"Check your email and click on the link to verify your email address and start using the app." - verificationViewControllerClass:[VerificationViewController class]]; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+PasscodeManagement.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+PasscodeManagement.h deleted file mode 100644 index f44b60178d..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+PasscodeManagement.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (PasscodeManagement) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+PasscodeManagement.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+PasscodeManagement.m deleted file mode 100644 index 9d4483f1ce..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+PasscodeManagement.m +++ /dev/null @@ -1,58 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+PasscodeManagement.h" - -@import ResearchKit; - - -@implementation TaskFactory (PasscodeManagement) - -/* - Tests various uses of passcode step and view controllers. - - Passcode authentication and passcode editing are presented in - the examples. Passcode creation would ideally be as part of - the consent process. - */ - -- (id)makeCreatePasscodeTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - ORKPasscodeStep *passcodeStep = [[ORKPasscodeStep alloc] initWithIdentifier:@"createPasscode"]; - passcodeStep.text = @"This passcode protects your privacy and ensures that the user giving consent is the one completing the tasks."; - [steps addObject: passcodeStep]; - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+QuestionSteps.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+QuestionSteps.h deleted file mode 100644 index 11de8bc3c9..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+QuestionSteps.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (QuestionSteps) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+QuestionSteps.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+QuestionSteps.m deleted file mode 100644 index 3cf8fc87aa..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+QuestionSteps.m +++ /dev/null @@ -1,1255 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks. - Copyright (c) 2018, Brian Ganninger. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+QuestionSteps.h" - -@import ResearchKit; - - -@implementation TaskFactory (QuestionSteps) - -/* - This task presents several questions which exercise functionality based on - `UIDatePicker`. - */ -- (id)makeDatePickersTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"instruction"]; - step.title = @"Date Survey"; - step.detailText = @"date pickers"; - [steps addObject:step]; - } - - /* - A time interval question with no default set. - */ - { - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"timeInterval1" - title:@"Date Survey" - question:@"How long did it take to fall asleep last night?" - answer:[ORKAnswerFormat timeIntervalAnswerFormat]]; - [steps addObject:step]; - } - - /* - A time interval question specifying a default and a step size. - */ - { - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"timeInterval2" - title:@"Date Survey" - question:@"How long did it take to fall asleep last night?" - answer:[ORKAnswerFormat timeIntervalAnswerFormatWithDefaultInterval:300 step:5]]; - [steps addObject:step]; - } - - /* - A date answer format question, specifying a specific calendar. - If no calendar were specified, the user's preferred calendar would be used. - */ - { - ORKDateAnswerFormat *dateAnswer = [ORKDateAnswerFormat dateAnswerFormatWithDefaultDate:nil minimumDate:nil maximumDate:nil calendar: [NSCalendar calendarWithIdentifier:NSCalendarIdentifierHebrew]]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"date1" - title:@"Date Survey" - question:@"When is your birthday?" - answer:dateAnswer]; - [steps addObject:step]; - } - - /* - A date question with a minimum, maximum, and default. - Also specifically requires the Gregorian calendar. - */ - { - NSDate *defaultDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:10 toDate:[NSDate date] options:(NSCalendarOptions)0]; - NSDate *minDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:8 toDate:[NSDate date] options:(NSCalendarOptions)0]; - NSDate *maxDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:12 toDate:[NSDate date] options:(NSCalendarOptions)0]; - ORKDateAnswerFormat *dateAnswer = [ORKDateAnswerFormat dateAnswerFormatWithDefaultDate:defaultDate - minimumDate:minDate - maximumDate:maxDate - calendar: [NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"date2" - title:@"Date Survey" - question:@"What day are you available?" - answer:dateAnswer]; - [steps addObject:step]; - } - - /* - A time of day question with no default. - */ - { - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"timeOfDay1" - title:@"Date Survey" - question:@"What time do you get up?" - answer:[ORKTimeOfDayAnswerFormat timeOfDayAnswerFormat]]; - [steps addObject:step]; - } - - /* - A time of day question with a default of 8:15 AM. - */ - { - - NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - dateComponents.hour = 8; - dateComponents.minute = 15; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"timeOfDay2" - title:@"Date Survey" - question:@"What time do you get up?" - answer:[ORKTimeOfDayAnswerFormat timeOfDayAnswerFormatWithDefaultComponents:dateComponents]]; - [steps addObject:step]; - } - - /* - A date-time question with default parameters (no min, no max, default to now). - */ - { - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"dateTime1" - title:@"Date Survey" - question:@"When is your next meeting?" - answer:[ORKDateAnswerFormat dateTimeAnswerFormat]]; - [steps addObject:step]; - } - - /* - A date-time question with specified min, max, default date, and calendar. - */ - { - NSDate *defaultDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:10 toDate:[NSDate date] options:(NSCalendarOptions)0]; - NSDate *minDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:8 toDate:[NSDate date] options:(NSCalendarOptions)0]; - NSDate *maxDate = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:12 toDate:[NSDate date] options:(NSCalendarOptions)0]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"dateTime2" - title:@"Date Survey" - question:@"When is your next meeting?" - answer:[ORKDateAnswerFormat dateTimeAnswerFormatWithDefaultDate:defaultDate minimumDate:minDate maximumDate:maxDate calendar:[NSCalendar calendarWithIdentifier:NSCalendarIdentifierGregorian]]]; - [steps addObject:step]; - - } - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -- (id)makeImageCaptureTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - /* - If implementing an image capture task like this one, remember that people will - take your instructions literally. So, be cautious. Make sure your template image - is high contrast and very visible against a variety of backgrounds. - */ - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"begin"]; - step.title = @"Hands"; - step.image = [[UIImage imageNamed:@"hands_solid"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"In this step we will capture images of both of your hands"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"right1"]; - step.title = @"Right Hand"; - step.image = [[UIImage imageNamed:@"right_hand_solid"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Let's start by capturing an image of your right hand"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"right2"]; - step.title = @"Right Hand"; - step.image = [[UIImage imageNamed:@"right_hand_outline"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Align your right hand with the on-screen outline and capture the image. Be sure to place your hand over a contrasting background. You can re-capture the image as many times as you need."; - [steps addObject:step]; - } - - { - ORKImageCaptureStep *step = [[ORKImageCaptureStep alloc] initWithIdentifier:@"right3"]; - step.templateImage = [UIImage imageNamed:@"right_hand_outline_big"]; - step.templateImageInsets = UIEdgeInsetsMake(0.05, 0.05, 0.05, 0.05); - step.accessibilityInstructions = @"Extend your right hand, palm side down, one foot in front of your device. Tap the Capture Image button, or two-finger double tap the preview to capture the image"; - step.accessibilityHint = @"Captures the image visible in the preview"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"left1"]; - step.title = @"Left Hand"; - step.image = [[UIImage imageNamed:@"left_hand_solid"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Now let's capture an image of your left hand"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"left2"]; - step.title = @"Left Hand"; - step.image = [[UIImage imageNamed:@"left_hand_outline"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Align your left hand with the on-screen outline and capture the image. Be sure to place your hand over a contrasting background. You can re-capture the image as many times as you need."; - [steps addObject:step]; - } - - { - ORKImageCaptureStep *step = [[ORKImageCaptureStep alloc] initWithIdentifier:@"left3"]; - step.templateImage = [UIImage imageNamed:@"left_hand_outline_big"]; - step.templateImageInsets = UIEdgeInsetsMake(0.05, 0.05, 0.05, 0.05); - step.accessibilityInstructions = @"Extend your left hand, palm side down, one foot in front of your device. Tap the Capture Image button, or two-finger double tap the preview to capture the image"; - step.accessibilityHint = @"Captures the image visible in the preview"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"end"]; - step.title = @"Complete"; - step.detailText = @"Hand image capture complete"; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -/* - Tests various uses of image choices. - - All these tests use square colored images to test layout correctness. In a real - application you would use images to convey an image scale. - - Tests image choices both in form items, and in question steps. - */ -- (id)makeImageChoiceTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - for (NSValue *ratio in @[[NSValue valueWithCGPoint:CGPointMake(1.0, 1.0)], [NSValue valueWithCGPoint:CGPointMake(2.0, 1.0)], [NSValue valueWithCGPoint:CGPointMake(1.0, 2.0)]]) - { - ORKFormStep *step = [[ORKFormStep alloc] initWithIdentifier:[NSString stringWithFormat:@"formStep%@",NSStringFromCGPoint(ratio.CGPointValue)] title:@"Image Choice" text:@"Testing image choices in a form layout."]; - - NSMutableArray *items = [NSMutableArray new]; - - for (NSNumber *dimension in @[@(360), @(60)]) - { - CGSize size1 = CGSizeMake(dimension.floatValue * ratio.CGPointValue.x, dimension.floatValue * ratio.CGPointValue.y); - CGSize size2 = CGSizeMake(dimension.floatValue * ratio.CGPointValue.y, dimension.floatValue * ratio.CGPointValue.x); - - ORKImageChoice *option1 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor redColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor redColor] size:size1 border:YES] - text:@"Red" value:@"red"]; - ORKImageChoice *option2 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor orangeColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor orangeColor] size:size1 border:YES] - text:nil value:@"orange"]; - ORKImageChoice *option3 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor yellowColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor yellowColor] size:size1 border:YES] - text:@"Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow" value:@"yellow"]; - ORKImageChoice *option4 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor greenColor] size:size2 border:NO] - selectedImage:[self imageWithColor:[UIColor greenColor] size:size2 border:YES] - text:@"Green" value:@"green"]; - ORKImageChoice *option5 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor blueColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor blueColor] size:size1 border:YES] - text:nil value:@"blue"]; - ORKImageChoice *option6 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor cyanColor] size:size2 border:NO] - selectedImage:[self imageWithColor:[UIColor cyanColor] size:size2 border:YES] - text:@"Cyan" value:@"cyanColor"]; - - - ORKFormItem *item1 = [[ORKFormItem alloc] initWithIdentifier:[@"item1" stringByAppendingFormat:@"%@",dimension] text:@"Pick a color" - answerFormat:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1] ]]; - [items addObject:item1]; - - ORKFormItem *item2 = [[ORKFormItem alloc] initWithIdentifier:[@"item2" stringByAppendingFormat:@"%@",dimension] text:@"Pick a color" - answerFormat:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1, option2] ]]; - [items addObject:item2]; - - ORKFormItem *item3 = [[ORKFormItem alloc] initWithIdentifier:[@"item3" stringByAppendingFormat:@"%@",dimension] text:@"Pick a color" - answerFormat:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1, option2, option3] ]]; - [items addObject:item3]; - - ORKFormItem *item6 = [[ORKFormItem alloc] initWithIdentifier:[@"item4" stringByAppendingFormat:@"%@",dimension] text:@"Pick a color" - answerFormat:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1, option2, option3, option4, option5, option6] ]]; - [items addObject:item6]; - } - - [step setFormItems:items]; - [steps addObject:step]; - - for (NSNumber *dimension in @[@(360), @(60), @(20)]) { - CGSize size1 = CGSizeMake(dimension.floatValue * ratio.CGPointValue.x, dimension.floatValue * ratio.CGPointValue.y); - CGSize size2 = CGSizeMake(dimension.floatValue * ratio.CGPointValue.y, dimension.floatValue * ratio.CGPointValue.x); - - ORKImageChoice *option1 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor redColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor redColor] size:size1 border:YES] - text:@"Red\nRed\nRed\nRed" value:@"red"]; - ORKImageChoice *option2 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor orangeColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor orangeColor] size:size1 border:YES] - text:@"Orange" value:@"orange"]; - ORKImageChoice *option3 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor yellowColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor yellowColor] size:size1 border:YES] - text:@"Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow Yellow" value:@"yellow"]; - ORKImageChoice *option4 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor greenColor] size:size2 border:NO] - selectedImage:[self imageWithColor:[UIColor greenColor] size:size2 border:YES] - text:@"Green" value:@"green"]; - ORKImageChoice *option5 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor blueColor] size:size1 border:NO] - selectedImage:[self imageWithColor:[UIColor blueColor] size:size1 border:YES] - text:@"Blue" value:@"blue"]; - ORKImageChoice *option6 = [ORKImageChoice choiceWithNormalImage:[self imageWithColor:[UIColor cyanColor] size:size2 border:NO] - selectedImage:[self imageWithColor:[UIColor cyanColor] size:size2 border:YES] - text:@"Cyan" value:@"cyanColor"]; - - ORKQuestionStep *step1 = [ORKQuestionStep questionStepWithIdentifier:[NSString stringWithFormat:@"qid_color1_%@_%@", NSStringFromCGPoint(ratio.CGPointValue), dimension] - title:@"Image Choice" - question:@"Pick a color" - answer:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1] ]]; - [steps addObject:step1]; - - ORKQuestionStep *step2 = [ORKQuestionStep questionStepWithIdentifier:[NSString stringWithFormat:@"qid_color2_%@_%@", NSStringFromCGPoint(ratio.CGPointValue), dimension] - title:@"Image Choice" - question:@"Pick a color" - answer:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1, option2] ]]; - [steps addObject:step2]; - - ORKQuestionStep *step3 = [ORKQuestionStep questionStepWithIdentifier:[NSString stringWithFormat:@"qid_color3_%@_%@", NSStringFromCGPoint(ratio.CGPointValue), dimension] - title:@"Image Choice" - question:@"Pick a color" - answer:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1, option2, option3] ]]; - [steps addObject:step3]; - - ORKQuestionStep *step6 = [ORKQuestionStep questionStepWithIdentifier:[NSString stringWithFormat:@"qid_color6_%@_%@", NSStringFromCGPoint(ratio.CGPointValue), dimension] - title:@"Image Choice" - question:@"Pick a color" - answer:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:@[option1, option2, option3, option4, option5, option6]]]; - [steps addObject:step6]; - } - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"end"]; - step.title = @"Image Choices End"; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -- (id)makeLocationTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Location Survey"; - [steps addObject:step1]; - - // Location question with current location observing on - ORKQuestionStep *step2 = [[ORKQuestionStep alloc] initWithIdentifier:@"step2"]; - step2.title = @"Location Survey"; - step2.text = @"Where are you right now?"; - step2.answerFormat = [[ORKLocationAnswerFormat alloc] init]; - [steps addObject:step2]; - - // Location question with current location observing off - ORKQuestionStep *step3 = [[ORKQuestionStep alloc] initWithIdentifier:@"step3"]; - step3.title = @"Location Survey"; - step3.text = @"Where is your home?"; - ORKLocationAnswerFormat *locationAnswerFormat = [[ORKLocationAnswerFormat alloc] init]; - locationAnswerFormat.useCurrentLocation= NO; - step3.answerFormat = locationAnswerFormat; - [steps addObject:step3]; - - ORKCompletionStep *step4 = [[ORKCompletionStep alloc] initWithIdentifier:@"step4"]; - step4.title = @"Location Survey"; - step4.text = @"Survey Complete"; - [steps addObject:step4]; - - ORKOrderedTask *locationTask = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return locationTask; -} - -/* - This task is used to test various uses of discrete and continuous, horizontal and vertical valued sliders. - */ -- (id)makeScaleTaskWithIdentifier:(NSString *)identifier { - - NSMutableArray *steps = [NSMutableArray array]; - - { - /* - Continuous scale with two decimal places. - */ - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:NSIntegerMax - maximumFractionDigits:2 - vertical:NO - maximumValueDescription:nil - minimumValueDescription:nil]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale1" - title:@"Scale" - question:@"On a scale of 1 to 10, how much pain do you feel?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Discrete scale, no default. - */ - ORKScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat scaleAnswerFormatWithMaximumValue:300 - minimumValue:100 - defaultValue:NSIntegerMax - step:50 - vertical:NO - maximumValueDescription:nil - minimumValueDescription:nil]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale2" - title:@"Scale" - question:@"How much money do you need?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Discrete scale, with a default. - */ - ORKScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat scaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:5 - step:1 - vertical:NO - maximumValueDescription:nil - minimumValueDescription:nil]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale3" - title:@"Scale" - question:@"On a scale of 1 to 10, how much pain do you feel?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Discrete scale, with a default that is not on a step boundary. - */ - ORKScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat scaleAnswerFormatWithMaximumValue:300 - minimumValue:100 - defaultValue:174 - step:50 - vertical:NO - maximumValueDescription:nil - minimumValueDescription:nil]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale4" - title:@"Scale" - question:@"How much money do you need?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Vertical continuous scale with three decimal places and a default. - */ - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:8.725 - maximumFractionDigits:3 - vertical:YES - maximumValueDescription:nil - minimumValueDescription:nil]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale5" - title:@"Scale" - question:@"On a scale of 1 to 10, what is your mood?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Vertical discrete scale, with a default on a step boundary. - */ - ORKScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat scaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:5 - step:1 - vertical:YES - maximumValueDescription:nil - minimumValueDescription:nil]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale6" - title:@"Scale" - question:@"How was your mood yesterday?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Vertical discrete scale, with min and max labels. - */ - ORKScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat scaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:NSIntegerMax - step:1 - vertical:YES - maximumValueDescription:@"A lot" - minimumValueDescription:@"Not at all"]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale7" - title:@"Scale" - question:@"On a scale of 1 to 10, what is your mood?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Vertical continuous scale, with min and max labels. - */ - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:99 - maximumFractionDigits:2 - vertical:YES - maximumValueDescription:@"High value" - minimumValueDescription:@"Low value"]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale8" - title:@"Scale" - question:@"How would you measure your mood improvement?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Vertical discrete scale, with min and max labels. - */ - ORKScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat scaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:NSIntegerMax - step:1 - vertical:NO - maximumValueDescription:@"A lot" - minimumValueDescription:@"Not at all"]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale9" - title:@"Scale" - question:@"On a scale of 1 to 10, what is your mood?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Vertical continuous scale, with min and max labels. - */ - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:99 - maximumFractionDigits:2 - vertical:NO - maximumValueDescription:@"High value" - minimumValueDescription:@"Low value"]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale10" - title:@"Scale" - question:@"How would you measure your mood improvement?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Vertical continuous scale with three decimal places, a default, and a format style. - */ - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:1.0 - minimumValue:0.0 - defaultValue:0.8725 - maximumFractionDigits:0 - vertical:YES - maximumValueDescription:nil - minimumValueDescription:nil]; - - scaleAnswerFormat.numberStyle = ORKNumberFormattingStylePercent; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale11" - title:@"Scale" - question:@"How much has your mood improved?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Continuous scale with images. - */ - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:NSIntegerMax - maximumFractionDigits:2 - vertical:YES - maximumValueDescription:@"Hot" - minimumValueDescription:@"Warm"]; - - scaleAnswerFormat.hideSelectedValue = YES; - scaleAnswerFormat.minimumImage = [self imageWithColor:[UIColor yellowColor] size:CGSizeMake(30, 30) border:NO]; - scaleAnswerFormat.maximumImage = [self imageWithColor:[UIColor redColor] size:CGSizeMake(30, 30) border:NO]; - scaleAnswerFormat.minimumImage.accessibilityHint = @"A yellow colored square to represent warmness."; - scaleAnswerFormat.maximumImage.accessibilityHint = @"A red colored square to represent hot."; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale12" - title:@"Scale" - question:@"How warm do you feel?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Discrete scale with images. - */ - ORKScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat scaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:NSIntegerMax - step:1 - vertical:NO - maximumValueDescription:nil - minimumValueDescription:nil]; - - scaleAnswerFormat.hideSelectedValue = YES; - scaleAnswerFormat.minimumImage = [self imageWithColor:[UIColor yellowColor] size:CGSizeMake(30, 30) border:NO]; - scaleAnswerFormat.maximumImage = [self imageWithColor:[UIColor redColor] size:CGSizeMake(30, 30) border:NO]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale13" - title:@"Scale" - question:@"How warm do you feel?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - /* - Horizontal text choice scale with visible selected value. - */ - ORKTextChoice *textChoice1 = [ORKTextChoice choiceWithText:@"Poor" value:@(1)]; - ORKTextChoice *textChoice2 = [ORKTextChoice choiceWithText:@"Fair" value:@(2)]; - ORKTextChoice *textChoice3 = [ORKTextChoice choiceWithText:@"Good" value:@(3)]; - ORKTextChoice *textChoice4 = [ORKTextChoice choiceWithText:@"Above Average" value:@(4)]; - ORKTextChoice *textChoice5 = [ORKTextChoice choiceWithText:@"Excellent" value:@(5)]; - - NSArray *textChoices = @[textChoice1, textChoice2, textChoice3, textChoice4, textChoice5]; - - ORKTextScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat textScaleAnswerFormatWithTextChoices:textChoices - defaultIndex:3 - vertical:NO]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale14" - title:@"Scale" - question:@"How are you feeling today?" - answer:scaleAnswerFormat]; - - [steps addObject:step]; - } - - { - /* - Horizontal text choice scale with hidden selected value. - */ - ORKTextChoice *textChoice1 = [ORKTextChoice choiceWithText:@"Poor" value:@(1)]; - ORKTextChoice *textChoice2 = [ORKTextChoice choiceWithText:@"Fair" value:@(2)]; - ORKTextChoice *textChoice3 = [ORKTextChoice choiceWithText:@"Good" value:@(3)]; - ORKTextChoice *textChoice4 = [ORKTextChoice choiceWithText:@"Above Average" value:@(4)]; - ORKTextChoice *textChoice5 = [ORKTextChoice choiceWithText:@"Excellent" value:@(5)]; - - NSArray *textChoices = @[textChoice1, textChoice2, textChoice3, textChoice4, textChoice5]; - - ORKTextScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat textScaleAnswerFormatWithTextChoices:textChoices - defaultIndex:3 - vertical:NO]; - - scaleAnswerFormat.hideSelectedValue = YES; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale15" - title:@"Scale" - question:@"How are you feeling today?" - answer:scaleAnswerFormat]; - - [steps addObject:step]; - } - - { - /* - Vertical text choice scale. Selected value isn't shown for type. - */ - ORKTextChoice *textChoice1 = [ORKTextChoice choiceWithText:@"Poor" value:@(1)]; - ORKTextChoice *textChoice2 = [ORKTextChoice choiceWithText:@"Fair" value:@(2)]; - ORKTextChoice *textChoice3 = [ORKTextChoice choiceWithText:@"Good" value:@(3)]; - ORKTextChoice *textChoice4 = [ORKTextChoice choiceWithText:@"Above Average" value:@(4)]; - ORKTextChoice *textChoice5 = [ORKTextChoice choiceWithText:@"Excellent" value:@(5)]; - - NSArray *textChoices = @[textChoice1, textChoice2, textChoice3, textChoice4, textChoice5]; - - ORKTextScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat textScaleAnswerFormatWithTextChoices:textChoices - defaultIndex:NSIntegerMax - vertical:YES]; - - scaleAnswerFormat.hideSelectedValue = YES; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"scale16" - title:@"Scale" - question:@"How are you feeling today?" - answer:scaleAnswerFormat]; - - [steps addObject:step]; - } - - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; - -} - -- (id)makeScaleColorGradientTaskWithIdentifier:(NSString *)identifier { - ORKOrderedTask *task = (ORKOrderedTask *)[self makeScaleTaskWithIdentifier:identifier]; - - for (ORKQuestionStep *step in task.steps) { - if ([step isKindOfClass:[ORKQuestionStep class]]) { - ORKAnswerFormat *answerFormat = step.answerFormat; - if ([answerFormat respondsToSelector:@selector(setGradientColors:)]) { - [answerFormat performSelector:@selector(setGradientColors:) withObject:@[[UIColor redColor], - [UIColor greenColor], - [UIColor greenColor], - [UIColor yellowColor], - [UIColor yellowColor]]]; - [answerFormat performSelector:@selector(setGradientLocations:) withObject:@[@0.2, @0.2, @0.7, @0.7, @0.8]]; - } - } - } - return task; -} - -/* - The selection survey task is just a collection of various styles of survey questions. - */ -- (id)makeSelectionSurveyTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step.title = @"Selection Survey"; - [steps addObject:step]; - } - - { - /* - A numeric question requiring integer answers in a fixed range, with no default. - */ - ORKNumericAnswerFormat *format = [ORKNumericAnswerFormat integerAnswerFormatWithUnit:@"years"]; - format.minimum = @(0); - format.maximum = @(199); - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step2" - title:@"Selection Survey" - question:@"How old are you?" - answer:format]; - [steps addObject:step]; - } - - { - /* - A boolean question. - */ - ORKBooleanAnswerFormat *format = [ORKBooleanAnswerFormat new]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step3" - title:@"Selection Survey" - question:@"Do you consent to a background check?" - answer:format]; - [steps addObject:step]; - } - - { - /* - A custom boolean question. - */ - ORKBooleanAnswerFormat *format = [ORKAnswerFormat booleanAnswerFormatWithYesString:@"Agree" noString:@"Disagree"]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step4" - title:@"Selection Survey" - question:@"Do you agree to proceed to the background check questions?" - answer:format]; - [steps addObject:step]; - } - - { - /* - A single-choice question presented in the tableview format. - */ - ORKTextChoiceAnswerFormat *answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices: - @[ - [ORKTextChoice choiceWithText:@"Less than seven" - value:@(7)], - [ORKTextChoice choiceWithText:@"Between seven and eight" - value:@(8)], - [ORKTextChoice choiceWithText:@"More than eight" - value:@(9)] - ]]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step5" - title:@"Selection Survey" - question:@"How many hours did you sleep last night?" - answer:answerFormat]; - - step.optional = NO; - [steps addObject:step]; - } - - { - /* - A multiple-choice question presented in the tableview format. - */ - ORKTextChoiceAnswerFormat *answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleMultipleChoice textChoices: - @[ - [ORKTextChoice choiceWithText:@"Cough" - value:@"cough"], - [ORKTextChoice choiceWithText:@"Fever" - value:@"fever"], - [ORKTextChoice choiceWithText:@"Headaches" - value:@"headache"], - [ORKTextChoice choiceWithText:@"None of the above" - detailText:nil - value:@"none" - exclusive:YES] - ]]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step6" - title:@"Selection Survey" - question:@"Which symptoms do you have?" - answer:answerFormat]; - [steps addObject:step]; - } - - { - /* - A multiple-choice question with text choices that have detail text. - */ - ORKTextChoiceAnswerFormat *answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleMultipleChoice textChoices: - @[ - [ORKTextChoice choiceWithText:@"Cough" - detailText:@"A cough and/or sore throat" - value:@"cough" - exclusive:NO], - [ORKTextChoice choiceWithText:@"Fever" - detailText:@"A 100F or higher fever or feeling feverish" - value:@"fever" - exclusive:NO], - [ORKTextChoice choiceWithText:@"Headaches" - detailText:@"Headaches and/or body aches" - value:@"headache" - exclusive:NO] - ]]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step7" - title:@"Selection Survey" - question:@"Which symptoms do you have?" - answer:answerFormat]; - - [steps addObject:step]; - } - - { - /* - A text question with the default multiple-line text entry. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step8" - title:@"Selection Survey" - question:@"How did you feel last night?" - answer:[ORKAnswerFormat textAnswerFormat]]; - [steps addObject:step]; - } - - { - /* - A text question with single-line text entry, with autocapitalization on - for words, and autocorrection, and spellchecking turned off. - */ - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormat]; - format.multipleLines = NO; - format.autocapitalizationType = UITextAutocapitalizationTypeWords; - format.autocorrectionType = UITextAutocorrectionTypeNo; - format.spellCheckingType = UITextSpellCheckingTypeNo; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step9" - title:@"Selection Survey" - question:@"What is your name?" - answer:format]; - [steps addObject:step]; - } - - { - /* - A text question with a length limit. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step10" - title:@"Selection Survey" - question:@"How did you feel last night?" - answer:[ORKTextAnswerFormat textAnswerFormatWithMaximumLength:20]]; - [steps addObject:step]; - } - - { - /* - An email question with single-line text entry. - */ - ORKEmailAnswerFormat *format = [ORKAnswerFormat emailAnswerFormat]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step11" - title:@"Selection Survey" - question:@"What is your email?" - answer:format]; - [steps addObject:step]; - } - - { - /* - A text question demos secureTextEntry feature - */ - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:10]; - format.secureTextEntry = YES; - format.multipleLines = NO; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step12" - title:@"Selection Survey" - question:@"What is your passcode?" - answer:format]; - step.placeholder = @"Tap your passcode here"; - [steps addObject:step]; - } - - { - /* - A text question with single-line text entry and a length limit. - */ - ORKTextAnswerFormat *format = [ORKAnswerFormat textAnswerFormatWithMaximumLength:20]; - format.multipleLines = NO; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step13" - title:@"Selection Survey" - question:@"What is your name?" - answer:format]; - [steps addObject:step]; - } - - { - /* - A single-select value-picker question. Rather than seeing the items in a tableview, - the user sees them in a picker wheel. This is suitable where the list - of items can be long, and the text describing the options can be kept short. - */ - ORKValuePickerAnswerFormat *answerFormat = [ORKAnswerFormat valuePickerAnswerFormatWithTextChoices: - @[ - [ORKTextChoice choiceWithText:@"Cough" - value:@"cough"], - [ORKTextChoice choiceWithText:@"Fever" - value:@"fever"], - [ORKTextChoice choiceWithText:@"Headaches" - value:@"headache"] - ]]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step14" - title:@"Selection Survey" - question:@"Select a symptom" - answer:answerFormat]; - - [steps addObject:step]; - } - - { - /* - A multiple component value-picker question. - */ - ORKValuePickerAnswerFormat *colorFormat = [ORKAnswerFormat valuePickerAnswerFormatWithTextChoices: - @[ - [ORKTextChoice choiceWithText:@"Red" - value:@"red"], - [ORKTextChoice choiceWithText:@"Blue" - value:@"blue"], - [ORKTextChoice choiceWithText:@"Green" - value:@"green"] - ]]; - - ORKValuePickerAnswerFormat *animalFormat = [ORKAnswerFormat valuePickerAnswerFormatWithTextChoices: - @[ - [ORKTextChoice choiceWithText:@"Cat" - value:@"cat"], - [ORKTextChoice choiceWithText:@"Dog" - value:@"dog"], - [ORKTextChoice choiceWithText:@"Turtle" - value:@"turtle"] - ]]; - - ORKMultipleValuePickerAnswerFormat *answerFormat = [ORKAnswerFormat multipleValuePickerAnswerFormatWithValuePickers: - @[colorFormat, animalFormat]]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step15" - title:@"Selection Survey" - question:@"Select a pet:" - answer:answerFormat]; - - [steps addObject:step]; - } - - - { - /* - A multiple component value-picker question. - */ - ORKValuePickerAnswerFormat *f1 = [ORKAnswerFormat valuePickerAnswerFormatWithTextChoices: - @[ - [ORKTextChoice choiceWithText:@"A" - value:@"A"], - [ORKTextChoice choiceWithText:@"B" - value:@"B"], - [ORKTextChoice choiceWithText:@"C" - value:@"C"] - ]]; - - ORKValuePickerAnswerFormat *f2 = [ORKAnswerFormat valuePickerAnswerFormatWithTextChoices: - @[ - [ORKTextChoice choiceWithText:@"0" - value:@0], - [ORKTextChoice choiceWithText:@"1" - value:@1], - [ORKTextChoice choiceWithText:@"2" - value:@2] - ]]; - - ORKMultipleValuePickerAnswerFormat *answerFormat = [[ORKMultipleValuePickerAnswerFormat alloc] initWithValuePickers:@[f1, f2] separator:@"-"]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step16" - title:@"Selection Survey" - question:@"Select a letter and number code:" - answer:answerFormat]; - - [steps addObject:step]; - } - - { - /* - A continuous slider question. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step17" - title:@"Selection Survey" - question:@"On a scale of 1 to 10, how much pain do you feel?" - answer:[[ORKContinuousScaleAnswerFormat alloc] initWithMaximumValue:10 minimumValue:1 defaultValue:NSIntegerMax maximumFractionDigits:1]]; - [steps addObject:step]; - } - - { - /* - The same as the previous question, but now using a discrete slider. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step18" - title:@"Selection Survey" - question:@"On a scale of 1 to 10, how much pain do you feel?" - answer:[ORKAnswerFormat scaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:NSIntegerMax - step:1 - vertical:NO - maximumValueDescription:@"High value" - minimumValueDescription:@"Low value"]]; - [steps addObject:step]; - } - - { - /* - A HealthKit answer format question for gender. - The default value is read from HealthKit when the step is being presented, - but the user's answer is not written back to HealthKit. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step19" - title:@"Selection Survey" - question:@"What is your gender" - answer:[ORKHealthKitCharacteristicTypeAnswerFormat answerFormatWithCharacteristicType:[HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex]]]; - [steps addObject:step]; - } - - { - /* - A HealthKit answer format question for blood type. - The default value is read from HealthKit when the step is being presented, - but the user's answer is not written back to HealthKit. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step20" - title:@"Selection Survey" - question:@"What is your blood type?" - answer:[ORKHealthKitCharacteristicTypeAnswerFormat answerFormatWithCharacteristicType:[HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBloodType]]]; - [steps addObject:step]; - } - - { - /* - A HealthKit answer format question for date of birth. - The default value is read from HealthKit when the step is being presented, - but the user's answer is not written back to HealthKit. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step21" - title:@"Selection Survey" - question:@"What is your date of birth?" - answer:[ORKHealthKitCharacteristicTypeAnswerFormat answerFormatWithCharacteristicType:[HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierDateOfBirth]]]; - [steps addObject:step]; - } - - { - /* - A HealthKit answer format question for weight. - The default value is read from HealthKit when the step is being presented, - but the user's answer is not written back to HealthKit. - */ - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step22" - title:@"Selection Survey" - question:@"How much do you weigh?" - answer:[ORKHealthKitQuantityTypeAnswerFormat answerFormatWithQuantityType:[HKQuantityType quantityTypeForIdentifier:HKQuantityTypeIdentifierBodyMass] - unit:nil - style:ORKNumericAnswerStyleDecimal]]; - [steps addObject:step]; - } - - { - /* - A multiple choice question where the items are mis-formatted. - This question is used for verifying correct layout of the table view - cells when the content is mixed or very long. - */ - ORKTextChoiceAnswerFormat *answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleMultipleChoice textChoices: - @[ - [ORKTextChoice choiceWithText:@"Cough, A cough and/or sore throat, A cough and/or sore throat" - detailText:@"A cough and/or sore throat, A cough and/or sore throat, A cough and/or sore throat" - value:@"cough" - exclusive:NO], - [ORKTextChoice choiceWithText:@"Fever, A 100F or higher fever or feeling feverish" - detailText:nil - value:@"fever" - exclusive:NO], - [ORKTextChoice choiceWithText:@"" - detailText:@"Headaches, Headaches and/or body aches" - value:@"headache" - exclusive:NO] - ]]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step23" - title:@"Selection Survey" - question:@"(Misused) Which symptoms do you have?" - answer:answerFormat]; - [steps addObject:step]; - } - - { - ORKCompletionStep *step = [[ORKCompletionStep alloc] initWithIdentifier:@"completion"]; - step.title = @"Survey Complete"; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -- (id)makeVideoCaptureTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - /* - If implementing an video capture task like this one, remember that people will - take your instructions literally. So, be cautious. Make sure your template image - is high contrast and very visible against a variety of backgrounds. - */ - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"begin"]; - step.title = @"Hands"; - step.image = [[UIImage imageNamed:@"hands_solid"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"In this step we will capture 5 second videos of both of your hands"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"right1"]; - step.title = @"Right Hand"; - step.image = [[UIImage imageNamed:@"right_hand_solid"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Let's start by capturing a video of your right hand"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"right2"]; - step.title = @"Right Hand"; - step.image = [[UIImage imageNamed:@"right_hand_outline"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Align your right hand with the on-screen outline and record the video. Be sure to place your hand over a contrasting background. You can re-capture the video as many times as you need."; - [steps addObject:step]; - } - - { - ORKVideoCaptureStep *step = [[ORKVideoCaptureStep alloc] initWithIdentifier:@"right3"]; - step.templateImage = [UIImage imageNamed:@"right_hand_outline_big"]; - step.templateImageInsets = UIEdgeInsetsMake(0.05, 0.05, 0.05, 0.05); - step.duration = @5.0; - step.accessibilityInstructions = @"Extend your right hand, palm side down, one foot in front of your device. Tap the Start Recording button, or two-finger double tap the preview to capture the video"; - step.accessibilityHint = @"Records the video visible in the preview"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"left1"]; - step.title = @"Left Hand"; - step.image = [[UIImage imageNamed:@"left_hand_solid"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Now let's capture a video of your left hand"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"left2"]; - step.title = @"Left Hand"; - step.image = [[UIImage imageNamed:@"left_hand_outline"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; - step.detailText = @"Align your left hand with the on-screen outline and record the video. Be sure to place your hand over a contrasting background. You can re-capture the video as many times as you need."; - [steps addObject:step]; - } - - { - ORKVideoCaptureStep *step = [[ORKVideoCaptureStep alloc] initWithIdentifier:@"left3"]; - step.templateImage = [UIImage imageNamed:@"left_hand_outline_big"]; - step.templateImageInsets = UIEdgeInsetsMake(0.05, 0.05, 0.05, 0.05); - step.duration = @5.0; - step.accessibilityInstructions = @"Extend your left hand, palm side down, one foot in front of your device. Tap the Start Recording button, or two-finger double tap the preview to capture the video"; - step.accessibilityHint = @"Records the video visible in the preview"; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"end"]; - step.title = @"Complete"; - step.detailText = @"Hand video capture complete"; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskCustomization.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskCustomization.h deleted file mode 100644 index c2de574e16..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskCustomization.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (TaskCustomization) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskCustomization.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskCustomization.m deleted file mode 100644 index c7098217f2..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskCustomization.m +++ /dev/null @@ -1,392 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+TaskCustomization.h" - -#import "DragonPokerStep.h" -#import "DynamicTask.h" - -@import ResearchKit.Private; - - -@implementation TaskFactory (TaskCustomization) - -- (id)makeCustomViewControllerTaskWithIdentifier:(NSString *)identifier { - - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Custom VC"; - step1.text = @"The next step uses a custom subclass of an ORKFormStepViewController."; - - DragonPokerStep *dragonStep = [[DragonPokerStep alloc] initWithIdentifier:@"dragonStep"]; - dragonStep.title = @"Custom VC"; - - ORKStep *lastStep = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - lastStep.title = @"Complete"; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:@[step1, dragonStep, lastStep]]; -} - -- (id)makeDynamicTaskWithIdentifier:(NSString *)identifier { - return [DynamicTask new]; -} - -/* - This demonstrates a task where if the user enters a value that is too low for - the first question (say, under 18), the task view controller delegate API can - be used to reject the answer and prevent forward navigation. - - See the implementation of the task view controller delegate methods for specific - handling of this task. - */ -- (id)makeInterruptibleTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKNumericAnswerFormat *format = [ORKNumericAnswerFormat integerAnswerFormatWithUnit:@"years"]; - format.minimum = @(5); - format.maximum = @(90); - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step1" - title:@"Interruptible" - question:@"How old are you?" - answer:format]; - [steps addObject:step]; - } - - { - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"step2" - title:@"Interruptible" - question:@"How much did you pay for your car?" - answer:[ORKNumericAnswerFormat decimalAnswerFormatWithUnit:@"USD"]]; - /* - Test interrupting navigation from the task view controller delegate. - - This is an example of preventing a user from proceeding if they don't - enter a valid answer. - */ - step.shouldPresentStepBlock = ^BOOL(ORKTaskViewController *taskViewController, ORKStep *step) { - BOOL shouldPresentStep = YES; - ORKQuestionResult *questionResult = (ORKQuestionResult *)[[[taskViewController result] stepResultForStepIdentifier:@"step1"] firstResult]; - if (questionResult == nil || [(NSNumber *)questionResult.answer integerValue] < 18) { - UIAlertController *alertViewController = - [UIAlertController alertControllerWithTitle:@"Warning" - message:@"You can't participate if you are under 18." - preferredStyle:UIAlertControllerStyleAlert]; - - - UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" - style:UIAlertActionStyleDefault - handler:^(UIAlertAction * action) - { - [alertViewController dismissViewControllerAnimated:YES completion:nil]; - }]; - [alertViewController addAction:okAction]; - - [taskViewController presentViewController:alertViewController animated:NO completion:nil]; - shouldPresentStep = NO; - } - return shouldPresentStep; - }; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"step3"]; - step.title = @"Thank you for completing this task."; - [steps addObject:step]; - } - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return task; -} - -- (id)makeNavigableOrderedLoopTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - ORKAnswerFormat *answerFormat = nil; - ORKStep *step = nil; - NSArray *textChoices = nil; - ORKQuestionStep *questionStep = nil; - - // Intro step - step = [[ORKInstructionStep alloc] initWithIdentifier:@"introStep"]; - step.title = @"Ordered Loop"; - step.text = @"This task demonstrates an skippable step and an optional loop within a navigable ordered task"; - [steps addObject:step]; - - // Skippable step - answerFormat = [ORKAnswerFormat booleanAnswerFormat]; - questionStep = [ORKQuestionStep questionStepWithIdentifier:@"skipNextStep" title:@"Ordered Loop" question:@"Do you want to skip the next step?" answer:answerFormat]; - questionStep.optional = NO; - [steps addObject:questionStep]; - - step = [[ORKInstructionStep alloc] initWithIdentifier:@"skippableStep"]; - step.title = @"Optional Skip"; - step.text = @"You should only see this step if you answered the previous question with 'No'"; - [steps addObject:step]; - - // Loop target step - step = [[ORKInstructionStep alloc] initWithIdentifier:@"loopAStep"]; - step.title = @"Optional return"; - step.text = @"You'll optionally return to this step"; - [steps addObject:step]; - - // Branching paths - textChoices = - @[ - [ORKTextChoice choiceWithText:@"Scale" value:@"scale"], - [ORKTextChoice choiceWithText:@"Text Choice" value:@"textchoice"] - ]; - - answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice - textChoices:textChoices]; - - questionStep = [ORKQuestionStep questionStepWithIdentifier:@"branchingStep" title:@"Ordered Loop" question:@"Which kind of question do you prefer?" answer:answerFormat]; - questionStep.optional = NO; - [steps addObject:questionStep]; - - // Scale question step - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:8.725 - maximumFractionDigits:3 - vertical:YES - maximumValueDescription:nil - minimumValueDescription:nil]; - - step = [ORKQuestionStep questionStepWithIdentifier:@"scaleStep" - title:@"Ordered Loop" - question:@"On a scale of 1 to 10, what is your mood?" - answer:scaleAnswerFormat]; - [steps addObject:step]; - - // Text choice question step - textChoices = - @[ - [ORKTextChoice choiceWithText:@"Good" value:@"good"], - [ORKTextChoice choiceWithText:@"Bad" value:@"bad"] - ]; - - answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice - textChoices:textChoices]; - - questionStep = [ORKQuestionStep questionStepWithIdentifier:@"textChoiceStep" title:@"Ordered Loop" question:@"How is your mood?" answer:answerFormat]; - questionStep.optional = NO; - [steps addObject:questionStep]; - - // Loop conditional step - answerFormat = [ORKAnswerFormat booleanAnswerFormat]; - step = [ORKQuestionStep questionStepWithIdentifier:@"loopBStep" title:@"Ordered Loop" question:@"Do you want to repeat the survey?" answer:answerFormat]; - step.optional = NO; - [steps addObject:step]; - - step = [[ORKInstructionStep alloc] initWithIdentifier:@"endStep"]; - step.title = @"Complete"; - step.text = @"You have finished the task"; - [steps addObject:step]; - - ORKNavigableOrderedTask *task = [[ORKNavigableOrderedTask alloc] initWithIdentifier:identifier - steps:steps]; - - // Build navigation rules - ORKResultSelector *resultSelector = nil; - ORKPredicateStepNavigationRule *predicateRule = nil; - ORKDirectStepNavigationRule *directRule = nil; - ORKPredicateSkipStepNavigationRule *predicateSkipRule = nil; - - // skippable step - resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"skipNextStep"]; - NSPredicate *predicateSkipStep = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:resultSelector - expectedAnswer:YES]; - predicateSkipRule = [[ORKPredicateSkipStepNavigationRule alloc] initWithResultPredicate:predicateSkipStep]; - [task setSkipNavigationRule:predicateSkipRule forStepIdentifier:@"skippableStep"]; - - // From the branching step, go to either scaleStep or textChoiceStep - resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"branchingStep"]; - NSPredicate *predicateAnswerTypeScale = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector - expectedAnswerValue:@"scale"]; - predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[ predicateAnswerTypeScale ] - destinationStepIdentifiers:@[ @"scaleStep" ] - defaultStepIdentifier:@"textChoiceStep"]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"branchingStep"]; - - // From the loopB step, return to loopA if user chooses so - resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"loopBStep"]; - NSPredicate *predicateLoopYes = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:resultSelector - expectedAnswer:YES]; - predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[ predicateLoopYes ] - destinationStepIdentifiers:@[ @"loopAStep" ] ]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"loopBStep"]; - - // scaleStep to loopB direct navigation rule - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"loopBStep"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"scaleStep"]; - - return task; -} - -- (id)makeStepWillAppearTaskWithIdentifier:(NSString *)identifier { - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Will Appear"; - step1.text = @"This task will test several usages of the delegate's 'taskViewController:stepViewControllerWillAppear:\' method."; - - /* - Test adding a custom view to a view controller for an active step, without - subclassing. - - This is possible, but not recommended. A better choice would be to create - a custom active step subclass and a matching active step view controller - subclass, so you completely own the view controller and its appearance. - */ - ORKActiveStep *step2 = [[ORKActiveStep alloc] initWithIdentifier:@"step2"]; - step2.title = @"Will Appear"; - step2.text = @"Custom View On Active Step"; - step2.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - UIView *customView = [UIView new]; - customView.backgroundColor = [UIColor cyanColor]; - - // Have the custom view request the space it needs. - // A little tricky because we need to let it size to fit if there's not enough space. - customView.translatesAutoresizingMaskIntoConstraints = NO; - NSArray *verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:[c(==160)]" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:@{@"c":customView}]; - for (NSLayoutConstraint *constraint in verticalConstraints) { - constraint.priority = UILayoutPriorityFittingSizeLevel; - } - [NSLayoutConstraint activateConstraints:verticalConstraints]; - [NSLayoutConstraint activateConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[c(==280)]" - options:(NSLayoutFormatOptions)0 - metrics:nil - views:@{@"c":customView}]]; - - [(ORKActiveStepViewController *)stepViewController setCustomView:customView]; - - // Set custom button on navigation bar - stepViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Custom button" - style:UIBarButtonItemStylePlain - target:nil - action:nil]; - }; - - /* - Customize the continue and learn more buttons. - */ - ORKInstructionStep *step3 = [[ORKInstructionStep alloc] initWithIdentifier:@"step3"]; - step3.title = @"Will Appear"; - step3.text = @"Custom Next and Learn More Buttons"; - step3.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - stepViewController.continueButtonTitle = @"Next Customized Step"; - stepViewController.learnMoreButtonTitle = @"Learn more about this customized task"; - }; - - /* - Customize the back and cancel buttons. - */ - ORKInstructionStep *step4 = [[ORKInstructionStep alloc] initWithIdentifier:@"step4"]; - step4.title = @"Will Appear"; - step4.text = @"Custom Back and Cancel Buttons"; - step4.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - stepViewController.backButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Backwards" - style:UIBarButtonItemStylePlain - target:stepViewController.backButtonItem.target - action:stepViewController.backButtonItem.action]; - stepViewController.cancelButtonItem.title = @"Abort"; - }; - - /* - Customize the navigation item title. - */ - ORKInstructionStep *step5 = [[ORKInstructionStep alloc] initWithIdentifier:@"step5"]; - step5.title = @"Will Appear"; - step5.text = @"Custom Navigation Item Title"; - step5.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - taskViewController.showsProgressInNavigationBar = NO; - stepViewController.navigationItem.title = @"Custom title"; - }; - step5.stepViewControllerWillDisappearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController, - ORKStepViewControllerNavigationDirection navigationDirection) { - taskViewController.showsProgressInNavigationBar = YES; - }; - - /* - Customize the navigation item title view. - */ - ORKInstructionStep *step6 = [[ORKInstructionStep alloc] initWithIdentifier:@"step6"]; - step6.title = @"Will Appear"; - step6.text = @"Custom Navigation Item Title View"; - step6.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - taskViewController.showsProgressInNavigationBar = NO; - NSMutableArray *items = [[NSMutableArray alloc] init]; - [items addObject:@"Item1"]; - [items addObject:@"Item2"]; - [items addObject:@"Item3"]; - stepViewController.navigationItem.titleView = [[UISegmentedControl alloc] initWithItems:items]; - }; - step6.stepViewControllerWillDisappearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController, - ORKStepViewControllerNavigationDirection navigationDirection) { - taskViewController.showsProgressInNavigationBar = YES; - }; - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier - steps:@[step1, step2, step3, step4, step5, step6]]; - return task; -} - -- (id)makeStepWillDisappearTaskWithIdentifier:(NSString *)identifier { - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Will Disappear"; - step1.text = @"The tint color of the task view controller will be changed to magenta in the delegate's 'taskViewController:stepViewControllerWillDisappear:navigationDirection:' method after this step."; - - step1.stepViewControllerWillDisappearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController, - ORKStepViewControllerNavigationDirection navigationDirection) { - taskViewController.view.tintColor = [UIColor magentaColor]; - }; - - ORKCompletionStep *step2 = [[ORKCompletionStep alloc] initWithIdentifier:@"step2"]; - step2.title = @"Survey Complete"; - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:@[step1, step2]]; - return task; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskReview.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskReview.h deleted file mode 100644 index 4999d64d3e..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskReview.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (TaskReview) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskReview.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskReview.m deleted file mode 100644 index 402439e298..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+TaskReview.m +++ /dev/null @@ -1,137 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+TaskReview.h" - -@import ResearchKit; - - -@implementation TaskFactory (TaskReview) - -- (NSArray *)stepsForReviewTasks { - // ORKInstructionStep - ORKInstructionStep *instructionStep = [[ORKInstructionStep alloc] initWithIdentifier:@"instructionStep"]; - instructionStep.title = @"Review Task"; - instructionStep.text = @"The task demonstrates the usage of ORKReviewStep within a task"; - - NSMutableArray *textChoices = [[NSMutableArray alloc] init]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Good" detailText:@"" value:[NSNumber numberWithInt:0] exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Average" detailText:@"" value:[NSNumber numberWithInt:1] exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Poor" detailText:@"" value:[NSNumber numberWithInt:2] exclusive:NO]]; - ORKQuestionStep *step1 = [ORKQuestionStep questionStepWithIdentifier:@"step1" title:@"Review Task" question:@"How do you feel today?" answer:[ORKAnswerFormat valuePickerAnswerFormatWithTextChoices:textChoices]]; - - // ORKImageChoiceAnswerFormat - NSMutableArray *imageChoices = [[NSMutableArray alloc] init]; - [imageChoices addObject:[[ORKImageChoice alloc] initWithNormalImage:[UIImage imageNamed:@"left_hand_outline"] selectedImage:[UIImage imageNamed:@"left_hand_solid"] text:@"Left hand" value:[NSNumber numberWithInt:1]]]; - [imageChoices addObject:[[ORKImageChoice alloc] initWithNormalImage:[UIImage imageNamed:@"right_hand_outline"] selectedImage:[UIImage imageNamed:@"right_hand_solid"] text:@"Right hand" value:[NSNumber numberWithInt:0]]]; - ORKQuestionStep *step2 = [ORKQuestionStep questionStepWithIdentifier:@"step2" title:@"Review Task" question: @"Which hand was injured?" answer:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:imageChoices]]; - - // ORKTextChoiceAnswerFormat - ORKQuestionStep *step3 = [ORKQuestionStep questionStepWithIdentifier:@"step3" title:@"Review Task" question: @"How do you feel today?" answer:[ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:textChoices]]; - - // ORKBooleanAnswerFormat - ORKQuestionStep *step4 = [ORKQuestionStep questionStepWithIdentifier:@"step4" title:@"Review Task" question:@"Are you at least 18 years old?" answer:[ORKAnswerFormat booleanAnswerFormat]]; - - // ORKTimeOfDayAnswerFormat - ORKQuestionStep *step5 = [ORKQuestionStep questionStepWithIdentifier:@"step5" title:@"Review Task" question:@"When did you wake up today?" answer:[ORKAnswerFormat timeOfDayAnswerFormat]]; - - // ORKDateAnswerFormat - ORKQuestionStep *step6 = [ORKQuestionStep questionStepWithIdentifier:@"step6" title:@"Review Task" question:@"When is your birthday?" answer:[ORKAnswerFormat dateAnswerFormat]]; - - // ORKFormStep - ORKFormStep *formStep = [[ORKFormStep alloc] initWithIdentifier:@"formStep" title:@"Survey" text:@"Please answer the following set of questions"]; - ORKFormItem *formItem1 = [[ORKFormItem alloc] initWithIdentifier:@"formItem1" text:@"How do you feel today?" answerFormat:[ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:textChoices]]; - ORKFormItem *formItem2 = [[ORKFormItem alloc] initWithIdentifier:@"formItem2" text:@"Are you pregnant?" answerFormat:[ORKAnswerFormat booleanAnswerFormat]]; - formStep.formItems = @[formItem1, formItem2]; - - // ORKReviewStep - ORKReviewStep *reviewStep = [ORKReviewStep embeddedReviewStepWithIdentifier:@"embeddedReviewStep"]; - reviewStep.title = @"Review"; - reviewStep.text = @"Review your answers"; - - // ORKNumericAnswerFormat - ORKQuestionStep *step7 = [ORKQuestionStep questionStepWithIdentifier:@"step7" title:@"Review Task" question:@"How many children do you have?" answer:[ORKAnswerFormat integerAnswerFormatWithUnit:@"children"]]; - - // ORKScaleAnswerFormat - ORKQuestionStep *step8 = [ORKQuestionStep questionStepWithIdentifier:@"step8" title:@"Review Task" question:@"On a scale from 1 to 10: How do you feel today?" answer:[ORKAnswerFormat scaleAnswerFormatWithMaximumValue:10 minimumValue:1 defaultValue:6 step:1 vertical:NO maximumValueDescription:@"Excellent" minimumValueDescription:@"Poor"]]; - - // ORKContinousScaleAnswerFormat - ORKQuestionStep *step9 = [ORKQuestionStep questionStepWithIdentifier:@"step9" title:@"Review Task" question:@"On a scale from 1 to 10: How do you feel today?" answer:[ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 minimumValue:1 defaultValue:6 maximumFractionDigits:2 vertical:NO maximumValueDescription:@"Excellent" minimumValueDescription:@"Poor"]]; - - // ORKTextScaleAnswerFormat - ORKQuestionStep *step10 = [ORKQuestionStep questionStepWithIdentifier:@"step10" title:@"Review Task" question:@"How do you feel today?" answer:[ORKAnswerFormat textScaleAnswerFormatWithTextChoices:textChoices defaultIndex:0 vertical:NO]]; - - // ORKTextAnswerFormat - ORKQuestionStep *step11 = [ORKQuestionStep questionStepWithIdentifier:@"step11" title:@"Review Task" question:@"What books do you like best?" answer:[ORKAnswerFormat textAnswerFormat]]; - - // ORKEmailAnswerFormat - ORKQuestionStep *step12 = [ORKQuestionStep questionStepWithIdentifier:@"step12" title:@"Review Task" question:@"What is your e-mail address?" answer:[ORKAnswerFormat emailAnswerFormat]]; - - // ORKTimeIntervalAnswerFormat - ORKQuestionStep *step13 = [ORKQuestionStep questionStepWithIdentifier:@"step13" title:@"Review Task" question:@"How many hours did you sleep last night?" answer:[ORKAnswerFormat timeIntervalAnswerFormat]]; - - // ORKHeightAnswerFormat - ORKQuestionStep *step14 = [ORKQuestionStep questionStepWithIdentifier:@"step14" title:@"Review Task" question:@"What is your height?" answer:[ORKAnswerFormat heightAnswerFormat]]; - - // ORKWeightAnswerFormat - ORKQuestionStep *step15 = [ORKQuestionStep questionStepWithIdentifier:@"step15" title:@"Review Task" question:@"What is your weight?" answer:[ORKAnswerFormat weightAnswerFormat]]; - - // ORKLocationAnswerFormat - ORKQuestionStep *step16 = [ORKQuestionStep questionStepWithIdentifier:@"step16" title:@"Review Task" question:@"Where do you live?" answer:[ORKAnswerFormat locationAnswerFormat]]; - - return @[instructionStep, step1, step2, step3, step4, step5, step6, formStep, reviewStep, step7, step8, step9, step10, step11, step12, step13, step14, step15, step16]; -} - -- (id)makeEmbeddedReviewTaskWithIdentifier:(NSString *)identifier { - // ORKValuePickerAnswerFormat - NSMutableArray *steps = [[NSMutableArray alloc] initWithArray:[self stepsForReviewTasks]]; - ORKReviewStep *reviewStep = [ORKReviewStep embeddedReviewStepWithIdentifier:@"reviewStep"]; - reviewStep.title = @"Review"; - reviewStep.text = @"Review your answers"; - [steps addObject:reviewStep]; - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - task.isEmbeddedReviewTask = YES; - return task; -} - -- (id)makeStandaloneReviewTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] initWithArray:[self stepsForReviewTasks]]; - ORKReviewStep *reviewStep = [ORKReviewStep standaloneReviewStepWithIdentifier:@"reviewStep" steps:steps resultSource:self.embeddedReviewTaskResult]; - reviewStep.title = @"Review"; - reviewStep.text = @"Review your answers from your last survey"; - reviewStep.excludeInstructionSteps = YES; - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:@[reviewStep]]; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+UtilitySteps.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+UtilitySteps.h deleted file mode 100644 index 6e629a7e23..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+UtilitySteps.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - - -@interface TaskFactory (UtilitySteps) - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+UtilitySteps.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory+UtilitySteps.m deleted file mode 100644 index c113b1dcc6..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory+UtilitySteps.m +++ /dev/null @@ -1,725 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory+UtilitySteps.h" - -@import ResearchKit.Private; - - -@interface ORKWebViewTaskViewController: ORKTaskViewController - -@end - - -@implementation ORKWebViewTaskViewController - -- (void)stepViewController:(ORKStepViewController *)stepViewController -didFinishWithNavigationDirection:(ORKStepViewControllerNavigationDirection)direction { - ORKStep *nextStep = [self.task stepAfterStep:stepViewController.step withResult:self.result]; - if (direction == ORKStepViewControllerNavigationDirectionForward - && [nextStep isKindOfClass:[ORKWebViewStep class]]) { - ORKWebViewStepViewController *webStepViewController = ORKDynamicCast([self viewControllerForStep:nextStep], ORKWebViewStepViewController); - webStepViewController.webViewDelegate = self; - [webStepViewController startPreload]; - } else { - [super stepViewController:stepViewController didFinishWithNavigationDirection:direction]; - } -} - -- (void)didFinishLoadingWebStepViewController:(nonnull ORKWebViewStepViewController *)webStepViewController { - [super stepViewController:self.currentStepViewController didFinishWithNavigationDirection:ORKStepViewControllerNavigationDirectionForward]; -} - -- (WKNavigationActionPolicy)handleLinkNavigationWithURL:(nonnull NSURL *)url { - return WKNavigationActionPolicyCancel; -} - -@end - - -@implementation TaskFactory (UtilitySteps) - -- (id)makeAuxiliaryImageStepTaskWithIdentifier:(NSString *)identifier { - - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"step"]; - step.title = @"Title"; - step.text = @"This is description text."; - step.detailText = @"This is detail text."; - step.image = [UIImage imageNamed:@"tremortest3a" inBundle:[NSBundle bundleForClass:[ORKOrderedTask class]] compatibleWithTraitCollection:nil]; - step.auxiliaryImage = [UIImage imageNamed:@"tremortest3b" inBundle:[NSBundle bundleForClass:[ORKOrderedTask class]] compatibleWithTraitCollection:nil]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:@[step]]; -} - -- (id)makeCompletionStepTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKCompletionStep *step1 = [[ORKCompletionStep alloc] initWithIdentifier:@"completionStepWithDoneButton"]; - step1.title = @"Completion Step"; - step1.text = @"Example of a step view controller with the continue button in the standard location below the checkmark."; - step1.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - ((ORKCompletionStepViewController*)stepViewController).shouldShowContinueButton = YES; - }; - [steps addObject:step1]; - - ORKCompletionStep *stepLast = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - stepLast.title = @"Completion Step"; - stepLast.text = @"Example of an step view controller with the continue button in the upper right."; - [steps addObject:stepLast]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -- (id)makeFootnoteStepTaskWithIdentifier:(NSString *)identifier { - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Footnote example"; - step1.text = @"This is an instruction step with a footnote."; - step1.footnote = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dignissim tortor eget orci placerat, eu congue diam tempor. In hac."; - - ORKInstructionStep *step2 = [[ORKInstructionStep alloc] initWithIdentifier:@"step2"]; - step2.title = @"No Footnote"; - step2.text = @"This is an instruction step with an image and NO footnote."; - step2.image = [UIImage imageNamed:@"image_example"]; - - ORKInstructionStep *step3 = [[ORKInstructionStep alloc] initWithIdentifier:@"step3"]; - step3.title = @"Image and Footnote"; - step3.text = @"This is an instruction step with an image and a footnote."; - step3.image = [UIImage imageNamed:@"image_example"]; - step3.footnote = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dignissim tortor eget orci placerat, eu congue diam tempor. In hac."; - - ORKFormStep *step4 = [[ORKFormStep alloc] initWithIdentifier:@"step4" title:@"Form Step" text:@"This is a form step with a skip button."]; - step4.formItems = @[[[ORKFormItem alloc] initWithIdentifier:@"formItem1" - text:@"Are you over 18 years of age?" - answerFormat:[ORKAnswerFormat booleanAnswerFormat]]]; - step4.optional = YES; - - ORKFormStep *step5 = [[ORKFormStep alloc] initWithIdentifier:@"step5" title:@"Footnote example" text:@"This is a form step with a skip button and footnote."]; - step5.formItems = @[[[ORKFormItem alloc] initWithIdentifier:@"formItem1" - text:@"Are you over 18 years of age?" - answerFormat:[ORKAnswerFormat booleanAnswerFormat]]]; - step5.optional = YES; - step5.footnote = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dignissim tortor eget orci placerat, eu congue diam tempor. In hac."; - - ORKCompletionStep *lastStep = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - lastStep.title = @"Last step."; - lastStep.text = @"This is a completion step with a footnote."; - lastStep.footnote = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce dignissim tortor eget orci placerat, eu congue diam tempor. In hac."; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:@[step1, step2, step3, step4, step5, lastStep]]; -} - -- (id)makeIconImageStepTaskWithIdentifier:(NSString *)identifier { - - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Title"; - step1.text = @"This is an example of a step with an icon image."; - - NSDictionary *infoPlist = [[NSBundle mainBundle] infoDictionary]; - NSString *icon = [[infoPlist valueForKeyPath:@"CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles"] lastObject]; - step1.iconImage = [UIImage imageNamed:icon]; - - ORKInstructionStep *step2 = [[ORKInstructionStep alloc] initWithIdentifier:@"step2"]; - step2.text = @"This is an example of a step with an icon image and no title."; - step2.iconImage = [UIImage imageNamed:icon]; - - ORKInstructionStep *step3 = [[ORKInstructionStep alloc] initWithIdentifier:@"step3"]; - step3.title = @"Title"; - step3.text = @"This is an example of a step with an icon image that is very big."; - step3.iconImage = [UIImage imageNamed:@"Poppies"]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:@[step1, step2, step3]]; -} - - -- (id)makePageStepTaskWithIdentifier:(NSString *)identifier { - - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Page Step"; - step1.text = @"Example of an ORKPageStep"; - [steps addObject:step1]; - - NSMutableArray *textChoices = [[NSMutableArray alloc] init]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Good" detailText:@"" value:[NSNumber numberWithInt:0] exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Average" detailText:@"" value:[NSNumber numberWithInt:1] exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Poor" detailText:@"" value:[NSNumber numberWithInt:2] exclusive:NO]]; - ORKAnswerFormat *answerFormat = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:textChoices]; - ORKFormItem *formItem = [[ORKFormItem alloc] initWithIdentifier:@"choice" text:nil answerFormat:answerFormat]; - ORKFormStep *groupStep1 = [[ORKFormStep alloc] initWithIdentifier:@"step1" title:nil text:@"How do you feel today?"]; - groupStep1.formItems = @[formItem]; - - NSMutableArray *imageChoices = [[NSMutableArray alloc] init]; - [imageChoices addObject:[[ORKImageChoice alloc] initWithNormalImage:[UIImage imageNamed:@"left_hand_outline"] selectedImage:[UIImage imageNamed:@"left_hand_solid"] text:@"Left hand" value:[NSNumber numberWithInt:1]]]; - [imageChoices addObject:[[ORKImageChoice alloc] initWithNormalImage:[UIImage imageNamed:@"right_hand_outline"] selectedImage:[UIImage imageNamed:@"right_hand_solid"] text:@"Right hand" value:[NSNumber numberWithInt:0]]]; - ORKQuestionStep *groupStep2 = [ORKQuestionStep questionStepWithIdentifier:@"step2" title:nil question:@"Which hand was injured?" answer:[ORKAnswerFormat choiceAnswerFormatWithImageChoices:imageChoices]]; - - ORKSignatureStep *groupStep3 = [[ORKSignatureStep alloc] initWithIdentifier:@"step3"]; - - ORKStep *groupStep4 = [[ORKConsentReviewStep alloc] initWithIdentifier:@"groupStep4" signature:nil inDocument:[self buildConsentDocument]]; - - ORKPageStep *pageStep = [[ORKPageStep alloc] initWithIdentifier:@"pageStep" steps:@[groupStep1, groupStep2, groupStep3, groupStep4]]; - pageStep.title = @"Page Step"; - [steps addObject:pageStep]; - - ORKOrderedTask *audioTask = [ORKOrderedTask audioTaskWithIdentifier:@"audioTask" - intendedUseDescription:nil - speechInstruction:nil - shortSpeechInstruction:nil - duration:10 - recordingSettings:nil - checkAudioLevel:YES - options: - ORKPredefinedTaskOptionExcludeInstructions | - ORKPredefinedTaskOptionExcludeConclusion]; - ORKPageStep *audioStep = [[ORKNavigablePageStep alloc] initWithIdentifier:@"audioStep" pageTask:audioTask]; - audioStep.title = @"Page Step"; - [steps addObject:audioStep]; - - ORKCompletionStep *stepLast = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - stepLast.title = @"Task Complete"; - [steps addObject:stepLast]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -/* - This is intended to test the predicate functions and APIs - */ -- (id)makePredicateTestsTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [NSMutableArray new]; - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"introStep"]; - step.title = @"Predicate Tests"; - [steps addObject:step]; - } - - // Test Expected Boolean value - { - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question1" title:@"Predicate Tests" question:@"Pass the Boolean question?" answer:[ORKAnswerFormat booleanAnswerFormat]]; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question1Fail"]; - step.title = @"Predicate Tests"; - step.text = @"You failed the Boolean question."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question1Pass"]; - step.title = @"Predicate Tests"; - step.text = @"You passed the Boolean question."; - [steps addObject:step]; - } - - // Test expected Single Choice - { - NSMutableArray *textChoices = [[NSMutableArray alloc] init]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Choose Yes" detailText:@"" value:[NSNumber numberWithInt:0] exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Choose No" detailText:@"" value:[NSNumber numberWithInt:1] exclusive:NO]]; - ORKAnswerFormat *answer = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:textChoices]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question2" title:@"Predicate Tests" question:@"Pass the single choice question?" answer:answer]; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question2Fail"]; - step.title = @"Predicate Tests"; - step.text = @"You failed the single choice question."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question2Pass"]; - step.title = @"Predicate Tests"; - step.text = @"You passed the single choice question."; - [steps addObject:step]; - } - - // Test expected multiple choices - { - NSMutableArray *textChoices = [[NSMutableArray alloc] init]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Cat" detailText:@"" value:[NSNumber numberWithInt:0] exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Dog" detailText:@"" value:[NSNumber numberWithInt:1] exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Rock" detailText:@"" value:[NSNumber numberWithInt:2] exclusive:NO]]; - ORKAnswerFormat *answer = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleMultipleChoice textChoices:textChoices]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question3" title:@"Predicate Tests" question:@"Select all the animals" answer:answer]; - - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question3Fail"]; - step.title = @"Predicate Tests"; - step.text = @"You failed the multiple choice animals question."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question3Pass"]; - step.title = @"Predicate Tests"; - step.text = @"You passed the multiple choice animals question."; - [steps addObject:step]; - } - - // Test expected multiple choices - { - NSMutableArray *textChoices = [[NSMutableArray alloc] init]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Cat" detailText:@"" value:@"Cat" exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Catheter" detailText:@"" value:@"Catheter" exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Cathedral" detailText:@"" value:@"Cathedral" exclusive:NO]]; - [textChoices addObject:[[ORKTextChoice alloc] initWithText:@"Dog" detailText:@"" value:@"Dog" exclusive:NO]]; - ORKAnswerFormat *answer = [ORKAnswerFormat choiceAnswerFormatWithStyle:ORKChoiceAnswerStyleSingleChoice textChoices:textChoices]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question4" title:@"Predicate Tests" question:@"Choose any word containing the word 'Cat'" answer:answer]; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question4Fail"]; - step.title = @"Predicate Tests"; - step.text = @"You failed the 'Cat' pattern match question."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question4Pass"]; - step.title = @"Predicate Tests"; - step.text = @"You passed the 'Cat' pattern match question."; - [steps addObject:step]; - } - - // Test expected text - { - ORKAnswerFormat *answer = [ORKAnswerFormat textAnswerFormat]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question5" title:@"Predicate Tests" question:@"Write the word 'Dog'" answer:answer]; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question5Fail"]; - step.title = @"Predicate Tests"; - step.text = @"You didn't write 'Dog'."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question5Pass"]; - step.title = @"Predicate Tests"; - step.text = @"You wrote 'Dog'."; - [steps addObject:step]; - } - - // Test matching text - { - ORKAnswerFormat *answer = [ORKAnswerFormat textAnswerFormat]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question6" title:@"Predicate Tests" question:@"Write a word matching '*og'" answer:answer]; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question6Fail"]; - step.title = @"Predicate Tests"; - step.text = @"You didn't write a word matching '*og'."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question6Pass"]; - step.title = @"Predicate Tests"; - step.text = @"You wrote a word matching '*og'."; - [steps addObject:step]; - } - - // Numeric test - any number over 10 - { - ORKAnswerFormat *answer = [ORKAnswerFormat integerAnswerFormatWithUnit:nil]; - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question7" title:@"Predicate Tests" question:@"Enter a number over 10" answer:answer]; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question7Fail"]; - step.title = @"Predicate Tests"; - step.text = @"Your number was less then 10."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question7Pass"]; - step.title = @"Predicate Tests"; - step.text = @"Your number was over 10."; - [steps addObject:step]; - } - - { - /* - Vertical continuous scale with three decimal places and a default. - */ - ORKContinuousScaleAnswerFormat *scaleAnswerFormat = [ORKAnswerFormat continuousScaleAnswerFormatWithMaximumValue:10 - minimumValue:1 - defaultValue:8.725 - maximumFractionDigits:3 - vertical:YES - maximumValueDescription:nil - minimumValueDescription:nil]; - - ORKQuestionStep *step = [ORKQuestionStep questionStepWithIdentifier:@"question8" title:@"Predciate Tests" question:@"Choose a value under 5" answer:scaleAnswerFormat]; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question8Fail"]; - step.title = @"Predicate Tests"; - step.text = @"Your number was more than 5."; - [steps addObject:step]; - } - - { - ORKInstructionStep *step = [[ORKInstructionStep alloc] initWithIdentifier:@"question8Pass"]; - step.title = @"Predicate Tests"; - step.text = @"Your number was less than 5."; - [steps addObject:step]; - } - - - { - ORKCompletionStep *step = [[ORKCompletionStep alloc] initWithIdentifier:@"allPassed"]; - step.title = @"Predicate Tests"; - step.text = @"All validation tests now completed."; - [steps addObject:step]; - } - - ORKNavigableOrderedTask *task = [[ORKNavigableOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - - // Build navigation rules. - { - // If we answer 'Yes' to Question 1, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question1"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForBooleanQuestionResultWithResultSelector:resultSelector expectedAnswer:YES]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question1Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question1"]; - } - - { - // If we arrived at question_01_fail then fall through to question 2 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"question2"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question1Fail"]; - } - - { - // If we answer 'Yes' to Question 2, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question2"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector expectedAnswerValue:@"Choose Yes"]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question2Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question2"]; - } - - { - // If we arrived at question_02_fail then fall through to question 3 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"question3"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question2Fail"]; - } - - { - // If we answer 'Yes' to Question 3, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question3"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector expectedAnswerValues:[NSArray arrayWithObjects: @"Cat", @"Dog", nil]]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question3Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question3"]; - } - - { - // If we arrived at question_03_fail then fall through to question 4 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"question4"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question3Fail"]; - } - - { - // If we answer 'Yes' to Question 4, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question4"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForChoiceQuestionResultWithResultSelector:resultSelector matchingPattern:@"Cat.*"]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question4Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question4"]; - } - - { - // If we arrived at question_04_fail then fall through to question 5 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"question5"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question4Fail"]; - } - - { - // If we answer 'Dog' to Question 5, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question5"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForTextQuestionResultWithResultSelector:resultSelector expectedString:@"Dog"]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question5Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question5"]; - } - - { - // If we arrived at question_05_fail then fall through to question 6 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"question6"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question5Fail"]; - } - - - { - // If we answer '*og' to Question 6, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question6"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForTextQuestionResultWithResultSelector:resultSelector matchingPattern:@".*og"]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question6Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question6"]; - } - - { - // If we arrived at question_06_fail then fall through to question 7 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"question7"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question6Fail"]; - } - - { - // If we answer '*og' to Question 7, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question7"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForNumericQuestionResultWithResultSelector:resultSelector minimumExpectedAnswerValue:10]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question7Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question7"]; - } - - { - // If we arrived at question_05_fail then fall through to question 6 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"question8"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question7Fail"]; - } - - { - // If we answer '*og' to Question 7, then proceed to the pass screen - ORKResultSelector *resultSelector = [ORKResultSelector selectorWithResultIdentifier:@"question8"]; - NSPredicate *predicateQuestion = [ORKResultPredicate predicateForScaleQuestionResultWithResultSelector:resultSelector maximumExpectedAnswerValue:5]; - - ORKPredicateStepNavigationRule *predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[predicateQuestion] - destinationStepIdentifiers:@[@"question8Pass"]]; - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"question8"]; - } - - { - // If we arrived at question_05_fail then fall through to question 6 - ORKDirectStepNavigationRule *directRule = nil; - directRule = [[ORKDirectStepNavigationRule alloc] initWithDestinationStepIdentifier:@"allPassed"]; - [task setNavigationRule:directRule forTriggerStepIdentifier:@"question8Fail"]; - } - - return task; -} - -- (id)makeSignatureStepTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Signature Step"; - step1.text = @"Example of an ORKSignatureStep"; - [steps addObject:step1]; - - ORKSignatureStep *signatureStep = [[ORKSignatureStep alloc] initWithIdentifier:@"signatureStep"]; - signatureStep.title = @"Signature Step"; - [steps addObject:signatureStep]; - - ORKCompletionStep *stepLast = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - stepLast.title = @"Task Complete"; - [steps addObject:stepLast]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -- (id)makeTableStepTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Table Step"; - step1.text = @"Example of an ORKTableStepViewController"; - [steps addObject:step1]; - - ORKTableStep *tableStep = [[ORKTableStep alloc] initWithIdentifier:@"tableStep"]; - tableStep.title = @"Table Step"; - tableStep.items = @[@"Item 1", @"Item 2", @"Item 3"]; - tableStep.bulletType = ORKBulletTypeNumber; - [steps addObject:tableStep]; - - ORKCompletionStep *stepLast = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - stepLast.title = @"Task Complete"; - [steps addObject:stepLast]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -- (id)makeVideoInstructionStepTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKInstructionStep *firstStep = [[ORKInstructionStep alloc] initWithIdentifier:@"firstStep"]; - firstStep.title = @"Video Instruction"; - firstStep.text = @"Example of an ORKVideoInstructionStep"; - [steps addObject:firstStep]; - - ORKVideoInstructionStep *videoInstructionStep = [[ORKVideoInstructionStep alloc] initWithIdentifier:@"videoInstructionStep"]; - videoInstructionStep.title = @"Video Instruction"; - videoInstructionStep.videoURL = [[NSURL alloc] initWithString:@"https://www.apple.com/media/us/researchkit/2016/a63aa7d4_e6fd_483f_a59d_d962016c8093/films/carekit/researchkit-carekit-cc-us-20160321_r848-9dwc.mov"]; - - [steps addObject:videoInstructionStep]; - - ORKCompletionStep *lastStep = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - lastStep.title = @"Task Complete"; - [steps addObject:lastStep]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -- (id)makeWaitStepTaskWithIdentifier:(NSString *)identifier { - - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - /* - To properly use the wait steps, one needs to implement the "" method of ORKTaskViewControllerDelegate to start their background action when the wait task begins, and then call the "finish" method on the ORKWaitTaskViewController when the background task has been completed. - */ - ORKInstructionStep *step1 = [[ORKInstructionStep alloc] initWithIdentifier:@"step1"]; - step1.title = @"Setup"; - step1.detailText = @"ORKTest needs to set up some things before you begin, once the setup is complete you will be able to continue."; - [steps addObject:step1]; - - // Interterminate wait step. - ORKWaitStep *step2 = [[ORKWaitStep alloc] initWithIdentifier:@"step2"]; - step2.title = @"Getting Ready"; - step2.text = @"Please wait while the setup completes."; - step2.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - [((ORKWaitStepViewController *)stepViewController) performSelector:@selector(updateText:) withObject:@"Updated text" afterDelay:2.0]; - [((ORKWaitStepViewController *)stepViewController) performSelector:@selector(goForward) withObject:nil afterDelay:5.0]; - }; - [steps addObject:step2]; - - ORKInstructionStep *step3 = [[ORKInstructionStep alloc] initWithIdentifier:@"step3"]; - step3.title = @"Account Setup"; - step3.detailText = @"The information you entered will be sent to the secure server to complete your account setup."; - [steps addObject:step3]; - - // Determinate wait step. - ORKWaitStep *step4 = [[ORKWaitStep alloc] initWithIdentifier:@"step4"]; - step4.title = @"Syncing Account"; - step4.text = @"Please wait while the data is uploaded."; - step4.indicatorType = ORKProgressIndicatorTypeProgressBar; - step4.stepViewControllerWillAppearBlock = ^(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController) { - [self updateProgress:0.0 waitStepViewController:((ORKWaitStepViewController *)stepViewController)]; - }; - [steps addObject:step4]; - - ORKCompletionStep *step5 = [[ORKCompletionStep alloc] initWithIdentifier:@"step5"]; - step5.title = @"Setup Complete"; - [steps addObject:step5]; - - ORKOrderedTask *waitTask = [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; - return waitTask; -} - -- (id)makeWebViewStepTaskWithIdentifier:(NSString *)identifier { - NSMutableArray *steps = [[NSMutableArray alloc] init]; - - ORKInstructionStep *firstStep = [[ORKInstructionStep alloc] initWithIdentifier:@"firstStep"]; - firstStep.title = @"Web View"; - firstStep.text = @"Example of an ORKWebViewStep"; - [steps addObject:firstStep]; - - NSString *html = @"

Consent

This is a legal document

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

"; - - ORKWebViewStep *webViewStep = [ORKWebViewStep webViewStepWithIdentifier:@"webViewStep" html:html]; - webViewStep.title = @"Web View"; - webViewStep.showSignatureAfterContent = YES; - [steps addObject:webViewStep]; - - ORKCompletionStep *lastStep = [[ORKCompletionStep alloc] initWithIdentifier:@"lastStep"]; - lastStep.title = @"Task Complete"; - [steps addObject:lastStep]; - - return [[ORKOrderedTask alloc] initWithIdentifier:identifier steps:steps]; -} - -- (ORKTaskViewController *)makeWebViewStepTaskViewControllerWithIdentifier:(NSString *)identifier - task:(id)task - restorationData:(NSData *)restorationData - delegate:(id)delegate { - return [[ORKWebViewTaskViewController alloc] initWithTask:task restorationData:restorationData delegate:delegate error:NULL]; -} - -// Update progress on the Wait Task -- (void)updateProgress:(CGFloat)progress waitStepViewController:(ORKWaitStepViewController *)waitStepviewController { - if (progress <= 1.0) { - [waitStepviewController setProgress:progress animated:true]; - double delayInSeconds = 0.1; - dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC)); - dispatch_after(popTime, dispatch_get_main_queue(), ^(void) { - [self updateProgress:(progress + 0.01) waitStepViewController:waitStepviewController]; - if (progress > 0.495 && progress < 0.505) { - NSString *newText = @"Please wait while the data is downloaded."; - [waitStepviewController updateText:newText]; - } - }); - } else { - [waitStepviewController goForward]; - } -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory.h b/Testing/ORKTest/ORKTest/Tasks/TaskFactory.h deleted file mode 100644 index e05c5e1790..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -@import UIKit; -@import ResearchKit; - - -/* NOTE: The task creation utility methods are alphabetically sorted within their - * their own category file. Make sure you insert your code in the appropriate place - * so all the methods in each categoty files remain alphabetically sorted. - */ - -@protocol ORKTask; -@class ORKConsentDocument; -@class ORKStepViewController; -@class ORKTaskResult; -@class ORKTaskViewController; - -// Helper properties to communicate task and step intent to MainViewController -@interface NSObject (TaskFactory) - -// ORKTask associated properties -@property (nonatomic, assign) BOOL hidesLearnMoreButtonOnInstructionStep; -@property (nonatomic, assign) BOOL isEmbeddedReviewTask; - -// ORKStep associated properties -typedef void (^StepViewControllerWillAppearBlockType)(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController); -@property (nonatomic, copy) StepViewControllerWillAppearBlockType stepViewControllerWillAppearBlock; - -typedef void (^StepViewControllerWillDisappearBlockType)(ORKTaskViewController *taskViewController, - ORKStepViewController *stepViewController, - ORKStepViewControllerNavigationDirection navigationDirection); -@property (nonatomic, copy) StepViewControllerWillDisappearBlockType stepViewControllerWillDisappearBlock; - -typedef BOOL (^ShouldPresentStepBlockType)(ORKTaskViewController *taskViewController, - ORKStep *step); -@property (nonatomic, copy) ShouldPresentStepBlockType shouldPresentStepBlock; - -@end - - -@interface TaskFactory : NSObject - -+ (instancetype)sharedInstance; - -- (id)makeTaskWithIdentifier:(NSString *)identifier; - -- (ORKTaskViewController *)makeTaskViewControllerWithIdentifier:(NSString *)identifier - task:(id)task - restorationData:(NSData *)data - delegate:(id)delegate; - -- (ORKConsentDocument *)buildConsentDocument; - -- (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size border:(BOOL)border; - -@property (nonatomic, copy) ORKConsentDocument *currentConsentDocument; - -@property (nonatomic, strong) ORKTaskResult *embeddedReviewTaskResult; - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory.m b/Testing/ORKTest/ORKTest/Tasks/TaskFactory.m deleted file mode 100644 index b09ac0b9fa..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory.m +++ /dev/null @@ -1,328 +0,0 @@ -/* - Copyright (c) 2015-2017, Apple Inc. All rights reserved. - Copyright (c) 2015, Bruce Duncan. - Copyright (c) 2015-2017, Ricardo Sanchez-Saez. - Copyright (c) 2016-2017, Sage Bionetworks - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - - 3. Neither the name of the copyright holder(s) nor the names of any contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. No license is granted to the trademarks of - the copyright holders even if such marks are included in this software. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#import "TaskFactory.h" - -#import "ORKTest-Swift.h" - -#import - - -// This macro generates a default implementation for CType properties declared inside a class extension. -// -// Example: -// -// ORKTypeExtensionProperty_Implementation(myBoolProperty, -// MyBoolProperty, -// BOOL, -// NO); -// -#define ORKTPasteTokens(A,B) A ## B - -#define ORKTCTypeExtensionProperty_Implementation(_propertyName, \ - _capitalizedPropertyName, \ - _propertyType, \ - _propertyDefaultValue) \ - \ -- (void) ORKTPasteTokens(set, _capitalizedPropertyName) :(_propertyType)propertyValue \ -{ \ - NSValue *value = [NSValue valueWithBytes:&propertyValue objCType:@encode(_propertyType)]; \ - objc_setAssociatedObject(self, @selector(_propertyName), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); \ -} \ - \ -- ( _propertyType ) _propertyName \ -{ \ - NSValue *value = objc_getAssociatedObject(self, @selector(_propertyName) ); \ - if (value) \ - { \ - _propertyType propertyValue; [value getValue:&propertyValue]; return propertyValue; \ - } \ - else \ - { \ - return _propertyDefaultValue ; \ - } \ -} \ - -#define ORKTCopyExtensionProperty_Implementation(_propertyName, \ - _capitalizedPropertyName, \ - _propertyType) \ - \ -- (void) ORKTPasteTokens(set, _capitalizedPropertyName) :(_propertyType)propertyValue \ -{ \ - objc_setAssociatedObject(self, \ - @selector(_propertyName), \ - propertyValue, \ - OBJC_ASSOCIATION_COPY_NONATOMIC); \ -} \ - \ -- ( _propertyType ) _propertyName \ -{ \ - return objc_getAssociatedObject(self, @selector(_propertyName)); \ -} \ - - -@implementation NSObject (TaskFactory) - -ORKTCTypeExtensionProperty_Implementation(hidesLearnMoreButtonOnInstructionStep, - HidesLearnMoreButtonOnInstructionStep, - BOOL, - NO); - -ORKTCTypeExtensionProperty_Implementation(hidesProgressInNavigationBar, - HidesProgressInNavigationBar, - BOOL, - NO); - -ORKTCTypeExtensionProperty_Implementation(isEmbeddedReviewTask, - IsEmbeddedReviewTask, - BOOL, - NO); - -ORKTCTypeExtensionProperty_Implementation(triggersStepWillDisappearAction, - TriggersStepWillDisappearAction, - BOOL, - NO); - -ORKTCopyExtensionProperty_Implementation(stepViewControllerWillAppearBlock, - StepViewControllerWillAppearBlock, - StepViewControllerWillAppearBlockType); - -ORKTCopyExtensionProperty_Implementation(stepViewControllerWillDisappearBlock, - StepViewControllerWillDisappearBlock, - StepViewControllerWillDisappearBlockType); - -ORKTCopyExtensionProperty_Implementation(shouldPresentStepBlock, - ShouldPresentStepBlock, - ShouldPresentStepBlockType); - -@end - - -@implementation TaskFactory - -+ (instancetype)sharedInstance -{ - static dispatch_once_t onceToken; - static id sharedInstance = nil; - dispatch_once(&onceToken, ^{ - sharedInstance = [[[self class] alloc] init]; - }); - return sharedInstance; -} - -#pragma mark - Mapping identifiers to tasks - -- (id)makeTaskWithIdentifier:(NSString *)identifier { - id task = nil; - // convert @"SampleTaskIdentifier" into @"makeSampleTaskWithIdentifier:" - NSString *makeTaskSelectorName = [NSString stringWithFormat:@"make%@WithIdentifier:", - [identifier substringToIndex:identifier.length - 10]]; - SEL makeTaskSelector = NSSelectorFromString(makeTaskSelectorName); - if ([self respondsToSelector:makeTaskSelector]) { - // Equivalent to [self peformSelector:buttonSelector], but ARC safe - IMP imp = [self methodForSelector:makeTaskSelector]; - id (*func)(id, SEL, NSString *) = (void *)imp; - task = func(self, makeTaskSelector, identifier); - } - return task; -} - -- (ORKTaskViewController *)makeTaskViewControllerWithIdentifier:(NSString *)identifier - task:(id)task - restorationData:(NSData *)data - delegate:(id)delegate { - ORKTaskViewController *taskViewController = nil; - // convert @"SampleTaskIdentifier" into @"makeSampleTaskViewControllerWithIdentifier:task:restorationData:delegate:" - NSString *makeTaskViewControllerSelectorName = [NSString stringWithFormat:@"make%@ViewControllerWithIdentifier:task:restorationData:delegate:", - [identifier substringToIndex:identifier.length - 10]]; - SEL makeTaskViewControllerSelector = NSSelectorFromString(makeTaskViewControllerSelectorName); - NSError *error; - if ([self respondsToSelector:makeTaskViewControllerSelector]) { - // Equivalent to [self peformSelector:buttonSelector], but ARC safe - IMP imp = [self methodForSelector:makeTaskViewControllerSelector]; - ORKTaskViewController *(*func)(id, SEL, NSString *, id, NSData *, id) = (void *)imp; - taskViewController = func(self, makeTaskViewControllerSelector, identifier, task, data, delegate); - } else { - taskViewController = [[ORKTaskViewController alloc] initWithTask:task restorationData:data delegate:delegate error:&error]; - } - return taskViewController; -} - -/* - Builds a test consent document. - */ -- (ORKConsentDocument *)buildConsentDocument { - ORKConsentDocument *consent = [[ORKConsentDocument alloc] init]; - - /* - If you have HTML review content, you can substitute it for the - concatenation of sections by doing something like this: - consent.htmlReviewContent = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:XXX ofType:@"html"] encoding:NSUTF8StringEncoding error:nil]; - */ - - /* - Title that will be shown in the generated document. - */ - consent.title = @"Demo Consent"; - - - /* - Signature page content, used in the generated document above the signatures. - */ - consent.signaturePageTitle = @"Consent"; - consent.signaturePageContent = @"I agree to participate in this research Study."; - - /* - The empty signature that the user will fill in. - */ - ORKConsentSignature *participantSig = [ORKConsentSignature signatureForPersonWithTitle:@"Participant" dateFormatString:nil identifier:@"participantSig"]; - [consent addSignature:participantSig]; - - /* - Pre-populated investigator's signature. - */ - ORKConsentSignature *investigatorSig = [ORKConsentSignature signatureForPersonWithTitle:@"Investigator" dateFormatString:nil identifier:@"investigatorSig" givenName:@"Jake" familyName:@"Clemson" signatureImage:[UIImage imageNamed:@"signature"] dateString:@"9/2/14" ]; - [consent addSignature:investigatorSig]; - - /* - These are the set of consent sections that have pre-defined animations and - images. - - We will create a section for each of the section types, and then add a custom - section on the end. - */ - NSArray *scenes = @[@(ORKConsentSectionTypeOverview), - @(ORKConsentSectionTypeDataGathering), - @(ORKConsentSectionTypePrivacy), - @(ORKConsentSectionTypeDataUse), - @(ORKConsentSectionTypeTimeCommitment), - @(ORKConsentSectionTypeStudySurvey), - @(ORKConsentSectionTypeStudyTasks), - @(ORKConsentSectionTypeWithdrawing)]; - - NSMutableArray *sections = [NSMutableArray new]; - for (NSNumber *type in scenes) { - NSString *summary = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo? An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo? Et doming eirmod delicata cum. Vel fabellas scribentur neglegentur cu, pro te iudicabit explicari. His alia idque scriptorem ei, quo no nominavi noluisse."; - ORKConsentSection *consentSection = [[ORKConsentSection alloc] initWithType:type.integerValue]; - consentSection.summary = summary; - - if (type.integerValue == ORKConsentSectionTypeOverview) { - /* - Tests HTML content instead of text for Learn More. - */ - consentSection.htmlContent = @"
  • Lorem
  • ipsum
  • dolor

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo?

\ -

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo?

研究"; - } else if (type.integerValue == ORKConsentSectionTypeDataGathering) { - /* - Tests PDF content instead of text, HTML for Learn More. - */ - NSString *path = [[NSBundle mainBundle] pathForResource:@"SAMPLE_PDF_TEST" ofType:@"pdf"]; - consentSection.contentURL = [NSURL URLWithString:path]; - - } else { - /* - Tests text Learn More content. - */ - consentSection.content = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo? An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo?\ - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo?\ - An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo? Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo?\ - An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo? Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo? An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo?\ - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo?\ - An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo?"; - } - - [sections addObject:consentSection]; - } - - { - /* - A custom consent scene. This doesn't demo it but you can also set a custom - animation. - */ - ORKConsentSection *consentSection = [[ORKConsentSection alloc] initWithType:ORKConsentSectionTypeCustom]; - consentSection.summary = @"Custom Scene summary"; - consentSection.title = @"Custom Scene"; - consentSection.customImage = [UIImage imageNamed:@"image_example.png"]; - consentSection.customLearnMoreButtonTitle = @"Learn more about customizing ResearchKit"; - consentSection.content = @"You can customize ResearchKit a lot!"; - [sections addObject:consentSection]; - } - - { - /* - An "only in document" scene. This is ignored for visual consent, but included in - the concatenated document for review. - */ - ORKConsentSection *consentSection = [[ORKConsentSection alloc] initWithType:ORKConsentSectionTypeOnlyInDocument]; - consentSection.summary = @"OnlyInDocument Scene summary"; - consentSection.title = @"OnlyInDocument Scene"; - consentSection.content = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo? An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo?"; - [sections addObject:consentSection]; - } - - consent.sections = [sections copy]; - return consent; -} - -/* - A helper for creating square colored images, which can optionally have a border. - - Used for testing the image choices answer format. - - @param color Color to use for the image. - @param size Size of image. - @param border Boolean value indicating whether to add a black border around the image. - - @return An image. - */ -- (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size border:(BOOL)border { - - UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)]; - - view.backgroundColor = color; - - if (border) { - view.layer.borderColor = [[UIColor blackColor] CGColor]; - view.layer.borderWidth = 5.0; - } - - UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0); - [view.layer renderInContext:UIGraphicsGetCurrentContext()]; - UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); - UIGraphicsEndImageContext(); - - return image; -} - -@end diff --git a/Testing/ORKTest/ORKTest/Tasks/TaskFactory.swift b/Testing/ORKTest/ORKTest/Tasks/TaskFactory.swift deleted file mode 100644 index 378e406429..0000000000 --- a/Testing/ORKTest/ORKTest/Tasks/TaskFactory.swift +++ /dev/null @@ -1,174 +0,0 @@ -/* -Copyright (c) 2015, Ricardo Sánchez-Sáez. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import Foundation -import ResearchKit - -public extension TaskFactory { - - @objc - class func makeNavigableOrderedTask(_ taskIdentifier: String) -> ORKNavigableOrderedTask { - var steps: [ORKStep] = [] - var answerFormat: ORKAnswerFormat - var step: ORKStep - var textChoices: [ORKTextChoice] - - // Intro step - step = ORKInstructionStep(identifier: "introStep") - step.title = "This task demonstrates rule-based navigation within tasks" - steps.append(step) - - // Form step - textChoices = [ - ORKTextChoice(text: "Good", value: "good" as NSString), - ORKTextChoice(text: "Bad", value: "bad" as NSString) - ] - answerFormat = ORKAnswerFormat.choiceAnswerFormat(with: ORKChoiceAnswerStyle.singleChoice, textChoices: textChoices) - let formItemFeeling: ORKFormItem = ORKFormItem(identifier: "formFeeling", text: "How do you feel", answerFormat: answerFormat) - let formItemMood: ORKFormItem = ORKFormItem(identifier: "formMood", text: "How is your mood", answerFormat: answerFormat) - let formStep: ORKFormStep = ORKFormStep(identifier: "introForm") - formStep.isOptional = false - formStep.formItems = [formItemFeeling, formItemMood] - steps.append(formStep) - - // Question steps - textChoices = [ - ORKTextChoice(text: "Headache", value: "headache" as NSString), - ORKTextChoice(text: "Dizziness", value: "dizziness" as NSString), - ORKTextChoice(text: "Nausea", value: "nausea" as NSString) - ] - answerFormat = ORKTextChoiceAnswerFormat(style: ORKChoiceAnswerStyle.singleChoice, textChoices: textChoices) - step = ORKQuestionStep(identifier: "symptom", title: "Symptoms", question: "Which is your most severe symptom?", answer: answerFormat) - step.isOptional = false - steps.append(step) - - answerFormat = ORKAnswerFormat.booleanAnswerFormat() - step = ORKQuestionStep(identifier: "severity", title: "Symptoms", question: "Does your symptom interfere with your daily life?", answer: answerFormat) - step.isOptional = false - steps.append(step) - - // Instruction steps - step = ORKInstructionStep(identifier: "blank") - step.title = "This step is intentionally left blank (you should not see it)" - steps.append(step) - - step = ORKInstructionStep(identifier: "severeHeadache") - step.title = "You have a severe headache" - steps.append(step) - - step = ORKInstructionStep(identifier: "lightHeadache") - step.title = "You have a light headache" - steps.append(step) - - step = ORKInstructionStep(identifier: "otherSymptom") - step.title = "Your symptom is not a headache" - steps.append(step) - - step = ORKInstructionStep(identifier: "surveySkipped") - step.title = "Please come back to this survey when you don't feel good or your mood is low." - steps.append(step) - - step = ORKInstructionStep(identifier: "end") - step.title = "You have finished the task" - steps.append(step) - - step = ORKInstructionStep(identifier: "blankB") - step.title = "This step is intentionally left blank (you should not see it)" - steps.append(step) - - let task: ORKNavigableOrderedTask = ORKNavigableOrderedTask(identifier: taskIdentifier, steps: steps) - - // Navigation rules - var predicateRule: ORKPredicateStepNavigationRule - - // From the feel/mood form step, skip the survey if the user is feeling okay and has a good mood - var resultSelector = ORKResultSelector(stepIdentifier: "introForm", resultIdentifier: "formFeeling") - let predicateGoodFeeling: NSPredicate = ORKResultPredicate.predicateForChoiceQuestionResult(with: resultSelector, expectedAnswerValue: "good" as NSString) - resultSelector = ORKResultSelector(stepIdentifier: "introForm", resultIdentifier: "formMood") - let predicateGoodMood: NSPredicate = ORKResultPredicate.predicateForChoiceQuestionResult(with: resultSelector, expectedAnswerValue: "good" as NSString) - let predicateGoodMoodAndFeeling: NSCompoundPredicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicateGoodFeeling, predicateGoodMood]) - predicateRule = ORKPredicateStepNavigationRule(resultPredicatesAndDestinationStepIdentifiers: - [ (predicateGoodMoodAndFeeling, "surveySkipped") ]) - task.setNavigationRule(predicateRule, forTriggerStepIdentifier: "introForm") - - // From the "symptom" step, go to "otherSymptom" is user didn't chose headache. - // Otherwise, default to going to next step (the regular ORKOrderedTask order applies - // when the defaultStepIdentifier argument is omitted). - - // User chose headache at the symptom step - // Equivalent to: - // [NSPredicate predicateWithFormat: - // @"SUBQUERY(SELF, $x, $x.identifier like 'symptom' \ - // AND SUBQUERY($x.answer, $y, $y like 'headache').@count > 0).@count > 0"]; - resultSelector = ORKResultSelector(resultIdentifier: "symptom") - let predicateHeadache: NSPredicate = ORKResultPredicate.predicateForChoiceQuestionResult(with: resultSelector, expectedAnswerValue: "headache" as NSString) - - // User didn't chose headache at the symptom step - let predicateNotHeadache: NSCompoundPredicate = NSCompoundPredicate(notPredicateWithSubpredicate: predicateHeadache) - - predicateRule = ORKPredicateStepNavigationRule(resultPredicatesAndDestinationStepIdentifiers: - [ (predicateNotHeadache, "otherSymptom") ]) - task.setNavigationRule(predicateRule, forTriggerStepIdentifier: "symptom") - - // From the "severity" step, go to "severeHeadache" or "lightHeadache" depending on the user answer - - // User chose YES at the severity step - // Equivalent to: - // [NSPredicate predicateWithFormat: - // @"SUBQUERY(SELF, $x, $x.identifier like 'severity' AND $x.answer == YES).@count > 0"]; - resultSelector = ORKResultSelector(resultIdentifier: "severity") - let predicateSevereYes: NSPredicate = ORKResultPredicate.predicateForBooleanQuestionResult(with: resultSelector, expectedAnswer: true) - - // User chose NO at the severity step - resultSelector = ORKResultSelector(resultIdentifier: "severity") - let predicateSevereNo: NSPredicate = ORKResultPredicate.predicateForBooleanQuestionResult(with: resultSelector, expectedAnswer: false) - - let predicateSevereHeadache: NSCompoundPredicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicateHeadache, predicateSevereYes]) - let predicateLightHeadache: NSCompoundPredicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicateHeadache, predicateSevereNo]) - - predicateRule = ORKPredicateStepNavigationRule(resultPredicatesAndDestinationStepIdentifiers: - [ (predicateSevereHeadache, "severeHeadache"), (predicateLightHeadache, "lightHeadache") ]) - task.setNavigationRule(predicateRule, forTriggerStepIdentifier: "severity") - - // Direct rules to skip unneeded steps - var directRule: ORKDirectStepNavigationRule - - directRule = ORKDirectStepNavigationRule(destinationStepIdentifier: "end") - task.setNavigationRule(directRule, forTriggerStepIdentifier: "severeHeadache") - task.setNavigationRule(directRule, forTriggerStepIdentifier: "lightHeadache") - task.setNavigationRule(directRule, forTriggerStepIdentifier: "otherSymptom") - task.setNavigationRule(directRule, forTriggerStepIdentifier: "surveySkipped") - - directRule = ORKDirectStepNavigationRule(destinationStepIdentifier: ORKNullStepIdentifier) - task.setNavigationRule(directRule, forTriggerStepIdentifier: "end") - - return task - } -} diff --git a/Testing/ORKTest/ORKTestTests/Info.plist b/Testing/ORKTest/ORKTestTests/Info.plist deleted file mode 100644 index c782c7932e..0000000000 --- a/Testing/ORKTest/ORKTestTests/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - NSHealthShareUsageDescription - Test HK releated features. - NSHealthUpdateUsageDescription - Test HK related features. - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORK3DModelStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORK3DModelStep.json deleted file mode 100644 index dbf844c496..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORK3DModelStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"50DE67FB-AE5A-4C1A-97E6-038BAB9A346F"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"23DBF489-731A-446A-A5ED-3D3E737C5E12"},"title":"","image":{"imageName":"A39F0D25-B88E-446C-BC34-614AE0405E73"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment":0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORK3DModelStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0, "modelManager": {"_class":"ORK3DModelManager", "allowsSelection":false, "identifiersOfObjectsToHighlight":[], "highlightColor": {"r":1, "g":1, "b":1, "a":1 }},"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAccuracyStroopStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAccuracyStroopStep.json deleted file mode 100644 index d2dbbbfbd6..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAccuracyStroopStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"62E9D4CF-3E7B-49B8-A295-7D2EB1ECC00B"},"auxiliaryImage":{"imageName":"8C25AB92-00C9-4E13-B55F-711658F53D48"},"title":"","image":{"imageName":"4930AC43-8AAA-4563-8C8F-6E7E25E550C3"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":9.2233720368547758e+18,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":true,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAccuracyStroopStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}, "baseDisplayColor":{"r":1,"g":1,"b":1,"a":1}, "isColorMatching":false} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKActiveStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKActiveStep.json deleted file mode 100644 index b6c6dcaad4..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKActiveStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"50DE67FB-AE5A-4C1A-97E6-038BAB9A346F"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"23DBF489-731A-446A-A5ED-3D3E737C5E12"},"title":"","image":{"imageName":"A39F0D25-B88E-446C-BC34-614AE0405E73"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment":0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKActiveStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAmslerGridStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAmslerGridStep.json deleted file mode 100644 index 475f90858f..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAmslerGridStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"DFC4815F-FB55-4365-9D10-FF2BA83879A1"},"auxiliaryImage":{"imageName":"3E076C04-09E0-4055-8FBE-5309DC4A5348"},"title":"","image":{"imageName":"0905D188-3CBD-4DEE-82C7-11165BA8352B"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0,"stepDuration":9.2233720368547758e+18,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","eyeSide":0,"optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":true,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAmslerGridStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioFitnessStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioFitnessStep.json deleted file mode 100644 index 7aafac51b1..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioFitnessStep.json +++ /dev/null @@ -1 +0,0 @@ -{"vocalCues":[{"_class":"ORKVocalCue","time": 12,"spokenText":"words"}, {"_class":"ORKVocalCue","time": 13,"spokenText":"more words"}],"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"3F5C9800-6A7A-4158-8ECF-0832B44DF6C1"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"988B687D-F50F-4B89-B6B7-20F11AE6AC8E"},"title":"","image":{"imageName":"B7400237-AD21-4AA3-8E4C-60F06E05EA39"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAudioFitnessStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"userInfo":{},"audioAsset":{"_class":"ORKBundleAsset","name":"filename","bundleIdentifier":"com.bundle.identifier","fileExtension":"mp4"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioStep.json deleted file mode 100644 index bef2fd5eae..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKAudioStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"244AD43E-7785-4BF5-829C-A3B5C771E9F2"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"A35CAC85-9557-4ED5-9807-DCFDAC04C81D"},"title":"","image":{"imageName":"5E598B50-21DC-400E-8D80-75BB26BDCD65"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0,"stepDuration":0,"useRecordButton":false,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKAudioStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKCompletionStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKCompletionStep.json deleted file mode 100644 index 1a72b67507..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKCompletionStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKCompletionStep","iconImage":{"imageName":"2A7001B3-FE8B-4628-B9A3-848BBEF58B1F"},"auxiliaryImage":{"imageName":"685A4968-7933-4BCE-A646-9EBE32A63514"},"title":"","identifier":"","image":{"imageName":"7469F374-6BCA-4716-8BF1-AFF1761E6DE2"},"footnote":"","text":"","detailText":"", "headerTextAlignment": 0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0, "reasonForCompletion":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConfirmTextAnswerFormat.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConfirmTextAnswerFormat.json deleted file mode 100644 index e2b70e3f20..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConfirmTextAnswerFormat.json +++ /dev/null @@ -1 +0,0 @@ -{"multipleLines":false,"hideClearButton":false,"hideCharacterCountLabel":false, "secureTextEntry":false,"keyboardType":0,"validationRegularExpression":{"pattern":".","options":[]},"_class":"ORKConfirmTextAnswerFormat","spellCheckingType":0,"invalidMessage":"","errorMessage":"","maximumLength":0,"textContentType":"","passwordRules":{"rules":""},"originalItemIdentifier":"","autocorrectionType":0,"autocapitalizationType":0,"defaultTextAnswer":"","showDontKnowButton":false,"customDontKnowButtonText":"","dontKnowButtonStyle":0,"placeholder":""} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentReviewStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentReviewStep.json deleted file mode 100644 index d686c3991e..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentReviewStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "consentDocument":{"_class":"ORKConsentDocument"},"optional":false,"shouldTintImages":true,"requiresScrollToBottom":false,"_class":"ORKConsentReviewStep","useSurveyMode":false,"iconImage":{"imageName":"7259A545-C1AF-4696-B0A5-E4DADBB7172F"},"title":"","auxiliaryImage":{"imageName":"0336A673-281A-47C4-BB1E-2428BFBFA947"},"signature":{"requiresName":true,"requiresSignatureImage":true,"_class":"ORKConsentSignature","identifier":"5739826D-2DEA-4CB9-AB4E-10047140EC66"},"identifier":"","footnote":"","image":{"imageName":"76F181D1-005C-43C2-B429-AE931FE7371E"},"text":"","reasonForConsent":"","imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSharingStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSharingStep.json deleted file mode 100644 index e1e2d2b562..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKConsentSharingStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"answerFormat":{"_class":"ORKAnswerFormat"},"detailText":"", "headerTextAlignment": 0, "optional":true,"shouldTintImages":true,"useSurveyMode":false,"_class":"ORKConsentSharingStep","presentationStyle":"default","iconImage":{"imageName":"648F7701-58AE-4D8E-9BF4-7CEB2544CE26"},"auxiliaryImage":{"imageName":"47CCEC1A-365D-4A7B-AE45-381EDD7B1F32"},"title":"","identifier":"","footnote":"","image":{"imageName":"E0C3A64C-50AA-4499-8CF6-41EBEA752510"},"text":"","placeholder":"","question":"","localizedLearnMoreHTMLContent":"","useCardView":true,"imageContentMode": 0, "learnMoreItem":{"_class":"ORKLearnMoreItem"},"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0, "tagText": "","earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKCountdownStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKCountdownStep.json deleted file mode 100644 index b4749664cf..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKCountdownStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"B6F92FB7-5395-4AE2-9360-066CA37A418E"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"C7C218A3-69F7-4C4E-9501-BAD38CC4260F"},"title":"","image":{"imageName":"55019522-82E5-4D89-86D3-0ACD6A220E9E"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0, "stepDuration":5,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKCountdownStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKEnvironmentSPLMeterStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKEnvironmentSPLMeterStep.json deleted file mode 100644 index a66488a502..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKEnvironmentSPLMeterStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"883D1208-F5D7-438F-96E2-BDCADF944A00"},"auxiliaryImage":{"imageName":"314A97C4-3FC7-42E3-BA7F-318B7584547E"},"thresholdValue":35,"title":"","shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"image":{"imageName":"B6828B3C-AE63-4DDC-A099-CA8898DBD6CA"},"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":true,"requiredContiguousSamples":5,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"samplingInterval":1,"finishedSpokenInstruction":"","_class":"ORKEnvironmentSPLMeterStep","text":"","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFitnessStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFitnessStep.json deleted file mode 100644 index ffea46b6f4..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFitnessStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"3F5C9800-6A7A-4158-8ECF-0832B44DF6C1"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"988B687D-F50F-4B89-B6B7-20F11AE6AC8E"},"title":"","image":{"imageName":"B7400237-AD21-4AA3-8E4C-60F06E05EA39"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKFitnessStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"userInfo":{}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFormStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFormStep.json deleted file mode 100644 index 17e17b4aac..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFormStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":true,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKFormStep","auxiliaryImage":{"imageName":"747C6BFD-53E7-47EE-95B6-D4ABDC6270CF"},"iconImage":{"imageName":"A9782DB7-4168-4967-8E34-F75A62A7106E"},"title":"","identifier":"","footnote":"","image":{"imageName":"0BBE4F43-391F-4B33-9770-740363779CBD"},"text":"","formItems":[],"useCardView":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFrontFacingCameraStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFrontFacingCameraStep.json deleted file mode 100644 index 6e142eae18..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKFrontFacingCameraStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"50DE67FB-AE5A-4C1A-97E6-038BAB9A346F"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"23DBF489-731A-446A-A5ED-3D3E737C5E12"},"title":"","image":{"imageName":"A39F0D25-B88E-446C-BC34-614AE0405E73"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"", "headerTextAlignment":0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKFrontFacingCameraStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"maximumRecordingLimit":60, "allowsReview":true, "allowsRetry":true,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestPlaceStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestPlaceStep.json deleted file mode 100644 index 5cee2b50c6..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestPlaceStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"C4304649-4220-45B0-95C8-07219157A460"},"auxiliaryImage":{"imageName":"CD0C6044-D7E4-4970-9E24-D4907A9CCF85"},"movingDirection":0,"title":"","shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"image":{"imageName":"48957C0F-22A8-419C-A372-9DB9B4CFE41B"},"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"dominantHandTested":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"numberOfPegs":0,"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"bodyItems":[],"text":"","finishedSpokenInstruction":"","_class":"ORKHolePegTestPlaceStep","rotated":false,"threshold":0,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestRemoveStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestRemoveStep.json deleted file mode 100644 index 068025323e..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKHolePegTestRemoveStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"BE486BA2-4BF4-4B55-A13C-823460C271F9"},"auxiliaryImage":{"imageName":"CC4FA554-A433-46CB-948E-35F2B01177BB"},"movingDirection":0,"title":"","shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"image":{"imageName":"0D2B43F6-8030-40F3-B7D5-6D3848EAEB83"},"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"dominantHandTested":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"numberOfPegs":0,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKHolePegTestRemoveStep","threshold":0,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKImageCaptureStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKImageCaptureStep.json deleted file mode 100644 index 63d5653b9a..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKImageCaptureStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":true,"useSurveyMode":false,"templateImageInsets":{"right":1,"top":1,"left":1,"bottom":1},"_class":"ORKImageCaptureStep","shouldTintImages":true,"iconImage":{"imageName":"B540C098-2AC8-47DC-AA92-C5D12711DE58"},"auxiliaryImage":{"imageName":"E8D4C452-E28D-4F04-9681-FCFE512B578D"},"captureRaw":false,"title":"","identifier":"","templateImage":{"imageName":"DFC768AB-9173-4574-A981-53298C0F9155"},"footnote":"","image":{"imageName":"D1E13489-E3D2-4248-9260-2F7A750DA1A3"},"text":"","accessibilityInstructions":"","accessibilityHint":"","imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKInstructionStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKInstructionStep.json deleted file mode 100644 index d9006937cd..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKInstructionStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKInstructionStep","iconImage":{"imageName":"009AF45B-7E20-494E-A16C-88C6BDC15016"},"auxiliaryImage":{"imageName":"63D79505-966B-4AB6-BD80-0B4CADF45EAA"},"title":"","identifier":"","image":{"imageName":"97759B9C-39F2-4BE2-AD0A-FBCC3571DC5C"},"footnote":"","text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLearnMoreInstructionStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLearnMoreInstructionStep.json deleted file mode 100644 index 52e6e87acb..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLearnMoreInstructionStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKLearnMoreInstructionStep","iconImage":{"imageName":"AA4B1340-91CA-43F8-8DFF-65D8072F47E0"},"auxiliaryImage":{"imageName":"51F527BE-5B1E-465A-9260-B79664443AC2"},"title":"","identifier":"","image":{"imageName":"EE23D70C-83EB-41CE-83FC-4D3D632322DE"},"footnote":"","text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLoginStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLoginStep.json deleted file mode 100644 index 34c0c7eb44..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKLoginStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "loginViewControllerString":"ORKLoginStepViewController","optional":true,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKLoginStep","iconImage":{"imageName":"65159B22-6011-4EB7-81BD-2E597B4AA29A"},"auxiliaryImage":{"imageName":"45AA55E2-9A86-4285-9FF7-A1E77856C480"},"title":"","identifier":"","footnote":"","image":{"imageName":"5B301CC2-521C-4403-BFBA-7597E0A93CFA"},"text":"","formItems":[],"useCardView":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNavigablePageStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNavigablePageStep.json deleted file mode 100644 index e7c654325f..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNavigablePageStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"pageTask":{"_class":"ORKOrderedTask","identifier":"test1"},"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKNavigablePageStep","iconImage":{"imageName":"EA8D496D-A56D-4C7E-A4F0-78CE32EE034C"},"auxiliaryImage":{"imageName":"A17C26E6-AEE0-4F8A-97E5-96C2B925884F"},"title":"","identifier":"","image":{"imageName":"428F188A-57C5-44A2-8B53-1BA16F8F50E0"},"footnote":"","text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNormalizedReactionTimeResult.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNormalizedReactionTimeResult.json deleted file mode 100644 index fa29b52e00..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNormalizedReactionTimeResult.json +++ /dev/null @@ -1,2 +0,0 @@ -{"_class":"ORKNormalizedReactionTimeResult","timerStartDate":"2019-05-27T00:35:06-0700","timerEndDate":"2019-05-27T00:35:06-0700", "stimulusStartDate":"2019-05-27T00:35:06-0700","reactionDate":"2019-05-27T00:35:06-0700", "identifier":"","currentInterval":0,"userInfo":{}, "endDate":"2019-05-27T00:35:06-0700","startDate":"2019-05-27T00:35:06-0700",} - diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNormalizedReactionTimeStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNormalizedReactionTimeStep.json deleted file mode 100644 index 82e92cbcfb..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKNormalizedReactionTimeStep.json +++ /dev/null @@ -1,2 +0,0 @@ -{"shouldVibrateOnStart":false,"spokenInstruction":"","shouldStartTimerAutomatically":false,"successSound":0,"stepDuration":0,"shouldShowDefaultTimer":true,"optional":false,"minimumStimulusInterval":0,"detailText":"", "headerTextAlignment": 0, "text":"","_class":"ORKNormalizedReactionTimeStep","useSurveyMode":false,"numberOfAttempts":0,"maximumStimulusInterval":0, "currentInterval":0,"thresholdAcceleration":0,"bodyItems":[],"shouldVibrateOnFinish":false,"image":{"imageName":"282B623C-C013-4FDD-8721-4D2EB755598F"},"iconImage":{"imageName":"904E22CF-C9ED-485D-B9C4-6B47D351C10A"},"shouldPlaySoundOnStart":false,"auxiliaryImage":{"imageName":"64424C2B-9897-4A78-A79E-B1948817505A"},"failureSound":0,"shouldContinueOnFinish":true,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","shouldSpeakCountDown":false,"timeout":0,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"timeoutSound":0,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} - diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPDFViewerStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPDFViewerStep.json deleted file mode 100644 index dd91de2f8e..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPDFViewerStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"pdfURL":"file:\/\/\/usr\/","useSurveyMode":false,"_class":"ORKPDFViewerStep","shouldTintImages":true,"iconImage":{"imageName":"304906CA-FB5B-4147-AA16-1A087A78A324"},"title":"","identifier":"","footnote":"","auxiliaryImage":{"imageName":"2ED7211C-A4AB-4EB3-A59E-C99AA7884B2D"},"actionBarOption":0,"image":{"imageName":"E2F454DF-3E96-4974-8BBB-46E1FF556A0C"},"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPSATStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPSATStep.json deleted file mode 100644 index d1e56bd5dd..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPSATStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","stimulusDuration":0,"recorderConfigurations":[],"shouldContinueOnFinish":true,"shouldSpeakCountDown":false,"interStimulusInterval":0,"shouldTintImages":true,"iconImage":{"imageName":"A0A7FA5A-91F9-4FC1-8D58-287F482B2074"},"auxiliaryImage":{"imageName":"A2ED4D38-98B4-46E2-A926-C226ED3415B0"},"shouldPlaySoundOnFinish":false,"seriesLength":0,"shouldPlaySoundOnStart":false,"title":"","image":{"imageName":"F7381130-E0E1-4B0E-A726-C0D0C6D0C8F0"},"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"presentationMode":0,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKPSATStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPageStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPageStep.json deleted file mode 100644 index 306a6dd066..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPageStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"pageTask":{"_class":"ORKOrderedTask","identifier":"test1"},"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKPageStep","iconImage":{"imageName":"AF540A3D-754B-4D3B-8800-3147F200E737"},"auxiliaryImage":{"imageName":"3F29D2C0-BFAD-47F5-BF04-46C669F92C27"},"title":"","identifier":"","image":{"imageName":"D83FAB77-1713-4C02-BAFD-4C0C0D831BCD"},"footnote":"","text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPasscodeStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPasscodeStep.json deleted file mode 100644 index dea5d00684..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKPasscodeStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "passcodeType":0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKPasscodeStep","iconImage":{"imageName":"AD57BE82-B09F-4325-A9EA-DE82F7C29610"},"auxiliaryImage":{"imageName":"3B3736C1-BD56-4237-9875-5C65FFFD0A37"},"title":"","identifier":"","footnote":"","image":{"imageName":"3F144446-AAAE-4D83-9860-46E99BB08AE1"},"text":"","useBiometrics":true, "passcodeFlow":0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKQuestionStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKQuestionStep.json deleted file mode 100644 index 6aea390bb6..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKQuestionStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"answerFormat":{"_class":"ORKAnswerFormat"},"detailText":"", "headerTextAlignment": 0, "optional":true,"shouldTintImages":true,"useSurveyMode":true,"_class":"ORKQuestionStep","presentationStyle":"default","iconImage":{"imageName":"08814579-346A-4783-8F5E-4BC2F61E9FE5"},"auxiliaryImage":{"imageName":"61DAEC67-9E43-4B89-A3F8-BE87C9F87C3B"},"title":"","identifier":"","footnote":"","image":{"imageName":"B2C3112F-8A16-4A7C-9CCF-743FBAF9B993"},"text":"","placeholder":"","question":"","useCardView":true,"imageContentMode": 0, "learnMoreItem":{"_class":"ORKLearnMoreItem"},"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"tagText": "","earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRangeOfMotionStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRangeOfMotionStep.json deleted file mode 100644 index 2cf4ae162b..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRangeOfMotionStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"F3331959-D3B6-43BA-A279-E1502B81DE5E"},"auxiliaryImage":{"imageName":"2C398061-2D1F-45E6-BCCF-F470628D51D1"},"title":"","image":{"imageName":"E1CF0E97-5E1A-4860-AF2D-D36FC5C427E3"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"limbOption":0,"detailText":"", "headerTextAlignment": 0, "stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKRangeOfMotionStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKReactionTimeStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKReactionTimeStep.json deleted file mode 100644 index d930f53c55..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKReactionTimeStep.json +++ /dev/null @@ -1 +0,0 @@ -{"shouldVibrateOnStart":false,"spokenInstruction":"","shouldStartTimerAutomatically":false,"successSound":0,"stepDuration":0,"shouldShowDefaultTimer":true,"optional":false,"minimumStimulusInterval":0,"detailText":"", "headerTextAlignment": 0, "text":"","_class":"ORKReactionTimeStep","useSurveyMode":false,"numberOfAttempts":0,"maximumStimulusInterval":0,"thresholdAcceleration":0,"bodyItems":[],"shouldVibrateOnFinish":false,"image":{"imageName":"282B623C-C013-4FDD-8721-4D2EB755598F"},"iconImage":{"imageName":"904E22CF-C9ED-485D-B9C4-6B47D351C10A"},"shouldPlaySoundOnStart":false,"auxiliaryImage":{"imageName":"64424C2B-9897-4A78-A79E-B1948817505A"},"failureSound":0,"shouldContinueOnFinish":true,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","shouldSpeakCountDown":false,"timeout":0,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"timeoutSound":0,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRegistrationStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRegistrationStep.json deleted file mode 100644 index 1e81c9da3d..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRegistrationStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "options":0,"optional":false,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKRegistrationStep","auxiliaryImage":{"imageName":"AE8E0687-1A0C-42C1-964A-E8F89E789B1E"},"iconImage":{"imageName":"4C7914C4-0EA8-4D43-A7B0-ECB2E3DE0FAC"},"title":"","identifier":"","footnote":"","image":{"imageName":"0BB5BA89-09CC-4DB0-B941-6A2D51834EC6"},"text":"","formItems":[],"useCardView":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRequestPermissionsStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRequestPermissionsStep.json deleted file mode 100644 index cb78197f85..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKRequestPermissionsStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKRequestPermissionsStep","iconImage":{"imageName":"1425D9D4-DB67-4B5D-93B0-FE3125E67262"},"auxiliaryImage":{"imageName":"5DEF32D5-D23E-4E8F-8C05-4B1D24E6257D"},"title":"","identifier":"","footnote":"","image":{"imageName":"DB613E0C-4491-457B-B958-C7FBE6232101"},"text":"","detailText":"","headerTextAlignment": 0,"imageContentMode": 0, "headerTextAlignment": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0, "permissionTypes":[],"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKReviewStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKReviewStep.json deleted file mode 100644 index 1397ef1c04..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKReviewStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKReviewStep","iconImage":{"imageName":"FC6FA284-33CF-4207-A766-E4B53D63D1FA"},"auxiliaryImage":{"imageName":"DF5BB476-8890-4AA0-9F39-D15A16D5FDF7"},"title":"","identifier":"","footnote":"","image":{"imageName":"C71BC697-7306-4B7D-99B7-62E7C9D0CEB2"},"excludeInstructionSteps":false,"text":"","resultSource":{"results":[],"_class":"ORKTaskResult","startDate":"2019-05-27T00:35:06-0700","endDate":"2019-05-27T00:35:06-0700"},"steps":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSecondaryTaskStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSecondaryTaskStep.json deleted file mode 100644 index c16cd96319..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSecondaryTaskStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKSecondaryTaskStep","iconImage":{"imageName":"AA4B1340-91CA-43F8-8DFF-65D8072F47E0"},"auxiliaryImage":{"imageName":"51F527BE-5B1E-465A-9260-B79664443AC2"},"title":"","identifier":"","image":{"imageName":"EE23D70C-83EB-41CE-83FC-4D3D632322DE"},"footnote":"","text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"secondaryTask":{"_class":"ORKOrderedTask","identifier":"test1"},"secondaryTaskButtonTitle":"","nextButtonTitle":"","requiredAttempts":0,"centerImageVertically":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSignatureStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSignatureStep.json deleted file mode 100644 index 34e5391c5a..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSignatureStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKSignatureStep","iconImage":{"imageName":"37EEFD54-6752-4FE3-A7AD-ABC987E21266"},"auxiliaryImage":{"imageName":"3FF8D308-8975-4B50-B016-28BA3E62C095"},"title":"","identifier":"","footnote":"","image":{"imageName":"10358617-E4C2-473F-8B22-9C68B4B8A5D9"},"text":"","detailText":"", "headerTextAlignment": 0, "imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryStep.json deleted file mode 100644 index 6649ba072c..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpatialSpanMemoryStep.json +++ /dev/null @@ -1 +0,0 @@ -{"spokenInstruction":"","shouldStartTimerAutomatically":true,"stepDuration":0,"shouldShowDefaultTimer":true,"requireReversal":false,"maximumSpan":0,"optional":false,"initialSpan":0,"detailText":"", "headerTextAlignment": 0, "minimumSpan":0,"_class":"ORKSpatialSpanMemoryStep","text":"","useSurveyMode":false,"bodyItems":[],"customTargetPluralName":"","shouldVibrateOnFinish":false,"image":{"imageName":"A8AB293A-10C1-41BE-ACFE-7AE22DE83E8B"},"iconImage":{"imageName":"DCA06D4F-5800-4E11-AE9C-127854AE5393"},"shouldPlaySoundOnStart":false,"maximumTests":0,"auxiliaryImage":{"imageName":"68CF68A4-DED8-4EC1-8246-D11AAEBA99D8"},"customTargetImage":{"imageName":"7F102C61-3C9D-420A-8C29-ED016F6C4E45"},"shouldContinueOnFinish":true,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","shouldSpeakCountDown":false,"playSpeed":0,"maximumConsecutiveFailures":0,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"shouldVibrateOnStart":false,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechRecognitionStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechRecognitionStep.json deleted file mode 100644 index 835d7e3fbe..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKSpeechRecognitionStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"A7F86173-D719-4A24-80B1-84307C0CAF6F"},"auxiliaryImage":{"imageName":"FE592459-9F5E-41AB-B051-7EFCD8F7ADA4"},"title":"","image":{"imageName":"97352EFE-D43D-498A-B780-DCAADFB923E9"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"speechRecognitionText":"test","detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"shouldHideTranscript":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","speechRecognizerLocale":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKSpeechRecognitionStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStep.json deleted file mode 100644 index 9b64c409fc..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKStep","iconImage":{"imageName":"1425D9D4-DB67-4B5D-93B0-FE3125E67262"},"auxiliaryImage":{"imageName":"5DEF32D5-D23E-4E8F-8C05-4B1D24E6257D"},"title":"","identifier":"","footnote":"","image":{"imageName":"DB613E0C-4491-457B-B958-C7FBE6232101"},"text":"","detailText":"","headerTextAlignment": 0,"imageContentMode": 0, "headerTextAlignment": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStroopStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStroopStep.json deleted file mode 100644 index 323a8cacd3..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKStroopStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"62E9D4CF-3E7B-49B8-A295-7D2EB1ECC00B"},"auxiliaryImage":{"imageName":"8C25AB92-00C9-4E13-B55F-711658F53D48"},"title":"","image":{"imageName":"4930AC43-8AAA-4563-8C8F-6E7E25E550C3"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":9.2233720368547758e+18,"shouldShowDefaultTimer":false,"numberOfAttempts":0,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":true,"shouldSpeakRemainingTimeAtHalfway":false, "randomizeVisualAndColorAlignment": true,"useTextForStimuli":true,"useGridLayoutForButtons":false, "text":"","finishedSpokenInstruction":"","_class":"ORKStroopStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTableStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTableStep.json deleted file mode 100644 index cecd1965e2..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTableStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"allowsSelection":false,"detailText":"","headerTextAlignment": 0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKTableStep","auxiliaryImage":{"imageName":"C594DE5C-AB0F-468C-956E-8347C5E14E08"},"iconImage":{"imageName":"A3C3C914-C4ED-4633-9852-67D8AB687094"},"isBulleted":false,"title":"","identifier":"","footnote":"","image":{"imageName":"FC4CCE13-5C8A-434F-979C-1E48ADDEBBE0"},"items":[],"text":"","bulletType":0,"bulletIconNames":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"pinNavigationContainer":false,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTappingIntervalStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTappingIntervalStep.json deleted file mode 100644 index fe80090e96..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTappingIntervalStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"E99E1E45-69C1-4A8D-B93A-8A2C21F83BF8"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"8C6E1C04-F1B1-4EA7-93F4-415FBEB3C489"},"title":"","image":{"imageName":"1DA566D1-4BE7-48C9-849B-8E30C0EE613A"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTappingIntervalStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextAnswerFormat.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextAnswerFormat.json deleted file mode 100644 index 46a5d1d37a..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTextAnswerFormat.json +++ /dev/null @@ -1 +0,0 @@ -{"secureTextEntry":false,"keyboardType":0, "validationRegularExpression":{"pattern":".","options":[]},"_class":"ORKTextAnswerFormat","spellCheckingType":0,"invalidMessage":"","maximumLength":0,"textContentType":"","passwordRules":{"rules":""},"autocorrectionType":0,"autocapitalizationType":0,"defaultTextAnswer":"","multipleLines":false,"hideClearButton":false, "hideCharacterCountLabel":false, "showDontKnowButton":false,"customDontKnowButtonText":"","placeholder":"","dontKnowButtonStyle":0} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimedWalkStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimedWalkStep.json deleted file mode 100644 index af16d3c55e..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTimedWalkStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"distanceInMeters":0,"iconImage":{"imageName":"392B209E-E4E0-458A-9CF3-0C7DF89F6626"},"auxiliaryImage":{"imageName":"0690C295-21F0-4FD8-926B-A4ECE1396745"},"title":"","shouldPlaySoundOnFinish":true,"shouldPlaySoundOnStart":true,"image":{"imageName":"2167A19B-9B1F-4010-812B-0F254CD98D00"},"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":true,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":true,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTimedWalkStep","shouldStartTimerAutomatically":true,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKToneAudiometryStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKToneAudiometryStep.json deleted file mode 100644 index 4848e1ff45..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKToneAudiometryStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"80051064-3F2B-4675-AB0C-5C2C841B6BD8"},"auxiliaryImage":{"imageName":"E7C93E74-A1F3-4FA7-887C-64254B197612"},"title":"","image":{"imageName":"06DE4520-4A3F-4E48-A331-84FA1BC2F05D"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","practiceStep":false,"optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKToneAudiometryStep","toneDuration":0,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTouchAnywhereStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTouchAnywhereStep.json deleted file mode 100644 index 87c6d7ca51..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTouchAnywhereStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"shouldTintImages":true,"shouldSpeakCountDown":false,"iconImage":{"imageName":"661D3E94-889E-406B-A010-63E1E382D649"},"recorderConfigurations":[],"auxiliaryImage":{"imageName":"2F9EF951-6F59-413F-AC9A-4005401B6430"},"title":"","image":{"imageName":"A1753FF0-DF94-4966-863F-47542F37D42E"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTouchAnywhereStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTowerOfHanoiStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTowerOfHanoiStep.json deleted file mode 100644 index 0478ea8aab..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTowerOfHanoiStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"CF6F5959-510B-4131-99B0-2B625446CCE7"},"auxiliaryImage":{"imageName":"CEC9CBE5-4978-473A-B597-3BFD19AA17FD"},"title":"","image":{"imageName":"30F1BD7F-633F-41EA-8144-0E06BCA8C457"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":true,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":true,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTowerOfHanoiStep","numberOfDisks":3,"shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTrailmakingStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTrailmakingStep.json deleted file mode 100644 index 48f52b0ef5..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKTrailmakingStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":true,"shouldTintImages":true,"shouldSpeakCountDown":false,"recorderConfigurations":[],"iconImage":{"imageName":"6C57DF6B-CBDE-4763-906B-82204530AD07"},"auxiliaryImage":{"imageName":"3ED81064-D8E6-4D26-A2F0-9302EFB1058F"},"title":"","image":{"imageName":"3F2A9599-FE48-41D2-9169-ABB8EFD777C6"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"detailText":"","headerTextAlignment": 0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"bodyItems":[],"shouldVibrateOnStart":false,"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKTrailmakingStep","trailType":"","shouldStartTimerAutomatically":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVerificationStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVerificationStep.json deleted file mode 100644 index 4e96620d29..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVerificationStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"","headerTextAlignment": 0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKVerificationStep","iconImage":{"imageName":"A3D51283-8457-474E-83F9-8624BA60C7D5"},"auxiliaryImage":{"imageName":"E9559DA0-9EE9-4365-A75E-5DA1A9A458F3"},"title":"","identifier":"","footnote":"","image":{"imageName":"39D4B5C9-17BA-40B1-8EA2-E78B3BDA896F"},"text":"","verificationViewControllerString":"ORKVerificationStepViewController","imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoCaptureStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoCaptureStep.json deleted file mode 100644 index da74404dae..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoCaptureStep.json +++ /dev/null @@ -1 +0,0 @@ -{"accessibilityHint":"","shouldTintImages":true,"templateImageInsets":{"right":1,"top":1,"left":1,"bottom":1},"iconImage":{"imageName":"3EBEBF88-86DD-4500-8B48-B7F61F75C7A6"},"title":"","devicePosition":1,"auxiliaryImage":{"imageName":"7832E6A2-DA40-4CFA-AB16-808717B2CA4E"},"duration":123,"templateImage":{"imageName":"0DCC3994-3FA0-4A05-97AC-A3C82777010B"},"image":{"imageName":"D2B3C2CB-10D5-4C97-B0FF-208C38971A0F"},"detailText":"","headerTextAlignment": 0,"optional":true,"audioMute":false,"useSurveyMode":false,"identifier":"","bodyItems":[],"text":"","accessibilityInstructions":"","_class":"ORKVideoCaptureStep","torchMode":2,"footnote":"","imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoInstructionStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoInstructionStep.json deleted file mode 100644 index f43790e77b..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKVideoInstructionStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"videoURL":"file:\/\/\/usr\/","optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKVideoInstructionStep","auxiliaryImage":{"imageName":"8EB1EFFE-C9DE-48C5-BD63-7B3182834B09"},"iconImage":{"imageName":"3AF26F65-958B-4EFA-974A-184B40D35D7A"},"title":"","identifier":"","footnote":"","image":{"imageName":"7025FEF9-6715-4499-B7C3-1C1AA8DDB3E1"},"text":"","thumbnailTime":0,"detailText":"","headerTextAlignment": 0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"centerImageVertically":0,"useExtendedPadding":0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"},"bundleAsset":{"_class":"ORKBundleAsset","name":"filename","bundleIdentifier":"com.bundle.identifier","fileExtension":"mp4"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWaitStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWaitStep.json deleted file mode 100644 index 3a94ffdb2c..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWaitStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKWaitStep","indicatorType":0,"iconImage":{"imageName":"8AB7019D-38A4-4969-8A3B-4132B98A4D43"},"title":"","identifier":"","footnote":"","image":{"imageName":"D9D9BA3C-8AE2-45F2-9439-7AF519EF2BFA"},"auxiliaryImage":{"imageName":"589E582A-6BE4-4956-9895-0C07DE2DE0E4"},"text":"","detailText":"","headerTextAlignment": 0,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWalkingTaskStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWalkingTaskStep.json deleted file mode 100644 index f5240a4604..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWalkingTaskStep.json +++ /dev/null @@ -1 +0,0 @@ -{"footnote":"","shouldContinueOnFinish":false,"recorderConfigurations":[],"shouldSpeakCountDown":false,"shouldTintImages":true,"iconImage":{"imageName":"B2C5CEC9-067F-42C7-ADD5-F6BDCB1AEB72"},"auxiliaryImage":{"imageName":"01708EE8-CC14-408A-AB15-4C9E9806172E"},"title":"","image":{"imageName":"10F66CE1-AA9F-4F9C-B51A-5AEED1B73A27"},"shouldPlaySoundOnFinish":false,"shouldPlaySoundOnStart":false,"numberOfStepsPerLeg":0,"detailText":"","headerTextAlignment": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"stepDuration":0,"shouldShowDefaultTimer":false,"shouldVibrateOnFinish":false,"spokenInstruction":"","optional":false,"useSurveyMode":false,"identifier":"","shouldUseNextAsSkipButton":false,"shouldVibrateOnStart":false,"bodyItems":[],"shouldSpeakRemainingTimeAtHalfway":false,"text":"","finishedSpokenInstruction":"","_class":"ORKWalkingTaskStep","shouldStartTimerAutomatically":false,"imageContentMode": 0,"earlyTerminationConfiguration": {"_class": "ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWebViewStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWebViewStep.json deleted file mode 100644 index 8b6960aff5..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKWebViewStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"","headerTextAlignment": 0,"optional":false,"useSurveyMode":false,"shouldTintImages":true,"_class":"ORKWebViewStep","iconImage":{"imageName":"369C0323-EB2C-4BD7-8B1F-90030C5A1B8F"},"auxiliaryImage":{"imageName":"C1A70CC9-EC88-4525-A166-5DE6BD2CFA1A"},"title":"","identifier":"","image":{"imageName":"4DAC99C9-1BC9-42EA-95E7-CD746641F78A"},"footnote":"","text":"","html":"","customCSS":"","showSignatureAfterContent":false,"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryOnboardingStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryOnboardingStep.json deleted file mode 100644 index f63d87ba48..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryOnboardingStep.json +++ /dev/null @@ -1 +0,0 @@ -{"bodyItems":[],"detailText":"", "headerTextAlignment": 0, "optional":true,"useSurveyMode":true,"shouldTintImages":true,"_class":"ORKdBHLToneAudiometryOnboardingStep","auxiliaryImage":{"imageName":"0255CA0B-11EA-4502-926A-07DCA0599AEC"},"iconImage":{"imageName":"B10BDAB3-6380-4F75-A5D3-7E334CD94C7D"},"title":"","identifier":"","footnote":"","image":{"imageName":"E2856DA0-1728-4A16-A468-9A940C0E6F95"},"text":"","formItems":[],"useCardView":true,"imageContentMode": 0,"footerText":"","bodyItemTextAlignment":0,"buildInBodyItems": 0,"cardViewStyle":0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryStep.json b/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryStep.json deleted file mode 100644 index 54ef901122..0000000000 --- a/Testing/ORKTest/ORKTestTests/samples.bundle/ORKdBHLToneAudiometryStep.json +++ /dev/null @@ -1 +0,0 @@ -{"postStimulusDelay":1,"spokenInstruction":"","headphoneType":"","shouldStartTimerAutomatically":false,"stepDuration":0,"shouldShowDefaultTimer":true,"optional":false,"detailText":"", "headerTextAlignment": 0, "earPreference":0,"text":"","_class":"ORKdBHLToneAudiometryStep","useSurveyMode":false,"initialdBHLValue":30,"dBHLStepDownSize":10,"dBHLMinimumThreshold":-10,"bodyItems":[],"maxNumberOfTransitionsPerFrequency":15,"shouldVibrateOnFinish":false,"iconImage":{"imageName":"90BF43E2-61B4-493A-A818-55FF314B240D"},"shouldPlaySoundOnStart":false,"image":{"imageName":"A660ED46-8FFE-4AFA-A3AA-AC9E134A20F0"},"auxiliaryImage":{"imageName":"99B355E5-D322-4C26-BA80-5701151B3352"},"shouldContinueOnFinish":false,"identifier":"","shouldSpeakRemainingTimeAtHalfway":false,"footnote":"","dBHLStepUpSize":5,"dBHLStepUpSizeFirstMiss":20,"dBHLStepUpSizeSecondMiss":10,"dBHLStepUpSizeThirdMiss":10,"shouldSpeakCountDown":false,"toneDuration":1,"frequencyList":[],"maxRandomPreStimulusDelay":2,"title":"","finishedSpokenInstruction":"","shouldUseNextAsSkipButton":false,"shouldPlaySoundOnFinish":false,"shouldTintImages":true,"shouldVibrateOnStart":false,"recorderConfigurations":[],"imageContentMode": 0,"bodyItemTextAlignment":0,"buildInBodyItems": 0,"useExtendedPadding":0,"earlyTerminationConfiguration":{"_class":"ORKEarlyTerminationConfiguration"}} diff --git a/Testing/ORKTest/README.md b/Testing/ORKTest/README.md deleted file mode 100644 index 129f08fdd3..0000000000 --- a/Testing/ORKTest/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# ORKTest - -The `ORKTest` project is an Objective-C test-bed used by the ResearchKit™ framework -developers to test API features during development. When adding a new -feature to the ResearchKit framework, please either add a way to test it in this -`ORKTest` project, or consider creating a new project to use for -testing. We also use this project to check for regressions. - -This project is not intended as an example of best practice in use of -the ResearchKit framework. For that, see the samples directory or the documentation -instead. - -Instead, this project should give good coverage of the features in -the ResearchKit framework. For example, the project enables localization to all the -supported languages, even though the survey content is not itself -localized. This allows us to test the localized parts of the ResearchKit framework, -but is not something you should do in a real app. As another example, -rotation is enabled on the iPhone, even though in real use it would be -atypical to enable rotation for most steps. - -The `ORKTest` tests include a module called `ORKESerialization`, a -JSON serialization module for the ResearchKit framework. `ORKESerialization` can -serialize and deserialize all the ResearchKit framework model objects, and all -ResearchKit framework results, to and from JSON. - - -## Build Requirements - -+ Xcode 7.0 -+ iOS 9.0 SDK or later - - -## Runtime Requirements - -+ iOS 8.0 or later - - -## Using the App - -You can run `ORKTest` on a device or in the iOS Simulator. - -To run on device, you will need to use a provisioning profile that -includes the appropriate HealthKit entitlement. - -When launching `ORKTest`, you will see an array of buttons. Each -button corresponds to a task that can be used for testing. Information -on the results and progress of the task are logged to the console. - diff --git a/docs/Account/Account-template.markdown b/docs/Account/Account-template.markdown deleted file mode 100644 index eda100b320..0000000000 --- a/docs/Account/Account-template.markdown +++ /dev/null @@ -1,97 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -# The Account Module -Registration is an important aspect of validating users of your ResearchKit app. The Account module provides all of the logic to perform this necessary functionality. - -The basic operations of the Account module include: - - * Registration, during which the user can enter an email address, password, and additional information such as first and last name, gender, and date of birth. - * Verification, when your app can vet new users. In order to properly vet new users, your app can opt to perform a verification step after registration. - * Login, which allows registered and verified users to access your app. After your user has registered and verified their registration, this operation allows them to log in to your app. - -##Register New Users -To register new users, use the `ORKRegistrationStep` class. The resulting view shows a title and helpful registration text. There, the user can type an email address and password, along with other optional information. - -The following example specifies a registration step that includes requesting the user's full name, gender, and birthday: - - ORKRegistrationStep *registrationStep = [[ORKRegistrationStep alloc] initWithIdentifier:@"identifier" - title:@"Account Registration" text:@"Please register at this point." - options:ORKRegistrationStepIncludeGivenName | ORKRegistrationStepIncludeFamilyName | ORKRegistrationStepIncludeGender |ORKRegistrationStepIncludeDOB]; - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:@"registrationTask" steps:@[registrationStep]]; - ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; - taskViewController.delegate = self; - [self presentViewController:taskViewController animated:YES completion:^{}]; - - -Figure 1 shows the registration view. - -
-
- -
Figure 1. Registration
-
-
- -After all of the information has been properly set, the user can touch the Done button to proceed. Your app is responsible for sending the user-provided data to a server to perform the actual registration. - -##Verify Users -Email verification is a common way to validate proper registration for a user. After the user registers, your backend server can send an email to the provided email address. - -To enable email verification in your app, use a combination of the `ORKVerificationStep` class along with a subclass of the `ORKVerificationStepViewController`. Subclassing `ORKVerificationStepViewController` allows you to provide custom behavior when the user taps the Resend Email Verification button. Here's how to set up your subclass: - - @interface MyVerificationStepViewController : ORKVerificationStepViewController - @end - - @implmentation MyVerificationStepViewController - - - (void)resendEmailButtonTapped { - // perform custom logic here - } - - @end - -Next, create a verification step and pass in the subclass object: - - ORKVerificationStep *verificationStep = [[ORKVerificationStep alloc] initWithIdentifier:@"identifier" - text:@"Please verify." - verificationViewControllerClass:[MyVerificationStepViewController class]]; - -You can then insert the step into your `ORKOrderedTask` object. When the step is executed, it instantiates the view controller, as shown in Figure 2. - -
-
- -
Figure 2. Verification
-
-
- -##Allow Users to Login -After the user has registered and has been verified, you can provide them access to further functionality in your app by helping them log in. - -Logging in requires subclassing the `ORKLoginStepViewController` class, which is similar to what you did to implement the verification step. Override the following method in your subclass so that you can add custom logic to handle the situation when the user forgets their password: - - - (void)forgotPasswordButtonTapped; - - -Here's a code snippet that shows how to create a subclass of `ORKLoginStepViewController`: - - @interface MyLoginStepViewController : ORKLoginStepViewController - @end - - @implmentation MyLoginStepViewController - - - (void)forgotPasswordButtonTapped { - // perform custom logic here - } - - @end - -When the login step executes, the view shown in Figure 3 appears. - -
-
- -
Figure 3. User login
-
-
diff --git a/docs/Account/Login.png b/docs/Account/Login.png deleted file mode 100644 index bff6845a1a..0000000000 Binary files a/docs/Account/Login.png and /dev/null differ diff --git a/docs/Account/Registration.png b/docs/Account/Registration.png deleted file mode 100644 index e541452bb8..0000000000 Binary files a/docs/Account/Registration.png and /dev/null differ diff --git a/docs/Account/Verification.png b/docs/Account/Verification.png deleted file mode 100644 index b6184c9d01..0000000000 Binary files a/docs/Account/Verification.png and /dev/null differ diff --git a/docs/ActiveTasks/ActiveTasks-template.markdown b/docs/ActiveTasks/ActiveTasks-template.markdown deleted file mode 100644 index b079ea4f9e..0000000000 --- a/docs/ActiveTasks/ActiveTasks-template.markdown +++ /dev/null @@ -1,601 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -# Active Tasks - -Active tasks invite users to perform activities under partially -controlled conditions while iPhone sensors are used to collect data. -For example, an active task for analyzing gait and balance might ask -the user to walk a short distance, while collecting accelerometer data on the device. - -## Predefined Active Tasks - -ResearchKit™ includes a number of predefined tasks, which fall into seven categories: motor activities, fitness, cognition, speech, hearing, hand dexterity, and vision. Table 1 summarizes each task and describes the data it generates. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table 1. Active tasks in ResearchKit
CATEGORYTASKSENSORDATA COLLECTED
Motor ActivitiesRange of MotionAccelerometer
- Gyroscope
Device motion
Gait and BalanceAccelerometer
- Gyroscope
Device motion
Pedometer
Tapping SpeedMulti-Touch display
-Accelerometer (optional) -
Touch activity
-
FitnessFitnessGPS
Gyroscope
Device motion
Pedometer
Location
Heart rate -
Timed WalkGPS
Gyroscope
Device motion
Pedometer
Location -
CognitionSpatial MemoryMulti-Touch display
-Accelerometer (optional)
-Touch activity
Correct answer
Actual sequences -
Stroop TestMulti-Touch displayActual color
Actual text
User selection
Completion time
Trail Making TestMulti-Touch displayCompletion time
Touch activity
Paced Serial Addition Test (PSAT)Multi-Touch displayAddition results from user
Tower of HanoiMulti-Touch display -Every move taken by the user -
Reaction TimeAccelerometer
Gyroscope -
Device motion -
SpeechSustained PhonationMicrophoneUncompressed audio
Speech RecognitionMicrophoneRaw audio recording
Transcription in the form of an SFTranscription object.
Edited transcript (if any, by the user)
Speech-in-NoiseMicrophoneRaw audio recording
Transcription in the form of an SFTranscription object
Edited transcript (if any, by the user). This can be used to calculate the Speech Reception Threshold (SRT) for a user.
HearingEnvironment SPLMicrophoneEnvironment sound pressure level in dBA
Tone AudiometryAirPods
-Headphones
Minimum amplitude for the user -to recognize the sound
dBHL Tone AudiometryAirPods
-Headphones
-Hearing threshold in dB HL scale
-User response timestamps -
Hand Dexterity9-Hole PegMulti-Touch displayCompletion time
Move distance -
VisionAmsler GridMulti-Touch displayTouch activity
Eye side
Areas of distortions as annotated by the user
- -You can disable the instruction or completion steps that are automatically -included in the framework by passing appropriate options when you create an active task. See the -`ORKPredefinedTaskOption` constants for the available options. - -You can use options flags to exclude data collection for data types that are not needed for your study. For example, to perform the fitness task without recording heart rate data, use the `ORKPredefinedTaskOptionExcludeHeartRate` option. - -## Range of Motion -In the range of motion task, participants follow movement instructions while accelerometer and gyroscope data is captured to measure flexed and extended positions for the knee or shoulder. Range of motion steps for the knee are shown in Figure 1. - -

Instruction step introducing the task

-

Instruction step introducing the task

-

Specific instructions with an illustration

-

-

Further instructions with an illustration

-

A touch anywhere step

-

A further touch anywhere step

-

Confirms task completion

-

-
Figure 1. Range of motion steps for the right knee
- -## Gait and Balance - -In the gait and balance task (see the method [ORKOrderedTask shortWalkTaskWithIdentifier:intendedUseDescription:numberOfStepsPerLeg:restDuration:options]([ORKOrderedTask shortWalkTaskWithIdentifier:intendedUseDescription:numberOfStepsPerLeg:restDuration:options:])), -the user walks for a short distance, which may be indoors. You might -use this semi-controlled task to collect objective measurements that -can be used to estimate stride length, smoothness, sway, and other -aspects of the participant's walking. - -Gait and balance steps are shown in Figure 2. - -

Welcome/introduction ScreenInstruction step introducing the task

-

Instruction step introducing the task

-

Count down a specified duration into the task

-

-

Asking user to walk

-

Asking user to walk

-

Asking user to rest

-

-

Confirms task completion

-

-
Figure 2. Gait and balance steps
- -## Tapping Speed - -In the tapping task (see the method [ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:intendedUseDescription:duration:handOptions:options]([ORKOrderedTask twoFingerTappingIntervalTaskWithIdentifier:intendedUseDescription:duration:handOptions:options:])), the user rapidly alternates between tapping two -targets on the touch screen. The resulting touch data can be used to -assess basic motor capabilities such as speed, accuracy, and rhythm. - -Touch data, and optionally accelerometer data from CoreMotion in iOS, are -collected using public APIs. No analysis is performed by the ResearchKit framework on the data. - -Tapping speed steps are shown in Figure 3. - -

Instruction step introducing the taskInstruction step introducing the task

-

Providing instruction for the right hand task

-

The user rapidly taps on the targets using the right hand

-

-

Providing instruction for the left hand task

-

The user rapidly taps on the targets using the left hand

-

Confirms task completion

-

-
Figure 3. Tapping speed steps
- -## Fitness - -In the fitness task (see the method [ORKOrderedTask fitnessCheckTaskWithIdentifier:intendedUseDescription:walkDuration:restDuration:options]([ORKOrderedTask fitnessCheckTaskWithIdentifier:intendedUseDescription:walkDuration:restDuration:options:])), the user walks for a specified duration (usually -several minutes). Sensor data is collected and returned through the -task view controller's delegate. Sensor data can include -accelerometer, device motion, pedometer, location, and heart rate data -where available. - -Toward the end of the walk, if heart rate data is available, the user -is asked to sit down and rest for a period. Data collection continues -during the rest period. - -Fitness steps are shown in Figure 4. - -

Instruction step introducing the task

-

Instruction step introducing the task

-

Count down a specified duration to begin the task

-

Displays distance and heart rate

-

The rest step, which can be skipped if heart rate data is unavailable

-

Confirms task completion

-

-
Figure 4. Fitness task
- -All of the data is collected from public CoreMotion and HealthKit APIs on iOS, and serialized to JSON. No analysis is applied to the data by the ResearchKit framework. - -## Timed Walk - -In the timed walk task (see the method [ORKOrderedTask timedWalkTaskWithIdentifier:intendedUseDescription:distanceInMeters:timeLimit:turnAroundLimit:includeAssistiveDeviceForm:options:]([ORKOrderedTask timedWalkTaskWithIdentifier:intendedUseDescription:distanceInMeters:timeLimit:turnAroundLimit:includeAssistiveDeviceForm:options:])), the user is asked to walk quickly and safely for a specific distance. The task is immediately administered again by having the user walk the same distance in the opposite direction. The timed walk task differs from both the fitness and the short walk tasks in that the distance walked by the user is fixed. A timed walk task measures the user's lower-extremity function. - -The data collected by this task includes accelerometer, device motion, pedometer data, and location of the user. Note that the location is available only if the user agrees to share their location. -Data collected by the task is in the form of an `ORKTimedWalkResult` object. - -Timed walk steps are shown in Figure 5. - -

Welcome/introduction ScreenInstruction step introducing the task

-

Gather information about the user's assistive deviceGathers information about the user's assistive device

-

Instruction to perform the taskInstructions on how to perform the task

-

-

Count down a specified duration to begin the taskCount down a specified duration to begin the task

-

Actual task screenActual task screen

-

Instruct the user to turn aroundInstruct the user to turn around

-

-

Actual task screenActual task screen

-

Task Completion screenTask completion

-

-
Figure 5. Timed walk steps
- -## Spatial Memory - -In the spatial memory task (see the method [ORKOrderedTask spatialSpanMemoryTaskWithIdentifier:intendedUseDescription:initialSpan:minimumSpan:maximumSpan:playSpeed:maximumTests:maximumConsecutiveFailures:customTargetImage:customTargetPluralName:requireReversal:options:]([ORKOrderedTask spatialSpanMemoryTaskWithIdentifier:intendedUseDescription:initialSpan:minimumSpan:maximumSpan:playSpeed:maximumTests:maximumConsecutiveFailures:customTargetImage:customTargetPluralName:requireReversal:options:])), -the user is asked to observe and then recall pattern sequences of -increasing length in a game-like environment. The task collects data that -can be used to assess visuospatial memory and executive function. - -The span (that is, the length of the pattern sequence) is automatically varied -during the task, increasing after successful completion of a sequence, -and decreasing after failures, in the range from `minimumSpan` to -`maximumSpan`. The `playSpeed` property lets you control the speed of sequence -playback, and the `customTargetImage` property lets you customize the shape of the tap target. The game finishes when either `maxTests` tests have been -completed, or the user has made `maxConsecutiveFailures` errors in a -row. - -The results collected are scores derived from the game, the details of -the game, and the touch inputs made by the user. - -Spatial memory test steps are shown in Figure 6. - -

Welcome/introduction ScreenInstruction step introducing the task

-

Instruction stepDescribes what the user must do

-

Initial sequence playback screenThe flowers light up in sequence

-

-

Recall sequence screenThe user must recall the sequence

-

Consecutive failure screenIf users make a mistake, they will be offered a new pattern

-

Welcome/introduction ScreenThe user is offered a shorter sequence

-

-

Task Completion screenConfirms task completion

-

-
Figure 6. Spatial memory steps
- -## Stroop Test -In the Stroop test, the participant is shown a series of words that are displayed in color, and must select the first letter of the color's name. Stroop test steps are shown in Figure 7. - -

Instruction step introducing the task

-

Further instructions

-

Count down a specified duration to begin the activity

-

-

A typical Stroop test; the correct answer is "B" for blue

-

Confirms task completion

-

-
Figure 7. Stroop test steps
- -## Trail Making Test -In the trail making test, the participant connects a series of labelled circles, in order. The time to complete the test is recorded. The circles can be labelled with sequential numbers (1, 2, 3, ...) or with alternating numbers and letters (1, a, 2, b, 3, c, ...). - -Trail making test steps are shown in Figure 8. - -

Instruction step introducing the task

-

Instruction step introducing the task

-

Further instructions

-

-

Count down a specified duration to begin the activity

-

The activity screen, shown mid-task

-

Confirms task completion

-

-
Figure 8. Trail making test steps
- -## Paced Serial Addition Test (PSAT) - -The Paced Serial Addition Test (PSAT) task (see method [ORKOrderedTask PSATTaskWithIdentifier:intendedUseDescription:presentationMode:interStimulusInterval:stimulusDuration:seriesLength:options]([ORKOrderedTask PSATTaskWithIdentifier:intendedUseDescription:presentationMode:interStimulusInterval:stimulusDuration:seriesLength:options:])) measures the cognitive function that assesses auditory and/or visual information processing speed, flexibility, and the calculation ability of the user. - -Single digits are presented every two or three seconds and the user must add each new digit to the one immediately before. - -There are three variations of this test: - -1. PASAT: Paced Auditory Serial Addition Test - the device speaks the digit every two or three seconds. -2. PVSAT: Paced Visual Serial Addition Test - the device shows the digit on screen. -3. PAVSAT: Paced Auditory and Visual Serial Addition Test - the device speaks the digit and shows it onscreen every two to three seconds. - -The score for the PSAT task is the total number of correct answers out of the number of possible correct answers. Data collected by the task is in the form of an `ORKPSATResult` object. - -PVSAT steps are shown in Figure 9. - -Note that the visual and auditory components of the task are optional. You can choose to include either of them or both. - -

Welcome/introduction ScreenInstruction step introducing the task

-

Instruction stepDescribes what the user must do

-

Countdown screenCount down a specified duration into the task

-

-

The user must add each new digit on the screen to the one immediately prior to itThe user must add each new digit on the screen to the one immediately prior to it

-

Task completion screenConfirms task completion

-

-
Figure 9. PVSAT memory steps
- -## Tower of Hanoi - -In the Tower of Hanoi task (see the method [ORKOrderedTask towerOfHanoiTaskWithIdentifier:intendedUseDescription:numberOfDisks:options:]([ORKOrderedTask towerOfHanoiTaskWithIdentifier:intendedUseDescription:numberOfDisks:options:])), the user is asked to solve the classic Tower of Hanoi puzzle in a minimum number of moves. To solve the puzzle, the user must move the entire stack to the highlighted platform in as few moves as possible. This task measures the user's problem solving skills. A Tower of Hanoi task finishes when the user completes the puzzle correctly or concedes that they cannot solve the puzzle. - -Data collected by this task is in the form of an `ORKTowerOfHanoiResult` object. It contains every move taken by the user and indicates whether the puzzle was successfully completed or not. - -Tower of Hanoi steps are shown in Figure 10. - -

Welcome/introduction ScreenInstruction step introducing the task

Instruction stepDescribes what the user must do

-

-

Actual task screenActual task

Task completion screenConfirms task completion

-

-
Figure 10. Tower of Hanoi steps
- -## Reaction Time - -In the reaction time task, the user shakes the device in response to a visual clue on the device's screen. The task is divided into a number of attempts, which you determine. To complete an attempt in a task, the user must shake or move the device with an acceleration that exceeds a threshold value ( `thresholdAcceleration` property) within the given time. The task finishes when the user successfully completes all the attempts as instructed in the task. Use this task to evaluate a user's response to the stimulus and calculate their reaction time. (See the method [ORKOrderedTask reactionTimeTaskWithIdentifier:intendedUseDescription:maximumStimulusInterval:minimumStimulusInterval:thresholdAcceleration:numberOfAttempts:timeout:successSound:timeoutSound:failureSound:option]([ORKOrderedTask reactionTimeTaskWithIdentifier:intendedUseDescription:maximumStimulusInterval:minimumStimulusInterval:thresholdAcceleration:numberOfAttempts:timeout:successSound:timeoutSound:failureSound:options:])). - -Data collected by this task is in the form of `ORKReactionTimeResult` objects. Each of these objects contain a timestamp representing the delivery of the stimulus and an `ORKFileResult` object that references the motion data collected during an attempt. To present this task, use an `ORKTaskViewController` object. - -Reaction time steps are shown in Figure 11. - -

Welcome/introduction ScreenInstruction step introducing the task

-

Instruction stepDescribes what the user must do

-

-

Actual task screenActual task

Task completion screenConfirms task completion

-

-
Figure 11. Reaction time steps
- -## Sustained Phonation - -In the sustained phonation task (see the method [ORKOrderedTask audioTaskWithIdentifier:intendedUseDescription:speechInstruction:shortSpeechInstruction:duration:recordingSettings:checkAudioLevel:options]([ORKOrderedTask audioTaskWithIdentifier:intendedUseDescription:speechInstruction:shortSpeechInstruction:duration:recordingSettings:checkAudioLevel:options:])), the user makes a sustained sound, and an audio -recording is made. Analysis of the audio data is not included in the -ResearchKit framework, but might naturally involve looking at the power spectrum -and how it relates to the ability to produce certain -sounds. The ResearchKit framework uses the AVFoundation framework to collect this -data and to present volume indication during recording. No data -analysis is done by ResearchKit; you can define your analysis on this -task according to your own requirements. -Audio steps are shown in Figure 12. - -

Welcome ScreenInstruction step introducing the task

-

Instruction ScreenInstruction step describes user action during the task

-

Task Completion ScreenCount down a specified duration to begin the task

-

-

Task ScreenDisplays a graph during audio playback (audio collection step)

-

Task Completion ScreenConfirms task completion

-

-
Figure 12. Audio steps
- -## Speech Recognition - -Researchers and developers can use ResearchKit to record audio data and produce transcriptions generated by Apple’s speech recognition system. ResearchKit also provides word alignments, confidence scores, and alternative speech recognition hypotheses in the form of an n-best list. Medical researchers and developers can leverage this information to analyze speech and language features like speaking rate, word usage, and pause durations. - -The n-best list and the confidence measure detect uncertainty in the speech recognition system's hypothesis in certain cases of unintelligible speech or speech containing word fragments or meaningless words. These conditions are found to be a useful indicator of cognitive decline associated with Alzheimer's disease and related dementias (1, 2), as well as other mental health issues (3). Additionally, researchers and developers can use the raw audio data captured through ResearchKit to investigate and deploy speech indicators for research and system design. - -The `ORKSpeechRecognitionStep` class represents a single recording step. In this step, the user's speech is recorded from the microphone. - -Speech recognition steps showing capturing and displaying recorded text are in Figure 13. - -

Instruction step introducing the taskInstruction step introducing the task

-

Instruct the user to prepare for recordingInstruct the user to prepare for recording

-

Prompts the user to start the recordingPrompts the user to start the recording

-

-

Records the user's speechRecords the user's speech

-

Provides the transcription and allows editingProvides the transcription and allows editing

-

Task completionTask completion

-

-
Figure 13. Speech recognition steps
- -Once a user completes the recording, they are given the option to edit the transcript generated by the speech recognition engine. The data collected by this task consists of three main components: -
    -
  1. The raw audio recording of what the user said.
  2. -
  3. The transcriptino generated by the speech recognition engine returned as an object of type `SFTranscript`.
  4. -
  5. The edited transcript, if any, by the user.
  6. -
- -## Speech-in-Noise - - -Understanding speech in noisy environments depends on both the level of the background noise and the hearing health of the listener. A speech-in-noise test quantifies the difficulty of understanding speech in noisy environments. - -A speech-in-noise test consists of presenting spoken sentences at different noise levels and asking listeners to repeat what they heard. Based on the sentence and word recognition rate, a metric is calculated. The speech intelligibility metric used in this test is the Speech Reception Threshold (SRT). It represents the SNR at which 50% of the words are correctly repeated by the user. The SRT is calculated using the Tillman-Olsen formula (4). - -The `ORKSpeechInNoiseStep` class plays the speech from a file set by the `speechFileNameWithExtension` property mixed with noise from a file set by the `noiseFileNameWithExtension` property. The noise gain is set through the `gainAppliedToNoise` property. Use the `filterFileNameWithExtension` property to specify a ramp-up/ramp-down filter. - -Speech-in-noise steps are shown in Figure 14. - -

Instruction step introducing the taskInstruction step introducing the task

-

Instructs the user how to proceed with the taskInstructs the user how to proceed with the task

-

Prompts the user to play the spoken sentencePrompts the user to play the spoken sentence

-

-

Plays the spoken sentence with background noisePlays the spoken sentence with background noise

-

Prompts the user to record and repeat what they heardPrompts the user to record and repeat what they heard

-

Records the user's voiceRecords the user's voice

-

-

Task completionTask completion

-

Displays spoken text and provides transcript editingDisplays spoken text and provides transcript editing

-

-
Figure 14. Speech-in-noise steps
- -## Environment SPL Meter - -The Environment SPL Meter is not a task, but a single step that detects the sound pressure level in the user's environment. Configure this step with the following properties: - -* `thresholdValue` is the maximum permissible value for the environment sound pressure level in dBA. -* `samplingInterval` is the rate at which the `AVAudioPCMBuffer` is queried and A-weighted filter is applied. -* `requiredContiguousSamples` is the number of consecutive samples less than threshold value required for the step to proceed. - -The environment SPL meter step is shown in Figure 15. - -
- -
Figure 15. Environment SPL meter
-
- -## Tone Audiometry - -In the tone audiometry task users listen through headphones to a series of tones, and tap left or right buttons on the screen when they hear each tone. These tones are of different audio frequencies, playing on different channels (left and right), with the volume being progressively increased until the user taps one of the buttons. A tone audiometry task measures different properties of a user's hearing ability, based on their reaction to a wide range of frequencies. (See the method [ORKOrderedTask toneAudiometryTaskWithIdentifier:intendedUseDescription:speechInstruction:shortSpeechInstruction:toneDuration:options:]([ORKOrderedTask toneAudiometryTaskWithIdentifier:intendedUseDescription:speechInstruction:shortSpeechInstruction:toneDuration:options:])). - -Data collected in this task consists of audio signal amplitude for specific frequencies and channels for each ear. - -Tone audiometry steps are shown in Figure 16. - -

Instruction step introducing the task

-

Instruction step introducing the task

-

Further instructions

-

-

Count down a specified duration to begin the activity

-

The tone test screen with buttons for left and right ears

-

Confirms task completion

-

-
Figure 16. Tone audiometry steps
- -## dBHL Tone Audiometry - -The dBHL tone audiometry task implements the Hughson-Westlake method of determining hearing threshold. It is similar to the tone audiometry task, except that it utilizes a dB HL scale. (See the method [ORKOrderedTask dBHLToneAudiometryTaskWithIdentifier:intendedUseDescription:options:]([ORKOrderedTask dBHLToneAudiometryTaskWithIdentifier:intendedUseDescription:options:])). - -Data collected in this task consists of audio signal amplitude for specific frequencies and channels for each ear. - -dBHL tone audiometry steps are shown in Figure 17. - -

Instruction step introducing the task

-

Instruction step allowing the user to select an ear

-

Further instructions

-

-

Count down a specified duration to begin the activity

-

The tone test screen with buttons for the left ear

-

Count down a specified duration to begin the activity

-

-

The tone test screen with buttons for the right ear

-

Confirms task completion

-

-
Figure 17. dBHL tone audiometry steps
- -## 9-Hole Peg Test - -The 9-hole peg test is a two-step test of hand dexterity to measure the MSFC score in Multiple Sclerosis, or signs of Parkinson's disease or stroke. This task is well documented in the scientific literature (see Earhart et al., 2011). - -The data collected by this task includes the number of pegs, an array of move samples, and the total duration that the user spent taking the test. Practically speaking, this task generates a two-step test in which the participant must put a variable number of pegs in a hole (the place step), and then remove them (the remove step). This task tests both hands. - -The `ORKHolePegTestPlaceStep` class represents the place step. In this step, the user uses two fingers to touch the peg and drag it into the hole using their left hand. The `ORKHolePegTestRemoveStep` class represents the remove step. Here, the user moves the peg over a line using two fingers on their right hand. - -9-Hole peg test steps are shown in Figure 18. - -

Instruction step introducing the task

-

Describes what the user must do

-

Instructs the user to perform the step with the right hand

-

-

Instructs the user to perform the step with the right hand

-

Instructs the user to perform the step with the right hand

-

Instructs the user to perform the step with the left hand

-

-

Task completion

-

-
Figure 18. 9-hole peg test steps
- - -## Amsler Grid - -The Amsler Grid task is a tool used to detect the onset of vision problems such as macular degeneration. - -The `ORKAmslerGridStep` class represents a single measurement step. In this step, the user observes the grid while closing one eye for any anomalies and marks the areas that appear distorted, using their finger or a stylus. - -Data collected by this task is in the form of an `ORKAmslerGridResult` object for the eye. It contains the eye side (specified by `ORKAmslerGridEyeSide`) and the image of the grid, along with the user's annotations for the corresponding eye. - -Amsler grid steps for the left and right eyes are shown in Figure 19. - -

Instruction step introducing the taskInstruction step introducing the task

-

Instruct the user how to measure the left eyeInstruct the user how to measure the left eye

-

Perform the left eye testPerform the left eye test

-

-

Instruct the user how to measure the right eyeInstruct the user how to measure the right eye

-

Perform the right eye testPerform the right eye test

-

Task completionTask completion

-

-
Figure 19. Amsler grid steps
- -## Collect the Data - -The data collected in active tasks is recorded in a hierarchy of `ORKResult` objects in memory. It is up to you to serialize this hierarchy for storage or transmission in a way that’s appropriate for your application. - -For high sample rate data, such as from the accelerometer, use the `ORKFileResult` in the hierarchy. This object references a file in the output directory (specified by the `outputDirectory` property of `ORKTaskViewController`) where the data is logged. - -The recommended approach for handling file-based output is to create a new directory per task and to remove it after you have processed the results of the task. - -Active steps support attaching recorder configurations -(`ORKRecorderConfiguration`). A recorder configuration defines a type of -data that should be collected for the duration of the step from a sensor or -a database on the device. For example: - -* The pedometer sensor returns a `CMPedometerData` object that provides step counts computed by the motion coprocessor on supported devices. -* The accelerometer sensor returns a `CMAccelerometerData` object that provides raw accelerometer samples indicating the forces on the device. -* A `CMDeviceMotion` object provides information about the orientation and movement of the device by combining data collected from the accelerometer, gyroscope, and magnetometer. -* HealthKit returns sample types, such as heart rate. -* CoreLocation returns location data (combined from GPS, Wi-Fi and cell tower information). - -The recorders used by ResearchKit's predefined active tasks always use -`NSFileProtectionCompleteUnlessOpen` while writing data to disk, and -then change the file protection level on any files generated to -`NSFileProtectionComplete` when recording is finished. - -### Access Health Data - -For HealthKit related data, there are two recorder configurations: - -* `ORKHealthQuantityTypeRecorderConfiguration` to access quantity data such as heart rate. -* `ORKHealthClinicalTypeRecorderConfiguration` to access health records data. - -Access to health quanity and records data requires explicit permission that the user must grant explicitly. More information about accessing health record data can be found here. - -## Create Custom Active Tasks - -You can build your own custom active tasks by creating custom subclasses of `ORKActiveStep` and -`ORKActiveStepViewController`. Follow the example of active steps in ResearchKit's predefined tasks. (A helpful tutorial on creating active tasks can be found here). - -Some steps used in the predefined tasks may be useful as guides for creating your own tasks. For example: - -* `ORKCountdownStep` displays a timer that counts down with animation for the step duration. -* `ORKCompletionStep` displays a confirmation that the task is completed. - -Figure 20 shows examples of custom tasks. - -

Countdown stepCountdown step

-

Task completion stepTask completion step

-

-
Figure 20. Custom task examples
- --- -### References - -1. [Yancheva et. al., 2015] M. Yancheva, K. C. Fraser and F. Rudzicz, “Using linguistic features longitudinally to predict clinical scores for Alzheimer's disease and related dementias,” Proceedings of SLPAT 2015: 6th Workshop on Speech and Language Processing for Assistive Technologies, 2015. - -2. [Konig et al., 2015] A. König, A. Satt, A. Sorin, R. Hoory, O. Toledo-Ronen, A. Derreumaux, V. Manera, F. Verhey, P. Aalten, P. H. Robert, and R. David. “Automatic speech analysis for the assessment of patients with predementia and Alzheimer's disease,” Alzheimers Dement (Amst). 2015 Mar; 1(1): 112–124. - -3. [Gong and Poellabauer’ 17] Y. Gong and C. Poellabauer, “Topic Modeling Based Multi-modal Depression Detection,” AVEC@ACM Multimedia, 2017. - -4. [T.W. Tillman and W.O. Olsen] "Speech audiometry, Modern Development in Audiology (2nd Edition)," 1972. diff --git a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep1.png b/docs/ActiveTasks/AmslerGridImages/AmslerGridStep1.png deleted file mode 100644 index 971a469d21..0000000000 Binary files a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep2.png b/docs/ActiveTasks/AmslerGridImages/AmslerGridStep2.png deleted file mode 100644 index 46ba12b55e..0000000000 Binary files a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep3.png b/docs/ActiveTasks/AmslerGridImages/AmslerGridStep3.png deleted file mode 100644 index bb947f0409..0000000000 Binary files a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep4.png b/docs/ActiveTasks/AmslerGridImages/AmslerGridStep4.png deleted file mode 100644 index 4adffb4067..0000000000 Binary files a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep5.png b/docs/ActiveTasks/AmslerGridImages/AmslerGridStep5.png deleted file mode 100644 index 9bc924424b..0000000000 Binary files a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep6.png b/docs/ActiveTasks/AmslerGridImages/AmslerGridStep6.png deleted file mode 100644 index 72744a21f6..0000000000 Binary files a/docs/ActiveTasks/AmslerGridImages/AmslerGridStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/AudioTaskImages/AudioStep1.png b/docs/ActiveTasks/AudioTaskImages/AudioStep1.png deleted file mode 100644 index 27d9c912ab..0000000000 Binary files a/docs/ActiveTasks/AudioTaskImages/AudioStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/AudioTaskImages/AudioStep2.png b/docs/ActiveTasks/AudioTaskImages/AudioStep2.png deleted file mode 100644 index 8832c6b4ac..0000000000 Binary files a/docs/ActiveTasks/AudioTaskImages/AudioStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/AudioTaskImages/AudioStep3.png b/docs/ActiveTasks/AudioTaskImages/AudioStep3.png deleted file mode 100644 index 84bc92ce39..0000000000 Binary files a/docs/ActiveTasks/AudioTaskImages/AudioStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/AudioTaskImages/AudioStep4.png b/docs/ActiveTasks/AudioTaskImages/AudioStep4.png deleted file mode 100644 index 8928024430..0000000000 Binary files a/docs/ActiveTasks/AudioTaskImages/AudioStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/AudioTaskImages/AudioStep5.png b/docs/ActiveTasks/AudioTaskImages/AudioStep5.png deleted file mode 100644 index d9cf534b31..0000000000 Binary files a/docs/ActiveTasks/AudioTaskImages/AudioStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/EnvironmentSPLImages/EnvironmentSPL.png b/docs/ActiveTasks/EnvironmentSPLImages/EnvironmentSPL.png deleted file mode 100644 index f9c483b149..0000000000 Binary files a/docs/ActiveTasks/EnvironmentSPLImages/EnvironmentSPL.png and /dev/null differ diff --git a/docs/ActiveTasks/FitnessTaskImages/FitnessStep1.png b/docs/ActiveTasks/FitnessTaskImages/FitnessStep1.png deleted file mode 100644 index 4b056e8dac..0000000000 Binary files a/docs/ActiveTasks/FitnessTaskImages/FitnessStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/FitnessTaskImages/FitnessStep2.png b/docs/ActiveTasks/FitnessTaskImages/FitnessStep2.png deleted file mode 100644 index c6bd516386..0000000000 Binary files a/docs/ActiveTasks/FitnessTaskImages/FitnessStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/FitnessTaskImages/FitnessStep3.png b/docs/ActiveTasks/FitnessTaskImages/FitnessStep3.png deleted file mode 100644 index 96ac30dd26..0000000000 Binary files a/docs/ActiveTasks/FitnessTaskImages/FitnessStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/FitnessTaskImages/FitnessStep4.png b/docs/ActiveTasks/FitnessTaskImages/FitnessStep4.png deleted file mode 100644 index 7765f64056..0000000000 Binary files a/docs/ActiveTasks/FitnessTaskImages/FitnessStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/FitnessTaskImages/FitnessStep5.png b/docs/ActiveTasks/FitnessTaskImages/FitnessStep5.png deleted file mode 100644 index ff85f212d2..0000000000 Binary files a/docs/ActiveTasks/FitnessTaskImages/FitnessStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/FitnessTaskImages/FitnessStep6.png b/docs/ActiveTasks/FitnessTaskImages/FitnessStep6.png deleted file mode 100644 index 954728622e..0000000000 Binary files a/docs/ActiveTasks/FitnessTaskImages/FitnessStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/HolePegTaskImages/HolePegStep1.png b/docs/ActiveTasks/HolePegTaskImages/HolePegStep1.png deleted file mode 100644 index 5e1f740ebf..0000000000 Binary files a/docs/ActiveTasks/HolePegTaskImages/HolePegStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/HolePegTaskImages/HolePegStep2.png b/docs/ActiveTasks/HolePegTaskImages/HolePegStep2.png deleted file mode 100644 index 470792bab3..0000000000 Binary files a/docs/ActiveTasks/HolePegTaskImages/HolePegStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/HolePegTaskImages/HolePegStep3.png b/docs/ActiveTasks/HolePegTaskImages/HolePegStep3.png deleted file mode 100644 index c5baa928b2..0000000000 Binary files a/docs/ActiveTasks/HolePegTaskImages/HolePegStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/HolePegTaskImages/HolePegStep4.png b/docs/ActiveTasks/HolePegTaskImages/HolePegStep4.png deleted file mode 100644 index ad6325f8bd..0000000000 Binary files a/docs/ActiveTasks/HolePegTaskImages/HolePegStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/HolePegTaskImages/HolePegStep5.png b/docs/ActiveTasks/HolePegTaskImages/HolePegStep5.png deleted file mode 100644 index 7d77d543c4..0000000000 Binary files a/docs/ActiveTasks/HolePegTaskImages/HolePegStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/HolePegTaskImages/HolePegStep6.png b/docs/ActiveTasks/HolePegTaskImages/HolePegStep6.png deleted file mode 100644 index 4ec7e2fb81..0000000000 Binary files a/docs/ActiveTasks/HolePegTaskImages/HolePegStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/HolePegTaskImages/HolePegStep7.png b/docs/ActiveTasks/HolePegTaskImages/HolePegStep7.png deleted file mode 100644 index 514de40674..0000000000 Binary files a/docs/ActiveTasks/HolePegTaskImages/HolePegStep7.png and /dev/null differ diff --git a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep1.png b/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep1.png deleted file mode 100644 index c95b26b747..0000000000 Binary files a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep2.png b/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep2.png deleted file mode 100644 index 0ed8687729..0000000000 Binary files a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep3.png b/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep3.png deleted file mode 100644 index dc737b0156..0000000000 Binary files a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep4.png b/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep4.png deleted file mode 100644 index 6864fa0007..0000000000 Binary files a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep5.png b/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep5.png deleted file mode 100644 index 5727877b25..0000000000 Binary files a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep6.png b/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep6.png deleted file mode 100644 index a22c37423d..0000000000 Binary files a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep7.png b/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep7.png deleted file mode 100644 index a3a6a04369..0000000000 Binary files a/docs/ActiveTasks/KneeRangeOfMotionTaskImages/KneeRangeOfMotionStep7.png and /dev/null differ diff --git a/docs/ActiveTasks/PsatTaskImages/PSATStep1.png b/docs/ActiveTasks/PsatTaskImages/PSATStep1.png deleted file mode 100644 index 18513a8f27..0000000000 Binary files a/docs/ActiveTasks/PsatTaskImages/PSATStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/PsatTaskImages/PSATStep2.png b/docs/ActiveTasks/PsatTaskImages/PSATStep2.png deleted file mode 100644 index e65ab0221a..0000000000 Binary files a/docs/ActiveTasks/PsatTaskImages/PSATStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/PsatTaskImages/PSATStep3.png b/docs/ActiveTasks/PsatTaskImages/PSATStep3.png deleted file mode 100644 index f1ff859523..0000000000 Binary files a/docs/ActiveTasks/PsatTaskImages/PSATStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/PsatTaskImages/PSATStep4.png b/docs/ActiveTasks/PsatTaskImages/PSATStep4.png deleted file mode 100644 index d830e0f152..0000000000 Binary files a/docs/ActiveTasks/PsatTaskImages/PSATStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/PsatTaskImages/PSATStep5.png b/docs/ActiveTasks/PsatTaskImages/PSATStep5.png deleted file mode 100644 index 8fcb43917a..0000000000 Binary files a/docs/ActiveTasks/PsatTaskImages/PSATStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep1.png b/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep1.png deleted file mode 100644 index e39bf777d0..0000000000 Binary files a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep2.png b/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep2.png deleted file mode 100644 index 228ad1364b..0000000000 Binary files a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep3.png b/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep3.png deleted file mode 100644 index a793c9bc6e..0000000000 Binary files a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep4.png b/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep4.png deleted file mode 100644 index ca207df802..0000000000 Binary files a/docs/ActiveTasks/ReactionTimeTaskImages/ReactionTimeStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep1.png b/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep1.png deleted file mode 100644 index ed2bd04ad3..0000000000 Binary files a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep2.png b/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep2.png deleted file mode 100644 index 8b839100da..0000000000 Binary files a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep3.png b/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep3.png deleted file mode 100644 index d3cbc0bc4d..0000000000 Binary files a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep4.png b/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep4.png deleted file mode 100644 index 8580bf55e0..0000000000 Binary files a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep5.png b/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep5.png deleted file mode 100644 index 324f9be44b..0000000000 Binary files a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep6.png b/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep6.png deleted file mode 100644 index 5ba53766dc..0000000000 Binary files a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep7.png b/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep7.png deleted file mode 100644 index bb372dbe08..0000000000 Binary files a/docs/ActiveTasks/ShortWalkTaskImages/ShortWalkStep7.png and /dev/null differ diff --git a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep1.png b/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep1.png deleted file mode 100644 index 8695179fb6..0000000000 Binary files a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep2.png b/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep2.png deleted file mode 100644 index bee461b6cc..0000000000 Binary files a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep3.png b/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep3.png deleted file mode 100644 index e9442c3930..0000000000 Binary files a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep4.png b/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep4.png deleted file mode 100644 index 6f7c523e92..0000000000 Binary files a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep5.png b/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep5.png deleted file mode 100644 index 2c36a90753..0000000000 Binary files a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep6.png b/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep6.png deleted file mode 100644 index 770d463ade..0000000000 Binary files a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep7.png b/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep7.png deleted file mode 100644 index 83972597f9..0000000000 Binary files a/docs/ActiveTasks/SpatialSpanMemoryTaskImages/SpatialSpanMemoryStep7.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep1.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep1.png deleted file mode 100644 index d24f305e45..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep2.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep2.png deleted file mode 100644 index 09bb4e12cf..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep3.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep3.png deleted file mode 100644 index fe82cb16fc..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep4.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep4.png deleted file mode 100644 index 60eec29fbd..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep5.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep5.png deleted file mode 100644 index c5ca97f001..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep6.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep6.png deleted file mode 100644 index 1073b4501e..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep7.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep7.png deleted file mode 100644 index 3a1a286122..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep7.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep8.png b/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep8.png deleted file mode 100644 index ca394fe513..0000000000 Binary files a/docs/ActiveTasks/SpeechInNoiseImages/SpeechInNoiseStep8.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep1.png b/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep1.png deleted file mode 100644 index 01d3865c5e..0000000000 Binary files a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep2.png b/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep2.png deleted file mode 100644 index f14b513a6f..0000000000 Binary files a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep3.png b/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep3.png deleted file mode 100644 index 3a977dadb7..0000000000 Binary files a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep4.png b/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep4.png deleted file mode 100644 index e79199a50f..0000000000 Binary files a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep5.png b/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep5.png deleted file mode 100644 index ac352d4d08..0000000000 Binary files a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep6.png b/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep6.png deleted file mode 100644 index 416b5baf8f..0000000000 Binary files a/docs/ActiveTasks/SpeechRecognitionImages/SpeechRecognitionStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/StroopTaskImages/StroopStep1.png b/docs/ActiveTasks/StroopTaskImages/StroopStep1.png deleted file mode 100644 index 7710b129fc..0000000000 Binary files a/docs/ActiveTasks/StroopTaskImages/StroopStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/StroopTaskImages/StroopStep2.png b/docs/ActiveTasks/StroopTaskImages/StroopStep2.png deleted file mode 100644 index 4c322570da..0000000000 Binary files a/docs/ActiveTasks/StroopTaskImages/StroopStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/StroopTaskImages/StroopStep3.png b/docs/ActiveTasks/StroopTaskImages/StroopStep3.png deleted file mode 100644 index 3deb2ebbc4..0000000000 Binary files a/docs/ActiveTasks/StroopTaskImages/StroopStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/StroopTaskImages/StroopStep4.png b/docs/ActiveTasks/StroopTaskImages/StroopStep4.png deleted file mode 100644 index fb26efd6bb..0000000000 Binary files a/docs/ActiveTasks/StroopTaskImages/StroopStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/StroopTaskImages/StroopStep5.png b/docs/ActiveTasks/StroopTaskImages/StroopStep5.png deleted file mode 100644 index 1be8fdd5b2..0000000000 Binary files a/docs/ActiveTasks/StroopTaskImages/StroopStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/TOHTaskImages/TOHStep1.png b/docs/ActiveTasks/TOHTaskImages/TOHStep1.png deleted file mode 100644 index bfa0a96892..0000000000 Binary files a/docs/ActiveTasks/TOHTaskImages/TOHStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/TOHTaskImages/TOHStep2.png b/docs/ActiveTasks/TOHTaskImages/TOHStep2.png deleted file mode 100644 index a1c860c20a..0000000000 Binary files a/docs/ActiveTasks/TOHTaskImages/TOHStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/TOHTaskImages/TOHStep3.png b/docs/ActiveTasks/TOHTaskImages/TOHStep3.png deleted file mode 100644 index 7cc29a421a..0000000000 Binary files a/docs/ActiveTasks/TOHTaskImages/TOHStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/TOHTaskImages/TOHStep4.png b/docs/ActiveTasks/TOHTaskImages/TOHStep4.png deleted file mode 100644 index da06af1084..0000000000 Binary files a/docs/ActiveTasks/TOHTaskImages/TOHStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep1.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep1.png deleted file mode 100644 index 19db5b14b2..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep2.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep2.png deleted file mode 100644 index 33a7d14e9c..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep3.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep3.png deleted file mode 100644 index 21b8c4e886..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep4.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep4.png deleted file mode 100644 index 6c8e6f0bdb..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep5.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep5.png deleted file mode 100644 index 55c217f019..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep6.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep6.png deleted file mode 100644 index acf0f3d603..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep7.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep7.png deleted file mode 100644 index 4cdd5750c7..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep7.png and /dev/null differ diff --git a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep8.png b/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep8.png deleted file mode 100644 index 39a138f1d6..0000000000 Binary files a/docs/ActiveTasks/TimedWalkTaskImages/TimedWalkStep8.png and /dev/null differ diff --git a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep1.png b/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep1.png deleted file mode 100644 index 3a7be4f138..0000000000 Binary files a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep2.png b/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep2.png deleted file mode 100644 index 866691880a..0000000000 Binary files a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep3.png b/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep3.png deleted file mode 100644 index b7c5117575..0000000000 Binary files a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep4.png b/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep4.png deleted file mode 100644 index 77f161c34a..0000000000 Binary files a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep5.png b/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep5.png deleted file mode 100644 index 000901257a..0000000000 Binary files a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep6.png b/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep6.png deleted file mode 100644 index c26dd9c146..0000000000 Binary files a/docs/ActiveTasks/ToneAudiometryTaskImages/ToneAudiometryStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep1.png b/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep1.png deleted file mode 100644 index d2e7a63b4a..0000000000 Binary files a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep2.png b/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep2.png deleted file mode 100644 index aa89435ae5..0000000000 Binary files a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep3.png b/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep3.png deleted file mode 100644 index 7ec3360ec9..0000000000 Binary files a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep4.png b/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep4.png deleted file mode 100644 index 2a9fff78ec..0000000000 Binary files a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep5.png b/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep5.png deleted file mode 100644 index 4ee2e662bb..0000000000 Binary files a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep6.png b/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep6.png deleted file mode 100644 index b557bf6693..0000000000 Binary files a/docs/ActiveTasks/TrailMakingTaskImages/TrailMakingStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep1.png b/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep1.png deleted file mode 100644 index 471521ee9b..0000000000 Binary files a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep2.png b/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep2.png deleted file mode 100644 index bf51008317..0000000000 Binary files a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep3.png b/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep3.png deleted file mode 100644 index f58036874f..0000000000 Binary files a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep4.png b/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep4.png deleted file mode 100644 index f5e7c86760..0000000000 Binary files a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep5.png b/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep5.png deleted file mode 100644 index 0f63ddb374..0000000000 Binary files a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep6.png b/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep6.png deleted file mode 100644 index 076a438c55..0000000000 Binary files a/docs/ActiveTasks/TwoFingerTappingTaskImages/TwoFingerTappingStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep1.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep1.png deleted file mode 100644 index cde1e0a921..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep1.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep2.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep2.png deleted file mode 100644 index 4410217143..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep2.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep3.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep3.png deleted file mode 100644 index 6b706573ae..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep3.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep4.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep4.png deleted file mode 100644 index 81b35b6d81..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep4.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep5.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep5.png deleted file mode 100644 index bea902595d..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep5.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep6.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep6.png deleted file mode 100644 index 8d6be59a8a..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep6.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep7.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep7.png deleted file mode 100644 index 353916b3dc..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep7.png and /dev/null differ diff --git a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep8.png b/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep8.png deleted file mode 100644 index 51d19969cf..0000000000 Binary files a/docs/ActiveTasks/dBHLToneAudiometryTaskImages/dBHLToneAudiometryStep8.png and /dev/null differ diff --git a/docs/AppledocSettings.plist b/docs/AppledocSettings.plist deleted file mode 100644 index 3343b17502..0000000000 --- a/docs/AppledocSettings.plist +++ /dev/null @@ -1,43 +0,0 @@ - - - - - --repeat-first-par - - --company-id - org.researchkit - --create-docset - - --create-html - - --ignore - - Internal - ORKDemo - ORKDemoTests - docs - - --index-desc - docs/index-template.md - --install-docset - - --keep-undocumented-objects - - --logformat - xcode - --project-company - ResearchKit - --project-name - ResearchKit - --verbose - 2 - --warn-empty-description - - --warn-undocumented-member - - --warn-undocumented-object - - --warn-unknown-directive - - - diff --git a/docs/ChartsAndGraphs/ChartsAndGraphs-template.markdown b/docs/ChartsAndGraphs/ChartsAndGraphs-template.markdown deleted file mode 100644 index 730e250f31..0000000000 --- a/docs/ChartsAndGraphs/ChartsAndGraphs-template.markdown +++ /dev/null @@ -1,405 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. -# Charts and Graphs -The ResearchKit framework provides classes that display data in charts and graphs. Presenting information this way helps users understand your data better and provides key insights in a visual way. - -Use the ResearchKit classes to create five kinds of charts: - - * Pie chart (ORKPieChartView). A pie chart is a circular chart divided into segments, which is useful for showing the magnitude of a particular data point as it relates to the whole. For example, a task-based research app could use a pie chart to display how many of the user's daily activities are complete. - * Line graph (ORKLineGraphChartView). A line graph is a type of chart that displays information as a series of data points connected by a straight line. Use a line graph to display the number of steps taken by a user every day in a week. - * Multiple line graph. A multiple line graph is a type of line graph that's useful for comparing multiple data sets over time. - * Discrete graph (ORKDiscreteGraphChartView). A discrete graph displays information as a series of data points in which each series is evenly spaced across the axis according to a tier row index. A discrete graph chart is a good choice for displaying data within a range, such as the range of a user's heart rate over the past month. - * Discrete graph with multiple points. A discrete graph with multiple points groups together noncontinuous values, which is useful for showing relationships between different types of discrete values that occur at the same time (e.g. viewing a user's blood pressure and heart rate in a single discrete graph). - -Each of these charts is shown in Figure 1.  - -

Pie Chart

Line graph chart

Line graph chart with multiple lines

-

-

Discrete graph chart

Discrete graph chart with multiple points

-

-

Figure 1. Types of charts
-

- -##Add a Chart to Your App -Chart objects adhere to the Model-View-Controller (MVC) paradigm. MVC emphasizes separation between the data (model), the presentation of that data (view), and the class required to coordinate the data and its view (controller). This design pattern is pervasive in iOS programming and is an integral part of the charts feature. - -In a research app, the chart object (view) must be connected to a data source object (model) which is responsible for supplying the data. The chart is then presented to a view controller object (controller) which establishes the necessary connections between the data source and the view. - -To add a chart or graph to your app, first create a data source class to supply the data. Next, create a chart or graph object (such as an `ORKPieChartView` object), connect it to the data source, customize the chart object as you want, and present it in a view controller. - -###Implement the Data Source Protocol -The data source provides the information that a chart object needs in order to construct a chart. This communication is enforced by a contractual obligation between objects known as a *protocol*. A protocol is composed of a name and a list of methods that the data source promises to implement. - -Two types of methods exist in a protocol: *required* and *optional* methods. You must implement the required methods in the data source while choosing which optional methods to implement. In the case of ResearchKit charts, one of the required methods of the protocol provides the number of points (or segments) and another required method provides the value of each point to the chart object. The optional methods of the protocol help in further configuring data, such as color of the x axis or segments. - -When providing the data to a chart, the data source must adopt one of two protocols: the `ORKGraphChartViewDataSource` protocol (for a graph chart) or the `ORKPieChartViewDataSource` protocol (for a pie chart). For specific examples of implementing these protocols, see [Adding a Line or Discrete Graph Chart to Your App](#header-add-line) and [Adding a Pie Chart to Your App](#header-add-pie). - -###Create a Chart Object and Adding It to a View Controller -To present data in a chart, create an instance of a ResearchKit chart object, such as `ORKPieChartView` or `ORKLineGraphChartView`. To do this, first create a UIView object in a UIViewController object and change the custom class of the view to the ResearchKit chart class you want to use. - -Next, use an IBOutlet to link the chart view to your code. This connection between your code and the view will allow you to update the contents of the chart on demand, as well as customize its look and feel. - -Then, connect the chart view with your data source so that the chart has access to the data. For example, to connect a pie chart object with a custom data source, you can use code similar to this: - - // Connect the pie chart-view object to a data source - pieChartView.dataSource = pieChartDataSource - -###Customize the Chart Object (Optional) -Although the default ResearchKit charts and graphs are ready to use with your data, it's easy to customize them to suit your app. Each chart object includes several properties that let you customize its look and feel. You can title the segments in a pie chart by implementing the `titleForSegmentAtIndex` method in a pie chart data source class, as shown here: - - func pieChartView(pieChartView: ORKPieChartView, titleForSegmentAtIndex index: Int) -> String { - switch index { - case 0: - return "Steps taken" - case 1: - return "Tasks completed" - case 2: - return "Surveys completed" - default: - return "task \(index + 1)" - } - } - -The code above displays the titles in the pie chart shown in Figure 2. - -

-
- -
Figure 2. Pie chart with custom titles
-
-
- - -To learn about the customizable properties of pie, line graph, and discrete graph chart objects, see `ORKPieChartView`, `ORKGraphChartView`, and `ORKDiscreteGraphChartView`. - -##Add a Pie Chart to Your App -The data source object that provides data to a pie chart adopts the `ORKPieChartViewDataSource` protocol. To construct a pie chart, you need to know the number of segments and the value of each segment. - -To specify the number of segments in a pie chart, implement the `numberOfSegmentsInPieChartView` method and return an integer that indicates the number of segments in the pie chart. This code specifies a pie chart that has three segments: - - func numberOfSegmentsInPieChartView(pieChartView: ORKPieChartView) -> Int { - return 3 - } - -Before you can draw the segments in a pie chart, you need to specify the value of each segment. To provide a value for each segment of the pie chart, implement the `valueForSegmentAtIndex` method. - -The values themselves are percentages whose sum should equal to 100.0. For example, the code below returns the values 50, 30, and 20 for segments at indexes 0, 1, and 2 in the pie chart: - - func pieChartView(pieChartView: ORKPieChartView, valueForSegmentAtIndex index: Int) -> CGFloat { - switch index { - case 0: - return 60.0 - case 1: - return 25.0 - case 2: - return 15.0 - } - } - -You can use the optional methods in the pie chart data source protocol to help you customize the look and feel of the data in the chart, including specifying a color and a title for each segment. (To learn more about using properties in the pie chart data source protocol to customize your chart, see `ORKPieChartViewDataSource`.) - -Here's an example of a pie chart data source class that includes both required and optional methods: - - class PieChartDataSource: NSObject, ORKPieChartViewDataSource { - // Specify three different colors. - let colors = [ - UIColor(red: 217/225, green: 217/255, blue: 217/225, alpha: 1), - UIColor(red: 142/255, green: 142/255, blue: 147/255, alpha: 1), - UIColor(red: 244/255, green: 200/255, blue: 74/255, alpha: 1) - ] - - // Values for each of the three segments. - let values = [60.0, 25.0, 15.0] - - // Required methods. - func numberOfSegmentsInPieChartView(pieChartView: ORKPieChartView ) -> Int { - return colors.count - } - - func pieChartView(pieChartView: ORKPieChartView, valueForSegmentAtIndex index: Int) -> CGFloat { - return CGFloat(values[index]) - } - - // Optional methods - // Give a color to each segment in the pie chart. - func pieChartView(pieChartView: ORKPieChartView, colorForSegmentAtIndex index: Int) -> UIColor { - return colors[index] - } - - // Give a title to each segment in the pie chart. - func pieChartView(pieChartView: ORKPieChartView, titleForSegmentAtIndex index: Int) -> String { - switch index { - case 0: - return "Steps taken" - case 1: - return "Tasks completed" - case 2: - return "Surveys completed" - default: - return "task \(index + 1)" - } - } - } - -After you create a pie chart data source class, create a pie chart object that presents the data it receives from the data source object. This code shows how to create a pie chart object, connect it to the data source, and customize some of its properties: - - // Create a pie chart object - @IBOutlet weak var pieChartView: ORKPieChartView! - - override func viewDidLoad() { - super.viewDidLoad() - - // Connect the pie chart object to a data source - pieChartView.dataSource = pieChartDataSource - - // Optional custom configuration - pieChartView.showsTitleAboveChart = false - pieChartView.showsPercentageLabels = true - pieChartView.drawsClockwise = true - pieChartView.titleColor = UIColor.purpleColor() - pieChartView.textColor = UIColor.purpleColor() - pieChartView.title = "Weekly" - pieChartView.text = "Report" - pieChartView.lineWidth = 10 - pieChartView.showsPercentageLabels = true - } - -Figure 3 shows the pie chart created by the code in this section. - -
-
-Instruction step -
Figure 3. Pie chart
-
-
- - -##Add a Line or Discrete Graph Chart to Your App -Adding data to line and discrete graph is a matter of implementing methods in the `ORKGraphChartViewDataSource` protocol. There are several methods that you must implement for correct behavior. - -Line and discrete graphs can display one or more plots. A plot is a graphical representation of a relationship between two variables. - -Start by implementing the `graphChartView:numberOfPointsForPlotIndex:` method. Here, you return the number of points for the specific plot index (a graph may have more than one plot associated with it). - -Next, implement the `graphChartView:pointForPointIndex:plotIndex:` method. In this method, return a `ORKValueRange` (which represents a ranged point used in a graph plot) for the given point index and plot index. - -An optional method that you can implement is `numberOfPlotsInGraphChartView:`. Here, return the number of plots for the passed graph. If you don't implement this method, one plot is assumed. - -Other optional methods provide titles as well as set minimum and maximum values for the y axis. - -Here's an example of a data source class for a line graph. This class returns five points for the two plots that will appear on the graph: - - class LineGraphDataSource: NSObject, ORKGraphChartViewDataSource { - - var plotPoints = - [ - [ - ORKValueRange(value: 200), - ORKValueRange(value: 450), - ORKValueRange(value: 500), - ORKValueRange(value: 250), - ORKValueRange(value: 300), - ORKValueRange(value: 600), - ORKValueRange(value: 300), - ], - [ - ORKValueRange(value: 100), - ORKValueRange(value: 350), - ORKValueRange(value: 400), - ORKValueRange(value: 150), - ORKValueRange(value: 200), - ORKValueRange(value: 500), - ORKValueRange(value: 400), - ] - ] - - // Required methods - - func graphChartView(graphChartView: ORKGraphChartView, pointForPointIndex dataPointForPointIndex: Int, plotIndex: Int) -> ORKValueRange { - - return plotPoints[plotIndex][pointIndex] - } - - func graphChartView(graphChartView: ORKGraphChartView, numberOfDataPointsForPlotIndex plotIndex: Int) -> Int { - return plotPoints[plotIndex].count - } - - // Optional methods - - // Returns the number of points to the graph chart view - func numberOfPlotsInGraphChartView(in graphChartView: ORKGraphChartView) -> Int { - return plotPoints.count - } - - // Sets the maximum value on the y axis - func maximumValueForGraphChartView(for graphChartView: ORKGraphChartView) -> CGFloat { - return 1000 - } - - // Sets the minimum value on the y axis - func minimumValueForGraphChartView(for graphChartView: ORKGraphChartView) -> CGFloat { - return 0 - } - - // Provides titles for x axis - func graphChartView(_ graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String? { - switch pointIndex { - case 0: - return "Mon" - case 1: - return "Tue" - case 2: - return "Wed" - case 3: - return "Thu" - case 4: - return "Fri" - case 5: - return "Sat" - case 6: - return "Sun" - default: - return "Day \(pointIndex + 1)" - } - } - - // Returns the color for the given plot index - func graphChartView(graphChartView: ORKGraphChartView, colorForPlotIndex plotIndex: Int) -> UIColor { - if plotIndex == 0 { - return UIColor.purpleColor() - } - } - -Note: A discrete graph uses the same data source protocol as a line graph, so the data source class for a discrete graph tends to look similar to the line graph data source class shown above. - -After you create the data source class for a graph, create a graph chart object to present the data. This code creates a line graph chart object, connects it to the data source shown above, and customizes some of its properties: - - // Create a line graph view object - @IBOutlet weak var lineGraphView: ORKLineGraphChartView! - - override func viewDidLoad() { - super.viewDidLoad() - - // Connect the line graph view object to a data source - lineGraphView.dataSource = lineGraphChartDataSource() - - // Optional custom configuration - lineGraphView.showsHorizontalReferenceLines = true - lineGraphView.showsVerticalReferenceLines = true - lineGraphView.axisColor = UIColor.whiteColor() - lineGraphView.verticalAxisTitleColor = UIColor.orangeColor() - lineGraphView.showsHorizontalReferenceLines = true - lineGraphView.showsVerticalReferenceLines = true - lineGraphView.scrubberLineColor = UIColor.redColor() - } - -Figure 4 shows the line graph created by the code in this section. - -
-
-Instruction step -
Figure 4. Line graph chart
-
-
- -To display a discrete graph chart instead of a line graph chart, use code similar to the code below to create a discrete graph chart object, connect it to a data source, and customize some of its properties: - - // Creating discrete graph chart-view object - @IBOutlet weak var discreteGraphChart: ORKDiscreteGraphChartView! - - //Connecting discrete graph chart-view object to a data source - let discreteGraphChartDataSource = DiscreteGraphDataSource() - - override func viewDidLoad() { - super.viewDidLoad() - - // Connect the line graph view object to a data source - discreteGraphChart.dataSource = discreteGraphChartDataSource - - // Optional custom configuration - discreteGraphChart.showsVerticalReferenceLines = true - discreteGraphChart.drawsConnectedRanges = true - } - - -Figure 5 shows a discrete graph that uses the same data source class created for the line graph chart at the beginning of this section. - -
-
- -
Figure 5. Discrete graph chart
-
-
- - -###Draw Multiple Lines in a Graph -By default, the graph object assumes that it has a single plot to draw. To draw more than one plot on a graph, use the `numberOfPlotsInGraphChartView` method and specify the number of plots in the graph. This optional data source method is useful when drawing more than one plot on a graph chart. - -This code shows how a graph object can draw two plots: - - // Optional methods - func numberOfPlotsInGraphChartView(graphChartView: ORKGraphChartView) -> Int { - return 2 - } - -###Add Titles to a Graph Chart -To add titles along the x axis in a line or discrete graph, implement the `titleForXAxisAtPointIndex` method in the data source class and return the title to display adjacent to each division on the x axis. For the y axis, display maximum or minimum values using the `maximumValueForGraphChartView:` or `minimumValueForGraphChartView:` properties (to display images instead of values, use the `maximumValueImage` and `minimumValueImage` properties). - -The following code displays titles on the x axis of a discrete graph chart: - - func graphChartView(graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String? { - switch pointIndex { - case 0: - return "Jan" - case 1: - return "Feb" - case 2: - return "Mar" - case 3: - return "Apr" - default: - return "Month \(pointIndex + 1)" - } - } - -The code above displays the titles you can see in the discrete graph shown in Figure 6. - -
-
- -
Figure 6. Discrete graph chart with custom titles
-
-
- -###Support the Pan Gesture -By default, the graph chart object implements the pan gesture for you. When the user drags a finger along the graph in a view, a label appears above the point that's closest to the user's finger, displaying the point's value. - -You can extend the default pan gesture behavior by implementing the `ORKGraphChartViewDelegate` protocol. The graph chart view delegate protocol forwards the pan gesture events occurring within the bounds of an `ORKGraphChartView` object. - -There are three optional methods that can be implemented: - -- `graphChartViewTouchesBegan:` alerts the object when the user has started touching the graph chart view. - -- `graphChartView:touchesMovedToXPosition:` provides the position on the x axis where the touch has moved. - -- `graphChartViewTouchesEnded:` alerts the object when the user has stopped touching the graph view. - -### Update the Data Source -In the examples above, the `plotPoints` are hard-coded. To update the data source, you may add functions that take in a new set of `plotPoints` to update the data. Call the `reloadData()` method after updating your data source in order to redraw the graph. - -If your graph is in a table view: - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - let dataSource = lineGraphChartView.dataSource as! yourDataSource - dataSource.updatePlotPoints(newPlotPoints: [ - ORKValueRange(value: 2), - ORKValueRange(value: 4), - ORKValueRange(value: 8), - ORKValueRange(value: 16), - ORKValueRange(value: 32), - ORKValueRange(value: 64), - ] - hrLineGraphChartView.reloadData() - hrLineGraphChartView.animate(withDuration: 0.5) - } diff --git a/docs/ChartsAndGraphs/ChartsImages/CustomizedChart.png b/docs/ChartsAndGraphs/ChartsImages/CustomizedChart.png deleted file mode 100644 index c519de7def..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/CustomizedChart.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/CustomizedLineGraph.png b/docs/ChartsAndGraphs/ChartsImages/CustomizedLineGraph.png deleted file mode 100644 index 7716a16acb..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/CustomizedLineGraph.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/DiscreteGraphChart.png b/docs/ChartsAndGraphs/ChartsImages/DiscreteGraphChart.png deleted file mode 100644 index 027e79a6fb..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/DiscreteGraphChart.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/DiscreteGraphChart2.png b/docs/ChartsAndGraphs/ChartsImages/DiscreteGraphChart2.png deleted file mode 100644 index 570c3f4ab7..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/DiscreteGraphChart2.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/LineChart/LineChart1.png b/docs/ChartsAndGraphs/ChartsImages/LineChart/LineChart1.png deleted file mode 100644 index 1917201fb9..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/LineChart/LineChart1.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/Overview/DiscereteGraphChartMultipleLinesOverview.png b/docs/ChartsAndGraphs/ChartsImages/Overview/DiscereteGraphChartMultipleLinesOverview.png deleted file mode 100644 index dadf00793a..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/Overview/DiscereteGraphChartMultipleLinesOverview.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/Overview/DiscreteGraphChartOverview.png b/docs/ChartsAndGraphs/ChartsImages/Overview/DiscreteGraphChartOverview.png deleted file mode 100644 index e13ee95b48..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/Overview/DiscreteGraphChartOverview.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/Overview/LineGraphChartMultipleLinesOverview.png b/docs/ChartsAndGraphs/ChartsImages/Overview/LineGraphChartMultipleLinesOverview.png deleted file mode 100644 index b7fcf0d740..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/Overview/LineGraphChartMultipleLinesOverview.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/Overview/LineGraphChartOverview.png b/docs/ChartsAndGraphs/ChartsImages/Overview/LineGraphChartOverview.png deleted file mode 100644 index 61bae4f42f..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/Overview/LineGraphChartOverview.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/Overview/PieChartOverview.png b/docs/ChartsAndGraphs/ChartsImages/Overview/PieChartOverview.png deleted file mode 100644 index 990c466c02..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/Overview/PieChartOverview.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/PieChart/CustomTitlePieChart.png b/docs/ChartsAndGraphs/ChartsImages/PieChart/CustomTitlePieChart.png deleted file mode 100644 index 5380aa244f..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/PieChart/CustomTitlePieChart.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/PieChart/CustomizedChart.png b/docs/ChartsAndGraphs/ChartsImages/PieChart/CustomizedChart.png deleted file mode 100644 index 65b90003b6..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/PieChart/CustomizedChart.png and /dev/null differ diff --git a/docs/ChartsAndGraphs/ChartsImages/PieChart/chart1.png b/docs/ChartsAndGraphs/ChartsImages/PieChart/chart1.png deleted file mode 100644 index aa10c2d846..0000000000 Binary files a/docs/ChartsAndGraphs/ChartsImages/PieChart/chart1.png and /dev/null differ diff --git a/docs/InformedConsent/InformedConsent-template-ObjC.markdown b/docs/InformedConsent/InformedConsent-template-ObjC.markdown deleted file mode 100644 index 7aaa59719f..0000000000 --- a/docs/InformedConsent/InformedConsent-template-ObjC.markdown +++ /dev/null @@ -1,229 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -# Obtaining Consent - -Research studies that involve human subjects typically require some form of ethics review. Depending on the country, this may be review by an institutional review board (IRB) or by an ethics committee (EC). For some studies, informed consent may be required to conduct a research study, which means that the researcher must ensure that each participant is fully informed about the nature of the study, and must obtain a signed consent from each participant. Additionally, consent may be required as a condition of app review. - -The ResearchKit™ framework makes it easy to display your consent document and to obtain a participant's signature. Note that the ResearchKit framework does not include digital signature support. If the signature needs to be verifiable and irrevocable, you are responsible for producing a digital signature or for generating a PDF that can be used to attest to the identity of the participant and the time at which the form was signed. - -To use the ResearchKit framework to obtain consent, start by creating a consent document model object (`ORKConsentDocument`) that represents the consent document. - -In the consent document model, encode each section of your consent document and the signatures that are needed. After you have the structure of your consent form in the document model, present a visual, animated sequence to help the participant understand it by adding the document to a visual consent step (`ORKVisualConsentStep`). To present the document for review and obtain a signature, add the document to a consent review step (`ORKConsentReviewStep`). To present the visual consent and consent review steps together, create a consent task that contains the steps and present them using an `ORKTaskViewController` object. - -You can also add other steps into your consent sequence. For example, a consent sharing step (`ORKConsentSharingStep`) can be used to explicitly obtain permission to share the data your study is collecting with other researchers, if allowed by your IRB or EC. Or you can add instruction, form, or question steps to ask comprehension questions to verify that your prospective participants understand the nature of the study. - -## 1. Create the Consent Document Model - -To create a consent document model, first decide how you want to present your consent document. Categorize your content into sections based on what information you present to participants. After you have the structure for your consent document, you can replicate the same structure using the consent document model object (`ORKConsentDocument`). - -The ResearchKit framework comes with some predefined sections that are commonly included in consent documents: - -* Overview (`ORKConsentSectionTypeOverview`) -* Data gathering (`ORKConsentSectionTypeDataGathering`) -* Privacy (`ORKConsentSectionTypePrivacy`) -* Data use (`ORKConsentSectionTypeDataUse`) -* Time commitment (`ORKConsentSectionTypeTimeCommitment`) -* Surveys (`ORKConsentSectionTypeStudySurvey`) -* Tasks (`ORKConsentSectionTypeStudyTasks`) -* Withdrawal (`ORKConsentSectionTypeWithdrawing`) - -The predefined sections include appropriate images and localized titles. To use a predefined section, use the `content` or `htmlContent` properties of `ORKConsentSection` object to supply a short, one-line summary of the section and the content to display if the participant taps the Learn More button. - -If you use the predefined sections in the expected order, the ResearchKit framework animates the transitions between the sections, giving a more fluid participant experience. - -After you create a section, you create a step to present the section. - -```objective-c - ORKConsentDocument *document = [ORKConsentDocument new]; - ORKConsentSection *section1 = - [[ORKConsentSection alloc] initWithType:ORKConsentSectionTypeDataGathering]; - section1.title = @"The title of the section goes here ..."; - section1.summary = @"The summary about the section goes here ..."; - section1.content = @"The content to show in learn more ..."; - - // Create additional section objects for later sections - document.sections = @[section1, ...]; - - ORKVisualConsentStep *step = - [[ORKVisualConsentStep alloc] initWithIdentifier:kVisualConsent document:document]; - - // And then create and present a task including this step. -``` - -If the predefined consent sections do not adequately cover the sections of your consent document, you can create your own custom sections. You can also create your own images and animations and add them to your consent section, to complete the experience. The animations you add should be H.264 videos; for best results, try to match the assets included with the ResearchKit framework. - -### Create a Visual Consent Step - -The visual consent step presents the sections of the consent document. -It is your responsibility to populate the visual consent step with -content; the `ORKVisualConsentStep` object doesn't contain any -default content. - -```objective-c - // Add consent sections for each page of visual consent; for example: - ORKConsentSection *section1 = - [[ORKConsentSection alloc] initWithType:ORKConsentSectionTypeDataGathering]; - document.sections = @[section1, ...]; - - // Add the document to a visual consent step and/or a review step: - ORKVisualConsentStep *visualConsent = - [[ORKVisualConsentStep alloc] initWithIdentifier:kVisualConsentIdentifier document:document]; - - // Create and present a task including this step. -``` - -Visual step is presented as: - - - -> Consent overview screen (ORKConsentSectionTypeOverview object) - - - -> Data gathering (ORKConsentSectionTypeDataGathering object) - - - -> Privacy (ORKConsentSectionTypePrivacy object) - - - -> Data use disclosure (ORKConsentSectionTypeDataUse object) - - - -> Time commitment (ORKConsentSectionTypeTimeCommitment object) - - - -> Type of study survey (ORKConsentSectionTypeStudySurvey object)

- - - -> Study tasks (ORKConsentSectionTypeStudyTasks object) - - - -> Consent withdrawal (ORKConsentSectionTypeWithdrawing object) - - - -> Custom consent section (ORKConsentSectionTypeCustom object) - -### Add a Review Step - -Participants review the consent review document in the consent review step (`ORKConsentReviewStep`). Depending on your signature requirements, participant can also be asked to enter their name and write a signature on the screen. - -The content for consent review can either be produced as a concatenation of all the consent sections in your document model, or you can provide entirely separate review content as HTML in the consent document's `htmlReviewContent` property. - -When the participant agrees to the content in the consent form, a confirmation dialog is shown. The text of this dialog is customizable using the `reasonForConsent` property of `ORKConsentReviewStep`. - -The name entry page is included in a consent review step if the step’s `signature` property contains a signature object in which the `requiresName` property is YES. Similarly, the signature entry page is included in a consent review step if the step’s `signature` property contains a signature object in which the `requiresSignature` property is YES. - -```objective-c - ORKConsentDocument *consent = [[ORKConsentDocument alloc] init]; - consent.title = @"Demo Consent"; - consent.signaturePageTitle = @"Consent"; - - ORKConsentReviewStep *reviewStep = - [[ORKConsentReviewStep alloc] initWithIdentifier:kConsentReviewIdentifier - signature:consent.signatures[0] - inDocument:consent]; - reviewStep.text = @"Lorem ipsum .."; - reviewStep.reasonForConsent = @"Lorem ipsum ..."; - - // Add the content to a task and present it. -``` - -Review step is presented as: - - - -> Consent review (ORKConsentReviewStep object) - - - -> Agreeing to the consent document (reasonForConsent property of ORKConsentReviewStep object) - - - -> Consent review name entry (signature property in ORKConsentReviewStep) - - - -> Consent review signature (signature property in ORKConsentReviewStep) - -### Consent Sharing Step - -The primary aim of apps which use the ResearchKit framework is to collect data for a -specific study. But if you want to ask participants to share their data with other -researchers, participants must be able to control this. - -A consent sharing step (`ORKConsentSharingStep`) can be used to explicitly obtain permission -to share their data that you collect for your study with other researchers, if allowed by -your IRB or EC if applicable. To use a consent sharing step, include it in a task, perhaps -just before a consent review step. - -```objective-c - ORKConsentSharingStep *sharingStep = - [[ORKConsentSharingStep alloc] initWithIdentifier:kConsentSharingIdentifier - investigatorShortDescription:@"MyInstitution" - investigatorLongDescription:@"MyInstitution and its partners" - localizedLearnMoreHTMLContent:@"Lorem ipsum..."]; - - // Then include this step to a task and present with a task view controller. -``` - -The consent sharing step looks like this: - - - -> Example of a consent sharing step. - -## 2. Create the Consent Task - -After you create the step(s), create an `ORKOrderedTask` task and add them to it. To present the task, attach your task to a task view controller and present it. - -The following code snippet shows how to create a task with a visual consent step and a consent review step: - -```objective-c - ORKVisualConsentStep *visualStep = - [[ORKVisualConsentStep alloc] initWithIdentifier:kVisualConsentIdentifier - document:consent]; - ORKConsentReviewStep *reviewStep = - [[ORKConsentReviewStep alloc] initWithIdentifier:kConsentReviewIdentifier - signature:consent.signatures[0] - inDocument:consent]; - // Configure the steps. - - // Create a task containing those steps. - ORKOrderedTask *task = - [[ORKOrderedTask alloc] initWithIdentifier:kConsentTaskIdentifier - steps:@[visualStep,reviewStep]]; - - ORKTaskViewController *taskViewController = - [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; - - // And then present the task view controller. -``` - -## 3. Optionally, Generate a PDF - -The ResearchKit framework can help you generate a PDF of the signed consent form and provide it to the participant. For example, your app could generate the PDF locally, write it to disk, email it to the participant, display it in the app, or send it to a server. - -To do this, first take any signature results from the completed consent review, and apply the resulting signatures to a copy of your consent document. Then, call the `makePDFWithCompletionHandler:` method of `ORKConsentDocument` as shown here. - -```objective-c - ORKConsentDocument *documentCopy = [document copy]; - - ORKConsentSignatureResult *signatureResult = - (ORKConsentSignatureResult *)[[[taskViewController result] stepResultForStepIdentifier:kConsentReviewIdentifier] firstResult]; - [signatureResult applyToDocument:documentCopy]; - - [documentCopy makePDFWithCompletionHandler:^(NSData *pdfData, NSError *error) { - // Write the PDF data to disk, email it, display it, or send it to a server. - }]; -``` - -You can only apply a signature result to a new copy of a consent document. diff --git a/docs/InformedConsent/InformedConsent-template-Swfit3.md b/docs/InformedConsent/InformedConsent-template-Swfit3.md deleted file mode 100644 index acff2b1749..0000000000 --- a/docs/InformedConsent/InformedConsent-template-Swfit3.md +++ /dev/null @@ -1,208 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -# Obtaining Consent - -Research studies that involve human subjects typically require some form of ethics review. Depending on the country, this may be review by an institutional review board (IRB) or by an ethics committee (EC). For some studies, informed consent may be required to conduct a research study, which means that the researcher must ensure that each participant is fully informed about the nature of the study, and must obtain a signed consent from each participant. Additionally, consent may be required as a condition of app review. - -The ResearchKit™ framework makes it easy to display your consent document and to obtain a participant's signature. Note that the ResearchKit framework does not include digital signature support. If the signature needs to be verifiable and irrevocable, you are responsible for producing a digital signature or for generating a PDF that can be used to attest to the identity of the participant and the time at which the form was signed. - -To use the ResearchKit framework to obtain consent, start by creating a consent document model object (`ORKConsentDocument`) that represents the consent document. - -In the consent document model, encode each section of your consent document and the signatures that are needed. After you have the structure of your consent form in the document model, present a visual, animated sequence to help the user understand it by adding the document to a visual consent step (`ORKVisualConsentStep`). To present the document for review and obtain a signature, add the document to a consent review step (`ORKConsentReviewStep`). To present the visual consent and consent review steps together, create a consent task that contains the steps and present them using an `ORKTaskViewController` object. - -You can also add other steps into your consent sequence. For example, a consent sharing step (`ORKConsentSharingStep`) can be used to explicitly obtain permission to share the data your study is collecting with other researchers, if allowed by your IRB or EC. Or you can add instruction, form, or question steps to ask comprehension questions to verify that your prospective participants understand the nature of the study. - -## 1. Create the Consent Document Model - -To create a consent document model, first decide how you want to present your consent document. Categorize your content into sections based on what information you present to participants. After you have the structure for your consent document, you can replicate the same structure using the consent document model object (`ORKConsentDocument`). - -The ResearchKit framework comes with some predefined sections that are commonly included in consent documents: - -* Overview (`ORKConsentSectionTypeOverview`) -* Data gathering (`ORKConsentSectionTypeDataGathering`) -* Privacy (`ORKConsentSectionTypePrivacy`) -* Data use (`ORKConsentSectionTypeDataUse`) -* Time commitment (`ORKConsentSectionTypeTimeCommitment`) -* Surveys (`ORKConsentSectionTypeStudySurvey`) -* Tasks (`ORKConsentSectionTypeStudyTasks`) -* Withdrawal (`ORKConsentSectionTypeWithdrawing`) - -The predefined sections include appropriate images and localized titles. To use a predefined section, use the `content` or `htmlContent` properties of `ORKConsentSection` object to supply a short, one-line summary of the section and the content to display if the participant taps the Learn More button. - -If you use the predefined sections in the expected order, the ResearchKit framework animates the transitions between the sections, giving a more fluid participant experience. - -After you create a section, you create a step to present the section. - -```swift -let document = ORKConsentDocument() - -let section1 = ORKConsentSection(type: .dataGathering) -section1.title = "The title of the section goes here ..." -section1.summary = "The summary about the section goes here ..." -section1.content = "The content to show in learn more ..." - -// Create additional section objects for later sections -document.sections = [section1, ...] - -let step = ORKVisualConsentStep(identifier: "VisualConsentStep", document: document) -// And then create and present a task including this step. -``` - -If the predefined consent sections do not adequately cover the sections of your consent document, you can create your own custom sections. You can also create your own images and animations and add them to your consent section, to complete the experience. The animations you add should be H.264 videos; for best results, try to match the assets included with the ResearchKit framework. - -### Create a Visual Consent Step - -The visual consent step presents the sections of the consent document. -It is your responsibility to populate the visual consent step with -content; the `ORKVisualConsentStep` object doesn't contain any -default content. - -```swift -// Add consent sections for each page of visual consent; for example: -let section1 = ORKConsentSection(type: .dataGathering) -document.sections = [section1, ...] - -// Add the document to a visual consent step and/or a review step: -let step = ORKVisualConsentStep(identifier: "VisualConsentStep", document: document) - -// Create and present a task including this step. -``` - -Visual step is presented as: - - - -> Consent overview screen (ORKConsentSectionTypeOverview object) - - - -> Data gathering (ORKConsentSectionTypeDataGathering object) - - - -> Privacy (ORKConsentSectionTypePrivacy object) - - - -> Data use disclosure (ORKConsentSectionTypeDataUse object) - - - -> Time commitment (ORKConsentSectionTypeTimeCommitment object) - - - -> Type of study survey (ORKConsentSectionTypeStudySurvey object)

- - - -> Study tasks (ORKConsentSectionTypeStudyTasks object) - - - -> Consent withdrawal (ORKConsentSectionTypeWithdrawing object) - - - -> Custom consent section (ORKConsentSectionTypeCustom object)

- -### Add a Review Step - -Participants review the consent review document in the consent review step (`ORKConsentReviewStep`). Depending on your signature requirements, a participant can also be asked to enter their name and write a signature on the screen. - -The content for consent review can either be produced as a concatenation of all the consent sections in your document model, or you can provide entirely separate review content as HTML in the consent document's `htmlReviewContent` property. - -When the participant agrees to the content in the consent form, a confirmation dialog is shown. The text of this dialog is customizable using the `reasonForConsent` property of `ORKConsentReviewStep`. - -The name entry page is included in a consent review step if the step’s `signature` property contains a signature object in which the `requiresName` property is YES. Similarly, the signature entry page is included in a consent review step if the step’s `signature` property contains a signature object in which the `requiresSignature` property is YES. - -```swift -let consent = ORKConsentDocument() -consent.title = "Demo Consent" -consent.signaturePageTitle = "Consent" - -let reviewStep = ORKConsentReviewStep(identifier: "ConsentReviewStep", signature: consent.signatures[0], in: consent) -reviewStep.text = "Lorem ipsum .." -reviewStep.reasonForConsent = "Lorem ipsum ..." - -// Add the content to a task and present it. -``` - -Review step is presented as: - - - -> Consent review (ORKConsentReviewStep object) - - - -> Agreeing to the consent document (reasonForConsent property of ORKConsentReviewStep object) - - - -> Consent review name entry (signature property in ORKConsentReviewStep) - - - -> Consent review signature (signature property in ORKConsentReviewStep) - -### Consent Sharing Step - -The primary aim of apps which use the ResearchKit framework is to collect data for a -specific study. But if you want to ask participants to share their data with other -researchers, participants must be able to control this. - -A consent sharing step (`ORKConsentSharingStep`) can be used to explicitly obtain permission -to share their data that you collect for your study with other researchers, if allowed by -your IRB or EC if applicable. To use a consent sharing step, include it in a task, perhaps -just before a consent review step. - -```swift -let sharingStep = ORKConsentSharingStep(identifier: "ConsentSharingStep", investigatorShortDescription: "MyInstitution", investigatorLongDescription: "MyInstitution and its partners", localizedLearnMoreHTMLContent: "Lorem ipsum...") - -// Then include this step to a task and present with a task view controller. -``` - -The consent sharing step looks like this: - - - -> Example of a consent sharing step. - -## 2. Create the Consent Task - -After you create the step(s), create an `ORKOrderedTask` task and add them to it. To present the task, attach your task to a task view controller and present it. - -The following code snippet shows how to create a task with a visual consent step and a consent review step: - -```swift -let visualStep = ORKVisualConsentStep(identifier: "VisualConsentStep", document: document) -let reviewStep = ORKConsentReviewStep(identifier: "ConsentReviewStep", signature: consent.signatures[0], in: consent) -// Configure the steps. - -// Create a task containing those steps. -let task = ORKOrderedTask(identifier: "ConsentTask", steps: [visualStep, reviewStep]) - -let taskViewController = ORKTaskViewController(task: task, taskRun: nil) - -// And then present the task view controller. -``` - -## 3. Optionally, Generate a PDF - -The ResearchKit framework can help you generate a PDF of the signed consent form and provide it to the participant. For example, your app could generate the PDF locally, write it to disk, email it to the participant, display it in the app, or send it to a server. - -To do this, first take any signature results from the completed consent review, and apply the resulting signatures to a copy of your consent document. Then, call the `makePDFWithCompletionHandler:` method of `ORKConsentDocument` as shown here. - -```swift -let documentCopy = document.copy() as! ORKConsentDocument - -let signatureResult: ORKConsentSignatureResult = taskViewController.result.stepResult(forStepIdentifier: "ConsentReviewStep")?.firstResult as! ORKConsentSignatureResult - -documentCopy.makePDF{ (data, error) -> Void in - // Write the PDF data to disk, email it, display it, or send it to a server. -} -``` - -You can only apply a signature result to a new copy of a consent document. diff --git a/docs/InformedConsent/InformedConsent-template.markdown b/docs/InformedConsent/InformedConsent-template.markdown deleted file mode 100644 index 556bdc7934..0000000000 --- a/docs/InformedConsent/InformedConsent-template.markdown +++ /dev/null @@ -1,211 +0,0 @@ - # -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -#Obtaining Consent - -Research studies that involve human subjects typically require some form of ethics review. Depending on the country, this may be review by an institutional review board (IRB), or by an ethics committee (EC). For some studies, consent may be required to conduct a research study, which means that the researcher must ensure that each participant is fully informed about the nature of the study, and must obtain a signed consent from each participant. Additionally, consent may be required as a condition of app review. - -The ResearchKit™ framework makes it easy to display your consent document and to obtain a participant's signature. Note that the ResearchKit framework does not include digital signature support. If the signature needs to be verifiable and irrevocable, you are responsible for producing a digital signature or for generating a PDF that can be used to attest to the identity of the participant and the time at which the form was signed. - -To use the ResearchKit framework to obtain consent, start by creating a consent document model object (`ORKConsentDocument`) that represents the consent document. -In the consent document model, encode each section of your consent document, and the signatures that are needed. After you have the structure of your consent form in the document model, present a visual, animated sequence to help the user understand it by adding the document to a visual consent step (`ORKVisualConsentStep`). To present the document for review and obtain a signature, add the document to a consent review step (`ORKConsentReviewStep`). To present the visual consent and consent review steps together, create an consent task that contains the steps, and present them using an `ORKTaskViewController` object. - -You can also add other steps into your consent sequence. For example, a consent-sharing step (`ORKConsentSharingStep`) can be used to explicitly obtain permission to share the data your study is collecting with other researchers, if allowed by your IRB or EC. Or, add an instruction, form, or question steps to ask comprehension questions to verify that your prospective participants understand the nature of the study. - -##Create the Consent Document Model - -To create a consent document model, first decide how you want to present your consent document. Categorize your content into sections based on what information you present to users. After you have the structure for your consent document, you can replicate the same structure using the consent document model object (`ORKConsentDocument`). - -The ResearchKit framework comes with some predefined sections that are commonly included in consent documents: - -* Overview (`ORKConsentSectionTypeOverview`) -* Data gathering (`ORKConsentSectionTypeDataGathering`) -* Privacy (`ORKConsentSectionTypePrivacy`) -* Data use (`ORKConsentSectionTypeDataUse`) -* Time commitment (`ORKConsentSectionTypeTimeCommitment`) -* Surveys (`ORKConsentSectionTypeStudySurvey`) -* Tasks (`ORKConsentSectionTypeStudyTasks`) -* Withdrawal (`ORKConsentSectionTypeWithdrawing`) - -The predefined sections include appropriate images and localized titles. To use a predefined section, use the `content` or `htmlContent` properties of `ORKConsentSection` object to supply a short, one-line summary of the section and the content to display if the user taps the Learn More button. -You use the predefined sections in the expected order, and the ResearchKit framework animates the transitions between the sections, giving a more fluid user experience. - -After you create a section, you create a step to present the section. - - - ORKConsentDocument *document = [ORKConsentDocument new]; - ORKConsentSection *section1 = - [[ORKConsentSection alloc] initWithType:ORKConsentSectionTypeDataGathering]; - section1.title = @"The title of the section goes here ..."; - section1.summary = @"The summary about the section goes here ..."; - section1.content = @"The content to show in learn more ..."; - - // Create additional section objects for later sections - document.sections = @[section1, ...]; - - ORKVisualConsentStep *step = - [[ORKVisualConsentStep alloc] initWithIdentifier:kVisualConsent document:document]; - - // And then create and present a task including this step. - -If the predefined consent sections do not adequately cover the sections of your consent document, you can create your own custom sections. You can also create your own images and animations and add them to your consent section, to complete the experience. The animations you add should be H.264 videos; for best results, try to match the assets included with the ResearchKit framework. - -### Create a Visual Consent Step - -The visual consent step presents the sections of the consent document. -It is your responsibility to populate the visual consent step with -content; the `ORKVisualConsentStep` object doesn't contain any -default content. - - // Add consent sections for each page of visual consent; for example: - ORKConsentSection *section1 = - [[ORKConsentSection alloc] initWithType:ORKConsentSectionTypeDataGathering]; - document.sections = @[section1, ...]; - - // Add the document to a visual consent step and/or a review step: - ORKVisualConsentStep *visualConsent = - [[ORKVisualConsentStep alloc] initWithIdentifier:kVisualConsentIdentifier document:document]; - - // Create and present a task including this step. - - -The visual step is presented as shown in Figure 1. - -

Consent overview screen (ORKConsentSectionTypeOverview object)

Data gathering (ORKConsentSectionTypeDataGathering object)

Privacy (ORKConsentSectionTypePrivacy object)

-

-

Data use disclosure (ORKConsentSectionTypeDataUse object)

Time commitment (ORKConsentSectionTypeTimeCommitment object)

Type of study survey (ORKConsentSectionTypeStudySurvey object)

-

-

Study tasks (ORKConsentSectionTypeStudyTasks object)

-

Consent withdrawal (ORKConsentSectionTypeWithdrawing object)

-

-

Figure 1. Visual consent steps
-

- - -### Add a Review Step - -Users review the consent review document in the consent review step (`ORKConsentReviewStep`). Depending on your signature requirements, users can also be asked to enter their name and write a signature on the screen. - -The content for consent review can either be produced as a concatenation of all the consent sections in your document model, or you can provide entirely separate review content as HTML in the consent document's `htmlReviewContent` property. - -When the user agrees to the content in the consent form, a confirmation dialog is shown. The text of this dialog is customizable using the `reasonForConsent` property of `ORKConsentReviewStep`. - -The name entry page is included in a consent review step if the step’s `signature` property contains a signature object in which the `requiresName` property is YES. Similarly, the signature entry page is included in a consent review step if the step’s `signature` property contains a signature object in which the `requiresSignature` property is YES. - - - ORKConsentDocument *consent = [[ORKConsentDocument alloc] init]; - consent.title = @"Demo Consent"; - consent.signaturePageTitle = @"Consent"; - - ORKConsentReviewStep *reviewStep = - [[ORKConsentReviewStep alloc] initWithIdentifier:kConsentReviewIdentifier - signature:consent.signatures[0] - inDocument:consent]; - reviewStep.text = @"Lorem ipsum .."; - reviewStep.reasonForConsent = @"Lorem ipsum ..."; - - // Add the content to a task and present it. - - -The review step is presented as shown in Figure 2. - -

Custom consent section (ORKConsentSectionTypeCustom object)

-

Consent review (ORKConsentReviewStep object)

-

Agreeing to the consent document (reasonForConsent property of ORKConsentReviewStep object)

-

-

Consent review name entry (signature property in ORKConsentReviewStep)

-

-

Figure 2. Review consent steps
-

- -### Consent-Sharing Step - -Apps that use the ResearchKit framework primarily collect data for a -specific study. But if you want to ask participants to share their data with other -researchers, participants must be able to control that decision. - -A consent-sharing step (`ORKConsentSharingStep`) can be used to explicitly obtain permission -to share participants' data that you have collected for your study with other researchers, if allowed by -your IRB or EC if applicable. To use a consent-sharing step, include it in a task, perhaps -just before a consent review step. - - - ORKConsentSharingStep *sharingStep = - [[ORKConsentSharingStep alloc] initWithIdentifier:kConsentSharingIdentifier - investigatorShortDescription:@"MyInstitution" - investigatorLongDescription:@"MyInstitution and its partners" - localizedLearnMoreHTMLContent:@"Lorem ipsum..."]; - - // Then include this step to a task and present with a task view controller. - - -The consent-sharing step is shown in Figure 3. - -

-
-Instruction step -
Figure 3. A consent-sharing step
-
-
- -##Create the Consent Task - -After you create the step(s), create an `ORKOrderedTask` task and add them to it. To present the task, attach your task to a task view controller and present it. - -This code snippet shows how to create a task with a visual consent step and a consent review step: - - - ORKVisualConsentStep *visualStep = - [[ORKVisualConsentStep alloc] initWithIdentifier:kVisualConsentIdentifier - document:consent]; - ORKConsentReviewStep *reviewStep = - [[ORKConsentReviewStep alloc] initWithIdentifier:kConsentReviewIdentifier - signature:consent.signatures[0] - inDocument:consent]; - // Configure the steps. - - // Create a task containing those steps. - ORKOrderedTask *task = - [[ORKOrderedTask alloc] initWithIdentifier:kConsentTaskIdentifier - steps:@[visualStep,reviewStep]]; - - ORKTaskViewController *taskViewController = - [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; - - // And then present the task view controller. - -##Generate a PDF - -The ResearchKit framework can help you generate a PDF of the signed consent form and provide it to the user. For example, your app could generate the PDF locally, write it to disk, email it to the participant, display it in the app, or send it to a server. - -To do this, first take any signature results from the completed consent review, and apply the resulting signatures to a copy of your consent document. Then, call the `makePDFWithCompletionHandler:` method of `ORKConsentDocument` as shown here. - - - ORKConsentDocument *documentCopy = [document copy]; - - ORKConsentSignatureResult *signatureResult = - (ORKConsentSignatureResult *)[[[taskViewController result] stepResultForStepIdentifier:kConsentReviewIdentifier] firstResult]; - [signatureResult applyToDocument:documentCopy]; - - [documentCopy makePDFWithCompletionHandler:^(NSData *pdfData, NSError *error) { - // Write the PDF data to disk, email it, display it, or send it to a server. - }]; - - -You can only apply a signature result to a new copy of a consent document. - -##Enhanced PDF Viewing - -Providing clear and concise material for the user to review is an important part of the data collection process. With `ORKPDFViewerStep`, the user can view a PDF in detail, perform text search, and mark up sections of the document. Other available features include viewing the pages of the PDF as thumbnails for quick perusal, printing, and saving the document. - -The various modes of this step are show in Figure 4. - -

Reviewing the document

-

Viewing the document in thumbnail mode

-

Marking up the document in markup mode

-

-

Searching the document for text

-

Sharing the document

-

-

Figure 4. PDF viewing modes
- diff --git a/docs/InformedConsent/VisualStep_Images/PDFStep_1.png b/docs/InformedConsent/VisualStep_Images/PDFStep_1.png deleted file mode 100644 index fd4f4cf588..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/PDFStep_1.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/PDFStep_2.png b/docs/InformedConsent/VisualStep_Images/PDFStep_2.png deleted file mode 100644 index f673b8bd06..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/PDFStep_2.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/PDFStep_3.png b/docs/InformedConsent/VisualStep_Images/PDFStep_3.png deleted file mode 100644 index cfcb4c94a9..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/PDFStep_3.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/PDFStep_4.png b/docs/InformedConsent/VisualStep_Images/PDFStep_4.png deleted file mode 100644 index 9a1420f80f..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/PDFStep_4.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/PDFStep_5.png b/docs/InformedConsent/VisualStep_Images/PDFStep_5.png deleted file mode 100644 index 180cf2f755..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/PDFStep_5.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/SharingConsentStep.png b/docs/InformedConsent/VisualStep_Images/SharingConsentStep.png deleted file mode 100644 index 7cd1a92b0c..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/SharingConsentStep.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_1.png b/docs/InformedConsent/VisualStep_Images/VisualStep_1.png deleted file mode 100644 index e94f10e733..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_1.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_10.png b/docs/InformedConsent/VisualStep_Images/VisualStep_10.png deleted file mode 100644 index c628555806..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_10.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_11.png b/docs/InformedConsent/VisualStep_Images/VisualStep_11.png deleted file mode 100644 index a13bc8f8f6..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_11.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_12.png b/docs/InformedConsent/VisualStep_Images/VisualStep_12.png deleted file mode 100644 index f1c841793e..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_12.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_2.png b/docs/InformedConsent/VisualStep_Images/VisualStep_2.png deleted file mode 100644 index 5e8bbc64fb..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_2.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_3.png b/docs/InformedConsent/VisualStep_Images/VisualStep_3.png deleted file mode 100644 index 57874fa4c8..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_3.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_4.png b/docs/InformedConsent/VisualStep_Images/VisualStep_4.png deleted file mode 100644 index 7917e50843..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_4.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_5.png b/docs/InformedConsent/VisualStep_Images/VisualStep_5.png deleted file mode 100644 index 88e24a2092..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_5.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_6.png b/docs/InformedConsent/VisualStep_Images/VisualStep_6.png deleted file mode 100644 index bc5c646b2e..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_6.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_7.png b/docs/InformedConsent/VisualStep_Images/VisualStep_7.png deleted file mode 100644 index 21c05f712c..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_7.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_8.png b/docs/InformedConsent/VisualStep_Images/VisualStep_8.png deleted file mode 100644 index 2726879ad0..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_8.png and /dev/null differ diff --git a/docs/InformedConsent/VisualStep_Images/VisualStep_9.png b/docs/InformedConsent/VisualStep_Images/VisualStep_9.png deleted file mode 100644 index 4f52f59142..0000000000 Binary files a/docs/InformedConsent/VisualStep_Images/VisualStep_9.png and /dev/null differ diff --git a/docs/Overview/GuideOverview-template.markdown b/docs/Overview/GuideOverview-template.markdown deleted file mode 100644 index 580a65d94b..0000000000 --- a/docs/Overview/GuideOverview-template.markdown +++ /dev/null @@ -1,95 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -#ResearchKit Framework Programming Guide - -The *ResearchKit™ framework* is an open source software framework that makes it easy for app -developers and researchers to create research apps. This new framework takes advantage of sensors -and capabilities of iPhone to track movement, take measurements, and record data. Users can perform -activities and generate data from anywhere. - -##Modules - -The *ResearchKit framework* provides three customizable modules that address some of the most -common elements of research: *surveys*, *consent*, and *active tasks*. You can use these modules as they -are, build on them, and even create completely new modules of your own. - -###Surveys - -The survey module's predefined user interface lets you quickly build surveys simply by specifying -the questions and types of answers. The survey module is already localized, so all you need to do is -to localize your questions. To learn more about surveys, see -[Creating Surveys](CreatingSurveys-template). - -###Consent - -Participants in research studies are often asked to share sensitive information as part of their -enrollment and involvement in the study. That’s why it’s critical to clarify exactly what -information will be collected from users and who will have access to their information. The -*ResearchKit framework* provides templates that you can customize to explain the details of your -study and to obtain the participant’s consent. To learn more about consent, see -[Creating a Consent Document](InformedConsent-template). - -### Active Tasks -Some studies may need more data than is provided by responses to survey questions or the data -collection capabilities of the *HealthKit* and *CoreMotion* APIs on *iOS*. Active tasks invite users -to perform activities under partially controlled conditions using iPhone sensors to actively collect -data. To learn more about active tasks, see [Active Tasks](ActiveTasks-template). - -##Tasks and Steps - -A task in the *ResearchKit framework* can be a simple ordered sequence of steps, or it can be -dynamic, with previous results informing what is presented. The task view controller supports saving -progress in the middle of a long task and restoring it later, as well as UI state restoration to -prevent data loss if the user switches out of your app in the middle of a task. - -Whether your app is giving instructions, presenting a form or survey, obtaining consent, or running -an active task, everything in the *ResearchKit framework* is a collection of steps -(`ORKStep` objects), which together form a task (an `ORKTask` object). To present a task, attach the -task to a task view controller object (`ORKTaskViewController`). When the user completes a step in a -task, the task view controller generates a step result object (`ORKStepResult`) that records the -start and end time for that step, and any results from the step. - -
ResearchKit framework Overview
- -In a simple app, you can build up your tasks directly in code, collect the results, and serialize -them to disk for later manual collection and analysis. A large-scale deployment might dynamically -download predefined surveys from a server and deserialize them to produce a *ResearchKit framework* -object hierarchy. Similarly, results from tasks can be serialized and uploaded to a server for later -analysis. - -##Current Limitations - -The *ResearchKit framework* feature list will continue to grow as useful modules are contributed by -the community. Keep in mind that the *ResearchKit framework* currently doesn’t include: - -* Background sensor data collection. APIs like *HealthKit* and *CoreMotion* on *iOS* already support - this. -* Secure communication mechanisms between your app and your server; you will need to provide this. -* The ability to schedule surveys and active tasks for your participants. -* A defined data format for how the *ResearchKit framework* structured data is serialized. All the - *ResearchKit framework* objects conform to the `NSSecureCoding` protocol, and sample code exists - protocol, and sample code exists outside the framework for - serializing objects to JSON. - -You are responsible for complying with applicable law for each -territory in which the app is made available. - -## Logging Errors and Warnings - -The *ResearchKit framework* supports four log levels, controlled by four preprocessor macros and their corresponding *`NSLog()`-like* logging macros: -* `ORK_LOG_LEVEL_NONE` -* `ORK_LOG_LEVEL_DEBUG`, `ORK_Log_Debug()` -* `ORK_LOG_LEVEL_WARNING`, `ORK_Log_Warning()` -* `ORK_LOG_LEVEL_ERROR`, `ORK_Log_Error()` - -Setting the *ResearchKit framework* `ORK_LOG_LEVEL_NONE` macro to `1` completely silences all ResearchKit logs, overriding any other specified log level. Setting `ORK_LOG_LEVEL_DEBUG`, `ORK_LOG_LEVEL_WARNING`, or `ORK_LOG_LEVEL_ERROR` to `1` enables logging at that level and at those of higher seriousness. - -If you do not explicitly set a log level, `ORK_LOG_LEVEL_WARNING=1` is used by default. - -You have to set any of these preprocessor macros in your ResearchKit subproject, not in your main project. Within *Xcode*, you can do so by setting any of them in the `Preprocessor Macros` list on the `Build Settings` of your `ResearchKit` framework target. - -See these resources if you are using ResearchKit through CocoaPods and need to change the log level: [[1]](http://stackoverflow.com/a/30038120/269753) [[2]](http://www.mokacoding.com/blog/cocoapods-and-custom-build-configurations/). - -##Digital Object Identifier for ResearchKit -The ResearchKit repository has an assigned digital object identifier (DOI), which is a persistent identifier that can be used to reference ResearchKit in academic papers. The DOI is registered on zenodo.org. See https://doi.org/10.5281/zenodo.826964 . diff --git a/docs/Overview/overview.png b/docs/Overview/overview.png deleted file mode 100644 index 2c0c6fc16a..0000000000 Binary files a/docs/Overview/overview.png and /dev/null differ diff --git a/docs/Passcode/Passcode-template.markdown b/docs/Passcode/Passcode-template.markdown deleted file mode 100644 index d0830bbd54..0000000000 --- a/docs/Passcode/Passcode-template.markdown +++ /dev/null @@ -1,140 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -# Passcode -ResearchKit apps often hold sensitive user data. In order to protect that data, your app can use Apple's Passcode technology from within ResearchKit. With Passcode, your users can provide a four or six-digit user-selected code for access or use their fingerprint via Touch ID on devices that provide that feature. - -Supporting Passcode in your app involves several operations: - - * Creation, during which the user enters their desired passcode twice—once to establish it and a second time to confirm it. - * Access, when the app requests the four-digit passcode or Touch ID after the passcode is created. - * Edit, in case the user wants to change the passcode. - * Remove, in case the user no longer wants a passcode. - -The user's keychain on the device stores the passcode. - -##Create a Passcode -The creation of a passcode starts with the creation of an `ORKPasscodeStep` object. The `ORKPasscodeStep` class inherits from the `ORKStep` class and provides step functionality that is common in ResearchKit. - -This code demonstrates how to create a passcode step using a four-digit passcode. - -First, create the step object: - - ORKPasscodeStep *passcodeStep = [[ORKPasscodeStep alloc] init]; - -Next, set the passcode type. Here, a four-digit passcode is used: - - passcodeStep.passcodeType = ORKPasscodeType4Digit; - -For additional security, consider using a six-digit passcode: - - passcodeStep.passcodeType = ORKPasscodeType6Digit; - -After the step is created, create an `ORKOrderedTask` object. Pass a string identifier as the first parameter, and the newly created passcode step (along with any additional steps for your app) into an array as the second parameter: - - ORKOrderedTask *task = [[ORKOrderedTask alloc] initWithIdentifier:@"passcodeTask" steps:@[passcodeStep]]; - -Pass the newly created task to an `ORKTaskViewController` object and set the view controller's delegate: - - ORKTaskViewController *taskViewController = [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; - taskViewController.delegate = self - -Finally, present the task view controller: - - [self presentViewController:taskViewController animated:TRUE completion:nil]; - -The user is instructed to type in a passcode twice—once for the initial passcode, and again to confirm it. Figure 1 shows the initial view. - -
-Initial passcode view -
-
Figure 1. Initial passcode view
-

- -If the confirmation fails, an alert appears indicating a mismatch. The user can then type the passcode again, as shown in Figure 2. - -

-Incorrect passcode with retry -
-
Figure 2. Incorrect passcode with retry
-

- -Upon a successful match, the step alerts the user that it has saved the passcode. The device's keychain stores the passcode. - - -##Use the Passcode to Protect Content -With the passcode set, you can protect sensitive data in your app by enforcing user confirmation. The `ORKPasscodeViewController` class is responsible for displaying the view that requires the user to enter their passcode before proceeding. Note that a passcode *must* be set prior to enforcement, or an exception occurs. - -To enforce passcode entry, use the following class method: - - ORKPasscodeViewController * passcodeViewController; - - if ([ORKPasscodeViewController isPasscodeStoredInKeychain] == YES) { - self.passcodeViewController = [ORKPasscodeViewController passcodeAuthenticationViewControllerWithText:@"Upon success, you'll go to the next step." delegate:self]; - // present the view - } else { - } - -Your class must adhere to the `ORKPasscodeDelegate` protocol in order to know whether the passcode was entered correctly or not, or if the user canceled. - -When the view is presented, the user is prompted to enter their four or six-digit passcode, as shown in Figure 3. - -

-Passcode entry -
-
Figure 3. Passcode entry
-

- - -The following method is called if the passcode was successfully entered: - - - (void)passcodeViewControllerDidFinishWithSuccess:(UIViewController *)viewController; - -You should perform any steps that would follow a successful authentication at this point. - -If the user does not input the passcode correctly, the following method is called: - - - (void)passcodeViewControllerDidFailAuthentication:(UIViewController *)viewController; - -The `passcodeViewControllerDidFailAuthentication` method gives your app the opportunity to attempt a reauthentication or rejection of additional steps going forward. - -If you want to provide a Cancel button so that the user has the option to back out of the authentication process, implement the following method: - - - (void)passcodeViewControllerDidCancel:(UIViewController *)viewController; - -The `passcodeViewControllerDidCancel` method is also called if the user taps the Cancel button. - -##Edit an Existing Passcode -Provide users the ability to conveniently edit their passcode by using the following code: - - ORKPasscodeViewController *passcodeViewController; - - if ([ORKPasscodeViewController isPasscodeStoredInKeychain] == YES) { - self.passcodeViewController = [ORKPasscodeViewController passcodeEditingViewControllerWithText:@"Choose something unique." delegate:self passcodeType:OKPasscodeType4Digit]; - // present the view - } else { - } - -When the editing view controller appears, the user is prompted to enter their old passcode, as shown in Figure 4. - -

-Old passcode entry -
-
Figure 4. Old passcode entry
-

- -If it is entered correctly, the user has the opportunity to enter a new passcode of the specified type and should enter it again to verify it. - -Note that the passcode type (four or six-digit) is passed as the last parameter to the method, allowing the user's new passcode to be of a different type than their current one. - -##Remove an Existing Passcode -At times it is necessary to know if the user has already created a passcode. The following class method on the `ORKPasscodeViewController` class returns YES or NO to indicate whether or not a passcode exists: - - + (BOOL)isPasscodeStoredInKeychain; - -You can remove the user's passcode from the keychain with the following class method on the `ORKPasscodeViewController` class: - - + (BOOL)removePasscodeFromKeychain; - -The value YES is returned if the passcode was successfully removed from the keychain. - diff --git a/docs/Passcode/Passcode.png b/docs/Passcode/Passcode.png deleted file mode 100644 index 14977a1932..0000000000 Binary files a/docs/Passcode/Passcode.png and /dev/null differ diff --git a/docs/Passcode/Passcode_ask.png b/docs/Passcode/Passcode_ask.png deleted file mode 100644 index 6ca74d928f..0000000000 Binary files a/docs/Passcode/Passcode_ask.png and /dev/null differ diff --git a/docs/Passcode/Passcode_edit.png b/docs/Passcode/Passcode_edit.png deleted file mode 100644 index a5b1dd0305..0000000000 Binary files a/docs/Passcode/Passcode_edit.png and /dev/null differ diff --git a/docs/Passcode/Passcode_retry.png b/docs/Passcode/Passcode_retry.png deleted file mode 100644 index e854064fc1..0000000000 Binary files a/docs/Passcode/Passcode_retry.png and /dev/null differ diff --git a/docs/Survey/CreatingSurveys-template.markdown b/docs/Survey/CreatingSurveys-template.markdown deleted file mode 100755 index e6cbfcb634..0000000000 --- a/docs/Survey/CreatingSurveys-template.markdown +++ /dev/null @@ -1,397 +0,0 @@ -# -These materials are for informational purposes only and do not constitute legal advice. You should contact an attorney to obtain advice with respect to the development of a research app and any applicable laws. - -# Creating Surveys - -A survey is a sequence of questions that you use to collect data from your users. In a ResearchKit app, a survey is composed of a survey task that has a collection of step objects (`ORKStep`). Each step object handles a specific question in the survey, such as "What medications are you taking?" or "How many hours did you sleep last night?". - -You can collect results for the individual steps or for the task as a whole. There are two types of survey tasks: an ordered task (`ORKOrderedTask`) and a navigable ordered task (`ORKNavigableOrderedTask`). - -In an ordered task, the order that the steps appear are always the same. -

-
-
An example of a survey that uses ordered tasks.
-
-
- -In a navigable ordered task, the order of the tasks can change, or branch out, depending on how the user answered a question in a previous task. - -
-
-
An example of a survey that uses navigable ordered tasks.
-
-
- -The steps for creating a task to present a survey are: - -1. Create one or more steps -2. Create a task -3. Collect results - -## 1. Create Steps - -The survey module provides a single-question step (`ORKQuestionStep`) -and a form step that can contain more than one item -(`ORKFormStep`). You can also use an instruction step -(`ORKInstructionStep`) or a video instruction step (`ORKVideoInstructionStep`) to introduce the survey or provide instructions. - -Every step has its own step view controller that defines the UI -presentation for that type of step. A task view controller presents the steps, instantiating and presenting the right step view -controller for the step. You can optionally customize the details of -each step view controller, such as button titles and appearance, by -implementing task view controller delegate methods (see -`ORKTaskViewControllerDelegate`). - -### Instruction Step - -An instruction step explains the purpose of a task and provides -instructions for the user. An `ORKInstructionStep` object includes an -identifier, title, text, detail text, and an image. An -instruction step does not collect any data and yields an empty -`ORKStepResult` that nonetheless records how long the instruction was -on screen. - - - ORKInstructionStep *step = - [[ORKInstructionStep alloc] initWithIdentifier:@"identifier"]; - step.title = @"Selection Survey"; - step.text = @"This survey helps us understand your eligibility for the fitness study"; - - -Creating a step as shown in the code above, including it in a task, and presenting with a task view controller, yields something like this: - -
-
-Instruction step -
Example of an instruction step.
-
-
- - -### Question Step - -A question step ([ORKQuestionStep](#)) presents a single question, -composed of a short [title]([ORKStep title]) and longer, more descriptive [text]([ORKStep text]). Configure the type of data the user can enter by setting the answer format. You can -also provide an option for the user to skip the question with the -step's [optional]([ORKStep optional]) property. - -For numeric and text answer formats, the question step's [placeholder]([ORKQuestionStep placeholder]) -property specifies a short hint that describes the expected value of -an input field. - -A question step yields a step result that, like the instruction step's -result, indicates how long the user had the question on screen. It -also has a child, an [ORKQuestionResult](#) subclass that reports the -user's answer. - -The following code configures a simple numeric question step: - - - ORKNumericAnswerFormat *format = - [ORKNumericAnswerFormat integerAnswerFormatWithUnit:@"years"]; - format.minimum = @(18); - format.maximum = @(90); - ORKQuestionStep *step = - [ORKQuestionStep questionStepWithIdentifier:kIdentifierAge - title:@"How old are you?" - answer:format]; - - -Adding this question step to a task and presenting the task produces a screen that looks like this: - -
-
-Question step -
Example of a question step.
-
-
- -### Form Step - -When your survey has several related questions, you can use a form step ([ORKFormStep](#)) to present them all on one page. Form steps support all the same answer formats as question -steps, but can contain multiple items ([ORKFormItem](#)), each with its -own answer format. - -Forms can be organized into sections by incorporating "dummy" form -items that contain only a title. See the [ORKFormItem](#) reference documentation -for more details. - -The result of a form step is similar to the result of a question step, -except that it contains one question result for each form -item. The results are matched to their corresponding form items using -their identifiers (the [identifier]([ORKFormItem identifier]) property). - -For example, the following code shows how to create a form that requests some basic details, using default values extracted from HealthKit on iOS to accelerate data entry: - - - ORKFormStep *step = - [[ORKFormStep alloc] initWithIdentifier:kFormIdentifier - title:@"Form" - text:@"Form groups multi-entry in one page"]; - NSMutableArray *items = [NSMutableArray new]; - ORKAnswerFormat *genderFormat = - [ORKHealthKitCharacteristicTypeAnswerFormat - answerFormatWithCharacteristicType: - [HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBiologicalSex]]; - [items addObject: - [[ORKFormItem alloc] initWithIdentifier:kGenderItemIdentifier - text:@"Gender" - answerFormat:genderFormat]; - - // Include a section separator - [items addObject: - [[ORKFormItem alloc] initWithSectionTitle:@"Basic Information"]]; - - ORKAnswerFormat *bloodTypeFormat = - [ORKHealthKitCharacteristicTypeAnswerFormat - answerFormatWithCharacteristicType: - [HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierBloodType]]; - [items addObject: - [[ORKFormItem alloc] initWithIdentifier:kBloodTypeItemIdentifier - text:@"Blood Type" - answerFormat:bloodTypeFormat]]; - - ORKAnswerFormat *dateOfBirthFormat = - [ORKHealthKitCharacteristicTypeAnswerFormat - answerFormatWithCharacteristicType: - [HKCharacteristicType characteristicTypeForIdentifier:HKCharacteristicTypeIdentifierDateOfBirth]]; - ORKFormItem *dateOfBirthItem = - [[ORKFormItem alloc] initWithIdentifier:kDateOfBirthItemIdentifier - text:@"DOB" - answerFormat:dateOfBirthFormat]]; - dateOfBirthItem.placeholder = @"DOB"; - dateOfBirthItem.optional = YES; - [items addObject:dateOfBirthItem]; - - // ... And so on, adding additional items - step.formItems = items; - - -The code above creates this form step: -
-
-Form step -
Example of a form step.
-
-
- -The [ORKFormItem](#) has a boolean property named `optional` which affects navigation to subsequent steps. It is set to NO by default, which requires the user to set that item before they can continue. If the property is set to YES, then the user can continue to the next step without setting the item. In the above code snippet, the `optional` property is for the `dateOfBirth` object is set to YES. This lets the user continue to the next step without entering their date of birth. - -### Answer Formats - -In the ResearchKit™ framework, an answer format defines how the user should be asked to -answer a question or an item in a form. For example, consider a -survey question such as "On a scale of 1 to 10, how much pain do you -feel?" The answer format for this question would naturally be a -discrete scale on that range, so you can use scale answer format ([ORKScaleAnswerFormat](#)), -and set its [minimum]([ORKScaleAnswerFormat minimum]) and [maximum]([ORKScaleAnswerFormat maximum]) -properties to reflect the desired range. - -The screenshots below show the standard answer formats that the ResearchKit framework provides. - -

Scale answer format

Boolean answer format

Value picker answer format

-

-

Image choice answer format

Text choice answer format (single text choice answer)

Text choice answer format (multiple text choice answer)

-

-

Numeric answer format

TimeOfTheDay answer format

Date answer format

-

-

Text answer format (unlimited text entry)

Text answer format (limited text entry)

-

Validated text answer format

-

-

Scale answer format (vertical)

-

Email answer format

-

Location answer format

-

- -In addition to the preceding answer formats, the ResearchKit framework provides -special answer formats for asking questions about quantities or -characteristics that the user might already have stored in the Health -app. When a HealthKit answer format is used, the task view controller -automatically presents a Health data access request to the user (if -they have not already granted access to your app). The presentation -details are populated automatically, and, if the user has granted -access, the field defaults to the current value retrieved from their -Health database. - -## 2. Create a Survey Task - -Once you create one or more steps, create an `ORKOrderedTask` object to -contain the steps. The code below shows a Boolean step being added to a task. - - - // Create a Boolean step to include in the task. - ORKStep *booleanStep = - [[ORKQuestionStep alloc] initWithIdentifier:kNutritionIdentifier]; - booleanStep.title = @"Do you take nutritional supplements?"; - booleanStep.answerFormat = [ORKBooleanAnswerFormat new]; - booleanStep.optional = NO; - // Create a task wrapping the boolean step. - ORKOrderedTask *task = - [[ORKOrderedTask alloc] initWithIdentifier:kTaskIdentifier - steps:@[booleanStep]]; - - -You must assign a string identifier to each step. The step identifier must be unique within the task, because it is the key that connects a step in the task hierarchy with the step result in the result hierarchy. - -To present the task, attach it to a task view controller and present -it. The code below shows how to create a task view controller and present it modally. - - - // Create a task view controller using the task and set a delegate. - ORKTaskViewController *taskViewController = - [[ORKTaskViewController alloc] initWithTask:task taskRunUUID:nil]; - taskViewController.delegate = self; - - // Present the task view controller. - [self presentViewController:taskViewController animated:YES completion:nil]; - - -*Note: `ORKOrderedTask` assumes that you will always present all the questions, -and will never decide what question to show based on previous answers. -To introduce conditional logic, you must either subclass -`ORKOrderedTask` or implement the `ORKTask` protocol yourself.* - -## 3. Collect Results - -The [result]([ORKTaskViewController result]) property of the task view controller gives you the results of the task. -Each step view controller that the user views produces a step result -([ORKStepResult](#)). The task view controller collates these results as -the user navigates through the task, in order to produce an -[ORKTaskResult](#). - -Both the task result and step result are collection results, in that -they can contain other result objects. For example, a task result -contains an array of step results. - -The results contained in a step result vary depending on the type of -step. For example, a question step produces a question result -([ORKQuestionResult](#)); a form step produces one question result for -every form item; and an active task with recorders generally produces -one result for each recorder. - -The hierarchy of results corresponds closely to the input -model hierarchy of task and steps, as you can see here: - -

-
-Completion step -
Example of a result hierarchy
-
-
-
- -Among other properties, every result has an identifier. This -identifier is what connects the result to the model object (task, -step, form item, or recorder) that produced it. Every result also -includes start and end times, using the [startDate]([ORKResult startDate]) and [endDate]([ORKResult endDate]) -properties respectively. These properties can be used to infer how long the user -spent on the step. - -### Conditional Steps - -Sometimes it's important to know the result of a step before presenting the next step. For example, suppose a step asks "Do you have a fever?" If the user answers `Yes`, the next question the next question might be "What is your temperature now?"; otherwise it might be, "Do you have any additional health concerns?" - -To add custom conditional behavior in your task, use either ordered task (`ORKOrderedTask`) or navigable ordered task (`ORKNavigableOrderedTask`), and override particular `ORKTask` methods like `stepAfterStep:withResult`, and `stepBeforeStep:withResult:` and call `super` for all other methods. - -#### Ordered Tasks - -A sequential (static) task, such as a survey or an active task, can be represented as an ordered task. - -The following example demonstrates how to subclass -`ORKOrderedTask` to provide a different set of steps depending on the -user's answer to a Boolean question. Although the code shows the step-after-step method, a corresponding implementation of "step-before-step" -is usually necessary. - - - - (ORKStep *)stepAfterStep:(ORKStep *)step - withResult:(id)result { - NSString *identifier = step.identifier; - if ([identifier isEqualToString:self.qualificationStep.identifier]) - { - ORKStepResult *stepResult = [result stepResultForStepIdentifier:identifier]; - ORKQuestionResult *result = (ORKQuestionResult *)stepResult.firstResult; - if ([result isKindOfClass:[ORKBooleanQuestionResult class]]) - { - ORKBooleanQuestionResult *booleanResult = result; - NSNumber *booleanAnswer = booleanResult.booleanAnswer; - if (booleanAnswer) - { - return booleanAnswer.boolValue ? self.regularQuestionStep : self.terminationStep; - } - } - } - return [super stepAfterStep:step withResult:result]; - } - - -#### Navigable Ordered Task -The navigable ordered task (`ORKNavigableOrderedTask`) inherits its behavior from the ordered task (`ORKOrderedTask`) class. In addition to inheriting the behavior of ordered task it provides functionality to present different set of steps depending on the user's answer to a question. - -You can add a condition while the user navigates through the steps in a task by adding a conditional step navigation. For example, add a navigation rule to obtain a new destination step when the user goes forward from one step to another. You cannot add more than one navigation rule to the same step. If you do, then the most recent rule is executed. - -For example, to display a survey question only when the user answered Yes to a previous question you can use `ORKPredicateStepNavigationRule`; or if you want to define an arbitrary jump between two steps, you can use `ORKDirectStepNavigationRule`. - -The following example demonstrates how you can add a navigation rule to go to different step in the task depending on the user's selection to the symptom type. For example, from the "symptom" step, go to "other_symptom" step when the user didn't chose headache. Otherwise, default to going to next step (the regular ordered task ([ORKOrderedTask](#)) applies). - - - ORKNavigableOrderedTask *task = [[ORKNavigableOrderedTask alloc] initWithIdentifier:StepNavigationTaskIdentifier steps:steps]; - - - // Build a navigation rule - ORKPredicateStepNavigationRule *predicateRule = nil; - - NSPredicate *predicateHeadache = [ORKResultPredicate predicateForChoiceQuestionResultWithResultIdentifier:@"symptom" expectedString:@"headache"]; - - - // The user didn't choose headache at the symptom step - NSPredicate *predicateNotHeadache = [NSCompoundPredicate notPredicateWithSubpredicate:predicateHeadache]; - - predicateRule = [[ORKPredicateStepNavigationRule alloc] initWithResultPredicates:@[ predicateNotHeadache ] - destinationStepIdentifiers:@[ @"other_symptom" ] ]; - - [task setNavigationRule:predicateRule forTriggerStepIdentifier:@"symptom"]; - - -#### Saving Results on Task Completion - -After a task is completed, you can save or upload the results. This approach -will likely include serializing the result hierarchy in some form, -either using the built-in `NSSecureCoding` support, or another -format appropriate for your application. - -If your task can produce file output, the files are generally referenced by an `ORKFileResult` object and they are placed in the output directory that you set on the task view controller. After you complete a task, one implementation might be to serialize the result hierarchy into the output directory, zip up the entire output -directory, and share it. - -In the following example, the result is archived with -`NSKeyedArchiver` on successful completion. If you choose to support -saving and restoring tasks, the user may save the task, so this -example also demonstrates how to obtain the restoration data that -would later be needed to restore the task. - - - (void)taskViewController:(ORKTaskViewController *)taskViewController - didFinishWithReason:(ORKTaskViewControllerFinishReason)reason - error:(NSError *)error - { - switch (reason) { - case ORKTaskViewControllerFinishReasonCompleted: - // Archive the result object first - NSData *data = [NSKeyedArchiver archivedDataWithRootObject:taskViewController.result]; - - // Save the data to disk with file protection - // or upload to a remote server securely. - - // If any file results are expected, also zip up the outputDirectory. - break; - case ORKTaskViewControllerFinishReasonFailed: - case ORKTaskViewControllerFinishReasonDiscarded: - // Generally, discard the result. - // Consider clearing the contents of the output directory. - break; - case ORKTaskViewControllerFinishReasonSaved: - NSData *data = [taskViewController restorationData]; - // Store the restoration data persistently for later use. - // Normally, keep the output directory for when you will restore. - break; - } - } - diff --git a/docs/Survey/SurveyImages/BooleanAnswerFormat.png b/docs/Survey/SurveyImages/BooleanAnswerFormat.png deleted file mode 100644 index 720ee662bc..0000000000 Binary files a/docs/Survey/SurveyImages/BooleanAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/DateAnswerFormat.png b/docs/Survey/SurveyImages/DateAnswerFormat.png deleted file mode 100644 index 7c030d9113..0000000000 Binary files a/docs/Survey/SurveyImages/DateAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/EmailAnswerFormat.png b/docs/Survey/SurveyImages/EmailAnswerFormat.png deleted file mode 100644 index bb098ae166..0000000000 Binary files a/docs/Survey/SurveyImages/EmailAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/FormStep.png b/docs/Survey/SurveyImages/FormStep.png deleted file mode 100644 index 46740d356e..0000000000 Binary files a/docs/Survey/SurveyImages/FormStep.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/FormStep_2.png b/docs/Survey/SurveyImages/FormStep_2.png deleted file mode 100755 index a4bbe11254..0000000000 Binary files a/docs/Survey/SurveyImages/FormStep_2.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/ImageChoiceAnswerFormat.png b/docs/Survey/SurveyImages/ImageChoiceAnswerFormat.png deleted file mode 100644 index 00b7dfdf8f..0000000000 Binary files a/docs/Survey/SurveyImages/ImageChoiceAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/InstructionStep.png b/docs/Survey/SurveyImages/InstructionStep.png deleted file mode 100644 index 2fcaf2ac66..0000000000 Binary files a/docs/Survey/SurveyImages/InstructionStep.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/LocationAnswerFormat.png b/docs/Survey/SurveyImages/LocationAnswerFormat.png deleted file mode 100644 index 5481f2aa48..0000000000 Binary files a/docs/Survey/SurveyImages/LocationAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/NumericAnswerFormat.png b/docs/Survey/SurveyImages/NumericAnswerFormat.png deleted file mode 100644 index 1f67c1916a..0000000000 Binary files a/docs/Survey/SurveyImages/NumericAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/QuestionStep.png b/docs/Survey/SurveyImages/QuestionStep.png deleted file mode 100644 index d8c5dd5aac..0000000000 Binary files a/docs/Survey/SurveyImages/QuestionStep.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/ScaleAnswerFormat.png b/docs/Survey/SurveyImages/ScaleAnswerFormat.png deleted file mode 100644 index 2fcaf2ac66..0000000000 Binary files a/docs/Survey/SurveyImages/ScaleAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/SurveyExample.png b/docs/Survey/SurveyImages/SurveyExample.png deleted file mode 100644 index 1d0ad483e6..0000000000 Binary files a/docs/Survey/SurveyImages/SurveyExample.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/SurveyIntroduction_1.png b/docs/Survey/SurveyImages/SurveyIntroduction_1.png deleted file mode 100755 index a43edb4e42..0000000000 Binary files a/docs/Survey/SurveyImages/SurveyIntroduction_1.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/SurveyIntroduction_2.png b/docs/Survey/SurveyImages/SurveyIntroduction_2.png deleted file mode 100755 index 1b7213efa3..0000000000 Binary files a/docs/Survey/SurveyImages/SurveyIntroduction_2.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/TextAnswerFormat_1.png b/docs/Survey/SurveyImages/TextAnswerFormat_1.png deleted file mode 100644 index 35d2ea5b03..0000000000 Binary files a/docs/Survey/SurveyImages/TextAnswerFormat_1.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/TextAnswerFormat_2.png b/docs/Survey/SurveyImages/TextAnswerFormat_2.png deleted file mode 100644 index f4d0900c04..0000000000 Binary files a/docs/Survey/SurveyImages/TextAnswerFormat_2.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/TextChoiceAnswerFormat_1.png b/docs/Survey/SurveyImages/TextChoiceAnswerFormat_1.png deleted file mode 100644 index 33f4769485..0000000000 Binary files a/docs/Survey/SurveyImages/TextChoiceAnswerFormat_1.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/TextChoiceAnswerFormat_2.png b/docs/Survey/SurveyImages/TextChoiceAnswerFormat_2.png deleted file mode 100644 index 93fa07936c..0000000000 Binary files a/docs/Survey/SurveyImages/TextChoiceAnswerFormat_2.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/TimeIntervalAnswerFormat.png b/docs/Survey/SurveyImages/TimeIntervalAnswerFormat.png deleted file mode 100755 index 26342c024d..0000000000 Binary files a/docs/Survey/SurveyImages/TimeIntervalAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/TimeOfTheDayAnswerFormat.png b/docs/Survey/SurveyImages/TimeOfTheDayAnswerFormat.png deleted file mode 100644 index 70f7c499a9..0000000000 Binary files a/docs/Survey/SurveyImages/TimeOfTheDayAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/ValidatedTextAnswerFormat.png b/docs/Survey/SurveyImages/ValidatedTextAnswerFormat.png deleted file mode 100644 index 06be54fd85..0000000000 Binary files a/docs/Survey/SurveyImages/ValidatedTextAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/ValuePickerAnswerFormat.png b/docs/Survey/SurveyImages/ValuePickerAnswerFormat.png deleted file mode 100644 index 9c5888a270..0000000000 Binary files a/docs/Survey/SurveyImages/ValuePickerAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/VerticalSliderAnswerFormat.png b/docs/Survey/SurveyImages/VerticalSliderAnswerFormat.png deleted file mode 100644 index e737207c26..0000000000 Binary files a/docs/Survey/SurveyImages/VerticalSliderAnswerFormat.png and /dev/null differ diff --git a/docs/Survey/SurveyImages/video_1.png b/docs/Survey/SurveyImages/video_1.png deleted file mode 100644 index 245fd1b632..0000000000 Binary files a/docs/Survey/SurveyImages/video_1.png and /dev/null differ diff --git a/docs/index-template.md b/docs/index-template.md deleted file mode 100644 index 3f9cd4a6b0..0000000000 --- a/docs/index-template.md +++ /dev/null @@ -1,55 +0,0 @@ -The ResearchKit™ framework is an open source framework that developers and researchers can use to create apps that let iOS users participate in medical research. - -This is the API documentation for the ResearchKit framework. For an overview of framework and a more general guide to using and extending the framework, see the [Programming Guide](GuideOverview). - - -Constructing Tasks --------------------- - -ResearchKit tasks are actions to be performed by participants in a research study. Tasks are the building blocks for ResearchKit modules, which address the most common components of medical studies: surveys, consent documents, and active tasks. - -Tasks are constructed using a hierarchy of model objects. -At the root of the hierarchy is an ORKOrderedTask object (or another object that implements the ORKTask protocol). The task defines the order in which steps are presented, and how progress through the task is represented. - -A task consists of steps, which are subclasses of ORKStep. Most steps are designed for data presentation or data entry, but the ORKActiveStep subclasses can also enable data collection. -The ORKQuestionStep and ORKFormStep survey step classes describe a question to be asked. The format of the answer is modeled with subclasses of ORKAnswerFormat. - - -Presenting Tasks --------------------- - -To present a task, you create an ORKTaskViewController object and give it the task. The task view controller manages the task and returns the result through delegate methods. - -For each step, ORKTaskViewController instantiates an appropriate subclass of ORKStepViewController to display the step. - - -Getting Results --------------------- - -The `result` property of ORKTaskViewController provides the results of the task, both while the task is in progress, and upon completion of the task. - -Results are constructed with a hierarchy that’s similar to the task model hierarchy. In the hierarchy for a result, ORKTaskResult is the root and ORKStepResult objects form the immediate children. - -For survey question steps, the answers collected are reported as ORKQuestionResult objects, which are children of ORKStepResult. Active steps may include additional result objects as children, depending on the types of data that are recorded. To help you get data from various device features, such as the accelerometer or HealthKit, the ResearchKit framework provides the ORKRecorder and ORKRecorderConfiguration classes, which work together to collect and configure data into a serialized format during the duration of an active step. - - -Predefined Active Tasks --------------------- - -An active task invites users to perform activities under semi-controlled conditions, while iPhone sensors actively collect data. A category on ORKOrderedTask provides factory methods for generating ORKOrderedTask instances that correspond to ResearchKit's predefined active tasks, such as the short walk or fitness task. - - -Consent --------------------- - -The consent features in the ResearchKit framework are implemented using three special steps that can be added to tasks: - -* ORKVisualConsentStep. The visual consent step presents a series of simple graphics to help participants understand the content of an consent document. The default graphics have animated transitions. - -* ORKConsentSharingStep. The consent sharing step has predefined transitions that can be used to establish user preferences regarding how widely personal data can be shared. - -* ORKConsentReviewStep. The consent review step makes the consent document available for review, and provides facilities for collecting the user's name and signature. - -Creating the visual consent step and the consent review step requires a consent document model (that is, an ORKConsentDocument object). - -In addition to the consent steps, `ORKPDFViewerStep` displays a PDF document. The user can search, marked up, and share the PDF document from within the step. diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Info.plist b/docs/org.researchkit.ResearchKit.docset/Contents/Info.plist deleted file mode 100644 index 543fb434cc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleIdentifier - org.researchkit.ResearchKit - CFBundleName - ResearchKit Documentation - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - - - - - DocSetFeedName - ResearchKit Documentation - - DocSetMinimumXcodeVersion - 3.0 - - DashDocSetFamily - appledoc - DocSetPublisherIdentifier - org.researchkit.documentation - DocSetPublisherName - ResearchKit - NSHumanReadableCopyright - Copyright © 2018 ResearchKit. All rights reserved. - - diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKActiveStepTimerHandler.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKActiveStepTimerHandler.html deleted file mode 100644 index d4bb57e145..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKActiveStepTimerHandler.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - ORKActiveStepTimerHandler Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKActiveStepTimerHandler Block Reference

- - -
- - - - -
Declared inORKActiveStepTimer.h
- - - - - - - - - - -

Block Definition

-

ORKActiveStepTimerHandler

- - -typedef void (^ORKActiveStepTimerHandler) (ORKActiveStepTimer *timer, BOOL finished) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKOperationBlock.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKOperationBlock.html deleted file mode 100644 index a0c26ca971..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKOperationBlock.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - ORKOperationBlock Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKOperationBlock Block Reference

- - -
- - - - -
Declared inORKOperation.h
- - - - - - - - - - -

Block Definition

-

ORKOperationBlock

- - -typedef void (^ORKOperationBlock) (ORKOperation *operation) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKVisualConsentAnimationCompletionHandler.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKVisualConsentAnimationCompletionHandler.html deleted file mode 100644 index 104dda9abf..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ORKVisualConsentAnimationCompletionHandler.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - ORKVisualConsentAnimationCompletionHandler Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVisualConsentAnimationCompletionHandler Block Reference

- - -
- - - - -
Declared inORKVisualConsentTransitionAnimator.h
- - - - - - - - - - -

Block Definition

-

ORKVisualConsentAnimationCompletionHandler

- - -typedef void (^ORKVisualConsentAnimationCompletionHandler) (ORKVisualConsentTransitionAnimator *animator, UIPageViewControllerNavigationDirection direction) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ShouldPresentStepBlockType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ShouldPresentStepBlockType.html deleted file mode 100644 index ad61e06771..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/ShouldPresentStepBlockType.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - ShouldPresentStepBlockType Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ShouldPresentStepBlockType Block Reference

- - -
- - - - -
Declared inTaskFactory.h
- - - - - - - - - - -

Block Definition

-

ShouldPresentStepBlockType

- - -typedef BOOL (^ShouldPresentStepBlockType) (ORKTaskViewController *taskViewController, ORKStep *step) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/StepViewControllerWillAppearBlockType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/StepViewControllerWillAppearBlockType.html deleted file mode 100644 index 2007b7e3df..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/StepViewControllerWillAppearBlockType.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - StepViewControllerWillAppearBlockType Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

StepViewControllerWillAppearBlockType Block Reference

- - -
- - - - -
Declared inTaskFactory.h
- - - - - - - - - - -

Block Definition

-

StepViewControllerWillAppearBlockType

- - -typedef void (^StepViewControllerWillAppearBlockType) (ORKTaskViewController *taskViewController, ORKStepViewController *stepViewController) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/StepViewControllerWillDisappearBlockType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/StepViewControllerWillDisappearBlockType.html deleted file mode 100644 index 936fa02155..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/StepViewControllerWillDisappearBlockType.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - StepViewControllerWillDisappearBlockType Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

StepViewControllerWillDisappearBlockType Block Reference

- - -
- - - - -
Declared inTaskFactory.h
- - - - - - - - - - -

Block Definition

-

StepViewControllerWillDisappearBlockType

- - -typedef void (^StepViewControllerWillDisappearBlockType) (ORKTaskViewController *taskViewController, ORKStepViewController *stepViewController, ORKStepViewControllerNavigationDirection navigationDirection) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/_ORKLocationAuthorizationRequestHandler.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/_ORKLocationAuthorizationRequestHandler.html deleted file mode 100644 index 4ff8fb046c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/_ORKLocationAuthorizationRequestHandler.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - _ORKLocationAuthorizationRequestHandler Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

_ORKLocationAuthorizationRequestHandler Block Reference

- - -
- - - - -
Declared inORKTaskViewController.m
- - - - - - - - - - -

Block Definition

-

_ORKLocationAuthorizationRequestHandler

- - -typedef void (^_ORKLocationAuthorizationRequestHandler) (BOOL success) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/_ORKStateHandler.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/_ORKStateHandler.html deleted file mode 100644 index 36db8f741b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Blocks/_ORKStateHandler.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - _ORKStateHandler Block Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

_ORKStateHandler Block Reference

- - -
- - - - -
Declared inORKSpatialSpanMemoryStepViewController.m
- - - - - - - - - - -

Block Definition

-

_ORKStateHandler

- - -typedef void (^_ORKStateHandler) (ORKState *fromState, ORKState *_toState, id context) - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKAnchoredObjectQuery+iOS8.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKAnchoredObjectQuery+iOS8.html deleted file mode 100644 index 1a0394cab1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKAnchoredObjectQuery+iOS8.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - HKAnchoredObjectQuery(iOS8) Category Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

HKAnchoredObjectQuery(iOS8) Category Reference

- - -
- - - - -
Declared inORKHealthQuantityTypeRecorder.m
- - - - -
- -

Overview

-

Add a protocol defining the initializer for iOS 8 apps. This signature was deprecated in iOS 9 -and deleted in iOS 10.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKCorrelation+ORKJSONDictionary.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKCorrelation+ORKJSONDictionary.html deleted file mode 100644 index e9bb237e5c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKCorrelation+ORKJSONDictionary.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - HKCorrelation(ORKJSONDictionary) Category Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

HKCorrelation(ORKJSONDictionary) Category Reference

- - -
- - - - -
Declared inHKSample+ORKJSONDictionary.h
HKSample+ORKJSONDictionary.m
- - - - -
- -

Overview

-

JSON serialization aid for HKCorrelation.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKSample+ORKJSONDictionary.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKSample+ORKJSONDictionary.html deleted file mode 100644 index f08c5521fb..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKSample+ORKJSONDictionary.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - HKSample(ORKJSONDictionary) Category Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

HKSample(ORKJSONDictionary) Category Reference

- - -
- - - - -
Declared inHKSample+ORKJSONDictionary.h
HKSample+ORKJSONDictionary.m
- - - - -
- -

Overview

-

JSON serialization aid for HKSample.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKUnit+ORKLocalized.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKUnit+ORKLocalized.html deleted file mode 100644 index f75dc52bb1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/HKUnit+ORKLocalized.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - HKUnit(ORKLocalized) Category Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

HKUnit(ORKLocalized) Category Reference

- - -
- - - - -
Declared inORKHealthAnswerFormat.h
ORKHealthAnswerFormat.m
- - - - - - -
- - - - - - -
-
- -

– localizedUnitString -

- -
-
- -
- - -
-

Returns the localized string for the unit (if available)

-
- - - -
- (NSString *)localizedUnitString
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/UIColor+ORKColor.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/UIColor+ORKColor.html deleted file mode 100644 index f687180dca..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Categories/UIColor+ORKColor.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - UIColor(ORKColor) Category Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

UIColor(ORKColor) Category Reference

- - -
- - - - -
Declared inORKSkin.h
ORKSkin.m
- - - - -
- -

Overview

-

Modify the color for a specified ORK…ColorKey. (for customization)

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/DragonPokerStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/DragonPokerStep.html deleted file mode 100644 index 3d28efbea9..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/DragonPokerStep.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - DragonPokerStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

DragonPokerStep Class Reference

- - -
- - - - - - - -
Inherits fromORKFormStep : ORKStep : NSObject
Declared inDragonPokerStep.h
DragonPokerStep.m
- - - - -
- -

Overview

-

Example implementation of an override of the class method instantiateStepViewControllerWithResult: -In this example, only show the cancel button on Tuesdays

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– instantiateStepViewControllerWithResult: -

- -
-
- -
- - -
-

Instantiates a step view controller for this class.

-
- - - -
- (ORKStepViewController *)instantiateStepViewControllerWithResult:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - -
result

The result associated with this step

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - -
-

Discussion

-

This method is called when a step is about to be presented. The default implementation returns -a view controller that is appropriate to this step by allocating an instance of ORKStepViewController -using the stepViewControllerClass method and initializing that instance by calling initWithIdentifier:result: -on the provided ORKStepViewController class instance.

- -

Override this method if you need to customize the behavior before presenting the step or if -the view controller is presented using a nib or storyboard.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/DynamicTask.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/DynamicTask.html deleted file mode 100644 index ede14ebe38..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/DynamicTask.html +++ /dev/null @@ -1,269 +0,0 @@ - - - - - - DynamicTask Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

DynamicTask Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toORKTask
Declared inDynamicTask.h
DynamicTask.m
- - - - - - -
- - - - - - -
-
- -

– identifier -

- -
-
- -
- - -
-

The unique identifier for this task.

-
- - - -
- (NSString *)identifier
- - - - - - - - - -
-

Discussion

-

The identifier should be a short string that identifies the task. The identifier is copied -into the ORKTaskResult objects generated by the task view controller for this -task. You can use a human-readable string for the task identifier -or a UUID; the exact string you use depends on your app.

- -

In the case of apps whose tasks come from a server, the unique -identifier for the task may be in an external database.

- -

The task view controller uses the identifier when constructing the task result. -The identifier can also be used during UI state restoration to identify the -task that needs to be restored.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepAfterStep:withResult: -

- -
-
- -
- - - - -
- (ORKStep *)stepAfterStep:(ORKStep *)step withResult:(id<ORKTaskResultSource>)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepBeforeStep:withResult: -

- -
-
- -
- - - - -
- (ORKStep *)stepBeforeStep:(ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/LoginViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/LoginViewController.html deleted file mode 100644 index 042c8be0a2..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/LoginViewController.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - LoginViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

LoginViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKLoginStepViewController : ORKFormStepViewController : ORKStepViewController : UIViewController
Declared inTaskFactory+Onboarding.m
- - - - -
- -

Overview

-

A subclass is required for the login step.

- -

The implementation below demonstrates how to subclass and override button actions.

-
- - - - - -
- - - - - - -
-
- -

– forgotPasswordButtonTapped -

- -
-
- -
- - -
-

Action method for the forgot password button.

-
- - - -
- (void)forgotPasswordButtonTapped
- - - - - - - - - -
-

Discussion

-

The forgot password button is shown in place of the skip button. -Override this method to provide custom logic for the button action.

-
- - - - - - - -
-

Declared In

-

ORKLoginStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/MainViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/MainViewController.html deleted file mode 100644 index f6cb98418f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/MainViewController.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - MainViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

MainViewController Class Reference

- - -
- - - - - - - -
Inherits fromUIViewController
Declared inMainViewController.h
MainViewController.m
- - - - - - -
- - - - - - -
-
- -

– taskViewController:didChangeResult: -

- -
-
- -
- - -
-

When a task has completed it calls this method to post the result of the task to the delegate.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController didChangeResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

MainViewController.m

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAccelerometerRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAccelerometerRecorder.html deleted file mode 100644 index 517e0bb939..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAccelerometerRecorder.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - - ORKAccelerometerRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAccelerometerRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKAccelerometerRecorder.h
ORKAccelerometerRecorder.m
- - - - -
- -

Overview

-

The ORKAccelerometerRecorder class represents a recorder that requests and collects raw accelerometer data from CoreMotion at a fixed frequency.

- -

The accelerometer recorder continues to record when the application enters the -background by using the background task support provided by UIApplication.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:frequency:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized accelerometer recorder using the specified frequency.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier frequency:(double)frequency step:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

frequency

The frequency of accelerometer data collected from CoreMotion, in hertz (Hz).

step

The step that requested this recorder.

outputDirectory

The directory in which the accelerometer data should be stored.

-
- - - -
-

Return Value

-

An initialized accelerometer recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAccelerometerRecorder.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  frequency -

- -
-
- -
- - -
-

The frequency of accelerometer data collected from CoreMotion, in hertz (Hz).

-
- - - -
@property (nonatomic, readonly) double frequency
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAccelerometerRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAccelerometerRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAccelerometerRecorderConfiguration.html deleted file mode 100644 index c1055cb23a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAccelerometerRecorderConfiguration.html +++ /dev/null @@ -1,511 +0,0 @@ - - - - - - ORKAccelerometerRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAccelerometerRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKAccelerometerRecorder.m
ORKRecorder.h
- - - - -
- -

Overview

-

The ORKAccelerometerRecorderConfiguration subclass configures -the collection of accelerometer data during an active step.

- -

Accelerometer data is serialized to JSON and returned as an ORKFileResult object. -For details on the format, see CMAccelerometerData+ORKJSONDictionary.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– initWithIdentifier:frequency: -

- -
-
- -
- - -
-

Returns an initialized accelerometer recorder configuration using the specified frequency.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier frequency:(double)frequency
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier of the recorder configuration.

frequency

The frequency of accelerometer data collection in samples per second (Hz).

-
- - - -
-

Return Value

-

An initialized accelerometer recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new accelerometer recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the accelerometer recorder configuration.

-
- - - -
-

Return Value

-

A new accelerometer recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedPermissionMask -

- -
-
- -
- - -
-

Returns the permission mask indicating the permissions required for this configuration.

-
- - - -
- (ORKPermissionMask)requestedPermissionMask
- - - - - - - - - -
-

Discussion

-

This method is typically overridden in new recorder configuration subclasses.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  frequency -

- -
-
- -
- - -
-

The frequency of accelerometer data collection in samples per second (Hz).

-
- - - -
@property (nonatomic, readonly) double frequency
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKActiveStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKActiveStep.html deleted file mode 100644 index 38cef9aa53..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKActiveStep.html +++ /dev/null @@ -1,1217 +0,0 @@ - - - - - - ORKActiveStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKActiveStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKActiveStep.h
ORKActiveStep.m
- - - - -
- -

Overview

-

The ORKActiveStep class is the base class for steps in active tasks, which -are steps that collect sensor data in a semi-controlled environment, as opposed -to the purely passive data collection enabled by HealthKit, or the more subjective data -collected when users fill in surveys.

- -

In addition to the behaviors of ORKStep, active steps have the concept of -life cycle, which includes a defined start and finish.

- -

The ResearchKit framework provides built-in behaviors that allow active steps to play voice prompts, speak a count down, and have a -defined duration.

- -

To present an active step in your app, it’s likely that you will subclass ORKActiveStep and -ORKActiveStepViewController to present custom UI and custom -prompts. For example subclasses, see ORKSpatialSpanMemoryStep or ORKFitnessStep. -Active steps may also need ORKResult subclasses to record their results -if these don’t come purely from recorders.

- -

If you develop a new active step subclass, consider contributing your -code to the ResearchKit project so that it’s available for others to use in -their studies.

- -

See also: ORKActiveStepViewController

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  stepDuration -

- -
-
- -
- - -
-

The duration of the step in seconds.

-
- - - -
@property (nonatomic) NSTimeInterval stepDuration
- - - - - - - - - -
-

Discussion

-

If the step duration is greater than zero, a built-in timer starts when the -step starts. If shouldStartTimerAutomatically is set, the timer -starts when the step’s view appears. When the timer expires, a sound or -vibration may be played. If shouldContinueOnFinish is set, the step -automatically navigates forward when the timer expires.

- -

The default value of this property is 0, which disables the built-in timer.

- -

See also: ORKActiveStepViewController

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldShowDefaultTimer -

- -
-
- -
- - -
-

A Boolean value indicating whether to show a view with a default timer.

-
- - - -
@property (nonatomic) BOOL shouldShowDefaultTimer
- - - - - - - - - -
-

Discussion

-

The default timer UI is not used in any of the current predefined tasks, -but it can be displayed in a simple active task that does not require custom -UI and needs only a count down timer on screen during data collection.

- -

Note that this property is ignored if stepDuration is 0.

- -

The default value of this property is YES.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldSpeakCountDown -

- -
-
- -
- - -
-

A Boolean value indicating whether to speak the last few seconds in the count down of the -duration of a timed step.

-
- - - -
@property (nonatomic) BOOL shouldSpeakCountDown
- - - - - - - - - -
-

Discussion

-

When the value of this property is YES, AVSpeechSynthesizer is used to synthesize the countdown. Note that this property is ignored if VoiceOver is enabled.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldSpeakRemainingTimeAtHalfway -

- -
-
- -
- - -
-

A Boolean value indicating whether to speak the halfway point in the count down of the -duration of a timed step.

-
- - - -
@property (nonatomic) BOOL shouldSpeakRemainingTimeAtHalfway
- - - - - - - - - -
-

Discussion

-

When the value of this property is YES, AVSpeechSynthesizer is used to synthesize the countdown. Note that this property is ignored if VoiceOver is enabled.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldStartTimerAutomatically -

- -
-
- -
- - -
-

A Boolean value indicating whether to start the count down timer automatically when the step starts, or -require the user to take some explicit action to start the step, such as tapping a button.

-
- - - -
@property (nonatomic) BOOL shouldStartTimerAutomatically
- - - - - - - - - -
-

Discussion

-

Usually the explicit action needs to come from custom UI in an -ORKActiveStepViewController subclass.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldPlaySoundOnStart -

- -
-
- -
- - -
-

A Boolean value indicating whether to play a default sound when the step starts.

-
- - - -
@property (nonatomic) BOOL shouldPlaySoundOnStart
- - - - - - - - - -
-

Discussion

-

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldPlaySoundOnFinish -

- -
-
- -
- - -
-

A Boolean value indicating whether to play a default sound when the step finishes.

-
- - - -
@property (nonatomic) BOOL shouldPlaySoundOnFinish
- - - - - - - - - -
-

Discussion

-

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldVibrateOnStart -

- -
-
- -
- - -
-

A Boolean value indicating whether to vibrate when the step starts.

-
- - - -
@property (nonatomic) BOOL shouldVibrateOnStart
- - - - - - - - - -
-

Discussion

-

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldVibrateOnFinish -

- -
-
- -
- - -
-

A Boolean value indicating whether to vibrate when the step finishes.

-
- - - -
@property (nonatomic) BOOL shouldVibrateOnFinish
- - - - - - - - - -
-

Discussion

-

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldUseNextAsSkipButton -

- -
-
- -
- - -
-

A Boolean value indicating whether the Next button should double as a skip action before -the step finishes.

-
- - - -
@property (nonatomic) BOOL shouldUseNextAsSkipButton
- - - - - - - - - -
-

Discussion

-

When the value of this property is YES, the ResearchKit framework hides the skip button and makes the Next button function as a skip button when the step has not yet finished.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  shouldContinueOnFinish -

- -
-
- -
- - -
-

A Boolean value indicating whether to transition automatically when the step finishes.

-
- - - -
@property (nonatomic) BOOL shouldContinueOnFinish
- - - - - - - - - -
-

Discussion

-

When the value of this property is YES, the active step view controller automatically performs the -continue action when the [ORKActiveStepViewController finish] method -is called.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  spokenInstruction -

- -
-
- -
- - -
-

Localized text that represents an instructional voice prompt.

-
- - - -
@property (nonatomic, copy, nullable) NSString *spokenInstruction
- - - - - - - - - -
-

Discussion

-

Instructional speech begins when the step starts. If VoiceOver is active, -the instruction is spoken by VoiceOver.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  finishedSpokenInstruction -

- -
-
- -
- - -
-

Localized text that represents an instructional voice prompt for when the step finishes.

-
- - - -
@property (nonatomic, copy, nullable) NSString *finishedSpokenInstruction
- - - - - - - - - -
-

Discussion

-

Instructional speech begins when the step finishes. If VoiceOver is active, -the instruction is spoken by VoiceOver.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  image -

- -
-
- -
- - -
-

An image to be displayed below the instructions for the step.

-
- - - -
@property (nonatomic, strong, nullable) UIImage *image
- - - - - - - - - -
-

Discussion

-

The image can be stretched to fit the available space. When choosing a size -for this asset, be sure to take into account the variations in device form factors.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

  recorderConfigurations -

- -
-
- -
- - -
-

An array of recorder configurations that define the parameters for recorders to be -run during a step to collect sensor or other data.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKRecorderConfiguration*> *recorderConfigurations
- - - - - - - - - -
-

Discussion

-

If you want to collect data from sensors while the step is in progress, -add one or more recorder configurations to the array. The active step view -controller instantiates recorders and collates their results as children -of the step result.

- -

The set of recorder configurations is scanned when populating the -requestedHealthKitTypesForReading and requestedPermissions properties.

- -

See also: ORKRecorderConfiguration and ORKRecorder.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– isRestorable -

- -
-
- -
- - -
-

A Boolean value indicating whether a task can be restored to the step -during state restoration. (read-only)

-
- - - -
- (BOOL)isRestorable
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is YES, but subclasses of ORKStep might use NO.

- -

If a task cannot be restored to the step, the task is typically restored to the -last restorable step in the task, or to the first step, if -no restorable steps are available.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

The set of HealthKit types the step requests for reading. (read-only)

-
- - - -
- (NSSet<HKObjectType*> *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

The task view controller uses this set of types when constructing a list of -all the HealthKit types required by all the steps in a task, so that it can -present the HealthKit access dialog just once during that task.

- -

By default, the property scans the recorders and collates the HealthKit -types the recorders require. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– requestedPermissions -

- -
-
- -
- - -
-

The set of access permissions required for the step. (read-only)

-
- - - -
- (ORKPermissionMask)requestedPermissions
- - - - - - - - - -
-

Discussion

-

The permission mask is used by the task view controller to determine the types of -access to request from users when they complete the initial instruction steps -in a task. If your step requires access to APIs that limit access, include -the permissions you require in this mask.

- -

By default, the property scans the recorders and collates the permissions -required by the recorders. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKActiveStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKActiveStepViewController.html deleted file mode 100644 index 36566a3df3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKActiveStepViewController.html +++ /dev/null @@ -1,1360 +0,0 @@ - - - - - - ORKActiveStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKActiveStepViewController Class Reference

- - -
- - - - - - - - - - -
Inherits fromORKStepViewController : UIViewController
Conforms toORKRecorderDelegate
Declared inORKActiveStepViewController.h
ORKActiveStepViewController.m
- - - - -
- -

Overview

-

The ORKActiveStepViewController class is the base class for displaying ORKActiveStep -subclasses. The predefined active tasks defined in ORKOrderedTask all make use -of subclasses of ORKActiveStep, paired with ORKActiveStepViewController -subclasses.

- -

An active step view controller is typically instantiated by a task view controller -when it encounters an active step in a task. Active steps generally include some form of sensor-driven data collection, or involve some highly interactive content, such as a cognitive task or game.

- -

Examples of active step view controller subclasses include ORKWalkingTaskStepViewController, -ORKCountdownStepViewController, ORKSpatialSpanMemoryStepViewController, -ORKFitnessStepViewController, and ORKAudioStepViewController.

- -

The primary feature that active step view controllers enable is life cycle. After an active step is presented, it can be started to start a timer. When the timer expires, the -step is considered finished. Some steps may have the concept of suspend and resume, such as when -the app is put in the background, and during which data recording is temporarily paused. -These life cycle methods generally apply to any recorders being used to record -data from the device’s sensors, but they should also be applied to any UI -being displayed to clearly indicate when data is being collected -for the task.

- -

When you develop a new active step, you should subclass ORKActiveStepViewController -and define your specific UI. When subclassing, pay special attention to the life cycle -methods, start, finish, suspend, and resume. Also, be sure to test for -the expected behavior when the user suspends and resumes the app, during task -save and restore, and during UIKit’s UI state restoration.

- -

See also: ORKActiveStep.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– imageView -

- -
-
- -
- - -
-

The image view for the active step. (read-only)

-
- - - -
- (ORKTintedImageView *)imageView
- - - - - - - - - -
-

Discussion

-

The image view is created on demand when this property is accessed, and is a -shortcut to display an image in the custom area of an active task (that is, instead of -using customView).

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– recordersDidChange -

- -
-
- -
- - -
-

Tells the view controller that the set of recorders changed.

-
- - - -
- (void)recordersDidChange
- - - - - - - - - -
-

Discussion

-

This method is usually called by the active step view controller in response -to start or resume.

- -

Subclasses may override this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– recordersWillStart -

- -
-
- -
- - -
-

Tells the view controller that the recorders are about to start.

-
- - - -
- (void)recordersWillStart
- - - - - - - - - -
-

Discussion

-

This method is called by the active step view controller after instantiating -the recorders, but before starting them.

- -

Subclasses may override this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– recordersWillStop -

- -
-
- -
- - -
-

Tells the view controller that the recorders are about to stop.

-
- - - -
- (void)recordersWillStop
- - - - - - - - - -
-

Discussion

-

This method is called by the active step view controller before -stopping the recorders.

- -

Subclasses may override this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– prepareStep -

- -
-
- -
- - -
-

Tells the view controller that the step has been loaded and is about to start.

-
- - - -
- (void)prepareStep
- - - - - - - - - -
-

Discussion

-

This method is called by the active step view controller just after the step -has been set. The base implementation instantiates the recorders and timer but -does not start them.

- -

Subclasses may override this method, but must also call super.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– suspend -

- -
-
- -
- - -
-

Suspends the active step.

-
- - - -
- (void)suspend
- - - - - - - - - -
-

Discussion

-

Call this method to suspend data recording and the step’s timer.

- -

This method may called automatically when the app is suspended. -The view controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– resume -

- -
-
- -
- - -
-

Resumes the active step.

-
- - - -
- (void)resume
- - - - - - - - - -
-

Discussion

-

Call this method when the step should be resumed. Calls to this method should -be paired with previous calls to suspend.

- -

This method may be called automatically when the app is resumed. The view -controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

When the step is resumed, the UI should resume at the point where the user left off, -or, if that does not make sense for the particular step, to the most recent -suitable point.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– finish -

- -
-
- -
- - -
-

Finishes the active step.

-
- - - -
- (void)finish
- - - - - - - - - -
-

Discussion

-

Call this method to finish the active step. If the active step is configured with -a timer, this method is called automatically when the timer expires.

- -

Finishing the active step stops all data recording and stops any timers. In steps that have the -shouldContinueOnFinish property set, forward navigation to the next step -may ensue.

- -

This method does nothing if the step has already finished.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– recorder:didCompleteWithResult: -

- -
-
- -
- - -
-

Tells the delegate that the recorder has completed with the specified result.

-
- - - -
- (void)recorder:(ORKRecorder *)recorder didCompleteWithResult:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
recorder

The generating recorder object.

result

The generated result.

-
- - - - - - - -
-

Discussion

-

Typically, this method is called once when recording is stopped.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorder:didFailWithError: -

- -
-
- -
- - -
-

Tells the delegate that recording failed.

-
- - - -
- (void)recorder:(ORKRecorder *)recorder didFailWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
recorder

The generating recorder object.

error

The error that occurred.

-
- - - - - - - -
-

Discussion

-

Typically, this method is called once when the error occurred.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- - - -

UI Customization

- -
-
- -

  customView -

- -
-
- -
- - -
-

The custom view for the active step.

-
- - - -
@property (nonatomic, strong, nullable) UIView *customView
- - - - - - - - - -
-

Discussion

-

Attach a custom view here, and implement sizeThatFits: or -use intrinsicContentSize or provide constraints that request the size needed for -the custom view within the active step’s layout.

- -

Custom views can be used for visual instructions with animation, -or for getting interactive input.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- - - -

Data collection

- -
-
- -

  recorders -

- -
-
- -
- - -
-

The array of recorders currently in use by the active step. (read-only)

-
- - - -
@property (nonatomic, strong, readonly, nullable) NSArray *recorders
- - - - - - - - - -
-

Discussion

-

Recorders are generated when the step starts, based on the recorder -configurations of the step. Each recorder is an instance of ORKRecorder, and -is created by the active step view controller using the array of recorder -configurations in the step.

- -

See also: ORKRecorderConfiguration and ORKActiveStep.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- - - -

Active step life cycle

- -
-
- -

  finished -

- -
-
- -
- - -
-

A Boolean value that indicates whether the step has finished. (read-only)

-
- - - -
@property (nonatomic, assign, readonly, getter=isFinished) BOOL finished
- - - - - - - - - -
-

Discussion

-

If the step is considered finished, the Continue button is enabled and the Skip -button is hidden. When the step is not finished, the Continue button is disabled and the Skip -button is visible.

- -

In addition, when a step is finished, all recorders are stopped.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

  started -

- -
-
- -
- - -
-

A Boolean value that indicates whether the step has started. (read-only)

-
- - - -
@property (nonatomic, assign, readonly, getter=isStarted) BOOL started
- - - - - - - - - -
-

Discussion

-

If the step has not yet started, recorders are not yet running, and time -is not counted against the duration of the step.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

  suspendIfInactive -

- -
-
- -
- - -
-

A Boolean value that indicates whether to suspend the step if the app is not -active or the screen is off.

-
- - - -
@property (nonatomic, assign) BOOL suspendIfInactive
- - - - - - - - - -
-

Discussion

-

Active steps that require the screen in order to work should suspend -recording when the app goes into the background. Other active steps require -the step to continue while the app is in the background. For example, the fitness check -active step continues to collect data while the screen is off, and continues -to give voice prompts.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- - - -

Extension Methods

- -
-
- -

  customViewContainer -

- -
-
- -
- - -
-

The customViewContainer allows custom view to be its subview.

-
- - - -
@property (nonatomic, strong, readonly, nullable) UIView *customViewContainer
- - - - - - - - - -
-

Discussion

-

Note: When ORKTouchRecorder is present, its gesture recognizer attaches to customViewContainer.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController_Internal.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridResult.html deleted file mode 100644 index 758d99d953..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridResult.html +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - ORKAmslerGridResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAmslerGridResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKAmslerGridResult.h
ORKAmslerGridResult.m
- - - - -
- -

Overview

-

The ORKAmslerGridResult class represents the result of a successful attempt of ORKAmslerGridStep.

- -

An amsler grid result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize the sample for transmission to a server or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  eyeSide -

- -
-
- -
- - -
-

Eye side closed.

-
- - - -
@property (nonatomic) ORKAmslerGridEyeSide eyeSide
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAmslerGridResult.h

-
- - -
-
-
- -

  image -

- -
-
- -
- - -
-

The image for the step.

-
- - - -
@property (nonatomic, nullable) UIImage *image
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAmslerGridResult.h

-
- - -
-
-
- -

  path -

- -
-
- -
- - -
-

The path used to mark the area in the image.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<UIBezierPath*> *path
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAmslerGridResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridStep.html deleted file mode 100644 index 4b89108d6c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridStep.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - ORKAmslerGridStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAmslerGridStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKAmslerGridStep.h
ORKAmslerGridStep.m
- - - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridStepViewController.html deleted file mode 100644 index 9222be8f0f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAmslerGridStepViewController.html +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - ORKAmslerGridStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAmslerGridStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKAmslerGridStepViewController.h
ORKAmslerGridStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerFormat.html deleted file mode 100644 index c1296d8a70..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerFormat.html +++ /dev/null @@ -1,320 +0,0 @@ - - - - - - ORKAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAnswerFormat Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKAnswerFormat class is the abstract base class for classes that describe the -format in which a survey question or form item should be answered. The ResearchKit framework uses -ORKQuestionStep and ORKFormItem to represent questions to ask the user. Each -question must have an associated answer format.

- -

To use an answer format, instantiate the appropriate answer format subclass and -attach it to a question step or form item. Incorporate the resulting step -into a task, and present the task with a task view controller.

- -

An answer format is validated when its owning step is validated.

- -

Some answer formats are constructed of other answer formats. When this is the -case, the answer format can override the method impliedAnswerFormat to return -the answer format that is implied. For example, a Boolean answer format -is presented in the same way as a single-choice answer format with the -choices Yes and No mapping to @(YES) and @(NO), respectively.

-
- - - - - -
- - - - -

Properties

- -
-
- -

  questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
@property (readonly) ORKQuestionType questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Validation

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– impliedAnswerFormat -

- -
-
- -
- - -
-

Some answer formats are constructed of other answer formats. This method allows -a subclass to return a different answer format for use in defining the UI/UX for -the answer format type. For example, a Boolean answer format is presented in the -same way as a single-choice answer format with the choices Yes and No mapping to -@(YES) and @(NO), respectively, so its impliedAnswerFormat is an -ORKTextChoiceAnswerFormat with those options.

-
- - - -
- (ORKAnswerFormat *)impliedAnswerFormat
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerTextField.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerTextField.html deleted file mode 100644 index 8b9b0f22a4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerTextField.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - ORKAnswerTextField Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAnswerTextField Class Reference

- - -
- - - - - - - - - - -
Inherits fromUITextField
Conforms toORKDefaultFont
Declared inORKAnswerTextField.h
ORKAnswerTextField.m
- - - - -
- -

Overview

-

Answer’s text field.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerTextView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerTextView.html deleted file mode 100644 index 1b9185183b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAnswerTextView.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - ORKAnswerTextView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAnswerTextView Class Reference

- - -
- - - - - - - - - - -
Inherits fromUITextView
Conforms toORKDefaultFont
Declared inORKAnswerTextView.h
ORKAnswerTextView.m
- - - - -
- -

Overview

-

The ORKAnswerTextView class represents the text view of the answer.

Note: The answer text view is used in the answer page and the form page.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioGenerator.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioGenerator.html deleted file mode 100644 index 363ede3c97..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioGenerator.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - ORKAudioGenerator Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAudioGenerator Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKAudioGenerator.h
ORKAudioGenerator.m
- - - - -
- -

Overview

-

The ORKAudioGenerator class represents an audio tone generator.

-
- - - - - -
- - - - - - -
-
- -

– volumeInDecibels -

- -
-
- -
- - -
-

Returns the peak audio volume being currently played, in decibels (dB).

-
- - - -
- (double)volumeInDecibels
- - - - - -
-

Return Value

-

The current audio volume in decibels.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAudioGenerator.h

-
- - -
-
-
- -

– volumeAmplitude -

- -
-
- -
- - -
-

Returns the peak audio volume amplitude being currently played (from 0 to 1).

-
- - - -
- (double)volumeAmplitude
- - - - - -
-

Return Value

-

The current audio volume amplitude.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAudioGenerator.h

-
- - -
-
-
- -

– playSoundAtFrequency: -

- -
-
- -
- - -
-

Plays a tone at a specific frequency in stereo.

-
- - - -
- (void)playSoundAtFrequency:(double)frequency
- - - -
-

Parameters

- - - - - - - -
frequency

The audio frequency in hertz.

-
- - - - - - - -
-

Discussion

-

The sound is a “pure” sinusoid tone.

-
- - - - - - - -
-

Declared In

-

ORKAudioGenerator.h

-
- - -
-
-
- -

– playSoundAtFrequency:onChannel:fadeInDuration: -

- -
-
- -
- - -
-

Plays a tone at a specific frequency on a specific channel, with a fade-in effect.

-
- - - -
- (void)playSoundAtFrequency:(double)frequency onChannel:(ORKAudioChannel)channel fadeInDuration:(NSTimeInterval)duration
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
frequency

The audio frequency in hertz.

channel

The audio channel (left or right).

duration

The fade-in duration.

-
- - - - - - - -
-

Discussion

-

The sound is a “pure” sinusoid tone. -The fade-in effect is applied linearly for the peak amplitude, from a 0 to 1 factor.

-
- - - - - - - -
-

Declared In

-

ORKAudioGenerator.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops the audio being played.

-
- - - -
- (void)stop
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAudioGenerator.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioLevelNavigationRule.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioLevelNavigationRule.html deleted file mode 100644 index 3746d5b90f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioLevelNavigationRule.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - ORKAudioLevelNavigationRule Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAudioLevelNavigationRule Class Reference

- - -
- - - - - - - -
Inherits fromORKStepNavigationRule : NSObject
Declared inORKAudioLevelNavigationRule.h
ORKAudioLevelNavigationRule.m
- - - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithAudioLevelStepIdentifier:destinationStepIdentifier:recordingSettings: -

- -
-
- -
- - -
-

Returns an initialized direct-step navigation rule using the specified destination step identifier.

-
- - - -
- (instancetype)initWithAudioLevelStepIdentifier:(NSString *)audioLevelStepIdentifier destinationStepIdentifier:(NSString *)destinationStepIdentifier recordingSettings:(NSDictionary *)recordingSettings
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
audioLevelStepIdentifier

The identifier of the step with the audio file to check.

destinationStepIdentifier

The identifier of the destination step if audio test passes.

recordingSettings

Use key AVNumberOfChannelsKey to sepcify the number of recording channels.

-
- - - -
-

Return Value

-

A audio level step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAudioLevelNavigationRule.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new direct-step navigation rule initialized from data in a given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the step navigation rule.

-
- - - -
-

Return Value

-

A new direct-step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAudioLevelNavigationRule.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– identifierForDestinationStepWithTaskResult: -

- -
-
- -
- - -
-

Returns the target step identifier.

-
- - - -
- (NSString *)identifierForDestinationStepWithTaskResult:(ORKTaskResult *)taskResult
- - - -
-

Parameters

- - - - - - - -
taskResult

The up-to-date task result, used for calculating the destination step.

-
- - - -
-

Return Value

-

The identifier of the destination step.

-
- - - - - -
-

Discussion

-

Subclasses must implement this method to calculate the next step based on the passed task result. -The ORKNullStepIdentifier constant can be returned to indicate that the ongoing task should end -after the step navigation rule is triggered.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioRecorder.html deleted file mode 100644 index 3e64f816c9..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioRecorder.html +++ /dev/null @@ -1,583 +0,0 @@ - - - - - - ORKAudioRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAudioRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKAudioRecorder.h
ORKAudioRecorder.m
- - - - -
- -

Overview

-

The ORKAudioRecorder class represents a recorder that uses the app’s -AVAudioSession object to record audio.

- -

To ensure audio recording continues when a task enters the background, -add the audio tag to UIBackgroundModes in your app’s Info.plist file.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ defaultRecorderSettings -

- -
-
- -
- - -
-

The default audio format settings.

-
- - - -
+ (NSDictionary *)defaultRecorderSettings
- - - - - - - - - -
-

Discussion

-

If no settings are specified, the audio configuration is -MPEG4 AAC, 2 channels, 16 bit, 44.1 kHz, AVAudioQualityMin.

-
- - - - - - - -
-

Declared In

-

ORKAudioRecorder.h

-
- - -
-
-
- -

– initWithIdentifier:recorderSettings:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized audio recorder using the specified settings, step, and output directory.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier recorderSettings:(NSDictionary *)recorderSettings step:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

recorderSettings

The settings for the recording session.

step

The step that requested this recorder.

outputDirectory

The directory in which the audio output should be stored.

-
- - - -
-

Return Value

-

An initialized audio recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAudioRecorder.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  recorderSettings -

- -
-
- -
- - -
-

Audio format settings

-
- - - -
@property (nonatomic, copy, readonly) NSDictionary *recorderSettings
- - - - - - - - - -
-

Discussion

-

Settings for the recording session. -Passed to AVAudioRecorder's-initWithURL:settings:error:` -For information on the settings available for an audio recorder, see “AV Foundation Audio Settings Constants”.

-
- - - - - - - -
-

Declared In

-

ORKAudioRecorder.h

-
- - -
-
-
- -

  audioRecorder -

- -
-
- -
- - -
-

Reference to the audio recorder being used.

-
- - - -
@property (nonatomic, strong, readonly, nullable) AVAudioRecorder *audioRecorder
- - - - - - - - - -
-

Discussion

-

The value of this property is used in the audio task in order to display recorded volume in real time during the task.

-
- - - - - - - -
-

Declared In

-

ORKAudioRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioRecorderConfiguration.html deleted file mode 100644 index 7131af438c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioRecorderConfiguration.html +++ /dev/null @@ -1,521 +0,0 @@ - - - - - - ORKAudioRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAudioRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKAudioRecorder.m
ORKRecorder.h
- - - - -
- -

Overview

-

The ORKAudioRecorderConfiguration class represents a configuration that records -audio data during an active step.

- -

An ORKAudioRecorderConfiguration generates an ORKAudioRecorder object.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– initWithIdentifier:recorderSettings: -

- -
-
- -
- - -
-

Returns an initialized audio recorder configuration using the specified settings.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier recorderSettings:(NSDictionary *)recorderSettings
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier of the recorder configuration.

recorderSettings

The settings for the recording session.

-
- - - -
-

Return Value

-

An initialized audio recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

- -

For information on the settings available for an audio recorder, see “AV Foundation Audio Settings Constants”.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new audio recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the audio recorder configuration.

-
- - - -
-

Return Value

-

A new audio recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedPermissionMask -

- -
-
- -
- - -
-

Returns the permission mask indicating the permissions required for this configuration.

-
- - - -
- (ORKPermissionMask)requestedPermissionMask
- - - - - - - - - -
-

Discussion

-

This method is typically overridden in new recorder configuration subclasses.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  recorderSettings -

- -
-
- -
- - -
-

The audio format settings for the recorder.

-
- - - -
@property (nonatomic, readonly, nullable) NSDictionary *recorderSettings
- - - - - - - - - -
-

Discussion

-

Pass the settings for the recording session to the AVAudioRecorder method initWithURL:settings:error:. -For information on the settings available for an audio recorder, see “AV Foundation Audio Settings Constants” in -the AVFoundation documentation.

- -

The results are returned as an ORKFileResult object, which points to an audio file.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioStep.html deleted file mode 100644 index dbf04074e0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioStep.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - ORKAudioStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAudioStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKAudioStep.h
ORKAudioStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioStepViewController.html deleted file mode 100644 index 6a1ae1530b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKAudioStepViewController.html +++ /dev/null @@ -1,519 +0,0 @@ - - - - - - ORKAudioStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAudioStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKAudioStepViewController.h
ORKAudioStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– recordersDidChange -

- -
-
- -
- - -
-

Tells the view controller that the set of recorders changed.

-
- - - -
- (void)recordersDidChange
- - - - - - - - - -
-

Discussion

-

This method is usually called by the active step view controller in response -to start or resume.

- -

Subclasses may override this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– suspend -

- -
-
- -
- - -
-

Suspends the active step.

-
- - - -
- (void)suspend
- - - - - - - - - -
-

Discussion

-

Call this method to suspend data recording and the step’s timer.

- -

This method may called automatically when the app is suspended. -The view controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– resume -

- -
-
- -
- - -
-

Resumes the active step.

-
- - - -
- (void)resume
- - - - - - - - - -
-

Discussion

-

Call this method when the step should be resumed. Calls to this method should -be paired with previous calls to suspend.

- -

This method may be called automatically when the app is resumed. The view -controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

When the step is resumed, the UI should resume at the point where the user left off, -or, if that does not make sense for the particular step, to the most recent -suitable point.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– finish -

- -
-
- -
- - -
-

Finishes the active step.

-
- - - -
- (void)finish
- - - - - - - - - -
-

Discussion

-

Call this method to finish the active step. If the active step is configured with -a timer, this method is called automatically when the timer expires.

- -

Finishing the active step stops all data recording and stops any timers. In steps that have the -shouldContinueOnFinish property set, forward navigation to the next step -may ensue.

- -

This method does nothing if the step has already finished.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBarGraphChartView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBarGraphChartView.html deleted file mode 100644 index 110062dab7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBarGraphChartView.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - ORKBarGraphChartView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKBarGraphChartView Class Reference

- - -
- - - - - - - -
Inherits fromORKGraphChartView : UIView
Declared inORKBarGraphChartView.h
ORKBarGraphChartView.m
- - - - -
- -

Overview

-

The ORKBarGraphChartView class presents the data provided by an object conforming to the -ORKValueStackGraphChartViewDataSource protocol as a bar graph.

- -

By default, the primary plot is colored by the tintColor, and any additional plots are colored -using the referenceLineColor property. You can customize the plot colors by implementing the --graphChartView:colorForPlotIndex: method in the data source.

-
- - - - - -
- - - - - - -
-
- -

  dataSource -

- -
-
- -
- - -
-

The data source responsible for providing the data required to populate the graph chart view.

-
- - - -
@property (nonatomic, weak) id<ORKValueStackGraphChartViewDataSource> dataSource
- - - - - - - - - -
-

Discussion

-

See the ORKValueStackGraphChartViewDataSource protocol.

-
- - - - - - - -
-

Declared In

-

ORKBarGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBooleanAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBooleanAnswerFormat.html deleted file mode 100644 index 5d240f8e92..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBooleanAnswerFormat.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - - ORKBooleanAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKBooleanAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKBooleanAnswerFormat class behaves the same as the ORKTextChoiceAnswerFormat class, -except that it is preconfigured to use only Yes and No answers.

- -

The Boolean answer format produces an ORKBooleanQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithYesString:noString: -

- -
-
- -
- - -
-

Returns an initialized Boolean answer format using the specified strings for Yes and No answers.

-
- - - -
- (instancetype)initWithYesString:(NSString *)yes noString:(NSString *)no
- - - -
-

Parameters

- - - - - - - - - - - - -
yes

A string that describes the Yes answer.

no

A string that describes the No answer.

-
- - - -
-

Return Value

-

An initialized Boolean answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  yes -

- -
-
- -
- - -
-

The string to describe the Yes answer. (read-only)

-
- - - -
@property (copy, readonly) NSString *yes
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  no -

- -
-
- -
- - -
-

The string to describe the No answer. (read-only)

-
- - - -
@property (copy, readonly) NSString *no
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– impliedAnswerFormat -

- -
-
- -
- - -
-

Some answer formats are constructed of other answer formats. This method allows -a subclass to return a different answer format for use in defining the UI/UX for -the answer format type. For example, a Boolean answer format is presented in the -same way as a single-choice answer format with the choices Yes and No mapping to -@(YES) and @(NO), respectively, so its impliedAnswerFormat is an -ORKTextChoiceAnswerFormat with those options.

-
- - - -
- (ORKAnswerFormat *)impliedAnswerFormat
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBooleanQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBooleanQuestionResult.html deleted file mode 100644 index 194c2adbfb..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBooleanQuestionResult.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - ORKBooleanQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKBooleanQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKBooleanQuestionResult class represents the answer to a Yes/No question.

- -

A Boolean question result is produced by the task view controller when it presents a question or form -item with a Boolean answer format (that is, ORKBooleanAnswerFormat).

- -

A Boolean question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  booleanAnswer -

- -
-
- -
- - -
-

The answer, or nil if the user skipped the question.

-
- - - -
@property (nonatomic, copy, nullable) NSNumber *booleanAnswer
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBorderedButton.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBorderedButton.html deleted file mode 100644 index 4749752a83..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKBorderedButton.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - ORKBorderedButton Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKBorderedButton Class Reference

- - -
- - - - - - - -
Inherits fromORKTextButton : UIButton
Declared inORKBorderedButton.h
ORKBorderedButton.m
- - - - - - -
- - - - - - -
-
- -

  normalTintColor -

- -
-
- -
- - -
-

The tint color of the button for UIControlStateNormal

-
- - - -
@property (nonatomic) UIColor *normalTintColor
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKBorderedButton.h

-
- - -
-
-
- -

  normalHighlightOrSelectTintColor -

- -
-
- -
- - -
-

The tint color of the button for UIControlStateSelected or UIControlStateHighlighted

-
- - - -
@property (nonatomic) UIColor *normalHighlightOrSelectTintColor
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKBorderedButton.h

-
- - -
-
-
- -

  disableTintColor -

- -
-
- -
- - -
-

The tint color of the button for UIControlStateDisabled

-
- - - -
@property (nonatomic) UIColor *disableTintColor
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKBorderedButton.h

-
- - -
-
-
- -

  fadeDelay -

- -
-
- -
- - -
-

The delay in fading animation

-
- - - -
@property (nonatomic, assign) NSTimeInterval fadeDelay
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKBorderedButton.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCaption1Label.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCaption1Label.html deleted file mode 100644 index 3db19f9f45..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCaption1Label.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKCaption1Label Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCaption1Label Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKCaption1Label.h
ORKCaption1Label.m
- - - - -
- -

Overview

-

Intro step’s first piece details text.

Note: Used as cell’s caption text: in ORKConsentDocumentCell and ORKFormItemCell

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKChoiceQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKChoiceQuestionResult.html deleted file mode 100644 index 8feb2ad39e..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKChoiceQuestionResult.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - ORKChoiceQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKChoiceQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKChoiceQuestionResult class represents the single or multiple choice -answers from a choice-based answer format.

- -

For example, an ORKTextChoiceAnswerFormat or an ORKImageChoiceAnswerFormat -format produces an ORKChoiceQuestionResult object.

- -

A choice question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  choiceAnswers -

- -
-
- -
- - -
-

An array of selected values, from the value property of an ORKTextChoice or ORKImageChoice object. -In the case of a single choice, the array has exactly one entry.

-
- - - -
@property (nonatomic, copy, nullable) NSArray *choiceAnswers
- - - - - - - - - -
-

Discussion

-

If the user skipped the question, the value of the corresponding array member is nil.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCollectionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCollectionResult.html deleted file mode 100644 index 2c48fbf445..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCollectionResult.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - ORKCollectionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCollectionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKCollectionResult.h
ORKCollectionResult.m
- - - - -
- -

Overview

-

The ORKCollectionResult class represents a result that contains an array of -child results.

- -

ORKCollectionResult is the superclass of ORKTaskResult and ORKStepResult.

- -

Note that object of this class are not instantiated directly by the ResearchKit framework.

-
- - - - - -
- - - - - - -
-
- -

  results -

- -
-
- -
- - -
-

An array of ORKResult objects that are the children of the result.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKResult*> *results
- - - - - - - - - -
-

Discussion

-

For ORKTaskResult, the array contains ORKStepResult objects. -For ORKStepResult the array contains concrete result objects such as ORKFileResult -and ORKQuestionResult.

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
- -

– resultForIdentifier: -

- -
-
- -
- - -
-

Looks up the child result containing an identifier that matches the specified identifier.

-
- - - -
- (nullable ORKResult *)resultForIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The identifier of the step for which to search.

-
- - - -
-

Return Value

-

The matching result, or nil if none was found.

-
- - - - - - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
- -

  firstResult -

- -
-
- -
- - -
-

The first result.

-
- - - -
@property (nonatomic, strong, readonly, nullable) ORKResult *firstResult
- - - - - - - - - -
-

Discussion

-

This is the first result, or nil if there are no results.

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCollector.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCollector.html deleted file mode 100644 index 7287b11d28..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCollector.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - - - ORKCollector Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCollector Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKCollector.h
ORKCollector.m
- - - - -
- -

Overview

-

Abstract class of data collector.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– serializedDataForObjects: -

- -
-
- -
- - -
-

Serialization helper that produces serialized output. -Subclasses should implement to provide a default serialization for upload.

-
- - - -
- (NSData *)serializedDataForObjects:(NSArray *)objects
- - - - - -
-

Return Value

-

Serialized data object.

-
- - - - - -
-

Discussion

-

@params objects The objects to be serialized.

-
- - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

– serializableObjectsForObjects: -

- -
-
- -
- - -
-

Serialization helper that produces objects suitable for serialization to JSON.

-
- - - -
- (NSArray *)serializableObjectsForObjects:(NSArray *)objects
- - - - - -
-

Return Value

-

Serializable dictionary objects.

-
- - - - - -
-

Discussion

-

Subclasses should implement to provide a default JSON serialization for upload. -Called by serializedDataForObjects:.

- -

@params objects The objects to be serialized.

-
- - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  identifier -

- -
-
- -
- - -
-

Identifier of this collector.

-
- - - -
@property (copy, readonly) NSString *identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCompletionStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCompletionStep.html deleted file mode 100644 index 2e1278b787..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCompletionStep.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - ORKCompletionStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCompletionStep Class Reference

- - -
- - - - - - - -
Inherits fromORKInstructionStep : ORKStep : NSObject
Declared inORKCompletionStep.h
ORKCompletionStep.m
- - - - -
- -

Overview

-

The ORKCompletionStep class is a subclass of ORKInstructionStep which behaves like -an instruction step, but includes animated imagery that thanks the user -for participating in the task.

-
- - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCompletionStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCompletionStepViewController.html deleted file mode 100644 index dcebd6b50d..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCompletionStepViewController.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - ORKCompletionStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCompletionStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKInstructionStepViewController : ORKStepViewController : UIViewController
Declared inORKCompletionStepViewController.h
ORKCompletionStepViewController.m
- - - - -
- -

Overview

-

An ORKCompletionStepViewController object is the step view controller for an -ORKCompletionStep object.

- -

Typically, you don’t need to instantiate a completion step view controller directly. -Instead, add a completion step to a task, and present the task with a -task view controller. The task view controller instantiates the step -view controller for the completion step.

-
- - - - - -
- - - - - - -
-
- -

  shouldShowContinueButton -

- -
-
- -
- - -
-

Optional property to allow showing the “Done/Next” button rather than moving this button -to the rightBarButtonItem.

-
- - - -
@property (nonatomic) BOOL shouldShowContinueButton
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCompletionStepViewController.h

-
- - -
-
-
- -

  checkmarkColor -

- -
-
- -
- - -
-

Optional property to set the color of the checkmark. This allows the checkmark to use a different -color from the tintColor of the parent view.

-
- - - -
@property (nonatomic, copy, nullable) UIColor *checkmarkColor
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCompletionStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConfirmTextAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConfirmTextAnswerFormat.html deleted file mode 100644 index 23d1d50e92..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConfirmTextAnswerFormat.html +++ /dev/null @@ -1,434 +0,0 @@ - - - - - - ORKConfirmTextAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConfirmTextAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKTextAnswerFormat : ORKAnswerFormat : NSObject
Declared inORKAnswerFormat.m
ORKAnswerFormat_Private.h
- - - - -
- -

Overview

-

The ORKConfirmTextAnswerFormat class represents the answer format for questions that collect a text -response from the user and validates it with another text answer format.

- -

An ORKConfirmTextAnswerFormat object produces an ORKBooleanQuestionResult object.

-
- - - - - -
- - - - - - -
-
- -

– initWithMaximumLength: -

- -
-
- -
- - -
-

Returns an initialized text answer format using the specified maximum string length.

-
- - - -
- (instancetype)initWithMaximumLength:(NSInteger)maximumLength
- - - -
-

Parameters

- - - - - - - -
maximumLength

The maximum number of characters to accept. When the value of this parameter - is 0, there is no maximum.

-
- - - -
-

Return Value

-

An initialized text answer format.

-
- - - - - -
-

Discussion

-

This method is one of the designated initializers.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithValidationRegularExpression:invalidMessage: -

- -
-
- -
- - -
-

Returns an initialized text answer format using the regular expression.

-
- - - -
- (instancetype)initWithValidationRegularExpression:(NSRegularExpression *)validationRegularExpression invalidMessage:(NSString *)invalidMessage
- - - -
-

Parameters

- - - - - - - - - - - - -
validationRegularExpression

The regular expression used to validate the text.

invalidMessage

The text presented to the user when invalid input is received.

-
- - - -
-

Return Value

-

An initialized validated text answer format.

-
- - - - - -
-

Discussion

-

This method is one of the designated initializers.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithOriginalItemIdentifier:errorMessage: -

- -
-
- -
- - -
-

Returns an initialized text answer format using the original item identifier.

-
- - - -
- (instancetype)initWithOriginalItemIdentifier:(NSString *)originalItemIdentifier errorMessage:(NSString *)errorMessage
- - - -
-

Parameters

- - - - - - - - - - - - -
originalItemIdentifier

The form item identifier against which this answer item is validated.

errorMessage

The error message displayed if validation fails.

-
- - - -
-

Return Value

-

An initialized confirm text answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat_Private.h

-
- - -
-
-
- -

  originalItemIdentifier -

- -
-
- -
- - -
-

The identifier for the form item that the current item will be validated against.

-
- - - -
@property (nonatomic, copy, readonly) NSString *originalItemIdentifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat_Private.h

-
- - -
-
-
- -

  errorMessage -

- -
-
- -
- - -
-

The error message displayed if validation fails.

-
- - - -
@property (nonatomic, copy, readonly) NSString *errorMessage
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentDocument.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentDocument.html deleted file mode 100644 index 56c9c1992c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentDocument.html +++ /dev/null @@ -1,690 +0,0 @@ - - - - - - ORKConsentDocument Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentDocument Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKConsentDocument.h
ORKConsentDocument.m
- - - - -
- -

Overview

-

The ORKConsentDocument class represents the content of an informed consent -document, which is a document that’s used to obtain informed consent from participants -in a medical or other research study. The ResearchKit framework uses an ORKConsentDocument object -to provide content for visual consent steps (ORKVisualConsentStep) and for consent review steps (ORKConsentReviewStep).

- -

The sections of an ORKConsentDocument object are instances of ORKConsentSection. -When an ORKConsentDocument object is attached to an visual consent step, these -sections provide the content for the visual consent screens, and for the -Learn More pages that are accessible from them. When attached to an consent review step, -the sections can provide the content for the consent document to -be reviewed.

- -

If the consent document is simple, each section may be able to map to a visual consent screen. And in some cases, the formatting of the consent document may -be sufficiently simple that it can be presented using only section headers and -simple formatting. If your consent document uses simple formatting, you might be able to generate a document to sign by specifying the sections and the signatures. -In a case like this, you don’t need to provide a value for the htmlReviewContent property, -and when the consent review step is completed, the signatures can be -placed into a copy of the document and a PDF can be generated.

- -

In more complex cases, the visual consent sections may bear little -relation to the formal consent document. In a situation like this, place the formal consent -document content in the htmlReviewContent property. Doing this overrides all content that would otherwise be generated from the consent -sections.

- -

The document should be in the user’s language, and all the content of -the document should be appropriately localized.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithHTMLPDFWriter:consentSectionFormatter:consentSignatureFormatter: -

- -
-
- -
- - -
-

Initializer with ORKHTMLPDFWriter parameter. Allows for injecting mock dependency for the -purposes of isolated unit testing.

-
- - - -
- (instancetype)initWithHTMLPDFWriter:(ORKHTMLPDFWriter *)writer consentSectionFormatter:(ORKConsentSectionFormatter *)sectionFormatter consentSignatureFormatter:(ORKConsentSignatureFormatter *)signatureFormatter
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
writer

The instance of the ORKHTMLPDFWriter upon which the class depends.

sectionFormatter

An instance of ORKConsentSectionFormatter

signatureFormatter

An instance of ORKConsentSignatureFormatter

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
- -

– signatures -

- -
-
- -
- - -
-

The set of signatures that are required or prepopulated in the document.

-
- - - -
- (NSArray<ORKConsentSignature*> *)signatures
- - - - - - - - - -
-

Discussion

-

To add a signature to the document after consent review, the signatures array -needs to be modified to incorporate the new signature content prior to PDF -generation. For more information, see [ORKConsentSignatureResult applyToDocument:].

-
- - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
- -

– addSignature: -

- -
-
- -
- - -
-

Adds a signature to the array of signatures.

-
- - - -
- (void)addSignature:(ORKConsentSignature *)signature
- - - -
-

Parameters

- - - - - - - -
signature

The signature object to add to the document.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
- -

– makePDFWithCompletionHandler: -

- -
-
- -
- - -
-

Writes the document’s content into a PDF file.

-
- - - -
- (void)makePDFWithCompletionHandler:(void ( ^ ) ( NSData *data , NSError *error ))handler
- - - -
-

Parameters

- - - - - - - -
handler

The handler block for generated PDF data. When successful, the returned - data represents a complete PDF document that represents the consent.

-
- - - - - - - -
-

Discussion

-

The PDF is generated in a form suitable for printing. This is done asynchronously, -so the PDF data is returned through a completion block.

-
- - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
-
- - - -

Properties

- -
-
- -

  title -

- -
-
- -
- - -
-

The document’s title in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *title
- - - - - - - - - -
-

Discussion

-

The title appears only in the generated PDF for review; it is not used in the -visual consent process.

-
- - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
-
- - - -

Visual consent sections

- -
-
- -

  sections -

- -
-
- -
- - -
-

The sections to be in printed in the PDF file and or presented in the -visual consent sequence.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKConsentSection*> *sections
- - - - - - - - - -
-

Discussion

-

All sections appear in the animated process, except for those sections of the -type ORKConsentSectionTypeOnlyInDocument.

- -

If the htmlReviewContent property is not set, this content is also used to -populate the document for review in the consent review step.

- -

The PDF file contains all sections.

-
- - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
-
- - - -

Signatures for consent review

- -
-
- -

  signaturePageTitle -

- -
-
- -
- - -
-

The title to be rendered on the signature page of the generated PDF in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *signaturePageTitle
- - - - - - - - - -
-

Discussion

-

The title is ignored for visual consent. The title is also ignored if you supply a value for the htmlReviewContent property.

-
- - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
- -

  signaturePageContent -

- -
-
- -
- - -
-

The content to be rendered below the title on the signature page of the generated PDF in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *signaturePageContent
- - - - - - - - - -
-

Discussion

-

The content is ignored for visual consent. The content is also ignored if you supply a value for the htmlReviewContent property.

-
- - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
-
- - - -

Alternative content provision

- -
-
- -

  htmlReviewContent -

- -
-
- -
- - -
-

Override HTML content for review.

-
- - - -
@property (nonatomic, copy, nullable) NSString *htmlReviewContent
- - - - - - - - - -
-

Discussion

-

Typically, the review content is generated from the values of the sections and signatures -properties.

- -

When this property is set, the review content is reproduced exactly as provided in the property -in the consent review step, and the sections and signatures properties -are ignored.

-
- - - - - - - -
-

Declared In

-

ORKConsentDocument.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentReviewStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentReviewStep.html deleted file mode 100644 index 9537a5cab2..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentReviewStep.html +++ /dev/null @@ -1,467 +0,0 @@ - - - - - - ORKConsentReviewStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentReviewStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKConsentReviewStep.h
ORKConsentReviewStep.m
- - - - -
- -

Overview

-

The ORKConsentReviewStep class is used to represent the consent review process. -Typically, the consent review process consists of three main parts:

- -
    -
  1. Consent document review. In this part, you display the consent document for review. Users -must explicitly agree to the consent document before they can proceed.

  2. -
  3. Name entry (optional). Users are asked to enter their first and last name. To -request name entry in your app, set the step’s signature property, and ensure that the signature’s -requiresName property is set to YES.

  4. -
  5. Signature (optional). Users are asked to draw their signature on the device screen. -To request signature entry in your app, set the step’s signature property, and ensure that the signature’s -requiresName property is set to YES.

  6. -
- - -

The content for the consent document review comes from a consent document (ORKConsentDocument) -provided during initialization.

- -

To use a consent review step, configure it and include it in a task. Then -present the task in a task view controller.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:signature:inDocument: -

- -
-
- -
- - -
-

Returns an initialized consent review step using the specified identifier, signature, and consent document.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier signature:(ORKConsentSignature *)signature inDocument:(ORKConsentDocument *)consentDocument
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The identifier for the step.

signature

The signature to be collected, if any.

consentDocument

The consent document to be reviewed.

-
- - - -
-

Return Value

-

An initialized consent review step.

-
- - - - - - - - - - - -
-

Declared In

-

ORKConsentReviewStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Properties

- -
-
- -

  consentDocument -

- -
-
- -
- - -
-

The consent document to be reviewed by the user during the consent review process. (read-only)

-
- - - -
@property (nonatomic, strong, readonly) ORKConsentDocument *consentDocument
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentReviewStep.h

-
- - -
-
-
- -

  signature -

- -
-
- -
- - -
-

The signature object from the document that should be collected. (read-only)

-
- - - -
@property (nonatomic, strong, readonly, nullable) ORKConsentSignature *signature
- - - - - - - - - -
-

Discussion

-

When the value of signature is nil, neither the name nor the finger scrawl are collected. -When the value of signature is not nil, the requiresName and requiresSignatureImage properties of -signature determine the screens that get presented.

- -

The identifier of the signature is expected to match one of the signature objects in -the consent document.

-
- - - - - - - -
-

Declared In

-

ORKConsentReviewStep.h

-
- - -
-
-
- -

  reasonForConsent -

- -
-
- -
- - -
-

A user-visible description of the reason for agreeing to consent in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *reasonForConsent
- - - - - - - - - -
-

Discussion

-

The reason for consent is presented in the confirmation dialog that users see when giving their consent.

-
- - - - - - - -
-

Declared In

-

ORKConsentReviewStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentReviewStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentReviewStepViewController.html deleted file mode 100644 index 5d91e16054..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentReviewStepViewController.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - ORKConsentReviewStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentReviewStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKConsentReviewStepViewController.h
ORKConsentReviewStepViewController.m
- - - - -
- -

Overview

-

The ORKConsentReviewStepViewController class is a step view controller subclass -used to manage a consent review step (ORKConsentReviewStep).

- -

You should not need to instantiate a consent review step view controller directly. Instead, include -a consent review step in a task, and present a task view controller for that -task.

-
- - - - - -
- - - - - - -
-
- -

– initWithConsentReviewStep:result: -

- -
-
- -
- - -
-

Returns an initialized consent review step view controller using the specified review step and result.

-
- - - -
- (instancetype)initWithConsentReviewStep:(ORKConsentReviewStep *)consentReviewStep result:(ORKConsentSignatureResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
consentReviewStep

The configured review step.

result

The initial or previous results for the review step, as appropriate.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKConsentReviewStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSection.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSection.html deleted file mode 100644 index 4e562c127f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSection.html +++ /dev/null @@ -1,761 +0,0 @@ - - - - - - ORKConsentSection Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentSection Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKConsentSection.h
ORKConsentSection.m
- - - - -
- -

Overview

-

The ORKConsentSection class represents one section in a consent document. Each -ORKConsentSection object (apart from those of type ORKConsentSectionTypeOnlyInDocument) -corresponds to a page in a visual consent step, or a section in the document -reviewed in consent review step.

- -

If you initialize a consent section with one of the defined section types, you get a prepopulated title, a default image, and animation (when appropriate). You can override these properties or you can use the ORKConsentSectionTypeCustom type to -avoid any prepopulation.

- -

If you provide content for the ORKConsentSection object, be sure to use localized content.

-
- - - - - -
- - - - - - -
-
- -

– initWithType: -

- -
-
- -
- - -
-

Returns an initialized consent section using the specified type.

-
- - - -
- (instancetype)initWithType:(ORKConsentSectionType)type
- - - -
-

Parameters

- - - - - - - -
type

The consent section type.

-
- - - - - - - -
-

Discussion

-

This method populates the title and summary for all types except for -ORKConsentSectionTypeCustom and ORKConsentSectionTypeOnlyInDocument.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  type -

- -
-
- -
- - -
-

The type of section. (read-only)

-
- - - -
@property (nonatomic, readonly) ORKConsentSectionType type
- - - - - - - - - -
-

Discussion

-

The value of this property indicates whether a predefined image, title, and animation are present.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  title -

- -
-
- -
- - -
-

The title of the consent section in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *title
- - - - - - - - - -
-

Discussion

-

The title is displayed as a scene title in the animated consent sequence and is also included in the PDF file, but it can be overridden by setting formalTitle. -The title is prefilled unless the type is ORKConsentSectionTypeCustom or ORKConsentSectionTypeOnlyInDocument.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  formalTitle -

- -
-
- -
- - -
-

The formal title of the section in a localized string, for use in the legal document.

-
- - - -
@property (nonatomic, copy, nullable) NSString *formalTitle
- - - - - - - - - -
-

Discussion

-

If the value of this property is nil, the value of title is used in the legal document instead.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  summary -

- -
-
- -
- - -
-

A short summary of the content in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *summary
- - - - - - - - - -
-

Discussion

-

The summary is displayed as description text in the animated consent sequence. -The summary should be limited in length, so that the consent can be reliably -displayed on smaller screens.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  content -

- -
-
- -
- - -
-

The content of the section in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *content
- - - - - - - - - -
-

Discussion

-

In a consent review step or in PDF file generation, the string is printed as the section’s -content. The string is also displayed as Learn More content in a visual consent step.

- -

This property is never prepopulated based on the value of type. If both content and htmlContent are non-nil, the value of the htmlContent property is used.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  htmlContent -

- -
-
- -
- - -
-

The HTML content used to override the content property if additional formatting is needed. The content should be localized.

-
- - - -
@property (nonatomic, copy, nullable) NSString *htmlContent
- - - - - - - - - -
-

Discussion

-

In cases where plain text content is not sufficient to convey important details -during the consent process, you can provide HTML content in this property. When you do this, the htmlContent property takes precedence over the content property.

- -

In a consent review step or in PDF file generation, the value of this property is printed as the section’s -content; in a visual consent step, the content is displayed as Learn More content.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  contentURL -

- -
-
- -
- - -
-

The NSURL used to override the ‘htmlContent’ and ‘consent’ property if a document should be required.

-
- - - -
@property (nonatomic, copy, nullable) NSURL *contentURL
- - - - - - - - - -
-

Discussion

-

This property is used to display a document when required by an authortity.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  omitFromDocument -

- -
-
- -
- - -
-

When set to YES, the section is omitted in a consent review step or in PDF file generation. This property is NO by default.

-
- - - -
@property (nonatomic) BOOL omitFromDocument
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  customImage -

- -
-
- -
- - -
-

A custom illustration for the consent.

-
- - - -
@property (nonatomic, copy, nullable) UIImage *customImage
- - - - - - - - - -
-

Discussion

-

The custom image can override the image associated with any of the predefined -section types for an ORKVisualConsentStep object. It is ignored for a consent review step and -for PDF generation.

- -

The image is used in template rendering mode, and is tinted using the tint color.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  customLearnMoreButtonTitle -

- -
-
- -
- - -
-

A custom Learn More button title in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *customLearnMoreButtonTitle
- - - - - - - - - -
-

Discussion

-

The predefined section types have localized descriptive Learn More button -titles for a visual consent step. When this property is not nil, it overrides that -default text.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
- -

  customAnimationURL -

- -
-
- -
- - -
-

A file URL that specifies a custom transition animation video.

-
- - - -
@property (nonatomic, copy, nullable) NSURL *customAnimationURL
- - - - - - - - - -
-

Discussion

-

Animations of the illustration between one screen and the next are provided -by default for transitions between consecutive section type codes. Custom -sections and out-of-order transitions may require custom animations.

- -

The animation loaded from the file URL is played aspect fill in the -illustration area for forward transitions only. The video is rendered in -template mode, with white treated as if it were transparent.

-
- - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSharingStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSharingStep.html deleted file mode 100644 index c7e1e2ff52..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSharingStep.html +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - ORKConsentSharingStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentSharingStep Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionStep : ORKStep : NSObject
Declared inORKConsentSharingStep.h
ORKConsentSharingStep.m
- - - - -
- -

Overview

-

The ORKConsentSharingStep class represents a question step that includes prepopulated content that asks users about how much they’re willing to allow -data to be shared after collection.

- -

To use the consent sharing step, include it in a task and present that task -with a task view controller. It’s easy to incorporate a consent sharing step into the review flow, because it provides default content for its title, text, and answer format.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:investigatorShortDescription:investigatorLongDescription:localizedLearnMoreHTMLContent: -

- -
-
- -
- - -
-

Returns an initialized consent sharing step using the specified title, text, and answer format.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier investigatorShortDescription:(NSString *)investigatorShortDescription investigatorLongDescription:(NSString *)investigatorLongDescription localizedLearnMoreHTMLContent:(NSString *)localizedLearnMoreHTMLContent
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The identifier of the step.

investigatorShortDescription

A short description of the investigator in a localized string. For example, “Stanford Medicine” or “American Heart Association.”

investigatorLongDescription

An extended description of the investigator and partners in a localized string. For example, “Stanford and its partners.”

localizedLearnMoreHTMLContent

The HTML content to display when the user - taps the Learn More button.

-
- - - -
-

Return Value

-

An initialized consent sharing step.

-
- - - - - - - - - - - -
-

Declared In

-

ORKConsentSharingStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  localizedLearnMoreHTMLContent -

- -
-
- -
- - -
-

Localized HTML content to present in the Learn More section for the step.

-
- - - -
@property (nonatomic, copy) NSString *localizedLearnMoreHTMLContent
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentSharingStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSharingStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSharingStepViewController.html deleted file mode 100644 index ef6a9c0b18..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSharingStepViewController.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - ORKConsentSharingStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentSharingStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionStepViewController : ORKStepViewController : UIViewController
Declared inORKConsentSharingStepViewController.h
ORKConsentSharingStepViewController.m
- - - - -
- -

Overview

-

The ORKConsentSharingStepViewController class is a view controller subclass -used to manage a consent sharing step (ORKConsentSharingStep).

- -

You should not need to instantiate a consent sharing step view controller directly. Instead, include -a consent sharing step in a task, and present a task view controller for that -task.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSignature.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSignature.html deleted file mode 100644 index 6f078d586e..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSignature.html +++ /dev/null @@ -1,756 +0,0 @@ - - - - - - ORKConsentSignature Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentSignature Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKConsentSignature.h
ORKConsentSignature.m
- - - - -
- -

Overview

-

The ORKConsentSignature class represents a signature in as ORKConsentDocument object. -The signature can be that of an investigator, possibly prefilled with -an image, date, and first and last name; or you might need to collect the details of a signature.

- -

Signatures can be collected in a consent review step (ORKConsentReviewStep). After a signature has -been obtained (which produces an ORKConsentSignatureResult object), the resulting signature -can be substituted into a copy of the document, and used when generating a PDF.

- -

Alternatively, the details of a signature can be uploaded to a server -for PDF generation elsewhere or simply as a record of having obtained consent.

- -

The signature object has no concept of a cryptographic signature – it is merely -a record of any input the user made during a consent review step. Also, an ORKConsentSignature object -does not verify or vouch for user identity.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ signatureForPersonWithTitle:dateFormatString:identifier:givenName:familyName:signatureImage:dateString: -

- -
-
- -
- - -
-

Returns a fully populated signature.

-
- - - -
+ (ORKConsentSignature *)signatureForPersonWithTitle:(NSString *)title dateFormatString:(NSString *)dateFormatString identifier:(NSString *)identifier givenName:(NSString *)givenName familyName:(NSString *)familyName signatureImage:(UIImage *)signatureImage dateString:(NSString *)signatureDate
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
title

The title of the signatory.

dateFormatString

The format string to use when formatting the date of signature.

identifier

The identifier of the signature, unique within this document.

givenName

The given name of the signatory.

familyName

The family name of the signatory.

signatureImage

An image of the signature.

signatureDate

The date on which the signature was obtained, represented as a string.

-
- - - - - - - -
-

Discussion

-

Use this factory method when you need to prepopulate the investigator’s signature in a generated consent document.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
- -

+ signatureForPersonWithTitle:dateFormatString:identifier: -

- -
-
- -
- - -
-

Returns a signature to be collected.

-
- - - -
+ (ORKConsentSignature *)signatureForPersonWithTitle:(NSString *)title dateFormatString:(NSString *)dateFormatString identifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
title

The title of the signatory.

dateFormatString

The format string to use when formatting the date of signature.

identifier

The identifier of the signature, unique within this document.

-
- - - - - - - -
-

Discussion

-

Use this factory method when representing a request to collect a signature for a consent review step.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
-
- - - -

Consent review configuration

- -
-
- -

  requiresName -

- -
-
- -
- - -
-

A Boolean value indicating whether the user needs to enter their name during consent review.

-
- - - -
@property (nonatomic, assign) BOOL requiresName
- - - - - - - - - -
-

Discussion

-

The default value of this property is YES. In a consent review step, the name entry screen is not displayed when the value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
- -

  requiresSignatureImage -

- -
-
- -
- - -
-

A Boolean value indicating whether the user needs to draw a signature during consent review.

-
- - - -
@property (nonatomic, assign) BOOL requiresSignatureImage
- - - - - - - - - -
-

Discussion

-

The default value of this property is YES. In a consent review step, the signature entry -screen is not shown when this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
-
- - - -

Identifying signatories

- -
-
- -

  identifier -

- -
-
- -
- - -
-

The identifier for this signature.

-
- - - -
@property (nonatomic, copy) NSString *identifier
- - - - - - - - - -
-

Discussion

-

The identifier should be unique in the document. It can be used to find or -replace a specific signature in an ORKConsentDocument object. The identifier is also reproduced in -the ORKConsentSignatureResult object produced by an ORKConsentReviewStep object.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
-
- - - -

Personal information.

- -
-
- -

  title -

- -
-
- -
- - -
-

The title of the signatory.

-
- - - -
@property (nonatomic, copy, nullable) NSString *title
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
- -

  givenName -

- -
-
- -
- - -
-

The given name (first name in Western languages)

-
- - - -
@property (nonatomic, copy, nullable) NSString *givenName
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
- -

  familyName -

- -
-
- -
- - -
-

The family name (last name in Western languages)

-
- - - -
@property (nonatomic, copy, nullable) NSString *familyName
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
- -

  signatureImage -

- -
-
- -
- - -
-

The image of the signature, if any.

-
- - - -
@property (nonatomic, copy, nullable) UIImage *signatureImage
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
- -

  signatureDate -

- -
-
- -
- - -
-

The date associated with the signature.

-
- - - -
@property (nonatomic, copy, nullable) NSString *signatureDate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
- -

  signatureDateFormatString -

- -
-
- -
- - -
-

The date format string to be used when producing a date string for the PDF -or consent review.

-
- - - -
@property (nonatomic, copy, nullable) NSString *signatureDateFormatString
- - - - - - - - - -
-

Discussion

-

For example, @“yyyy-MM-dd ‘at’ HH:mm”. When the value of this property is nil, -the current date and time for the current locale is used.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignature.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSignatureResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSignatureResult.html deleted file mode 100644 index f2dfdbdb3f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKConsentSignatureResult.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - ORKConsentSignatureResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentSignatureResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKConsentSignatureResult.h
ORKConsentSignatureResult.m
- - - - -
- -

Overview

-

The ORKConsentSignatureResult class represents a signature obtained during -a consent review step (ORKConsentReviewStep). The consent signature result is usually found as a child result of the -ORKStepResult object for the consent review step.

- -

You can apply the result to a document to facilitate the generation of a -PDF including the signature, or for presentation in a follow-on -consent review.

- -

A consent signature result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– applyToDocument: -

- -
-
- -
- - -
-

Applies the signature to the consent document.

-
- - - -
- (void)applyToDocument:(ORKConsentDocument *)document
- - - -
-

Parameters

- - - - - - - -
document

The document to which to apply the signature.

-
- - - - - - - -
-

Discussion

-

This method uses the identifier to look up the matching signature placeholder -in the consent document and replaces it with this signature. It may throw an exception if -the document does not contain a signature with a matching identifier.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignatureResult.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  signature -

- -
-
- -
- - -
-

A copy of the signature obtained.

-
- - - -
@property (nonatomic, copy, nullable) ORKConsentSignature *signature
- - - - - - - - - -
-

Discussion

-

The signature is a copy of the signature property in the originating -ORKConsentReviewStep object, but also includes any name or signature image collected during -the consent review step.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignatureResult.h

-
- - -
-
-
- -

  consented -

- -
-
- -
- - -
-

A boolean value indicating whether the participant consented.

-
- - - -
@property (nonatomic, assign) BOOL consented
- - - - - - - - - -
-

Discussion

-

YES if the user confirmed consent to the contents of the consent review. Note -that the signature could still be invalid if the name or signature image is -empty; this indicates only that the user gave a positive acknowledgement of the -document.

-
- - - - - - - -
-

Declared In

-

ORKConsentSignatureResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKContinuousScaleAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKContinuousScaleAnswerFormat.html deleted file mode 100644 index d9b1fde3e0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKContinuousScaleAnswerFormat.html +++ /dev/null @@ -1,1112 +0,0 @@ - - - - - - ORKContinuousScaleAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKContinuousScaleAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKContinuousScaleAnswerFormat class represents an answer format that lets participants -select a value on a continuous scale.

- -

The continuous scale answer format produces an ORKScaleQuestionResult object that has a -real-number value.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithMaximumValue:minimumValue:defaultValue:maximumFractionDigits:vertical:maximumValueDescription:minimumValueDescription: -

- -
-
- -
- - -
-

Returns an initialized continuous scale answer format using the specified values.

-
- - - -
- (instancetype)initWithMaximumValue:(double)maximumValue minimumValue:(double)minimumValue defaultValue:(double)defaultValue maximumFractionDigits:(NSInteger)maximumFractionDigits vertical:(BOOL)vertical maximumValueDescription:(nullable NSString *)maximumValueDescription minimumValueDescription:(nullable NSString *)minimumValueDescription
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
maximumValue

The upper bound of the scale.

minimumValue

The lower bound of the scale.

defaultValue

The default value of the scale. If this value is out of range, - the slider is displayed without a default value.

maximumFractionDigits

The maximum number of fractional digits to display.

vertical

Pass YES to use a vertical scale; for the default horizontal - scale, pass NO.

maximumValueDescription

A localized label to describe the maximum value of the scale. - For none, pass nil.

minimumValueDescription

A localized label to describe the minimum value of the scale. - For none, pass nil.

-
- - - -
-

Return Value

-

An initialized scale answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMaximumValue:minimumValue:defaultValue:maximumFractionDigits:vertical: -

- -
-
- -
- - -
-

Returns an initialized continuous scale answer format using the specified values.

-
- - - -
- (instancetype)initWithMaximumValue:(double)maximumValue minimumValue:(double)minimumValue defaultValue:(double)defaultValue maximumFractionDigits:(NSInteger)maximumFractionDigits vertical:(BOOL)vertical
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
maximumValue

The upper bound of the scale.

minimumValue

The lower bound of the scale.

defaultValue

The default value of the scale. If this value is out of range, the - slider is displayed without a default value.

maximumFractionDigits

The maximum number of fractional digits to display.

vertical

Pass YES to use a vertical scale; for the default horizontal scale, - pass NO.

-
- - - -
-

Return Value

-

An initialized scale answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMaximumValue:minimumValue:defaultValue:maximumFractionDigits: -

- -
-
- -
- - -
-

Returns an initialized horizontal continous scale answer format using the specified values.

-
- - - -
- (instancetype)initWithMaximumValue:(double)maximumValue minimumValue:(double)minimumValue defaultValue:(double)defaultValue maximumFractionDigits:(NSInteger)maximumFractionDigits
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
maximumValue

The upper bound of the scale.

minimumValue

The lower bound of the scale.

defaultValue

The default value of the scale. If this value is out of range, the - slider is displayed without a default value.

maximumFractionDigits

The maximum number of fractional digits to display.

-
- - - -
-

Return Value

-

An initialized scale answer format.

-
- - - - - -
-

Discussion

-

This method is a convenience initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximum -

- -
-
- -
- - -
-

The upper bound of the scale. (read-only)

-
- - - -
@property (readonly) double maximum
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimum -

- -
-
- -
- - -
-

The lower bound of the scale. (read-only)

-
- - - -
@property (readonly) double minimum
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultValue -

- -
-
- -
- - -
-

The default value for the slider. (read-only)

-
- - - -
@property (readonly) double defaultValue
- - - - - - - - - -
-

Discussion

-

If the value of this property is less than minimum or greater than maximum, the slider has no -default value.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumFractionDigits -

- -
-
- -
- - -
-

The maximum number of fractional digits to display. (read-only)

-
- - - -
@property (readonly) NSInteger maximumFractionDigits
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  vertical -

- -
-
- -
- - -
-

A Boolean value indicating whether the scale is oriented vertically. (read-only)

-
- - - -
@property (readonly, getter=isVertical) BOOL vertical
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  numberStyle -

- -
-
- -
- - -
-

A formatting style applied to the minimum, maximum, and slider values.

-
- - - -
@property ORKNumberFormattingStyle numberStyle
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  numberFormatter -

- -
-
- -
- - -
-

A number formatter applied to the minimum, maximum, and slider values. Can be overridden by -subclasses.

-
- - - -
@property (readonly) NSNumberFormatter *numberFormatter
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumValueDescription -

- -
-
- -
- - -
-

A localized label to describe the maximum value of the scale. (read-only)

-
- - - -
@property (readonly, nullable) NSString *maximumValueDescription
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimumValueDescription -

- -
-
- -
- - -
-

A localized label to describe the minimum value of the scale. (read-only)

-
- - - -
@property (readonly, nullable) NSString *minimumValueDescription
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumImage -

- -
-
- -
- - -
-

An image for the upper bound of the slider.

-
- - - -
@property (strong, nullable) UIImage *maximumImage
- - - - - - - - - -
-

Discussion

-

The recommended image size is 30 x 30 points. The maximum range label will not be visible.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimumImage -

- -
-
- -
- - -
-

An image for the lower bound of the slider.

-
- - - -
@property (strong, nullable) UIImage *minimumImage
- - - - - - - - - -
-

Discussion

-

The recommended image size is 30 x 30 points. The minimum range label will not be visible.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  gradientColors -

- -
-
- -
- - -
-

The colors to use when drawing a color gradient above the slider. Colors are drawn such that -lower indexes correspond to the minimum side of the scale, while colors at higher indexes in -the array corresond to the maximum side of the scale.

-
- - - -
@property (copy, nullable) NSArray<UIColor*> *gradientColors
- - - - - - - - - -
-

Discussion

-

Setting this value to nil results in no gradient being drawn. Defaults to nil.

- -

An example usage would set an array of red and green to visually indicate a scale from bad to good.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  gradientLocations -

- -
-
- -
- - -
-

Indicates the position of gradient stops for the colors specified in gradientColors. -Gradient stops are specified as values between 0 and 1. The values must be monotonically -increasing.

-
- - - -
@property (copy, nullable) NSArray<NSNumber*> *gradientLocations
- - - - - - - - - -
-

Discussion

-

If nil, the stops are spread uniformly across the range. Defaults to nil.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownLabel.html deleted file mode 100644 index 9e82f857ed..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKCountdownLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCountdownLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKCountdownLabel.h
ORKCountdownLabel.m
- - - - -
- -

Overview

-

Coundown label in active steps

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownStep.html deleted file mode 100644 index 49f2952e2f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownStep.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - ORKCountdownStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCountdownStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKCountdownStep.h
ORKCountdownStep.m
- - - - -
- -

Overview

-

The ORKCountdownStep class represents a step that displays a label and a -countdown for a time equal to its duration.

- -

To use the countdown step, set the duration property, incorporate it into a -task, and present the task with a task view controller.

- -

The countdown step is used in most of ResearchKit’s predefined active tasks.

-
- - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownStepViewController.html deleted file mode 100644 index d0aabe5acc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKCountdownStepViewController.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - ORKCountdownStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKCountdownStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKCountdownStepViewController.h
ORKCountdownStepViewController.m
- - - - -
- -

Overview

-

The ORKCountdownStepViewController class represents the step view controller that corresponds to an ORKCountdownStep.

- -

It is not usually necessary to instantiate this view controller directly. -Instead, add a countdown step to a task, and present the task in a task -view controller.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setStep: -

- -
-
- -
- - -
-

The step presented by the step view controller.

-
- - - -
- (void)setStep:(ORKStep *)step
- - - - - - - - - -
-

Discussion

-

If you use a storyboard to initialize the step view controller, initWithStep: isn’t called, -so you need to set the step property directly before the step view controller is presented.

- -

Setting the value of step after the controller has been presented is an error that -generates an exception. -Modifying the value of step after the controller has been presented is an error that -has undefined results.

- -

Subclasses that override the setter of this property must call super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataCollectionManager.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataCollectionManager.html deleted file mode 100644 index 7239758a97..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataCollectionManager.html +++ /dev/null @@ -1,676 +0,0 @@ - - - - - - ORKDataCollectionManager Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataCollectionManager Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKDataCollectionManager.h
ORKDataCollectionManager.m
- - - - -
- -

Overview

-

The data collection manager is used to collect HealthKit data and CoreMotion data.

- -

It uses collectors to track data types to be collected. -Anchors are used to track progress of each types of data to avoid duplications. -Collected data samples are returned in the delegation methods, return YES to confirm the samples has been accepted.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithPersistenceDirectoryURL: -

- -
-
- -
- - -
-

Initiate the manager with a persistence directory. -The directory is used to store the configurations and progress of the collectors.

-
- - - -
- (instancetype)initWithPersistenceDirectoryURL:(NSURL *)directoryURL
- - - -
-

Parameters

- - - - - - - -
directoryURL

URL path for the directory.

-
- - - -
-

Return Value

-

Initiated ORKDataCollectionManager instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

  collectors -

- -
-
- -
- - -
-

An array of collectors.

-
- - - -
@property (copy, readonly) NSArray<ORKCollector*> *collectors
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

  delegate -

- -
-
- -
- - -
-

Implement the delegate to receive collected data objects.

-
- - - -
@property (nonatomic, weak, nullable) id<ORKDataCollectionManagerDelegate> delegate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– addHealthCollectorWithSampleType:unit:startDate:error: -

- -
-
- -
- - -
-

Add a collector for HealthKit quantity and category samples.

-
- - - -
- (ORKHealthCollector *)addHealthCollectorWithSampleType:(HKSampleType *)sampleType unit:(HKUnit *)unit startDate:(NSDate *)startDate error:(NSError *_Nullable *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
sampleType

HealthKit sample type.

unit

HealthKit unit into which data should be collected.

startDate

Samples should be collected starting at this date.

error

Any error detected during this operation.

-
- - - -
-

Return Value

-

Initiated health collector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– addHealthCorrelationCollectorWithCorrelationType:sampleTypes:units:startDate:error: -

- -
-
- -
- - -
-

Add a collector for HealthKit correlations.

-
- - - -
- (ORKHealthCorrelationCollector *)addHealthCorrelationCollectorWithCorrelationType:(HKCorrelationType *)correlationType sampleTypes:(NSArray<HKSampleType*> *)sampleTypes units:(NSArray<HKUnit*> *)units startDate:(NSDate *)startDate error:(NSError *_Nullable *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
correlationType

HealthKit correlation type.

sampleTypes

Array of HKSampleType expected in the correlation.

units

Array of HKUnit to use when serializing the samples collected (should be same size as sampleTypes).

startDate

Samples should be collected starting at this date.

error

Any error detected during this operation.

-
- - - -
-

Return Value

-

Initiated health correlation collector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– addMotionActivityCollectorWithStartDate:error: -

- -
-
- -
- - -
-

Add a collector for motion activity.

-
- - - -
- (ORKMotionActivityCollector *)addMotionActivityCollectorWithStartDate:(NSDate *)startDate error:(NSError *_Nullable *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
startDate

When data collection should start.

error

Error during this operation.

-
- - - -
-

Return Value

-

Initiated motion activity collector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– removeCollector:error: -

- -
-
- -
- - -
-

Remove a collector.

-
- - - -
- (BOOL)removeCollector:(ORKCollector *)collector error:(NSError *_Nullable *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The collector to be removed.

error

Error during this operation.

-
- - - -
-

Return Value

-

If this operation is successful.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– startCollection -

- -
-
- -
- - -
-

Start data collection. -This method triggers running all the RKCollector collections associated with the present manager. -When the collection is completed, delegate recieves a method call dataCollectionManagerDidCompleteCollection:.

-
- - - -
- (void)startCollection
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
-
- - - -

Extension Methods

- -
-
- -

  lastCollectionDate -

- -
-
- -
- - -
-

Last collection date.

-
- - - -
@property (nonatomic, strong) NSDate *lastCollectionDate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager_Internal.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataCollectionTests.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataCollectionTests.html deleted file mode 100644 index d9523d7157..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataCollectionTests.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - ORKDataCollectionTests Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataCollectionTests Class Reference

- - -
- - - - - - - - - - -
Inherits fromXCTestCase
Conforms toORKDataCollectionManagerDelegate
Declared inORKDataCollectionTests.m
- - - - - - -
- - - - - - -
-
- -

– healthCollector:didCollectSamples: -

- -
-
- -
- - -
-

Method for delivering the collected health data samples.

-
- - - -
- (BOOL)healthCollector:(ORKHealthCollector *)collector didCollectSamples:(NSArray<HKSample*> *)samples
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

samples

Collected health data samples.

-
- - - -
-

Return Value

-

Boolean indicating whether the samples has be accepted. -If NO is returned or this method is not implemented, the manager will stop the collection for the collector and repeat this same collection next time, -until the data is accepted.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– healthCorrelationCollector:didCollectCorrelations: -

- -
-
- -
- - -
-

Method for delivering the collected health correlations.

-
- - - -
- (BOOL)healthCorrelationCollector:(ORKHealthCorrelationCollector *)collector didCollectCorrelations:(NSArray<HKCorrelation*> *)correlations
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

correlations

Collected health correlation samples.

-
- - - -
-

Return Value

-

Boolean indicating whether the samples has be accepted. -If NO is returned or this method is not implemented, the manager will stop the collection for the collector and repeat this same collection next time, -until the data is accepted.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– motionActivityCollector:didCollectMotionActivities: -

- -
-
- -
- - -
-

Method for delivering the collected motion activities.

-
- - - -
- (BOOL)motionActivityCollector:(ORKMotionActivityCollector *)collector didCollectMotionActivities:(NSArray<CMMotionActivity*> *)motionActivities
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

motionActivities

Collected motion activities.

-
- - - -
-

Return Value

-

Boolean indicating whether the samples has be accepted. -If NO is returned or this method is not implemented, the manager will stop the collection for the collector and repeat this same collection next time, -until the data is accepted.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– dataCollectionManagerDidCompleteCollection: -

- -
-
- -
- - -
-

Indicating the collection is completed for all the collectors.

-
- - - -
- (void)dataCollectionManagerDidCompleteCollection:(ORKDataCollectionManager *)manager
- - - -
-

Parameters

- - - - - - - -
manager

The data collection manager.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– collector:didDetectError: -

- -
-
- -
- - -
-

Method for reporting the deteted error during collection.

-
- - - -
- (void)collector:(ORKCollector *)collector didDetectError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

error

The error object.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLogger.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLogger.html deleted file mode 100644 index dc72ebb2a5..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLogger.html +++ /dev/null @@ -1,1433 +0,0 @@ - - - - - - ORKDataLogger Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataLogger Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKDataLogger.h
ORKDataLogger.m
- - - - -
- -

Overview

-

The ORKDataLogger class is an internal component used by some ORKRecorder -subclasses for writing data to disk during tasks. An ORKDataLogger object manages one log as a set of files in a directory.

- -

The current log file is at directory/logName. -Historic log files are at directory/logName-(timestamp)-(count) -where timestamp is of the form YYYYMMddHHmmss (Zulu) and indicates the time -the log finished (that is, was rolled over). If more than one rollover occurs within -one second, additional log files may be created with increasing count.

- -

The user is responsible for managing the historic log files, but the ORKDataLogger class -provides tools for enumerating them (in sorted order).

- -

The data logger contains a concept of whether a file has been uploaded, which -is tracked using file attributes. This feature can facilitate a workflow in which -log files are archived and queued for upload before actually sending them to -a server. When archived and ready for upload, the files could be marked uploaded -by the ORKDataLogger. When the upload is complete and the data has been handed -off downstream, the files can then be deleted. If the upload fails, the uploaded -files can have that flag cleared, to indicate that they should be included -in the next archiving attempt.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ JSONDataLoggerWithDirectory:logName:delegate: -

- -
-
- -
- - -
-

Returns a data logger with an ORKJSONLogFormatter.

-
- - - -
+ (ORKDataLogger *)JSONDataLoggerWithDirectory:(NSURL *)url logName:(NSString *)logName delegate:(id<ORKDataLoggerDelegate>)delegate
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
url

The URL of the directory in which to place log files.

logName

The prefix on the log file name in an ASCII string. Note that the string must not contain the hyphen character (“-”), because a hyphen is used as a separator in the log naming scheme.

delegate

The initial delegate. May be nil.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– initWithDirectory:logName:formatter:delegate: -

- -
-
- -
- - -
-

Returns an initialized data logger using the specified URL, log name, formatter, and delegate.

-
- - - -
- (instancetype)initWithDirectory:(NSURL *)url logName:(NSString *)logName formatter:(ORKLogFormatter *)formatter delegate:(id<ORKDataLoggerDelegate>)delegate
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
url

The URL of the directory in which to place log files

logName

The prefix on the log file name in an ASCII string. Note that -the string must not contain the hyphen character (“-”), because a hyphen is used as a separator in the log naming scheme.

formatter

The type of formatter to use for the log, such as ORKJSONLogFormatter.

delegate

The initial delegate. May be nil.

-
- - - -
-

Return Value

-

An initialized data logger.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– finishCurrentLog -

- -
-
- -
- - -
-

Forces a roll-over now.

-
- - - -
- (void)finishCurrentLog
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– currentLogFileURL -

- -
-
- -
- - -
-

The current log file’s location.

-
- - - -
- (NSURL *)currentLogFileURL
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– fileHandle -

- -
-
- -
- - -
-

The file handle to which to write

-
- - - -
- (NSFileHandle *)fileHandle
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– enumerateLogs:error: -

- -
-
- -
- - -
-

Enumerates the URLs of completed log files, sorted to put the oldest first.

-
- - - -
- (BOOL)enumerateLogs:(void ( ^ ) ( NSURL *logFileUrl , BOOL *stop ))block error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
block

The block to call during enumeration.

error

Any error detected during the enumeration.

-
- - - -
-

Return Value

-

YES if the enumeration was successful; otherwise, NO.

-
- - - - - -
-

Discussion

-

Takes a snapshot of the current directory’s relevant files, sorts them, -and enumerates them. Errors can occur if changes are being made to the filesystem other -than through this object.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– enumerateLogsNeedingUpload:error: -

- -
-
- -
- - -
-

Enumerates the URLs of completed log files not yet marked uploaded, -sorted to put the oldest first.

-
- - - -
- (BOOL)enumerateLogsNeedingUpload:(void ( ^ ) ( NSURL *logFileUrl , BOOL *stop ))block error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - -
block

The block to call during enumeration.

error

Any error detected during the enumeration.

-
- - - -
-

Return Value

-

YES if the enumeration was successful; otherwise, NO.

-
- - - - - -
-

Discussion

-

This method takes a snapshot of the current directory’s completed nonuploaded log files, sorts them, -and then enumerates them. Errors can occur if changes are being made to the filesystem other -than through this object.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– enumerateLogsAlreadyUploaded:error: -

- -
-
- -
- - -
-

Enumerates the URLs of completed log files not already marked uploaded, -sorted to put the oldest first.

-
- - - -
- (BOOL)enumerateLogsAlreadyUploaded:(void ( ^ ) ( NSURL *logFileUrl , BOOL *stop ))block error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - -
block

The block to call during enumeration.

error

Any error detected during the enumeration.

-
- - - -
-

Return Value

-

YES if the enumeration was successful; otherwise, NO.

-
- - - - - -
-

Discussion

-

Takes a snapshot of the current directory’s completed uploaded log files, sorts them, -and then enumerates them. Errors can occur if changes are being made to the filesystem other -than through this object.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– append:error: -

- -
-
- -
- - -
-

Appends an object to the log file, which is formatted with logFormatter.

-
- - - -
- (BOOL)append:(id)object error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
object

Should be an object of a class that is accepted by the logFormatter.

error

Error output, if the append fails.

-
- - - -
-

Return Value

-

YES if appending succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

The default log formatter expects NSData; call canAcceptLogObjectOfClass: on logFormatter to determine if it will accept this object.

- -

Note that the current log file is created and opened lazily when a request to -log data is made. If an attempt is made to log data and there is no access due -to file protection, the log is immediately rolled over and a new file created.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– appendObjects:error: -

- -
-
- -
- - -
-

Appends multiple objects to the log file.

-
- - - -
- (BOOL)appendObjects:(NSArray *)objects error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
objects

An array of objects of a class that is accepted by the logFormatter.

error

Error output, if the append fails.

-
- - - -
-

Return Value

-

YES if appending succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

This method formats and appends all the objects at once. Using this method may have efficiency -and atomicity gains for error handling, compared to making multiple calls to append:error.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– markFileUploaded:atURL:error: -

- -
-
- -
- - -
-

Marks or unmarks a file as uploaded.

-
- - - -
- (BOOL)markFileUploaded:(BOOL)uploaded atURL:(NSURL *)url error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
uploaded

A Boolean value that indicates whether to mark the file uploaded or not uploaded.

url

The URL to mark.

error

The error that occurred, if the operation fails.

-
- - - -
-

Return Value

-

YES if adding or removing the attribute succeeded; otherwise, NO.

-
- - - - - -
-

Discussion

-

This method uses an extended attribute on the filesystem to mark a file as uploaded. -This is intended for book-keeping use only and to track which files have already -been attached to a pending upload. When the upload is sufficiently complete, -the file should be removed.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– removeUploadedFiles:withError: -

- -
-
- -
- - -
-

Removes files if they are marked uploaded.

-
- - - -
- (BOOL)removeUploadedFiles:(NSArray<NSURL*> *)fileURLs withError:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
fileURLs

The array of files that should be removed.

error

The error that occurred, if the operation fails.

-
- - - -
-

Return Value

-

YES if removing the files succeeded; otherwise, NO.

-
- - - - - -
-

Discussion

-

If a file is in the list, but is no longer marked uploaded, this method does not remove the file. This workflow lets you unmark files selectively if they could not be added -to the archive, and later call removeUploadedFiles:withError: to remove only -the files that are still marked uploaded.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– removeAllFilesWithError: -

- -
-
- -
- - -
-

Removes all files managed by this logger (files that have the logName prefix).

-
- - - -
- (BOOL)removeAllFilesWithError:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - -
error

The error that occurred, if operation fails.

-
- - - -
-

Return Value

-

YES if removing the files succeeded.; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– isFileUploadedAtURL: -

- -
-
- -
- - -
-

Checks whether a file has been marked as uploaded.

-
- - - -
- (BOOL)isFileUploadedAtURL:(NSURL *)url
- - - -
-

Parameters

- - - - - - - -
url

The URL to check.

-
- - - -
-

Return Value

-

YES if the uploaded attribute has been set on the file and the file exists; otherwise, - NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  delegate -

- -
-
- -
- - -
-

The delegate to be notified when file sizes change or the log rolls over.

-
- - - -
@property (weak, nullable) id<ORKDataLoggerDelegate> delegate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  logFormatter -

- -
-
- -
- - -
-

The log formatter being used.

-
- - - -
@property (strong, readonly) ORKLogFormatter *logFormatter
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  maximumCurrentLogFileSize -

- -
-
- -
- - -
-

The maximum current log file size.

-
- - - -
@property size_t maximumCurrentLogFileSize
- - - - - - - - - -
-

Discussion

-

When the current log reaches this size, it is automatically rolled over.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  maximumCurrentLogFileLifetime -

- -
-
- -
- - -
-

The maximum current log file lifetime.

-
- - - -
@property NSTimeInterval maximumCurrentLogFileLifetime
- - - - - - - - - -
-

Discussion

-

When the current log file has been active this long, it is rolled over.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  pendingBytes -

- -
-
- -
- - -
-

The number of bytes of log data that are not marked uploaded, excluding the current file. This value is lazily updated.

-
- - - -
@property unsigned long long pendingBytes
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  uploadedBytes -

- -
-
- -
- - -
-

The number of bytes of log data that are marked uploaded. This value is lazily updated.

-
- - - -
@property unsigned long long uploadedBytes
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  fileProtectionMode -

- -
-
- -
- - -
-

The file protection mode to use for newly created files.

-
- - - -
@property (assign) ORKFileProtectionMode fileProtectionMode
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  logName -

- -
-
- -
- - -
-

The prefix on the log file names.

-
- - - -
@property (copy, readonly) NSString *logName
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerManager.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerManager.html deleted file mode 100644 index 08628c1a77..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerManager.html +++ /dev/null @@ -1,1159 +0,0 @@ - - - - - - ORKDataLoggerManager Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataLoggerManager Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toORKDataLoggerDelegate
Declared inORKDataLogger.h
ORKDataLogger.m
- - - - -
- -

Overview

-

The ORKDataLoggerManager class represents a manager for multiple ORKDataLogger instances, -which tracks the total size of log files produced and can notify its delegate -when file sizes reach configurable thresholds.

- -

The ORKDataLoggerManager class is an internal component used by some ORKRecorder -subclasses for writing data to disk during tasks.

- -

This manager can be used to organize the ORKDataLogger logs in a directory, -and keep track of the total number of bytes stored on disk by each logger. The -delegate can be informed if either the number of bytes pending upload, or the total -number of bytes, exceeds configurable thresholds.

- -

The configuration of the loggers and their thresholds is persisted in a -configuration file in the log directory.

- -

If the number of bytes pending upload exceeds the threshold, the natural action is to -upload them. A block-based enumeration is provided for enumerating all the logs -pending upload. Use enumerateLogsNeedingUpload:error:, and when a log has been -processed for upload, use the logger to mark it uploaded.

- -

When the upload succeeds (or at least is successfully queued), the uploaded files -can be removed across all the loggers by calling removeUploadedFiles:error:

- -

If the total number of bytes exceeds the threshold, the natural action is to remove log -files that have been marked uploaded, and then remove old log files until the -threshold is no longer exceeded. You can do this by calling removeOldAndUploadedLogsToThreshold:error:

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithDirectory:delegate: -

- -
-
- -
- - -
-

Returns an initialized data logger manager using the specified directory and delegate.

-
- - - -
- (instancetype)initWithDirectory:(NSURL *)directory delegate:(id<ORKDataLoggerManagerDelegate>)delegate
- - - -
-

Parameters

- - - - - - - - - - - - -
directory

The file URL of the directory where the data loggers should coexist.

delegate

The delegate to receive notifications.

-
- - - -
-

Return Value

-

An initialized data logger manager.

-
- - - - - -
-

Discussion

-

Designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– addJSONDataLoggerForLogName: -

- -
-
- -
- - -
-

Adds a data logger with a JSON log format to the directory.

-
- - - -
- (ORKDataLogger *)addJSONDataLoggerForLogName:(NSString *)logName
- - - -
-

Parameters

- - - - - - - -
logName

The log name prefix for the data logger.

-
- - - -
-

Return Value

-

The ORKDataLogger object that was added.

-
- - - - - -
-

Discussion

-

This method throws an exception if a logger already exists with the specified log name.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– addDataLoggerForLogName:formatter: -

- -
-
- -
- - -
-

Adds a data logger with a particular formatter to the directory.

-
- - - -
- (ORKDataLogger *)addDataLoggerForLogName:(NSString *)logName formatter:(ORKLogFormatter *)formatter
- - - -
-

Parameters

- - - - - - - - - - - - -
logName

The log name prefix for the data logger.

formatter

The log formatter instance to use for this logger.

-
- - - -
-

Return Value

-

The ORKDataLogger object that was added, or the existing one if one already existed for -that log name.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– removeDataLogger: -

- -
-
- -
- - -
-

Removes a data logger.

-
- - - -
- (void)removeDataLogger:(ORKDataLogger *)logger
- - - -
-

Parameters

- - - - - - - -
logger

The logger to remove.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– dataLoggerForLogName: -

- -
-
- -
- - -
-

Retrieves the already existing data logger for a log name.

-
- - - -
- (ORKDataLogger *)dataLoggerForLogName:(NSString *)logName
- - - -
-

Parameters

- - - - - - - -
logName

The log name prefix for the data logger.

-
- - - -
-

Return Value

-

The ORKDataLogger object that was retrieved, or nil if one already existed for that log name.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– logNames -

- -
-
- -
- - -
-

Returns the set of log names of the data loggers managed by this object.

-
- - - -
- (NSArray<NSString*> *)logNames
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– enumerateLogsNeedingUpload:error: -

- -
-
- -
- - -
-

Enumerates all the logs that need upload across all data loggers, sorted from oldest to first.

-
- - - -
- (BOOL)enumerateLogsNeedingUpload:(void ( ^ ) ( ORKDataLogger *dataLogger , NSURL *logFileUrl , BOOL *stop ))block error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
block

The block to call during enumeration.

error

The error, on failure.

-
- - - -
-

Return Value

-

YES if the enumeration succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

Before sorting the logs, this method fetches all the data loggers' logs that need upload.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– removeUploadedFiles:error: -

- -
-
- -
- - -
-

Removes a set of uploaded files.

-
- - - -
- (BOOL)removeUploadedFiles:(NSArray<NSURL*> *)fileURLs error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
fileURLs

The array of file URLs that should be removed.

error

The error, on failure.

-
- - - -
-

Return Value

-

YES if the operation succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

This method is analogous to a similar method in ORKDataLogger, but it accepts an array of files -that may relate to any of the data loggers. It is an error to pass a URL which would not -belong to one of the loggers managed by this manager.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– unmarkUploadedFiles:error: -

- -
-
- -
- - -
-

Unmarks the set of uploaded files.

-
- - - -
- (BOOL)unmarkUploadedFiles:(NSArray<NSURL*> *)fileURLs error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
fileURLs

The array of file URLs that should no longer be marked uploaded.

error

The error, on failure.

-
- - - -
-

Return Value

-

YES if the operation succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

Use this method to indicate that the specified files should no longer be marked uploaded (for example, because -the upload did not succeed).

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– removeOldAndUploadedLogsToThreshold:error: -

- -
-
- -
- - -
-

Removes old and uploaded logs to bring total bytes down to a threshold.

-
- - - -
- (BOOL)removeOldAndUploadedLogsToThreshold:(unsigned long long)bytes error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
bytes

The threshold down to which to remove old log files. File removal stops when the total bytes managed by all the data loggers reaches this threshold.

error

The error, on failure.

-
- - - -
-

Return Value

-

YES if the operation succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

This method removes uploaded logs first, followed by the oldest log files across -all of the data loggers, until the total usage falls below a threshold.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– dataLogger:finishedLogFile: -

- -
-
- -
- - -
-

Tells the delegate when a log file rollover occurs.

-
- - - -
- (void)dataLogger:(ORKDataLogger *)dataLogger finishedLogFile:(NSURL *)fileUrl
- - - -
-

Parameters

- - - - - - - - - - - - -
dataLogger

The data logger providing the notification.

fileUrl

The URL of the newly renamed log file.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– dataLoggerByteCountsDidChange: -

- -
-
- -
- - -
-

Tells the delegate if the number of bytes in completed logs changes.

-
- - - -
- (void)dataLoggerByteCountsDidChange:(ORKDataLogger *)dataLogger
- - - -
-

Parameters

- - - - - - - -
dataLogger

The data logger providing the notification.

-
- - - - - - - -
-

Discussion

-

When files are removed or added, or marked as uploaded or unmarked, this delegate method is called a short time later. Multiple directory changes -are rolled up into a single delegate callback.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  delegate -

- -
-
- -
- - -
-

The delegate of the data logger manager.

-
- - - -
@property (weak, nullable) id<ORKDataLoggerManagerDelegate> delegate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  pendingUploadBytesThreshold -

- -
-
- -
- - -
-

The threshold for delegate callback for total bytes not marked uploaded.

-
- - - -
@property unsigned long long pendingUploadBytesThreshold
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  totalBytesThreshold -

- -
-
- -
- - -
-

The threshold for delegate callback for total bytes of completed logs.

-
- - - -
@property unsigned long long totalBytesThreshold
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  pendingUploadBytes -

- -
-
- -
- - -
-

The total number of bytes of files not marked as pending upload.

-
- - - -
@property unsigned long long pendingUploadBytes
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

  totalBytes -

- -
-
- -
- - -
-

The total number of bytes for all the loggers.

-
- - - -
@property unsigned long long totalBytes
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerManagerTests.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerManagerTests.html deleted file mode 100644 index 9821084eac..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerManagerTests.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - ORKDataLoggerManagerTests Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataLoggerManagerTests Class Reference

- - -
- - - - - - - - - - -
Inherits fromXCTestCase
Conforms toORKDataLoggerManagerDelegate
Declared inORKDataLoggerManagerTests.m
- - - - - - -
- - - - - - -
-
- -

– dataLoggerManager:pendingUploadBytesReachedThreshold: -

- -
-
- -
- - -
-

Called by the data logger manager when the total size of files -that are not marked uploaded has reached a threshold.

-
- - - -
- (void)dataLoggerManager:(ORKDataLoggerManager *)dataLogger pendingUploadBytesReachedThreshold:(unsigned long long)pendingUploadBytes
- - - -
-

Parameters

- - - - - - - - - - - - -
dataLoggerManager

The manager that produced the notification.

pendingUploadBytes

The number of bytes managed by all the loggers, which - have not yet been marked uploaded.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– dataLoggerManager:totalBytesReachedThreshold: -

- -
-
- -
- - -
-

Called by the data logger manager when the total size of files -managed by any of the loggers has reached a threshold.

-
- - - -
- (void)dataLoggerManager:(ORKDataLoggerManager *)dataLogger totalBytesReachedThreshold:(unsigned long long)totalBytes
- - - -
-

Parameters

- - - - - - - - - - - - -
dataLoggerManager

The manager that produced the notification.

totalBytes

The total number of bytes of all files managed.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerTests.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerTests.html deleted file mode 100644 index 01b9e02c94..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDataLoggerTests.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - ORKDataLoggerTests Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataLoggerTests Class Reference

- - -
- - - - - - - - - - -
Inherits fromXCTestCase
Conforms toORKDataLoggerDelegate
Declared inORKDataLoggerTests.m
- - - - - - -
- - - - - - -
-
- -

– dataLogger:finishedLogFile: -

- -
-
- -
- - -
-

Tells the delegate when a log file rollover occurs.

-
- - - -
- (void)dataLogger:(ORKDataLogger *)dataLogger finishedLogFile:(NSURL *)fileUrl
- - - -
-

Parameters

- - - - - - - - - - - - -
dataLogger

The data logger providing the notification.

fileUrl

The URL of the newly renamed log file.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDateAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDateAnswerFormat.html deleted file mode 100644 index 6157bd411a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDateAnswerFormat.html +++ /dev/null @@ -1,593 +0,0 @@ - - - - - - ORKDateAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDateAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKDateAnswerFormat class represents the answer format for questions that require users -to enter a date, or a date and time.

- -

A date answer format produces an ORKDateQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithStyle: -

- -
-
- -
- - -
-

Returns an initialized date answer format using the specified date style.

-
- - - -
- (instancetype)initWithStyle:(ORKDateAnswerStyle)style
- - - -
-

Parameters

- - - - - - - -
style

The style of date answer, such as date, or date and time.

-
- - - -
-

Return Value

-

An initialized date answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithStyle:defaultDate:minimumDate:maximumDate:calendar: -

- -
-
- -
- - -
-

Returns an initialized date answer format using the specified answer style and default date values.

-
- - - -
- (instancetype)initWithStyle:(ORKDateAnswerStyle)style defaultDate:(nullable NSDate *)defaultDate minimumDate:(nullable NSDate *)minimumDate maximumDate:(nullable NSDate *)maximumDate calendar:(nullable NSCalendar *)calendar
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
style

The style of date answer, such as date, or date and time.

defaultDate

The default date to display. When the value of this parameter is nil, the - picker displays the current time.

minimumDate

The minimum date that is accessible in the picker. If the value of this - parameter is nil, there is no minimum.

maximumDate

The maximum date that is accessible in the picker. If the value of this - parameter is nil, there is no maximum.

calendar

The calendar to use. If the value of this parameter is nil, the picker - uses the default calendar for the current locale.

-
- - - -
-

Return Value

-

An initialized date answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  style -

- -
-
- -
- - -
-

The style of date entry.

-
- - - -
@property (readonly) ORKDateAnswerStyle style
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultDate -

- -
-
- -
- - -
-

The date to use as the default.

-
- - - -
@property (copy, readonly, nullable) NSDate *defaultDate
- - - - - - - - - -
-

Discussion

-

The date is displayed in the user’s time zone. -When the value of this property is nil, the current time is used as the default.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimumDate -

- -
-
- -
- - -
-

The minimum allowed date.

-
- - - -
@property (copy, readonly, nullable) NSDate *minimumDate
- - - - - - - - - -
-

Discussion

-

When the value of this property is nil, there is no minimum.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumDate -

- -
-
- -
- - -
-

The maximum allowed date.

-
- - - -
@property (copy, readonly, nullable) NSDate *maximumDate
- - - - - - - - - -
-

Discussion

-

When the value of this property is nil, there is no maximum.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  calendar -

- -
-
- -
- - -
-

The calendar to use in the picker.

-
- - - -
@property (copy, readonly, nullable) NSCalendar *calendar
- - - - - - - - - -
-

Discussion

-

When the value of this property is nil, the picker uses the default calendar for the current -locale.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDateQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDateQuestionResult.html deleted file mode 100644 index 73bbff41fb..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDateQuestionResult.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - ORKDateQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDateQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKDateQuestionResult class represents the result of a question or form item that asks for a date (ORKDateAnswerFormat).

- -

The calendar and time zone are recorded in addition to the answer itself, -to give the answer context. Usually, this data corresponds to the current calendar -and time zone at the time of the activity, but it can be overridden by setting -these properties explicitly in the ORKDateAnswerFormat object.

-
- - - - - -
- - - - - - -
-
- -

  dateAnswer -

- -
-
- -
- - -
-

The date that the user entered, or nil if the user skipped the question.

-
- - - -
@property (nonatomic, copy, nullable) NSDate *dateAnswer
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
- -

  calendar -

- -
-
- -
- - -
-

The calendar used when selecting date and time.

-
- - - -
@property (nonatomic, copy, nullable) NSCalendar *calendar
- - - - - - - - - -
-

Discussion

-

If the calendar in the ORKDateAnswerFormat object is nil, this calendar is the system -calendar at the time of data entry.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
- -

  timeZone -

- -
-
- -
- - -
-

The time zone that was current when selecting the date and time.

-
- - - -
@property (nonatomic, copy, nullable) NSTimeZone *timeZone
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDeviceMotionRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDeviceMotionRecorder.html deleted file mode 100644 index 5f49bc6452..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDeviceMotionRecorder.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - - ORKDeviceMotionRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDeviceMotionRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKDeviceMotionRecorder.h
ORKDeviceMotionRecorder.m
- - - - -
- -

Overview

-

The ORKDeviceMotionRecorder class represents a recorder that requests and collects device motion data from CoreMotion at a fixed frequency.

- -

To ensure that the motion recorder continues to record when the app enters the -background, use the background task support provided by UIApplication.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  frequency -

- -
-
- -
- - -
-

The frequency of motion data collection from CoreMotion in hertz (Hz).

-
- - - -
@property (nonatomic, readonly) double frequency
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKDeviceMotionRecorder.h

-
- - -
-
-
- -

– initWithIdentifier:frequency:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized device motion recorder using the specified frequency.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier frequency:(double)frequency step:(nullable ORKStep *)step outputDirectory:(nullable NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

frequency

The frequency of motion data collection from CoreMotion in hertz (Hz).

step

The step that requested this recorder.

outputDirectory

The directory in which the device motion data should be stored.

-
- - - -
-

Return Value

-

An initialized motion data recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDeviceMotionRecorder.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDeviceMotionRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDeviceMotionRecorderConfiguration.html deleted file mode 100644 index 71c59b22b1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDeviceMotionRecorderConfiguration.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - ORKDeviceMotionRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDeviceMotionRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKDeviceMotionRecorder.m
ORKRecorder.h
- - - - -
- -

Overview

-

The ORKDeviceMotionRecorderConfiguration class represents a configuration -that records device motion data during an active step.

- -

Device motion data is the processed motion data provided by CoreMotion and obtained -from a CMMotionManager object. The data can include measures of the overall device orientation -obtained from combining accelerometer, magnetometer, and gyroscope data.

- -

Device motion data is serialized to JSON and returned as an ORKFileResult object. -For details on the format, see CMDeviceMotion+ORKJSONDictionary.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– initWithIdentifier:frequency: -

- -
-
- -
- - -
-

Returns an initialized device motion recorder configuration using the specified frequency.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier frequency:(double)frequency
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier of the recorder configuration.

frequency

Motion data collection frequency in samples per second (Hz).

-
- - - -
-

Return Value

-

An initialized device motion recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new device motion recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the device motion recorder configuration.

-
- - - -
-

Return Value

-

A new device motion recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedPermissionMask -

- -
-
- -
- - -
-

Returns the permission mask indicating the permissions required for this configuration.

-
- - - -
- (ORKPermissionMask)requestedPermissionMask
- - - - - - - - - -
-

Discussion

-

This method is typically overridden in new recorder configuration subclasses.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  frequency -

- -
-
- -
- - -
-

The frequency of motion data collection in samples per second (Hz).

-
- - - -
@property (nonatomic, readonly) double frequency
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDirectStepNavigationRule.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDirectStepNavigationRule.html deleted file mode 100644 index bfd64905c4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDirectStepNavigationRule.html +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - ORKDirectStepNavigationRule Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDirectStepNavigationRule Class Reference

- - -
- - - - - - - -
Inherits fromORKStepNavigationRule : NSObject
Declared inORKStepNavigationRule.h
ORKStepNavigationRule.m
- - - - -
- -

Overview

-

The ORKDirectStepNavigationRule class can be used to unconditionally jump to a destination step -specified by its identifier or to finish the task early.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithDestinationStepIdentifier: -

- -
-
- -
- - -
-

Returns an initialized direct-step navigation rule using the specified destination step identifier.

-
- - - -
- (instancetype)initWithDestinationStepIdentifier:(NSString *)destinationStepIdentifier
- - - -
-

Parameters

- - - - - - - -
destinationStepIdentifier

The identifier of the destination step. Pass the - ORKNullStepIdentifier constant if you want to finish the - ongoing task when the direct-step navigation rule is - triggered.

-
- - - -
-

Return Value

-

A direct-step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new direct-step navigation rule initialized from data in a given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the step navigation rule.

-
- - - -
-

Return Value

-

A new direct-step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  destinationStepIdentifier -

- -
-
- -
- - -
-

The identifier of the destination step.

-
- - - -
@property (nonatomic, copy, readonly) NSString *destinationStepIdentifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– identifierForDestinationStepWithTaskResult: -

- -
-
- -
- - -
-

Returns the target step identifier.

-
- - - -
- (NSString *)identifierForDestinationStepWithTaskResult:(ORKTaskResult *)ORKTaskResult
- - - -
-

Parameters

- - - - - - - -
taskResult

The up-to-date task result, used for calculating the destination step.

-
- - - -
-

Return Value

-

The identifier of the destination step.

-
- - - - - -
-

Discussion

-

Subclasses must implement this method to calculate the next step based on the passed task result. -The ORKNullStepIdentifier constant can be returned to indicate that the ongoing task should end -after the step navigation rule is triggered.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDiscreteGraphChartView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDiscreteGraphChartView.html deleted file mode 100644 index 880ab0a88b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKDiscreteGraphChartView.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - ORKDiscreteGraphChartView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDiscreteGraphChartView Class Reference

- - -
- - - - - - - -
Inherits fromORKValueRangeGraphChartView : ORKGraphChartView : UIView
Declared inORKDiscreteGraphChartView.h
ORKDiscreteGraphChartView.m
- - - - -
- -

Overview

-

The ORKDiscreteGraphChartView class presents data provided by an object conforming to the -ORKValueRangeGraphChartViewDataSource protocol as a discrete graph of ranged points.

- -

You can optionally display a line connecting each ranged point pair.

- -

By default, the primary plot is colored by the tintColor, and any additional plots are colored -using the referenceLineColor property. You can customize the plot colors by implementing the --graphChartView:colorForPlotIndex: method in the data source.

-
- - - - - -
- - - - - - -
-
- -

  drawsConnectedRanges -

- -
-
- -
- - -
-

A Boolean value indicating whether to draw a line connecting the minimum value and maximum value of -each ranged point represented by the graph view.

-
- - - -
@property (nonatomic) IBInspectable BOOL drawsConnectedRanges
- - - - - - - - - -
-

Discussion

-

The default value for this property is YES.

-
- - - - - - - -
-

Declared In

-

ORKDiscreteGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEmailAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEmailAnswerFormat.html deleted file mode 100644 index 68e56d7bda..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEmailAnswerFormat.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - ORKEmailAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKEmailAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKEmailAnswerFormat class represents the answer format for questions that collect an email -response from the user.

- -

An ORKEmailAnswerFormat object produces an ORKTextQuestionResult object.

-
- - - - - -
- - - - - - -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– impliedAnswerFormat -

- -
-
- -
- - -
-

Some answer formats are constructed of other answer formats. This method allows -a subclass to return a different answer format for use in defining the UI/UX for -the answer format type. For example, a Boolean answer format is presented in the -same way as a single-choice answer format with the choices Yes and No mapping to -@(YES) and @(NO), respectively, so its impliedAnswerFormat is an -ORKTextChoiceAnswerFormat with those options.

-
- - - -
- (ORKAnswerFormat *)impliedAnswerFormat
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEnvironmentSPLMeterStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEnvironmentSPLMeterStep.html deleted file mode 100644 index af6a49be32..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEnvironmentSPLMeterStep.html +++ /dev/null @@ -1,445 +0,0 @@ - - - - - - ORKEnvironmentSPLMeterStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKEnvironmentSPLMeterStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKEnvironmentSPLMeterStep.h
ORKEnvironmentSPLMeterStep.m
- - - - - - -
- - - - -

Other Methods

- -
-
- -

  thresholdValue -

- -
-
- -
- - -
-

The maximum permissible value for the environment sound pressure level in dBA.

-
- - - -
@property (nonatomic, assign) double thresholdValue
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKEnvironmentSPLMeterStep.h

-
- - -
-
-
- -

  samplingInterval -

- -
-
- -
- - -
-

The rate at which the AVAudioPCMBuffer is queried and A-weighted filter is applied.

-
- - - -
@property (nonatomic, assign) NSTimeInterval samplingInterval
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKEnvironmentSPLMeterStep.h

-
- - -
-
-
- -

  requiredContiguousSamples -

- -
-
- -
- - -
-

The number of consecutive samples less than threshold value required for the step to proceed.

-
- - - -
@property (nonatomic, assign) NSInteger requiredContiguousSamples
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKEnvironmentSPLMeterStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEnvironmentSPLMeterStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEnvironmentSPLMeterStepViewController.html deleted file mode 100644 index 3b4f0b0a3b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKEnvironmentSPLMeterStepViewController.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - ORKEnvironmentSPLMeterStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKEnvironmentSPLMeterStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKEnvironmentSPLMeterStepViewController.h
ORKEnvironmentSPLMeterStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFileResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFileResult.html deleted file mode 100644 index 5037f22f56..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFileResult.html +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - ORKFileResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFileResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKFileResult.h
ORKFileResult.m
- - - - -
- -

Overview

-

The ORKFileResult class is a result that references the location of a file produced -during a task.

- -

A file result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize the linked file for transmission -to the server.

- -

Active steps typically produce file results when CoreMotion or HealthKit are -serialized to disk using a data logger (ORKDataLogger). Audio recording also produces a file -result.

- -

When you write a custom step, use files to report results only when the data -is likely to be too big to hold in memory for the duration of the task. For -example, fitness tasks that use sensors can be quite long and can generate -a large number of samples. To compensate for the length of the task, you can stream the samples to disk during -the task, and return an ORKFileResult object in the result hierarchy, usually as a -child of an ORKStepResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  contentType -

- -
-
- -
- - -
-

The MIME content type of the result.

-
- - - -
@property (nonatomic, copy, nullable) NSString *contentType
- - - - - - - - - -
-

Discussion

-

For example, @"application/json".

-
- - - - - - - -
-

Declared In

-

ORKFileResult.h

-
- - -
-
-
- -

  fileURL -

- -
-
- -
- - -
-

The URL of the file produced.

-
- - - -
@property (nonatomic, copy, nullable) NSURL *fileURL
- - - - - - - - - -
-

Discussion

-

It is the responsibility of the receiver of the result object to delete -the file when it is no longer needed.

- -

The file is typically written to the output directory of the -task view controller, so it is common to manage the archiving or cleanup -of these files by archiving or deleting the entire output directory.

-
- - - - - - - -
-

Declared In

-

ORKFileResult.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– isSaveable -

- -
-
- -
- - -
-

A boolean value indicating whether this result can be saved in a save and -restore procedure.

-
- - - -
- (BOOL)isSaveable
- - - - - - - - - -
-

Discussion

-

This is currently considered a private method, but overriding the getter in a result -is the correct way to prevent this result being considered as saveable for -the purpose of deciding whether to offer a “Save” option when the user -cancels a task in progress.

- -

ORKResult subclasses should return YES if they have data that the user -might want to be able to restore if the task were interrupted and later -resumed from the current state.

-
- - - - - - - -
-

Declared In

-

ORKResult_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFitnessStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFitnessStep.html deleted file mode 100644 index cd30cc27f1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFitnessStep.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - ORKFitnessStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFitnessStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKFitnessStep.h
ORKFitnessStep.m
- - - - -
- -

Overview

-

Fitness step.

- -

Displays usual header, a counting-up timer, read outs for distance and/or -heart rate if corresponding recorders are attached.

- -

Also displays an image during the task.

-
- - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFitnessStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFitnessStepViewController.html deleted file mode 100644 index 24b2a89da5..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFitnessStepViewController.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - ORKFitnessStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFitnessStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKFitnessStepViewController.h
ORKFitnessStepViewController.m
- - - - -
- -

Overview

-

Step view controller corresponding to ORKFitnessStep.

- -

Observes countdown timer, heart rate, and distance, and relays these to the -screen during the task.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– recordersDidChange -

- -
-
- -
- - -
-

Tells the view controller that the set of recorders changed.

-
- - - -
- (void)recordersDidChange
- - - - - - - - - -
-

Discussion

-

This method is usually called by the active step view controller in response -to start or resume.

- -

Subclasses may override this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFootnoteLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFootnoteLabel.html deleted file mode 100644 index 338df670b5..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFootnoteLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKFootnoteLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFootnoteLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKFootnoteLabel.h
ORKFootnoteLabel.m
- - - - -
- -

Overview

-

Step’s details text under title.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormItem.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormItem.html deleted file mode 100644 index fe6748e661..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormItem.html +++ /dev/null @@ -1,703 +0,0 @@ - - - - - - ORKFormItem Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFormItem Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKFormStep.h
ORKFormStep.m
- - - - -
- -

Overview

-

The ORKFormItem class represents a single item in a form step (ORKFormStep), and typically -represents a question.

- -

To use ORKFormItem, instantiate the object, fill in its properties, and incorporate -it in an ORKFormStep object.

- -

Usually, a form item corresponds to either a row or a section header in a form, but -if the answer format is a choice answer format, it may correspond to an entire -section.

- -

Each form item generates one question result (ORKQuestionResult), which becomes a child of its step’s -result (ORKStepResult).

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:text:answerFormat: -

- -
-
- -
- - -
-

Returns an initialized form item using the specified identifier, title, and answer format.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier text:(NSString *)text answerFormat:(ORKAnswerFormat *)answerFormat
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The string that identifies the form item, which should be unique within the form step.

text

The text displayed as a prompt for the form item’s question.

answerFormat

The answer format for the form item.

-
- - - -
-

Return Value

-

An initialized form item.

-
- - - - - - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

– initWithIdentifier:text:answerFormat:optional: -

- -
-
- -
- - -
-

Returns an initialized form item using the specified identifier, title, optionality and answer format.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier text:(NSString *)text answerFormat:(ORKAnswerFormat *)answerFormat optional:(BOOL)optional
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The string that identifies the form item, which should be unique within the form step.

text

The text displayed as a prompt for the form item’s question.

answerFormat

The answer format for the form item.

optional

A Boolean that determines whether the item is optional

-
- - - -
-

Return Value

-

An initialized form item.

-
- - - - - - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

– initWithSectionTitle: -

- -
-
- -
- - -
-

Returns an initialized form item using the specified section title.

-
- - - -
- (instancetype)initWithSectionTitle:(NSString *)sectionTitle
- - - -
-

Parameters

- - - - - - - -
sectionTitle

The title of the section.

-
- - - -
-

Return Value

-

An initialized form item for use as a section header in a form.

-
- - - - - - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

– confirmationAnswerFormItemWithIdentifier:text:errorMessage: -

- -
-
- -
- - -
-

Returns an form item that can be used for confirming a text entry.

-
- - - -
- (ORKFormItem *)confirmationAnswerFormItemWithIdentifier:(NSString *)identifier text:(nullable NSString *)text errorMessage:(NSString *)errorMessage
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The identifier for the ORKFormItem that is returned.

text

The text for the ORKFormItem that is returned.

errorMessage

The error message to display if the fields do not match

-
- - - -
-

Return Value

-

An ORKFormItem with the indicated identifier and text and an ORKAnswerFormat - that is appropriate for confirming the input form item.

-
- - - - - -
-

Discussion

-

This form item is intended to be used with an ORKFormStep in order to confirm a previous -formItem input. Example usage includes a password or participant identifier that is used to -anonymously identify a study participant.

- -

Currently, only ORKTextAnswerFormat is supported. Unsupported ORKAnswerFormat types will -throw an exception.

- -

The answer format for this item produces an ORKBooleanQuestionResult object.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  identifier -

- -
-
- -
- - -
-

A string that identifies the form item.

-
- - - -
@property (nonatomic, copy, readonly) NSString *identifier
- - - - - - - - - -
-

Discussion

-

The identifier should be unique within the form step that contains the form -item. The identifier is reproduced in the question result object (ORKQuestionResult) -generated for the item.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

  optional -

- -
-
- -
- - -
-

A Boolean value indicating whether the form item is optional.

-
- - - -
@property (nonatomic, getter=isOptional) BOOL optional
- - - - - - - - - -
-

Discussion

-

The default value of this property is YES. When the value is YES, this form item doesn’t need -to be answered for the Continue button of a step form to be enabled.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

  text -

- -
-
- -
- - -
-

A localized string that describes the form item.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSString *text
- - - - - - - - - -
-

Discussion

-

If the descriptive text is sufficiently short, you can display it as a prompt next to the item. -If it is too long to display next to the item, you can display it above the item.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

  placeholder -

- -
-
- -
- - -
-

A localized string that displays placeholder information for the form item.

-
- - - -
@property (nonatomic, copy, nullable) NSString *placeholder
- - - - - - - - - -
-

Discussion

-

You can display placeholder text in a text field or text area to help users understand how to answer the -item’s question. A placeholder string is not appropriate for choice-based answer formats.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

  answerFormat -

- -
-
- -
- - -
-

The format of the expected answer for the item.

-
- - - -
@property (nonatomic, copy, readonly, nullable) ORKAnswerFormat *answerFormat
- - - - - - - - - -
-

Discussion

-

The answer format specifies the type of answer that is expected, in addition to any -constraints on valid answers.

- -

By default, the answer format is nil. The answer format for a form item that represents a section -header is always nil, because no answer is expected.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormStep.html deleted file mode 100644 index cc618f3306..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormStep.html +++ /dev/null @@ -1,610 +0,0 @@ - - - - - - ORKFormStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFormStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKFormStep.h
ORKFormStep.m
- - - - -
- -

Overview

-

The ORKFormStep class is a concrete subclass of ORKStep, used for presenting multiple questions -on a single scrollable page.

- -

To use ORKFormStep, instantiate the object, fill in its properties, and include it -in a task. Next, create a task view controller for the task and present it. -When the task completes, the user’s answers are encoded in the result hierarchy -in the task view controller.

- -

Each question in the form is represented by an ORKFormItem object. The form items have an -optional property that defaults to YES. All required questions need to be answered for the -Continue button to be enabled. If all the form items are optional, at least one question needs to -be answered for the Continue button to be enabled. You can allow the user to completely skip a -form step using the Skip button, even if it has required form items, by setting the form step -optional property to yes.

- -

The form can be broken into sections by using an ORKFormItem object that includes only a section -title.

- -

The result of a form step is an ORKStepResult object that includes a child ORKQuestionResult -object for each form item.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:title:text: -

- -
-
- -
- - -
-

Returns an initialized form step using the specified identifier, title, and text.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier title:(NSString *)title text:(NSString *)text
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The string that identifies the step (see ORKStep).

title

The title of the form (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

-
- - - -
-

Return Value

-

As initialized form step object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

The set of HealthKit types the step requests for reading. (read-only)

-
- - - -
- (NSSet<HKObjectType*> *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

The task view controller uses this set of types when constructing a list of -all the HealthKit types required by all the steps in a task, so that it can -present the HealthKit access dialog just once during that task.

- -

By default, the property scans the recorders and collates the HealthKit -types the recorders require. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  footnote -

- -
-
- -
- - -
-

Additional text to display for the step in a localized string at the bottom of the view.

-
- - - -
@property (nonatomic, copy, nullable) NSString *footnote
- - - - - - - - - -
-

Discussion

-

The footnote is displayed in a smaller font below the continue button. It is intended to be used -in order to include disclaimer, copyright, etc. that is important to display in the step but -should not distract from the main purpose of the step.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

  formItems -

- -
-
- -
- - -
-

The array of items in the form.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKFormItem*> *formItems
- - - - - - - - - -
-

Discussion

-

A form step that contains no items is considered invalid and an exception will be thrown -when it is presented.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

  useCardView -

- -
-
- -
- - -
-

The property to present the form with all the items in a card view. Default to YES;

-
- - - -
@property (nonatomic) BOOL useCardView
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormStepViewController.html deleted file mode 100644 index 13e836f042..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormStepViewController.html +++ /dev/null @@ -1,488 +0,0 @@ - - - - - - ORKFormStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFormStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKFormStepViewController.h
ORKFormStepViewController.m
- - - - -
- -

Overview

-

The ORKFormStepViewController class is the concrete ORKStepViewController -implementation for ORKFormStep.

- -

You should not need to instantiate a form step view controller -directly. Instead, create an ORKFormStep object and include it in a task for an -ORKTaskViewController object, and present the task view controller. The task view -controller automatically instantiates the form step view controller -when it encounters a form step and needs to present it.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– initWithStep:result: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step to be presented.

result

The current step result for this step.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– skipForward -

- -
-
- -
- - -
-

This method is called when the user taps the skip button. By default, it calls goForward.

-
- - - -
- (void)skipForward
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– goBackward -

- -
-
- -
- - -
-

Navigates backward to the previous step.

-
- - - -
- (void)goBackward
- - - - - - - - - -
-

Discussion

-

When a user taps the Back button, the information passes through this method. You can use this method as an override -point or a target action for a subclass.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormTextView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormTextView.html deleted file mode 100644 index 61ebee49e3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFormTextView.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKFormTextView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFormTextView Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerTextView : UITextView
Declared inORKFormTextView.h
ORKFormTextView.m
- - - - -
- -

Overview

-

Text view for use in forms

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFreehandDrawingView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFreehandDrawingView.html deleted file mode 100644 index 2193348841..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKFreehandDrawingView.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - ORKFreehandDrawingView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFreehandDrawingView Class Reference

- - -
- - - - - - - -
Inherits fromUIView
Declared inORKFreehandDrawingView.h
ORKFreehandDrawingView.m
- - - - - - -
- - - - - - -
-
- -

  lineWidthVariation -

- -
-
- -
- - -
-

lineWidthVariation defines the max amount by which the line -width can vary (default 3pts).

-
- - - -
@property (nonatomic) CGFloat lineWidthVariation
- - - - - - - - - -
-

Discussion

-

The exact amount of the variation is determined by the amount -of force applied on 3D touch capable devices or by the speed -of the stroke if 3D touch is not available.

- -

If the user is signing with an Apple Pencil, its force will be used.

-
- - - - - - - -
-

Declared In

-

ORKFreehandDrawingView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKGraphChartView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKGraphChartView.html deleted file mode 100644 index ed548c2a48..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKGraphChartView.html +++ /dev/null @@ -1,1134 +0,0 @@ - - - - - - ORKGraphChartView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKGraphChartView Class Reference

- - -
- - - - - - - -
Inherits fromUIView
Declared inORKGraphChartView.h
ORKGraphChartView.m
- - - - -
- -

Overview

-

The ORKGraphChartView class is an abstract class which holds properties and methods common to -concrete subclasseses.

- -

You should not instantiate this class directly; use one of the subclasses instead. The concrete -subclasses are ORKLineGraphChartView, ORKDiscreteGraphChartView, and ORKBarGraphChartView.

-
- - - - - -
- - - - - - -
-
- -

  minimumValue -

- -
-
- -
- - -
-

The minimum value of the y-axis.

-
- - - -
@property (nonatomic, readonly) double minimumValue
- - - - - - - - - -
-

Discussion

-

You can provide this value to an instance of ORKGraphChartView by implementing the optional -minimumValueForGraphChartView: method of the ORKGraphChartViewDataSource protocol.

- -

If minimumValueForGraphChartView: is not implemented, the minimum value is assigned to the -smallest value of the minimumValue property of all ORKValueRange instances returned by the -graph chart view data source.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  maximumValue -

- -
-
- -
- - -
-

The maximum value of the y-axis.

-
- - - -
@property (nonatomic, readonly) double maximumValue
- - - - - - - - - -
-

Discussion

-

You can provide this value instance of ORKGraphChartView by implementing the -optional maximumValueForGraphChartView: method of the ORKGraphChartViewDataSource protocol.

- -

If maximumValueForGraphChartView: is not implemented, the maximum value is assigned to the -largest value of the maximumValue property of all ORKValueRange instances returned by the -graph chart view data source.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  showsHorizontalReferenceLines -

- -
-
- -
- - -
-

A Boolean value indicating whether the graph chart view should draw horizontal reference lines.

-
- - - -
@property (nonatomic) IBInspectable BOOL showsHorizontalReferenceLines
- - - - - - - - - -
-

Discussion

-

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  showsVerticalReferenceLines -

- -
-
- -
- - -
-

A Boolean value indicating whether the graph chart view should draw vertical reference lines.

-
- - - -
@property (nonatomic) IBInspectable BOOL showsVerticalReferenceLines
- - - - - - - - - -
-

Discussion

-

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  delegate -

- -
-
- -
- - -
-

The delegate is notified of pan gesture events occuring within the bounds of the graph chart -view.

-
- - - -
@property (nonatomic, weak, nullable) id<ORKGraphChartViewDelegate> delegate
- - - - - - - - - -
-

Discussion

-

See the ORKGraphChartViewDelegate protocol.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  dataSource -

- -
-
- -
- - -
-

The data source responsible for providing the data required to populate the graph chart view.

-
- - - -
@property (nonatomic, weak) id<ORKGraphChartViewDataSource> dataSource
- - - - - - - - - -
-

Discussion

-

See the ORKGraphChartViewDataSource protocol.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  axisColor -

- -
-
- -
- - -
-

The color of the axes drawn by the graph chart view.

-
- - - -
@property (nonatomic, strong, null_resettable) IBInspectable UIColor *axisColor
- - - - - - - - - -
-

Discussion

-

The default value for this property is a light gray color. Setting this property to nil -resets it to its default value.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  verticalAxisTitleColor -

- -
-
- -
- - -
-

The color of the vertical axis titles.

-
- - - -
@property (nonatomic, strong, null_resettable) IBInspectable UIColor *verticalAxisTitleColor
- - - - - - - - - -
-

Discussion

-

The default value for this property is a light gray color. Setting this property to nil resets it -to its default value.

Note: The horizontal axis titles use the current tintColor.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  referenceLineColor -

- -
-
- -
- - -
-

The color of the reference lines.

-
- - - -
@property (nonatomic, strong, null_resettable) IBInspectable UIColor *referenceLineColor
- - - - - - - - - -
-

Discussion

-

The default value for this property is a light gray color. Setting this property to nil resets it -to its default value.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  scrubberThumbColor -

- -
-
- -
- - -
-

The background color of the thumb on the scrubber line.

-
- - - -
@property (nonatomic, strong, null_resettable) IBInspectable UIColor *scrubberThumbColor
- - - - - - - - - -
-

Discussion

-

The default value for this property is a white color. Setting this property to nil resets it to -its default value.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  scrubberLineColor -

- -
-
- -
- - -
-

The color of the scrubber line.

-
- - - -
@property (nonatomic, strong, null_resettable) IBInspectable UIColor *scrubberLineColor
- - - - - - - - - -
-

Discussion

-

The default value for this property is a gray color. Setting this property to nil resets it to -its default value.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  noDataText -

- -
-
- -
- - -
-

The string that is displayed if no data points are provided by the data source.

-
- - - -
@property (nonatomic, copy, null_resettable) IBInspectable NSString *noDataText
- - - - - - - - - -
-

Discussion

-

The default value for this property is an appropriate message string. Setting this property to -nil resets it to its default value.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  maximumValueImage -

- -
-
- -
- - -
-

An image to be optionally displayed in place of the maximum value label on the y-axis.

-
- - - -
@property (nonatomic, strong, nullable) IBInspectable UIImage *maximumValueImage
- - - - - - - - - -
-

Discussion

-

The default value for this property is nil.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  minimumValueImage -

- -
-
- -
- - -
-

An image to be optionally displayed in place of the minimum value label on the y-axis.

-
- - - -
@property (nonatomic, strong, nullable) IBInspectable UIImage *minimumValueImage
- - - - - - - - - -
-

Discussion

-

The default value for this property is nil.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  longPressGestureRecognizer -

- -
-
- -
- - -
-

The long press gesture recognizer that is used for scrubbing by the graph chart view. You can use -this property to prioritize your own gesture recognizers.

-
- - - -
@property (nonatomic, strong, readonly) UILongPressGestureRecognizer *longPressGestureRecognizer
- - - - - - - - - -
-

Discussion

-

This object is instatiated and added to the view when it is created.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  panGestureRecognizer -

- -
-
- -
- - -
-

The gesture recognizer that is used for scrubbing by the graph chart view.

-
- - - -
@property (nonatomic, strong, readonly) UIPanGestureRecognizer *panGestureRecognizer
- - - - - - - - - -
-

Discussion

-

This object is instatiated and added to the view when it is created.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  decimalPlaces -

- -
-
- -
- - -
-

The number of decimal places that is used on the y-axis and scrubber value labels.

-
- - - -
@property (nonatomic) NSUInteger decimalPlaces
- - - - - - - - - -
-

Discussion

-

The default value of this property is 0.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

  yAxisLabelFactors -

- -
-
- -
- - -
-

An array of factors for adding Y-Axis labels

-
- - - -
@property (nonatomic) NSArray<NSNumber*> *yAxisLabelFactors
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– animateWithDuration: -

- -
-
- -
- - -
-

Animates the graph when it first displays on the screen.

-
- - - -
- (void)animateWithDuration:(NSTimeInterval)animationDuration
- - - -
-

Parameters

- - - - - - - -
animationDuration

The duration of the appearing animation.

-
- - - - - - - -
-

Discussion

-

You can optionally call this method from the viewWillAppear: implementation of the view -controller that owns the graph chart view.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– reloadData -

- -
-
- -
- - -
-

Reloads the plotted data.

-
- - - -
- (void)reloadData
- - - - - - - - - -
-

Discussion

-

Call this method to reload the data and re-plot the graph. You should call it if the data provided by the dataSource changes.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHeadlineLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHeadlineLabel.html deleted file mode 100644 index 33503e007d..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHeadlineLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKHeadlineLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHeadlineLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKHeadlineLabel.h
ORKHeadlineLabel.m
- - - - -
- -

Overview

-

Primary title for any step view controller.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthClinicalTypeRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthClinicalTypeRecorder.html deleted file mode 100644 index c133d0ba9e..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthClinicalTypeRecorder.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - ORKHealthClinicalTypeRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthClinicalTypeRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKHealthClinicalTypeRecorder.h
ORKHealthClinicalTypeRecorder.m
- - - - -
- -

Overview

-

The ORKHealthClinicalTypeRecorder class represents a recorder for collecting health records data from HealthKit during -an active task.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier:healthClinicalType:healthFHIRResourceType:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized health clinical type recorder using the specified HKClinicalType and HKFHIRResourceType.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier healthClinicalType:(HKClinicalType *)healthClinicalType healthFHIRResourceType:(nullable HKFHIRResourceType)healthFHIRResourceType step:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

healthClinicalType

The HKClinicalType data that should be collected during the active task.

healthFHIRResourceType

The HKFHIRResourceType for the predicate used to query the HKClinicalType.

step

The step that requested this recorder.

outputDirectory

The directory in which the health records data queried from HealthKit should be stored.

-
- - - -
-

Return Value

-

An initialized health quantity type recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKHealthClinicalTypeRecorder.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthClinicalTypeRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthClinicalTypeRecorderConfiguration.html deleted file mode 100644 index 173de78d09..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthClinicalTypeRecorderConfiguration.html +++ /dev/null @@ -1,547 +0,0 @@ - - - - - - ORKHealthClinicalTypeRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthClinicalTypeRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKHealthClinicalTypeRecorder.m
ORKRecorder.h
- - - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– initWithIdentifier:healthClinicalType:healthFHIRResourceType: -

- -
-
- -
- - -
-

Returns an initialized health clinical type recorder configuration using the specified clinical type.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier healthClinicalType:(HKClinicalType *)healthClinicalType healthFHIRResourceType:(nullable HKFHIRResourceType)healthFHIRResourceType
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder configuration.

healthClinicalType

The HKClinicalType that should be collected during the active task.

healthFHIRResourceType

The HKFHIRResourceType that should be used as predicate while querying for the healthClinicalType. Providing a HKFHIRResourceType that does not correspond to a HKClinicalType will NOT generate any result.

-
- - - -
-

Return Value

-

An initialized health clinical type recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new health clinical type recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the health clinical type recorder configuration.

-
- - - -
-

Return Value

-

A new health clinical type recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

Returns the HealthKit types for which this recorder requires read access in a set of HKSampleType objects.

-
- - - -
- (NSSet *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

Typically, the task view controller automatically collects -and collates the types of HealthKit data requested by each of the active steps in a task, -and requests access to them at the end of the initial instruction -steps in the task.

- -

If your recorder requires or would benefit from read access to HealthKit at -runtime during the task, return the appropriate set of HKSampleType objects.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  healthClinicalType -

- -
-
- -
- - -
-

The HKClinicalType to be collected from HealthKit. (read-only)

-
- - - -
@property (nonatomic, readonly, copy) HKClinicalType *healthClinicalType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

  healthFHIRResourceType -

- -
-
- -
- - -
-

The HKFHIRResourceType to used as predicate for HKQuery. (read-only)

-
- - - -
@property (nonatomic, readonly, copy) HKFHIRResourceType healthFHIRResourceType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthCollector.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthCollector.html deleted file mode 100644 index cd3bffe025..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthCollector.html +++ /dev/null @@ -1,383 +0,0 @@ - - - - - - ORKHealthCollector Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthCollector Class Reference

- - -
- - - - - - - -
Inherits fromORKCollector : NSObject
Declared inORKCollector.h
ORKCollector.m
- - - - -
- -

Overview

-

ORKHealthCollector collects HKSample.

- -

It cannot be initiated directly. -Use addHealthCollectorWithSampleType:to add one to a ORKDataCollectionManager.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– serializableObjectsForObjects: -

- -
-
- -
- - -
-

Serialization helper that produces objects suitable for serialization to JSON.

-
- - - -
- (NSArray *)serializableObjectsForObjects:(NSArray<HKSample*> *)objects
- - - - - -
-

Return Value

-

Serializable dictionary objects.

-
- - - - - -
-

Discussion

-

Subclasses should implement to provide a default JSON serialization for upload. -Called by serializedDataForObjects:.

- -

@params objects The objects to be serialized.

-
- - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  sampleType -

- -
-
- -
- - -
-

HealthKit sample type.

-
- - - -
@property (copy, readonly) HKSampleType *sampleType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  unit -

- -
-
- -
- - -
-

HealthKit unit into which data should be collected.

-
- - - -
@property (copy, readonly) HKUnit *unit
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  startDate -

- -
-
- -
- - -
-

Samples should be collected starting at this date.

-
- - - -
@property (copy, readonly) NSDate *startDate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  lastAnchor -

- -
-
- -
- - -
-

Last anchor already seen.

-
- - - -
@property (copy, readonly) HKQueryAnchor *lastAnchor
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthCorrelationCollector.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthCorrelationCollector.html deleted file mode 100644 index 41e7749705..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthCorrelationCollector.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - - - ORKHealthCorrelationCollector Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthCorrelationCollector Class Reference

- - -
- - - - - - - -
Inherits fromORKCollector : NSObject
Declared inORKCollector.h
ORKCollector.m
- - - - -
- -

Overview

-

ORKHealthCollector collects HKCorrelation.

- -

It cannot be initiated directly. -Use addHealthCorrelationCollectorWithCorrelationType:to add one to a ORKDataCollectionManager.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– serializableObjectsForObjects: -

- -
-
- -
- - -
-

Serialization helper that produces objects suitable for serialization to JSON.

-
- - - -
- (NSArray *)serializableObjectsForObjects:(NSArray<HKCorrelation*> *)objects
- - - - - -
-

Return Value

-

Serializable dictionary objects.

-
- - - - - -
-

Discussion

-

Subclasses should implement to provide a default JSON serialization for upload. -Called by serializedDataForObjects:.

- -

@params objects The objects to be serialized.

-
- - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  correlationType -

- -
-
- -
- - -
-

HealthKit correlation type.

-
- - - -
@property (copy, readonly) HKCorrelationType *correlationType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  sampleTypes -

- -
-
- -
- - -
-

Array of HKSampleType expected in the correlation.

-
- - - -
@property (copy, readonly) NSArray<HKSampleType*> *sampleTypes
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  units -

- -
-
- -
- - -
-

Array of HKUnit to use when serializing the samples collected (should be same size as sampleTypes).

-
- - - -
@property (copy, readonly) NSArray<HKUnit*> *units
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  startDate -

- -
-
- -
- - -
-

Samples should be collected starting at this date.

-
- - - -
@property (copy, readonly) NSDate *startDate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  lastAnchor -

- -
-
- -
- - -
-

Last anchor already seen.

-
- - - -
@property (copy, readonly) HKQueryAnchor *lastAnchor
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthKitCharacteristicTypeAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthKitCharacteristicTypeAnswerFormat.html deleted file mode 100644 index 89d5295971..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthKitCharacteristicTypeAnswerFormat.html +++ /dev/null @@ -1,673 +0,0 @@ - - - - - - ORKHealthKitCharacteristicTypeAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthKitCharacteristicTypeAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKHealthAnswerFormat.h
ORKHealthAnswerFormat.m
- - - - -
- -

Overview

-

The ORKHealthKitCharacteristicTypeAnswerFormat class represents an answer format that lets participants enter values that correspond to a HealthKit characteristic type.

- -

The actual UI used for collecting data with this answer format depends on the HealthKit type being collected. -The default value displayed in the UI is the most recent value received from HealthKit, if such a value exists. -When a step or item is presented using this answer format, authorization is requested unless the property -shouldRequestAuthorization is set to NO.

- -

You can use the HealthKit characteristic answer format to let users autofill information, such as their blood type or date of birth.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

+ answerFormatWithCharacteristicType: -

- -
-
- -
- - -
-

Returns a new answer format for the specified HealthKit characteristic type.

-
- - - -
+ (instancetype)answerFormatWithCharacteristicType:(HKCharacteristicType *)characteristicType
- - - -
-

Parameters

- - - - - - - -
characteristicType

The characteristic type to collect.

-
- - - -
-

Return Value

-

A new HealthKit characteristic type answer format instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

– initWithCharacteristicType: -

- -
-
- -
- - -
-

Returns an initialized HealthKit characteristic type answer format using the specified characteristic type.

-
- - - -
- (instancetype)initWithCharacteristicType:(HKCharacteristicType *)characteristicType
- - - -
-

Parameters

- - - - - - - -
characteristicType

The characteristic type to collect.

-
- - - -
-

Return Value

-

An initialized HealthKit characteristic type answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

– impliedAnswerFormat -

- -
-
- -
- - -
-

Some answer formats are constructed of other answer formats. This method allows -a subclass to return a different answer format for use in defining the UI/UX for -the answer format type. For example, a Boolean answer format is presented in the -same way as a single-choice answer format with the choices Yes and No mapping to -@(YES) and @(NO), respectively, so its impliedAnswerFormat is an -ORKTextChoiceAnswerFormat with those options.

-
- - - -
- (ORKAnswerFormat *)impliedAnswerFormat
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  shouldRequestAuthorization -

- -
-
- -
- - -
-

Should authorization be requested for the associated HealthKit data type. Default = YES.

-
- - - -
@property (nonatomic) BOOL shouldRequestAuthorization
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  characteristicType -

- -
-
- -
- - -
-

The HealthKit characteristic type to be collected by this answer format. (read-only)

-
- - - -
@property (nonatomic, copy, readonly) HKCharacteristicType *characteristicType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  defaultDate -

- -
-
- -
- - -
-

The default date shown by the date picker.

-
- - - -
@property (nonatomic, strong, nullable) NSDate *defaultDate
- - - - - - - - - -
-

Discussion

-

Only used for the HKCharacteristicTypeIdentifierDateOfBirth characteristic type. The date is -displayed in the user’s time zone. If you set this property to nil, the date picker will default -to the date representing 35 years before the current date.

-
- - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  minimumDate -

- -
-
- -
- - -
-

The minimum date that is allowed by the date picker.

-
- - - -
@property (nonatomic, strong, nullable) NSDate *minimumDate
- - - - - - - - - -
-

Discussion

-

Only used for the HKCharacteristicTypeIdentifierDateOfBirth characteristic type. If you set this -property to nil, the date picker will use the date representing 150 years before the curent date -as its minimum date.

-
- - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  maximumDate -

- -
-
- -
- - -
-

The maximum date that is allowed by the date picker.

-
- - - -
@property (nonatomic, strong, nullable) NSDate *maximumDate
- - - - - - - - - -
-

Discussion

-

Only used for the HKCharacteristicTypeIdentifierDateOfBirth characteristic type. If you set this -property to nil, the date picker will use the date representing 1 day after curent date as its -maximum date

-
- - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  calendar -

- -
-
- -
- - -
-

The calendar used by the date picker.

-
- - - -
@property (nonatomic, strong, nullable) NSCalendar *calendar
- - - - - - - - - -
-

Discussion

-

Only used for the HKCharacteristicTypeIdentifierDateOfBirth characteristic type. If you set this -property to nil, the date picker will use the default calendar for the current locale.

-
- - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthKitQuantityTypeAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthKitQuantityTypeAnswerFormat.html deleted file mode 100644 index 544975cd72..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthKitQuantityTypeAnswerFormat.html +++ /dev/null @@ -1,588 +0,0 @@ - - - - - - ORKHealthKitQuantityTypeAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthKitQuantityTypeAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKHealthAnswerFormat.h
ORKHealthAnswerFormat.m
- - - - -
- -

Overview

-

The ORKHealthKitQuantityTypeAnswerFormat class represents an answer format that lets participants enter values that correspond to a HealthKit quantity type, such as systolic blood pressure.

- -

The actual UI used for collecting data with this answer format depends on the HealthKit type being collected. -The default value in the UI is the most recent value received from HealthKit, if such a value exists. -When a step or item is presented using this answer format, authorization is requested unless the property -shouldRequestAuthorization is set to NO.

- -

You can use the HealthKit quantity type answer format to let users autofill values such as their weight with the most -recent data from HealthKit.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

+ answerFormatWithQuantityType:unit:style: -

- -
-
- -
- - -
-

Returns a new HealthKit quantity answer format with the specified quantity type.

-
- - - -
+ (instancetype)answerFormatWithQuantityType:(HKQuantityType *)quantityType unit:(HKUnit *)unit style:(ORKNumericAnswerStyle)style
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
quantityType

The HealthKit quantity type to collect.

unit

The unit used to describe the quantity. If the value of this parameter is nil, the default HealthKit unit is used, when available.

style

The numeric answer style to use when collecting this value.

-
- - - -
-

Return Value

-

A HealthKit quantity answer format instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

– initWithQuantityType:unit:style: -

- -
-
- -
- - -
-

Returns an initialized HealthKit quantity answer format using the specified quantity type, unit, and numeric answer style.

-
- - - -
- (instancetype)initWithQuantityType:(HKQuantityType *)quantityType unit:(HKUnit *)unit style:(ORKNumericAnswerStyle)style
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
quantityType

The HealthKit quantity type to collect.

unit

The unit used to describe the quantity. If the value of this parameter is nil, the default HealthKit unit is used, when available.

style

The numeric answer style to use when collecting this value.

-
- - - -
-

Return Value

-

An initialized HealthKit quantity answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

– impliedAnswerFormat -

- -
-
- -
- - -
-

Some answer formats are constructed of other answer formats. This method allows -a subclass to return a different answer format for use in defining the UI/UX for -the answer format type. For example, a Boolean answer format is presented in the -same way as a single-choice answer format with the choices Yes and No mapping to -@(YES) and @(NO), respectively, so its impliedAnswerFormat is an -ORKTextChoiceAnswerFormat with those options.

-
- - - -
- (ORKAnswerFormat *)impliedAnswerFormat
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  shouldRequestAuthorization -

- -
-
- -
- - -
-

Should authorization be requested for the associated HealthKit data type. Default = YES.

-
- - - -
@property (nonatomic) BOOL shouldRequestAuthorization
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  quantityType -

- -
-
- -
- - -
-

The HealthKit quantity type to collect. (read-only)

-
- - - -
@property (nonatomic, copy, readonly) HKQuantityType *quantityType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  unit -

- -
-
- -
- - -
-

The HealthKit unit in which to collect the answer. (read-only)

-
- - - -
@property (nonatomic, strong, readonly, nullable) HKUnit *unit
- - - - - - - - - -
-

Discussion

-

The unit is displayed when the user is entering data, and is also -included in the question result generated by form items or question steps -that use this answer format.

-
- - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
- -

  numericAnswerStyle -

- -
-
- -
- - -
-

The numeric answer style. (read-only)

-
- - - -
@property (nonatomic, readonly) ORKNumericAnswerStyle numericAnswerStyle
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHealthAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthQuantityTypeRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthQuantityTypeRecorder.html deleted file mode 100644 index d40611a14d..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthQuantityTypeRecorder.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - ORKHealthQuantityTypeRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthQuantityTypeRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKHealthQuantityTypeRecorder.h
ORKHealthQuantityTypeRecorder.m
- - - - -
- -

Overview

-

The ORKHealthQuantityTypeRecorder class represents a recorder for collecting real time sample data from HealthKit, such as heart rate, during -an active task.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier:healthQuantityType:unit:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized health quantity type recorder using the specified quantity type and unit.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier healthQuantityType:(HKQuantityType *)quantityType unit:(HKUnit *)unit step:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

quantityType

The quantity type that should be collected during the active task.

unit

The unit for the data that should be collected and serialized.

step

The step that requested this recorder.

outputDirectory

The directory in which the HealthKit data should be stored.

-
- - - -
-

Return Value

-

An initialized health quantity type recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKHealthQuantityTypeRecorder.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthQuantityTypeRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthQuantityTypeRecorderConfiguration.html deleted file mode 100644 index 9d8b937b05..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthQuantityTypeRecorderConfiguration.html +++ /dev/null @@ -1,568 +0,0 @@ - - - - - - ORKHealthQuantityTypeRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthQuantityTypeRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKHealthQuantityTypeRecorder.m
ORKRecorder.h
- - - - -
- -

Overview

-

The ORKHealthQuantityTypeRecorderConfiguration class represents a configuration -that records data from a HealthKit quantity type during an active step.

- -

Before you can use this configuration, you must use Xcode to enable the appropriate HealthKit entitlement -for your app.

- -

HealthKit quantity type data is serialized to JSON and returned as an ORKFileResult object. -For details on the format, see HKSample+ORKJSONDictionary.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– initWithIdentifier:healthQuantityType:unit: -

- -
-
- -
- - -
-

Returns an initialized health quantity type recorder configuration using the specified quantity type and unit designation.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier healthQuantityType:(HKQuantityType *)quantityType unit:(HKUnit *)unit
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder configuration.

quantityType

The quantity type that should be collected during the active task.

unit

The unit for the data that should be collected and serialized.

-
- - - -
-

Return Value

-

An initialized health quantity type recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new health quantity type recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the health quantity type recorder configuration.

-
- - - -
-

Return Value

-

A new health quantity type recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

Returns the HealthKit types for which this recorder requires read access in a set of HKSampleType objects.

-
- - - -
- (NSSet *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

Typically, the task view controller automatically collects -and collates the types of HealthKit data requested by each of the active steps in a task, -and requests access to them at the end of the initial instruction -steps in the task.

- -

If your recorder requires or would benefit from read access to HealthKit at -runtime during the task, return the appropriate set of HKSampleType objects.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  quantityType -

- -
-
- -
- - -
-

The quantity type to be collected from HealthKit. (read-only)

-
- - - -
@property (nonatomic, readonly, copy) HKQuantityType *quantityType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

  unit -

- -
-
- -
- - -
-

The unit in which to serialize the data from HealthKit. (read-only)

-
- - - -
@property (nonatomic, readonly, copy) HKUnit *unit
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthSampleQueryOperation.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthSampleQueryOperation.html deleted file mode 100644 index 090e04511f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHealthSampleQueryOperation.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - ORKHealthSampleQueryOperation Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHealthSampleQueryOperation Class Reference

- - -
- - - - - - - -
Inherits fromORKOperation : NSOperation
Declared inORKHealthSampleQueryOperation.h
ORKHealthSampleQueryOperation.m
- - - - -
- -

Overview

-

Operation for extracting and preparing HK data for upload. This operation -runs on the specified study / data type combo until there is no more HK data available, -or until file protection kicks in, stopping further preparation.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHeightAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHeightAnswerFormat.html deleted file mode 100644 index 7274263828..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHeightAnswerFormat.html +++ /dev/null @@ -1,366 +0,0 @@ - - - - - - ORKHeightAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHeightAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKHeightAnswerFormat class represents the answer format for questions that require users -to enter a height.

- -

A height answer format produces an ORKNumericQuestionResult object. The result is always reported -in the metric system using the cm unit.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– init -

- -
-
- -
- - -
-

Returns an initialized height answer format using the measurement system specified in the current -locale.

-
- - - -
- (instancetype)init
- - - - - -
-

Return Value

-

An initialized height answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMeasurementSystem: -

- -
-
- -
- - -
-

Returns an initialized height answer format using the specified measurement system.

-
- - - -
- (instancetype)initWithMeasurementSystem:(ORKMeasurementSystem)measurementSystem
- - - -
-

Parameters

- - - - - - - -
measurementSystem

The measurement system to use. See ORKMeasurementSystem for the - accepted values.

-
- - - -
-

Return Value

-

An initialized height answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  measurementSystem -

- -
-
- -
- - -
-

The measurement system used by the answer format.

-
- - - -
@property (readonly) ORKMeasurementSystem measurementSystem
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestPlaceStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestPlaceStep.html deleted file mode 100644 index efbbf72357..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestPlaceStep.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - ORKHolePegTestPlaceStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHolePegTestPlaceStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKHolePegTestPlaceStep.h
ORKHolePegTestPlaceStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestPlaceStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestPlaceStepViewController.html deleted file mode 100644 index f28668d6d2..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestPlaceStepViewController.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - ORKHolePegTestPlaceStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHolePegTestPlaceStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKHolePegTestPlaceStepViewController.h
ORKHolePegTestPlaceStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestRemoveStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestRemoveStep.html deleted file mode 100644 index a4f12a20a7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestRemoveStep.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - ORKHolePegTestRemoveStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHolePegTestRemoveStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKHolePegTestRemoveStep.h
ORKHolePegTestRemoveStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestRemoveStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestRemoveStepViewController.html deleted file mode 100644 index 2c7391041d..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestRemoveStepViewController.html +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - ORKHolePegTestRemoveStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHolePegTestRemoveStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKHolePegTestRemoveStepViewController.h
ORKHolePegTestRemoveStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestResult.html deleted file mode 100644 index 25e1217902..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestResult.html +++ /dev/null @@ -1,578 +0,0 @@ - - - - - - ORKHolePegTestResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHolePegTestResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKHolePegTestResult.h
ORKHolePegTestResult.m
- - - - -
- -

Overview

-

The ORKHolePegTestResult class records the results of a hole peg test.

- -

The hole peg test result object records the number of pegs, an array of move samples, the total duration -and also various attributes of the hole peg test.

- -

The hole peg test samples are generated by the framework as the task proceeds. -When the task completes, it may be appropriate to serialize them for transmission to a server, -or to immediately perform analysis on them.

-
- - - - - -
- - - - - - -
-
- -

  movingDirection -

- -
-
- -
- - -
-

The hole peg test moving direction.

-
- - - -
@property (nonatomic, assign) ORKBodySagittal movingDirection
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  dominantHandTested -

- -
-
- -
- - -
-

The step is for the dominant hand.

-
- - - -
@property (nonatomic, assign, getter=isDominantHandTested) BOOL dominantHandTested
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  numberOfPegs -

- -
-
- -
- - -
-

The number of pegs to test.

-
- - - -
@property (nonatomic, assign) NSInteger numberOfPegs
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  threshold -

- -
-
- -
- - -
-

The detection area sensitivity.

-
- - - -
@property (nonatomic, assign) double threshold
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  rotated -

- -
-
- -
- - -
-

The hole peg test also assesses the rotation capabilities.

-
- - - -
@property (nonatomic, assign, getter=isRotated) BOOL rotated
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  totalSuccesses -

- -
-
- -
- - -
-

The number of succeeded moves (out of numberOfPegs possible).

-
- - - -
@property (nonatomic, assign) NSInteger totalSuccesses
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  totalFailures -

- -
-
- -
- - -
-

The number of failed moves.

-
- - - -
@property (nonatomic, assign) NSInteger totalFailures
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  totalTime -

- -
-
- -
- - -
-

The total time needed to perform the test step (ie. the sum of all samples time).

-
- - - -
@property (nonatomic, assign) NSTimeInterval totalTime
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  totalDistance -

- -
-
- -
- - -
-

The total distance needed to perform the test step (ie. the sum of all samples distance).

-
- - - -
@property (nonatomic, assign) double totalDistance
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  samples -

- -
-
- -
- - -
-

An array of collected samples, in which each item is an ORKHolePegTestSample -object that represents a peg move.

-
- - - -
@property (nonatomic, copy, nullable) NSArray *samples
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestSample.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestSample.html deleted file mode 100644 index f8ce1ade06..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKHolePegTestSample.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - ORKHolePegTestSample Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKHolePegTestSample Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKHolePegTestResult.h
ORKHolePegTestResult.m
- - - - -
- -

Overview

-

The ORKHolePegTestSample class represents a peg move.

- -

The sample object records the duration, and the move distance. -An hole peg test is included in an ORKHolePegTestResult object, and is recorded -by the step view controller for the corresponding task.

- -

An hole peg test sample is typically generated by the framework as the task proceeds. -When the task completes, it may be appropriate to serialize the sample for -transmission to a server, or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  time -

- -
-
- -
- - -
-

The time interval for the peg move.

-
- - - -
@property (nonatomic, assign) NSTimeInterval time
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
- -

  distance -

- -
-
- -
- - -
-

The peg move distance.

-
- - - -
@property (nonatomic, assign) double distance
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKHolePegTestResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBBarGraphChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBBarGraphChartViewDataSource.html deleted file mode 100644 index 1b6f008208..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBBarGraphChartViewDataSource.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - ORKIBBarGraphChartViewDataSource Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKIBBarGraphChartViewDataSource Class Reference

- - -
- - - - - - - - - - -
Inherits fromORKIBGraphChartViewDataSource : NSObject
Conforms toORKValueStackGraphChartViewDataSource
Declared inORKBarGraphChartView.m
- - - - - - -
- - - - - - -
-
- -

– graphChartView:dataPointForPointIndex:plotIndex: -

- -
-
- -
- - -
-

Asks the data source for the value stack to be plotted at the specified point index for the -specified plot.

-
- - - -
- (ORKValueStack *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
graphChartView

The graph chart view that is asking for the value stack.

pointIndex

An index number identifying the value stack in the graph chart view.

plotIndex

An index number identifying the plot in the graph chart view. This index -is 0 in a single-plot graph chart view.

-
- - - -
-

Return Value

-

The value stack specified by pointIndex in the plot specified by plotIndex for the -specified graph chart view`.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBGraphChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBGraphChartViewDataSource.html deleted file mode 100644 index 4478eca799..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBGraphChartViewDataSource.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - ORKIBGraphChartViewDataSource Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKIBGraphChartViewDataSource Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toORKGraphChartViewDataSource
Declared inORKGraphChartView.m
ORKGraphChartView_Internal.h
- - - - - - -
- - - - - - -
-
- -

– numberOfPlotsInGraphChartView: -

- -
-
- -
- - -
-

Asks the data source for the number of plots to be plotted by the graph chart view.

-
- - - -
- (NSInteger)numberOfPlotsInGraphChartView:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view asking for the number of plots.

-
- - - -
-

Return Value

-

The number of plots in the graph chart view.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:numberOfDataPointsForPlotIndex: -

- -
-
- -
- - -
-

Asks the data source for the number of value points to be plotted by the graph chart view at the -specified plot index.

-
- - - -
- (NSInteger)graphChartView:(ORKGraphChartView *)graphChartView numberOfDataPointsForPlotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph chart view asking for the number of value points.

plotIndex

An index number identifying the plot in the graph chart view. This index - is 0 in a single-plot graph chart view.

-
- - - -
-

Return Value

-

The number of range points in the plot at plotIndex.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:titleForXAxisAtPointIndex: -

- -
-
- -
- - -
-

Asks the data source for the title to be displayed adjacent to each division in the x-axis (the -number returned by numberOfDivisionsInXAxisForGraphChartView:). You can return nil from this -method if you don’t want to display a title for the specified point index.

-
- - - -
- (NSString *)graphChartView:(ORKGraphChartView *)graphChartView titleForXAxisAtPointIndex:(NSInteger)pointIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph chart view asking for the title.

pointIndex

The index of the specified x-axis division.

-
- - - -
-

Return Value

-

The title string to be displayed adjacent to each division of the x-axis of the graph chart -view.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the x-axis has no titles.

- -

See also: numberOfDivisionsInXAxisForGraphChartView:.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBPieChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBPieChartViewDataSource.html deleted file mode 100644 index eb002e396c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBPieChartViewDataSource.html +++ /dev/null @@ -1,406 +0,0 @@ - - - - - - ORKIBPieChartViewDataSource Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKIBPieChartViewDataSource Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toORKPieChartViewDataSource
Declared inORKPieChartView.m
- - - - - - -
- - - - - - -
-
- -

– numberOfSegmentsInPieChartView: -

- -
-
- -
- - -
-

Asks the data source for the number of segments in the pie chart view.

-
- - - -
- (NSInteger)numberOfSegmentsInPieChartView:(ORKPieChartView *)pieChartView
- - - -
-

Parameters

- - - - - - - -
pieChartView

The pie chart view asking for the number of segments.

-
- - - -
-

Return Value

-

The number of segments in the pie chart view.

-
- - - - - - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– pieChartView:valueForSegmentAtIndex: -

- -
-
- -
- - -
-

Asks the data source for the value of a segment in the pie chart view.

-
- - - -
- (CGFloat)pieChartView:(ORKPieChartView *)pieChartView valueForSegmentAtIndex:(NSInteger)index
- - - -
-

Parameters

- - - - - - - - - - - - -
pieChartView

The pie chart view asking for the value of the segment.

index

An index number specifying the segment in the pie chart view.

-
- - - -
-

Return Value

-

The value of the segment at the specified index in the pie chart view.

-
- - - - - -
-

Discussion

-

The value can be any arbitrary integer: the pie chart view normalizes them by the sum of all -returned values.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– pieChartView:colorForSegmentAtIndex: -

- -
-
- -
- - -
-

Asks the data source for the color of a segment in the pie chart view.

-
- - - -
- (UIColor *)pieChartView:(ORKPieChartView *)pieChartView colorForSegmentAtIndex:(NSInteger)index
- - - -
-

Parameters

- - - - - - - - - - - - -
pieChartView

The pie chart view asking for the color of the segment.

index

An index number specifying the segment in the pie chart view.

-
- - - -
-

Return Value

-

The color of the segment at the specified index in the pie chart view.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the pie chart view uses a unique shade of the current -tint color for each segment.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– pieChartView:titleForSegmentAtIndex: -

- -
-
- -
- - -
-

Asks the data source for the title to appear in the legend for a segment in the pie chart view.

-
- - - -
- (NSString *)pieChartView:(ORKPieChartView *)pieChartView titleForSegmentAtIndex:(NSInteger)index
- - - -
-

Parameters

- - - - - - - - - - - - -
pieChartView

The pie chart view asking for the title.

index

An index number specifying the segment in the pie chart view.

-
- - - -
-

Return Value

-

The title of the segment at the specified index in the pie chat view’s -legend.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the pie chart view does not display the legend.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBValueRangeGraphChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBValueRangeGraphChartViewDataSource.html deleted file mode 100644 index 9f895d1107..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKIBValueRangeGraphChartViewDataSource.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - ORKIBValueRangeGraphChartViewDataSource Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKIBValueRangeGraphChartViewDataSource Class Reference

- - -
- - - - - - - - - - -
Inherits fromORKIBGraphChartViewDataSource : NSObject
Conforms toORKValueRangeGraphChartViewDataSource
Declared inORKGraphChartView.m
ORKGraphChartView_Internal.h
- - - - - - -
- - - - - - -
-
- -

– graphChartView:dataPointForPointIndex:plotIndex: -

- -
-
- -
- - -
-

Asks the data source for the value range to be plotted at the specified point index for the -specified plot.

-
- - - -
- (ORKValueRange *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
graphChartView

The graph chart view that is asking for the value range.

pointIndex

An index number identifying the value range in the graph chart view.

plotIndex

An index number identifying the plot in the graph chart view. This index - is 0 in a single-plot graph chart view.

-
- - - -
-

Return Value

-

The value range specified by pointIndex in the plot specified by plotIndex for the -specified graph chart view`.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageCaptureStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageCaptureStep.html deleted file mode 100644 index 5e18b92f26..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageCaptureStep.html +++ /dev/null @@ -1,481 +0,0 @@ - - - - - - ORKImageCaptureStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKImageCaptureStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKImageCaptureStep.h
ORKImageCaptureStep.m
- - - - -
- -

Overview

-

The ORKImageCaptureStep class represents a step that captures an image through the device -camera. A template image can optionally be laid over the camera preview to assist in properly -capturing the image.

- -

To use the image capture step, optionally set the templateImage and templateImageInsets -properties, incorporate the step into a task, and present the task with a task view controller.

- -

If implementing an image capture task like this one, remember that people will -take your instructions literally. So be cautious. Make sure your template image -is high contrast and very visible against a variety of backgrounds.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  templateImage -

- -
-
- -
- - -
-

An image to be displayed over the camera preview.

-
- - - -
@property (nonatomic, strong) UIImage *templateImage
- - - - - - - - - -
-

Discussion

-

The image is stretched to fit the available space while retaining its aspect ratio. -When choosing a size for this asset, be sure to take into account the variations in device -form factors.

-
- - - - - - - -
-

Declared In

-

ORKImageCaptureStep.h

-
- - -
-
-
- -

  templateImageInsets -

- -
-
- -
- - -
-

Insets to be used in positioning and sizing the templateImage.

-
- - - -
@property (nonatomic) UIEdgeInsets templateImageInsets
- - - - - - - - - -
-

Discussion

-

The insets are interpreted as percentages relative to the preview frame size. The left -and right insets are relative to the width of the preview frame. The top and bottom -insets are relative to the height of the preview frame.

-
- - - - - - - -
-

Declared In

-

ORKImageCaptureStep.h

-
- - -
-
-
- -

  accessibilityInstructions -

- -
-
- -
- - -
-

The accessibility hint for the capture preview.

-
- - - -
@property (nonatomic, copy) NSString *accessibilityInstructions
- - - - - - - - - -
-

Discussion

-

This property can be used to specify accessible instructions for capturing the image. The -use of this property can assist when the templateImage may not be visible -to the user.

- -

For example, if you want to capture an image of the user’s right hand, you may use a template -image that displays the outline of the right hand. You may also want to set this property -to a string such as @“Extend your right hand, palm side down, one foot from your device. -Tap the Capture Image button, or two finger tap on the preview, to capture an image of your -extended right hand.”

-
- - - - - - - -
-

Declared In

-

ORKImageCaptureStep.h

-
- - -
-
-
- -

  accessibilityHint -

- -
-
- -
- - -
-

The accessibility hint for the capture button.

-
- - - -
@property (nonatomic, copy) NSString *accessibilityHint
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKImageCaptureStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageCaptureStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageCaptureStepViewController.html deleted file mode 100644 index 6a017d7c99..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageCaptureStepViewController.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - ORKImageCaptureStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKImageCaptureStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKImageCaptureStepViewController.h
ORKImageCaptureStepViewController.m
- - - - -
- -

Overview

-

The ORKImageCaptureStepViewController class represents the step view controller that -corresponds to an ORKImageCaptureStep class.

- -

It is not usually necessary to instantiate this view controller directly. -Instead, add an image capture step to a task, and present the task in a task -view controller.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep:result: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step to be presented.

result

The current step result for this step.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoice.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoice.html deleted file mode 100644 index 3d19dfbebe..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoice.html +++ /dev/null @@ -1,514 +0,0 @@ - - - - - - ORKImageChoice Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKImageChoice Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKImageChoice class defines a choice that can -be included in an ORKImageChoiceAnswerFormat object.

- -

Typically, image choices are displayed in a horizontal row, so you need to use appropriate sizes. -For example, when five image choices are displayed in an ORKImageChoiceAnswerFormat, image sizes -of about 45 to 60 points allow the images to look good in apps that run on all versions of iPhone.

- -

The text that describes an image choice should be reasonably short. However, only the text for the -currently selected image choice is displayed, so text that wraps to more than one line -is supported.

-
- - - - - -
- - - - - - -
-
- -

+ choiceWithNormalImage:selectedImage:text:value: -

- -
-
- -
- - -
-

Returns an image choice that includes the specified images and text.

-
- - - -
+ (instancetype)choiceWithNormalImage:(nullable UIImage *)normal selectedImage:(nullable UIImage *)selected text:(nullable NSString *)text value:(id<NSCopying,NSCoding,NSObject>)value
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
normal

The image to display in the unselected state.

selected

The image to display in the selected state.

text

The text to display when the image is selected.

value

The value to record in a result object when the image is selected.

-
- - - -
-

Return Value

-

An image choice instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithNormalImage:selectedImage:text:value: -

- -
-
- -
- - -
-

Returns an initialized image choice using the specified images and text.

-
- - - -
- (instancetype)initWithNormalImage:(nullable UIImage *)normal selectedImage:(nullable UIImage *)selected text:(nullable NSString *)text value:(id<NSCopying,NSCoding,NSObject>)value
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
normal

The image to display in the unselected state.

selected

The image to display in the selected state.

text

The text to display when the image is selected.

value

The value to record in a result object when the image is selected.

-
- - - -
-

Return Value

-

An initialized image choice.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  normalStateImage -

- -
-
- -
- - -
-

The image to display when the choice is not selected. (read-only)

-
- - - -
@property (strong, readonly) UIImage *normalStateImage
- - - - - - - - - -
-

Discussion

-

The size of the unselected image depends on the number of choices you need to display. As a -general rule, it’s recommended that you start by creating an image that measures 44 x 44 points, -and adjust it if necessary.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  selectedStateImage -

- -
-
- -
- - -
-

The image to display when the choice is selected. (read-only)

-
- - - -
@property (strong, readonly, nullable) UIImage *selectedStateImage
- - - - - - - - - -
-

Discussion

-

For best results, the selected image should be the same size as the unselected image (that is, -the value of the normalStateImage property). -If you don’t specify a selected image, the default UIButton behavior is used to -indicate the selection state of the item.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  text -

- -
-
- -
- - -
-

The text to display when the image is selected, in a localized string. (read-only)

-
- - - -
@property (copy, readonly, nullable) NSString *text
- - - - - - - - - -
-

Discussion

-

Note that the text you supply may be spoken by VoiceOver even when the item is not selected.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  value -

- -
-
- -
- - -
-

The value to return when the image is selected. (read-only)

-
- - - -
@property (copy, readonly) id<NSCopying,NSCoding,NSObject> value
- - - - - - - - - -
-

Discussion

-

The value of this property is expected to be a scalar property list type, such as NSNumber or -NSString. If no value is provided, the index of the option in the ORKImageChoiceAnswerFormat -options list is used.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoiceAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoiceAnswerFormat.html deleted file mode 100644 index d3642f31d8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoiceAnswerFormat.html +++ /dev/null @@ -1,527 +0,0 @@ - - - - - - ORKImageChoiceAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKImageChoiceAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKImageChoiceAnswerFormat class represents an answer format that lets participants choose -one image from a fixed set of images in a single choice question.

- -

For example, you might use the image choice answer format to represent a range of moods that range -from very sad -to very happy.

- -

The image choice answer format produces an ORKChoiceQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithImageChoices: -

- -
-
- -
- - -
-

Returns an initialized image choice answer format using the specified array of images.

-
- - - -
- (instancetype)initWithImageChoices:(NSArray<ORKImageChoice*> *)imageChoices
- - - -
-

Parameters

- - - - - - - -
imageChoices

Array of ORKImageChoice objects.

-
- - - -
-

Return Value

-

An initialized image choice answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithImageChoices:style:vertical: -

- -
-
- -
- - -
-

Returns an initialized image choice answer format using the specified array of images.

-
- - - -
- (instancetype)initWithImageChoices:(NSArray<ORKImageChoice*> *)imageChoices style:(ORKChoiceAnswerStyle)style vertical:(BOOL)vertical
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
imageChoices

Array of ORKImageChoice objects.

style

The style of question, such as single or multiple choice.

vertical

Pass YES to stack images vertically; for the default horizontal -layout, pass NO.

-
- - - -
-

Return Value

-

An initialized image choice answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  imageChoices -

- -
-
- -
- - -
-

An array of ORKImageChoice objects that represent the available choices. (read-only)

-
- - - -
@property (copy, readonly) NSArray<ORKImageChoice*> *imageChoices
- - - - - - - - - -
-

Discussion

-

The text of the currently selected choice is displayed on screen. The text for -each choice is spoken by VoiceOver when an image is highlighted.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  style -

- -
-
- -
- - -
-

The style of the question (that is, single or multiple choice).

-
- - - -
@property (readonly) ORKChoiceAnswerStyle style
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  vertical -

- -
-
- -
- - -
-

A Boolean value indicating whether the choices are stacked vertically. (read-only)

-
- - - -
@property (readonly, getter=isVertical) BOOL vertical
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoiceLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoiceLabel.html deleted file mode 100644 index 92733a1e82..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKImageChoiceLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKImageChoiceLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKImageChoiceLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKImageChoiceLabel.h
ORKImageChoiceLabel.m
- - - - -
- -

Overview

-

Text label under image answer option icon

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKInstructionStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKInstructionStep.html deleted file mode 100644 index f9287a779e..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKInstructionStep.html +++ /dev/null @@ -1,530 +0,0 @@ - - - - - - ORKInstructionStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKInstructionStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKInstructionStep.h
ORKInstructionStep.m
- - - - -
- -

Overview

-

An ORKInstructionStep object gives the participant instructions for a task.

- -

You can use instruction steps to present various types of content during a task, such as -introductory content, instructions in the middle -of a task, or a final message at the completion of a task.

- -

To indicate the completion of a task, consider using an ORKCompletionStep object instead.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  detailText -

- -
-
- -
- - -
-

Additional detailed explanation for the instruction.

-
- - - -
@property (nonatomic, copy, nullable) NSString *detailText
- - - - - - - - - -
-

Discussion

-

The detail text is displayed below the content of the text property.

-
- - - - - - - -
-

Declared In

-

ORKInstructionStep.h

-
- - -
-
-
- -

  attributedDetailText -

- -
-
- -
- - -
-

Additional attributed explanation for the instruction.

-
- - - -
@property (nonatomic, copy, nullable) NSAttributedString *attributedDetailText
- - - - - - - - - -
-

Discussion

-

The attributed detail text is displayed below the content of the text property and overrides detailText.

-
- - - - - - - -
-

Declared In

-

ORKInstructionStep.h

-
- - -
-
-
- -

  footnote -

- -
-
- -
- - -
-

Additional text to display for the step in a localized string at the bottom of the view.

-
- - - -
@property (nonatomic, copy, nullable) NSString *footnote
- - - - - - - - - -
-

Discussion

-

The footnote is displayed in a smaller font below the continue button. It is intended to be used -in order to include disclaimer, copyright, etc. that is important to display in the step but -should not distract from the main purpose of the step.

-
- - - - - - - -
-

Declared In

-

ORKInstructionStep.h

-
- - -
-
-
- -

  image -

- -
-
- -
- - -
-

An image that provides visual context for the instruction.

-
- - - -
@property (nonatomic, copy, nullable) UIImage *image
- - - - - - - - - -
-

Discussion

-

The image is displayed with aspect fit. Depending on the device, the screen area -available for this image can vary. For exact -metrics, see ORKScreenMetricIllustrationHeight.

-
- - - - - - - -
-

Declared In

-

ORKInstructionStep.h

-
- - -
-
-
- -

  auxiliaryImage -

- -
-
- -
- - -
-

An image that provides visual context for the instruction that will allow for showing -a two-part composite image where the image is tinted and the auxiliaryImage is -shown with light grey.

-
- - - -
@property (nonatomic, copy, nullable) UIImage *auxiliaryImage
- - - - - - - - - -
-

Discussion

-

The image is displayed with the same frame as the image so both the auxiliaryImage -and image should have transparently to allow for overlay.

-
- - - - - - - -
-

Declared In

-

ORKInstructionStep.h

-
- - -
-
-
- -

  iconImage -

- -
-
- -
- - -
-

Optional icon image to show above the title and text.

-
- - - -
@property (nonatomic, copy, nullable) UIImage *iconImage
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKInstructionStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKInstructionStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKInstructionStepViewController.html deleted file mode 100644 index e040267389..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKInstructionStepViewController.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - ORKInstructionStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKInstructionStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKInstructionStepViewController.h
ORKInstructionStepViewController.m
- - - - -
- -

Overview

-

An ORKInstructionStepViewController object is the view controller for an ORKInstructionStep object.

- -

In general, you don’t need to instantiate an instruction step view controller directly. -Instead, add an instruction step to a task and present the task using a -task view controller. When appropriate, the task view controller instantiates the step -view controller for the step.

-
- - - - - -
- - - - - - -
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKJSONLogFormatter.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKJSONLogFormatter.html deleted file mode 100644 index 0bfb382d0b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKJSONLogFormatter.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - - - ORKJSONLogFormatter Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKJSONLogFormatter Class Reference

- - -
- - - - - - - -
Inherits fromORKLogFormatter : NSObject
Declared inORKDataLogger.h
ORKDataLogger.m
- - - - -
- -

Overview

-

The ORKJSONLogFormatter class represents a log formatter for producing JSON output.

- -

The JSON log formatter accepts NSDictionary objects for serialization. -The JSON output is a dictionary that contains one key, items, -which contains the array of logged items. The log itself does not contain -any timestamp information, so the items should include such fields, -if desired.

-
- - - - - -
- - - - - - -
-
- -

– canAcceptLogObjectOfClass: -

- -
-
- -
- - -
-

Returns a Boolean value that indicates whether the log formatter can serialize the specified type of object.

-
- - - -
- (BOOL)canAcceptLogObjectOfClass:(Class)c
- - - -
-

Parameters

- - - - - - - -
c

The class of object to serialize.

-
- - - -
-

Return Value

-

YES if the log formatter can serialize this object class; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– canAcceptLogObject: -

- -
-
- -
- - -
-

Returns a Boolean value that indicates whether the log formatter can serialize the specified type of object.

-
- - - -
- (BOOL)canAcceptLogObject:(id)object
- - - -
-

Parameters

- - - - - - - -
object

The object to serialize.

-
- - - -
-

Return Value

-

YES if the log formatter can serialize object; otherwise, NO

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– beginLogWithFileHandle:error: -

- -
-
- -
- - -
-

Begins a new log file on the specified file handle.

-
- - - -
- (BOOL)beginLogWithFileHandle:(NSFileHandle *)fileHandle error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - -
fileHandle

The file handle to which to write.

error

The error output, on failure.

-
- - - -
-

Return Value

-

YES if the write succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

For example, may write a header or opening stanza of a new log file.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– appendObject:fileHandle:error: -

- -
-
- -
- - -
-

Appends the specified object to the log file.

-
- - - -
- (BOOL)appendObject:(id)object fileHandle:(NSFileHandle *)fileHandle error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
object

The object to write.

fileHandle

The file handle to which to write.

error

The error output, on failure.

-
- - - -
-

Return Value

-

YES if the write succeeds; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– appendObjects:fileHandle:error: -

- -
-
- -
- - -
-

Appends the specified objects to the log file.

-
- - - -
- (BOOL)appendObjects:(NSArray *)objects fileHandle:(NSFileHandle *)fileHandle error:(NSError *__autoreleasing *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
objects

The objects to write.

fileHandle

The file handle to which to write.

error

The error output, on failure.

-
- - - -
-

Return Value

-

YES if the write succeeds; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKKeyValueStepModifier.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKKeyValueStepModifier.html deleted file mode 100644 index 957e82cc07..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKKeyValueStepModifier.html +++ /dev/null @@ -1,438 +0,0 @@ - - - - - - ORKKeyValueStepModifier Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKKeyValueStepModifier Class Reference

- - -
- - - - - - - -
Inherits fromORKStepModifier : NSObject
Declared inORKStepNavigationRule.h
ORKStepNavigationRule.m
- - - - -
- -

Overview

-

The ORKKeyValueStepModifier class is an class for an object that can be used to modify a step -if a given navigation rule is matched.

- -

Step modifiers can be used within an ORKNavigableOrderedTask object. You assign step modifiers -to be triggered after a task step is shown. Each step can have one step modifier at most.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  resultPredicate -

- -
-
- -
- - -
-

The result predicate to match.

-
- - - -
@property (nonatomic, strong, readonly) NSPredicate *resultPredicate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  keyValueMap -

- -
-
- -
- - -
-

A key-value mapping to apply to the modified step if the result predicate matches. -The keys in this are assumed to map using key-value coding.

-
- - - -
@property (nonatomic, strong, readonly) NSDictionary<NSString*NSObject*> *keyValueMap
- - - - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

– initWithResultPredicate:keyValueMap: -

- -
-
- -
- - -
-

Returns a new step modifier.

-
- - - -
- (instancetype)initWithResultPredicate:(NSPredicate *)resultPredicate keyValueMap:(NSDictionary<NSString*,NSObject*> *)keyValueMap
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
resultPredicate

The result predicate to use to determine if the step should be modified

keyValueMap

The mapping dictionary for this object

stepIdentifier

The step identifier for the step to modify

-
- - - -
-

Return Value

-

A new step modifier

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new step modifier.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the step navigation rule.

-
- - - -
-

Return Value

-

A new step modifier

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– modifyStep:withTaskResult: -

- -
-
- -
- - -
-

Modify the steps for a task.

-
- - - -
- (void)modifyStep:(ORKStep *)step withTaskResult:(ORKTaskResult *)taskResult
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step that is associated with this modifier

taskResult

The current task result

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKKeychainWrapper.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKKeychainWrapper.html deleted file mode 100644 index 313439b5f0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKKeychainWrapper.html +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - ORKKeychainWrapper Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKKeychainWrapper Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKKeychainWrapper.h
ORKKeychainWrapper.m
- - - - -
- -

Overview

-

The ORKKeychainWrapper class is an abstraction layer for the iOS keychain -communication.

-
- - - - - -
- - - - - - -
-
- -

+ setObject:forKey:error: -

- -
-
- -
- - -
-

Sets the given object in the keychain for the provided key.

-
- - - -
+ (BOOL)setObject:(id<NSSecureCoding>)object forKey:(NSString *)key error:(NSError *_Nullable *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
object

The data to be stored in the keychain.

key

The key used to set the data in the keychain.

error

If failure occurred, an NSError object indicating the reason for the - failure. The value of this parameter is nil if result does not - indicate failure.

-
- - - -
-

Return Value

-

A boolean with a value YES if the object was saved; otherwise `NO'.

-
- - - - - - - - - - - -
-

Declared In

-

ORKKeychainWrapper.h

-
- - -
-
-
- -

+ objectForKey:error: -

- -
-
- -
- - -
-

Returns the object in the keychain for the provided key.

-
- - - -
+ (nullable id<NSSecureCoding>)objectForKey:(nonnull NSString *)key error:(NSError *__autoreleasing _Nullable *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
key

The key used to set the data in the keychain.

error

If failure occurred, an NSError object indicating the reason for the - failure. The value of this parameter is nil if result does not - indicate failure.

-
- - - -
-

Return Value

-

An object or nil if key is not valid.

-
- - - - - - - - - - - -
-

Declared In

-

ORKKeychainWrapper.h

-
- - -
-
-
- -

+ removeObjectForKey:error: -

- -
-
- -
- - -
-

Removes the object in the keychain for the provided key.

-
- - - -
+ (BOOL)removeObjectForKey:(NSString *)key error:(NSError *_Nullable *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
key

The key used to set the value in the keychain.

error

If failure occurred, an NSError object indicating the reason for the - failure. The value of this parameter is nil if result does not - indicate failure.

-
- - - -
-

Return Value

-

A boolean with a value YES if the object was removed; otherwise `NO'.

-
- - - - - - - - - - - -
-

Declared In

-

ORKKeychainWrapper.h

-
- - -
-
-
- -

+ resetKeychainWithError: -

- -
-
- -
- - -
-

Removes all values stored in the keychain for the app.

-
- - - -
+ (BOOL)resetKeychainWithError:(NSError *_Nullable *)error
- - - -
-

Parameters

- - - - - - - -
error

If failure occurred, an NSError object indicating the reason for the - failure. The value of this parameter is nil if result does not - indicate failure.

-
- - - -
-

Return Value

-

A boolean with a value YES if the keychain was reset; otherwise `NO'.

-
- - - - - - - - - - - -
-

Declared In

-

ORKKeychainWrapper.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLabel.html deleted file mode 100644 index 3ebacbb7e3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLabel.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - ORKLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLabel Class Reference

- - -
- - - - - - - - - - -
Inherits fromUILabel
Conforms toORKDefaultFont
Declared inORKLabel.h
ORKLabel.m
- - - - -
- -

Overview

-

This is a base class, not being used directly.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLineGraphChartView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLineGraphChartView.html deleted file mode 100644 index 7683853a5b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLineGraphChartView.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - ORKLineGraphChartView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLineGraphChartView Class Reference

- - -
- - - - - - - -
Inherits fromORKValueRangeGraphChartView : ORKGraphChartView : UIView
Declared inORKLineGraphChartView.h
ORKLineGraphChartView.m
- - - - -
- -

Overview

-

The ORKLineGraphChartView class presents the data provided by an object conforming to the -ORKValueRangeGraphChartViewDataSource protocol as a line graph.

- -

The primary plot is colored by the tintColor, and any additional plots are colored using the -referenceLineColor property.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocation.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocation.html deleted file mode 100644 index 4052ad5793..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocation.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - ORKLocation Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLocation Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKLocation class represents the location addess obtained from a locaton question.

-
- - - - - -
- - - - - - -
-
- -

  coordinate -

- -
-
- -
- - -
-

The geographical coordinate information.

-
- - - -
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
- -

  region -

- -
-
- -
- - -
-

The region describes the size of the placemark of the location.

-
- - - -
@property (nonatomic, copy, readonly, nullable) CLCircularRegion *region
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
- -

  userInput -

- -
-
- -
- - -
-

The human readable address typed in by user.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSString *userInput
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
- -

  addressDictionary -

- -
-
- -
- - -
-

The address dicitonary for this coordinate from MapKit.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSDictionary *addressDictionary
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationAnswerFormat.html deleted file mode 100644 index d653fc0609..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationAnswerFormat.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - ORKLocationAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLocationAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKLocationAnswerFormat class represents the answer format for questions that collect a location response -from the user.

- -

An ORKLocationAnswerFormat object produces an ORKLocationQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  useCurrentLocation -

- -
-
- -
- - -
-

Indicates whether or not the user’s current location should be automatically entered the first time they tap on the input field.

-
- - - -
@property (nonatomic, assign) BOOL useCurrentLocation
- - - - - - - - - -
-

Discussion

-

By default, this value is YES.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationQuestionResult.html deleted file mode 100644 index a55d6f5746..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationQuestionResult.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - ORKLocationQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLocationQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKLocationQuestionResult class represents the result of a question or form item that asks for a location (ORKLocationAnswerFormat).

- -

A Location question result is produced by the task view controller when it presents a question or form -item with a Location answer format (that is, ORKLocationAnswerFormat).

- -

A Location question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  locationAnswer -

- -
-
- -
- - -
-

The answer representing the coordinate and the address of a specific location.

-
- - - -
@property (nonatomic, copy, nullable) ORKLocation *locationAnswer
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationRecorder.html deleted file mode 100644 index 944d203cba..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationRecorder.html +++ /dev/null @@ -1,471 +0,0 @@ - - - - - - ORKLocationRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLocationRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKLocationRecorder.h
ORKLocationRecorder.m
- - - - -
- -

Overview

-

The ORKLocationRecorder class represents a recorder for collecting location data from CoreLocation.

- -

Because location data is sensitive information, you need to take special care in handling it, including removoing or otherwise preparing it for a -anonymous data set.

- -

The accuracy of location data may be limited indoors.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized location recorder.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier step:(nullable ORKStep *)step outputDirectory:(nullable NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

step

The step that requested this recorder.

outputDirectory

The directory in which the location data should be stored.

-
- - - -
-

Return Value

-

An initialized location recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKLocationRecorder.h

-
- - -
-
-
- -

  locationManager -

- -
-
- -
- - -
-

The location manager, if any, being used by this recorder.

-
- - - -
@property (nonatomic, strong, nullable, readonly) CLLocationManager *locationManager
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKLocationRecorder.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationRecorderConfiguration.html deleted file mode 100644 index 5f1f47d462..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLocationRecorderConfiguration.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - ORKLocationRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLocationRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKLocationRecorder.m
ORKRecorder.h
- - - - -
- -

Overview

-

The ORKLocationRecorderConfiguration class represents a configuration -that records location data during an active step.

- -

The location data reported is the location provided by CoreLocation.

- -

If this configuration is included in an active step in a task, the task -view controller requests access to location data at the end of the -initial instruction steps in the task.

- -

Location data is serialized to JSON and returned as an ORKFileResult object. -For details on the format, see CLLocation+ORKJSONDictionary.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

- -

No additional parameters besides the identifier are required.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized location recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized location recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new location recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the location recorder configuration.

-
- - - -
-

Return Value

-

A new location recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedPermissionMask -

- -
-
- -
- - -
-

Returns the permission mask indicating the permissions required for this configuration.

-
- - - -
- (ORKPermissionMask)requestedPermissionMask
- - - - - - - - - -
-

Discussion

-

This method is typically overridden in new recorder configuration subclasses.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLogFormatter.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLogFormatter.html deleted file mode 100644 index 7882d40016..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLogFormatter.html +++ /dev/null @@ -1,478 +0,0 @@ - - - - - - ORKLogFormatter Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLogFormatter Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKDataLogger.h
ORKDataLogger.m
- - - - -
- -

Overview

-

The ORKLogFormatter class represents the base (default) log formatter, which appends data -blindly to a log file.

- -

A log formatter is used by a data logger to format objects -for output to the log, and to begin a new log file and end an existing log file. -ORKLogFormatter accepts NSData and has neither a header nor a footer.

- -

A log formatter should ensure that the log is always in a valid state, so that -even if the app is killed, the log is still readable.

-
- - - - - -
- - - - - - -
-
- -

– canAcceptLogObjectOfClass: -

- -
-
- -
- - -
-

Returns a Boolean value that indicates whether the log formatter can serialize the specified type of object.

-
- - - -
- (BOOL)canAcceptLogObjectOfClass:(Class)c
- - - -
-

Parameters

- - - - - - - -
c

The class of object to serialize.

-
- - - -
-

Return Value

-

YES if the log formatter can serialize this object class; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– canAcceptLogObject: -

- -
-
- -
- - -
-

Returns a Boolean value that indicates whether the log formatter can serialize the specified type of object.

-
- - - -
- (BOOL)canAcceptLogObject:(id)object
- - - -
-

Parameters

- - - - - - - -
object

The object to serialize.

-
- - - -
-

Return Value

-

YES if the log formatter can serialize object; otherwise, NO

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– beginLogWithFileHandle:error: -

- -
-
- -
- - -
-

Begins a new log file on the specified file handle.

-
- - - -
- (BOOL)beginLogWithFileHandle:(NSFileHandle *)fileHandle error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - -
fileHandle

The file handle to which to write.

error

The error output, on failure.

-
- - - -
-

Return Value

-

YES if the write succeeds; otherwise, NO.

-
- - - - - -
-

Discussion

-

For example, may write a header or opening stanza of a new log file.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– appendObject:fileHandle:error: -

- -
-
- -
- - -
-

Appends the specified object to the log file.

-
- - - -
- (BOOL)appendObject:(id)object fileHandle:(NSFileHandle *)fileHandle error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
object

The object to write.

fileHandle

The file handle to which to write.

error

The error output, on failure.

-
- - - -
-

Return Value

-

YES if the write succeeds; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– appendObjects:fileHandle:error: -

- -
-
- -
- - -
-

Appends the specified objects to the log file.

-
- - - -
- (BOOL)appendObjects:(NSArray *)objects fileHandle:(NSFileHandle *)fileHandle error:(NSError **)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
objects

The objects to write.

fileHandle

The file handle to which to write.

error

The error output, on failure.

-
- - - -
-

Return Value

-

YES if the write succeeds; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLoginStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLoginStep.html deleted file mode 100644 index a4c117295b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLoginStep.html +++ /dev/null @@ -1,572 +0,0 @@ - - - - - - ORKLoginStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLoginStep Class Reference

- - -
- - - - - - - -
Inherits fromORKFormStep : ORKStep : NSObject
Declared inORKLoginStep.h
ORKLoginStep.m
- - - - -
- -

Overview

-

The ORKLoginStep class represents a form step that provides fields commonly used -for account login.

- -

The login step contains email and password fields.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:title:text: -

- -
-
- -
- - -
-

Returns an initialized form step using the specified identifier, title, and text.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier title:(nullable NSString *)title text:(nullable NSString *)text
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The string that identifies the step (see ORKStep).

title

The title of the form (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

-
- - - -
-

Return Value

-

As initialized form step object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

– initWithIdentifier:title:text:loginViewControllerClass: -

- -
-
- -
- - -
-

Returns an initialized login step using the specified identifier, title, text, and options.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier title:(nullable NSString *)title text:(nullable NSString *)text loginViewControllerClass:(Class)loginViewControllerClass
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The string that identifies the step (see ORKStep).

title

The title of the form (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

loginViewControllerClass

The subclassed login step view controller class.

-
- - - -
-

Return Value

-

An initialized login step object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKLoginStep.h

-
- - -
-
-
- -

  loginViewControllerClass -

- -
-
- -
- - -
-

The view controller subclass used for the step.

-
- - - -
@property (nonatomic, readonly) Class loginViewControllerClass
- - - - - - - - - -
-

Discussion

-

The subclass allows you to override button actions in order to provide navigation logic -for the button items on the step.

-
- - - - - - - -
-

Declared In

-

ORKLoginStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– stepViewControllerClass -

- -
-
- -
- - - - -
- (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– isOptional -

- -
-
- -
- - -
-

A Boolean value indicating whether the user can skip the step -without providing an answer.

-
- - - -
- (BOOL)isOptional
- - - - - - - - - -
-

Discussion

-

The default value of this property is YES. When the value is NO, the Skip button does not -appear on this step.

- -

This property may not be meaningful for all steps; for example, an active step -might not provide a way to skip, because it requires a timer to finish.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLoginStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLoginStepViewController.html deleted file mode 100644 index e4fa28a094..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKLoginStepViewController.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - ORKLoginStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKLoginStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKFormStepViewController : ORKStepViewController : UIViewController
Declared inORKLoginStepViewController.h
ORKLoginStepViewController.m
- - - - -
- -

Overview

-

The ORKLoginStepViewController class is the concrete ORKStepViewController -implementation for ORKLoginStep.

- -

You should subclass a login step view controller and override the button action -methods to provide your navigation logic. All override methods are required.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– forgotPasswordButtonTapped -

- -
-
- -
- - -
-

Action method for the forgot password button.

-
- - - -
- (void)forgotPasswordButtonTapped
- - - - - - - - - -
-

Discussion

-

The forgot password button is shown in place of the skip button. -Override this method to provide custom logic for the button action.

-
- - - - - - - -
-

Declared In

-

ORKLoginStepViewController.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMotionActivityCollector.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMotionActivityCollector.html deleted file mode 100644 index a1dd650aac..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMotionActivityCollector.html +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - ORKMotionActivityCollector Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKMotionActivityCollector Class Reference

- - -
- - - - - - - -
Inherits fromORKCollector : NSObject
Declared inORKCollector.h
ORKCollector.m
- - - - -
- -

Overview

-

ORKHealthCollector collects CMMotionActivity.

- -

It cannot be initiated directly. -Use addMotionActivityCollectorWithStartDate:to add one to a ORKDataCollectionManager.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– serializableObjectsForObjects: -

- -
-
- -
- - -
-

Serialization helper that produces objects suitable for serialization to JSON.

-
- - - -
- (NSArray *)serializableObjectsForObjects:(NSArray<CMMotionActivity*> *)objects
- - - - - -
-

Return Value

-

Serializable dictionary objects.

-
- - - - - -
-

Discussion

-

Subclasses should implement to provide a default JSON serialization for upload. -Called by serializedDataForObjects:.

- -

@params objects The objects to be serialized.

-
- - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  startDate -

- -
-
- -
- - -
-

Samples should be collected starting at this date.

-
- - - -
@property (copy, readonly) NSDate *startDate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
- -

  lastDate -

- -
-
- -
- - -
-

Last anchor already seen.

-
- - - -
@property (copy, readonly) NSDate *lastDate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCollector.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMotionActivityQueryOperation.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMotionActivityQueryOperation.html deleted file mode 100644 index ca44799f5a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMotionActivityQueryOperation.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - ORKMotionActivityQueryOperation Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKMotionActivityQueryOperation Class Reference

- - -
- - - - - - - -
Inherits fromORKOperation : NSOperation
Declared inORKMotionActivityQueryOperation.h
ORKMotionActivityQueryOperation.m
- - - - -
- -

Overview

-

Operation for extracting and preparing CoreMotion data for upload. This operation -runs until there is no more CoreMotion data available, or until otherwise stopped.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMultipleComponentQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMultipleComponentQuestionResult.html deleted file mode 100644 index fea0589f69..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMultipleComponentQuestionResult.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - ORKMultipleComponentQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKMultipleComponentQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKMultipleComponentQuestionResult class represents the choice -answers from a multiple-component picker-style choice-based answer format.

- -

For example, an ORKMultipleValuePickerAnswerFormat produces an ORKMultipleComponentQuestionResult object.

- -

A multiple component question result is typically generated by the framework as the task proceeds. -When the task completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  componentsAnswer -

- -
-
- -
- - -
-

An array of selected components, from the value property of an ORKTextChoice object. -The array will have the same count as the number of components.

-
- - - -
@property (nonatomic, copy, nullable) NSArray *componentsAnswer
- - - - - - - - - -
-

Discussion

-

If the user skipped the question, the value of the corresponding array member is nil.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
- -

  separator -

- -
-
- -
- - -
-

The string separator used to join the components (if applicable)

-
- - - -
@property (nonatomic, copy, nullable) NSString *separator
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMultipleValuePickerAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMultipleValuePickerAnswerFormat.html deleted file mode 100644 index 31ff4243db..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKMultipleValuePickerAnswerFormat.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - ORKMultipleValuePickerAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKMultipleValuePickerAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKMultipleValuePickerAnswerFormat class represents an answer format that lets participants use a -multiple-component value picker to choose from a fixed set of text choices.

- -

Note that the multiple value picker answer format reports itself as being of the multiple picker question -type. The multiple-component value picker answer format produces an ORKMultipleComponentQuestionResult -object where the index into the array matches the array of ORKValuePickerAnswerFormat objects.

- -

For example, if the picker shows two columns with choices of [[A, B, C], [1, 2, 3, 4]] and the user picked -B and 3 then this would result in componentsAnswer = [B, 3].

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithValuePickers: -

- -
-
- -
- - -
-

Returns a multiple value picker answer format using the specified array of value pickers.

-
- - - -
- (instancetype)initWithValuePickers:(NSArray<ORKValuePickerAnswerFormat*> *)valuePickers
- - - -
-

Parameters

- - - - - - - -
valuePickers

Array of ORKValuePickerAnswerFormat objects.

-
- - - -
-

Return Value

-

An initialized multiple value picker answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithValuePickers:separator: -

- -
-
- -
- - -
-

Returns a multiple value picker answer format using the specified array of value pickers.

-
- - - -
- (instancetype)initWithValuePickers:(NSArray<ORKValuePickerAnswerFormat*> *)valuePickers separator:(NSString *)separator
- - - -
-

Parameters

- - - - - - - - - - - - -
valuePickers

Array of ORKValuePickerAnswerFormat objects.

separator

String used to separate the components

-
- - - -
-

Return Value

-

An initialized multiple value picker answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  valuePickers -

- -
-
- -
- - -
-

An array of value pickers that represent the options to display in the picker. (read-only)

-
- - - -
@property (copy, readonly) NSArray<ORKValuePickerAnswerFormat*> *valuePickers
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  separator -

- -
-
- -
- - -
-

A string used to define the separator for the format of the string. Default = “ ”.

-
- - - -
@property (copy, readonly) NSString *separator
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNavigableOrderedTask.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNavigableOrderedTask.html deleted file mode 100644 index 352b7e9b38..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNavigableOrderedTask.html +++ /dev/null @@ -1,1160 +0,0 @@ - - - - - - ORKNavigableOrderedTask Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNavigableOrderedTask Class Reference

- - -
- - - - - - - -
Inherits fromORKOrderedTask : NSObject
Declared inORKNavigableOrderedTask.h
ORKNavigableOrderedTask.m
- - - - -
- -

Overview

-

The ORKNavigableOrderedTask class adds conditional step navigation to the behavior inherited from -the ORKOrderedTask class.

- -

For implementing conditional task navigation, you must instantiate concrete subclasses of -ORKStepNavigationRule and ORKSkipStepNavigationRule and attach them to trigger steps by using -the setNavigationRule:forTriggerStepIdentifier: and setSkipNavigationRule:forStepIdentifier: -methods.

- -

For example, if you want to display a survey question only when the user answered Yes to a previous -question you can use ORKPredicateStepNavigationRule; or if you want to define an arbitrary jump -between two steps you can use ORKDirectStepNavigationRule. You can also optionally omit steps by -using ORKPredicateSkipStepNavigationRule objects.

- -

Note that each step in the task can have at most one attached navigation rule and one attached skip -navigation rule.

- -

Navigable ordered tasks support looping over previously visited steps. Note, however, that results -for steps that are visited more than once will be ovewritten when you revisit the step on the loop. -Thus, going over a loop will produce duplicate results within the task results for the steps that -are seen more than once, but all the duplicate step results will point to the same result instance: -the one corresponding to the last time you visited the step.

- -

The same applies when navigating backwards over looped steps: only your last valid answer is shown -every time you encounter a revisited step.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– setNavigationRule:forTriggerStepIdentifier: -

- -
-
- -
- - -
-

Adds a navigation rule for a trigger step identifier.

-
- - - -
- (void)setNavigationRule:(ORKStepNavigationRule *)stepNavigationRule forTriggerStepIdentifier:(NSString *)triggerStepIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - -
stepNavigationRule

The step navigation rule to be used when navigating forward from the - trigger step. A strong reference to the rule is kept by the - task.

triggerStepIdentifier

The identifier of the step that triggers the rule.

-
- - - - - - - -
-

Discussion

-

The rule will be used to obtain a new destination step when the participant goes forward from the -trigger step. You cannot add two different navigation rules to the same trigger step identifier; -only the most recently added rule is kept.

-
- - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– navigationRuleForTriggerStepIdentifier: -

- -
-
- -
- - -
-

Returns the step navigation rule associated with a trigger step identifier, or nil if there is -no rule associated with that step identifier.

-
- - - -
- (nullable ORKStepNavigationRule *)navigationRuleForTriggerStepIdentifier:(NSString *)triggerStepIdentifier
- - - -
-

Parameters

- - - - - - - -
triggerStepIdentifier

The identifier of the step whose rule you want to retrieve.

-
- - - -
-

Return Value

-

A step navigation rule, or nil if the trigger step identifier has none.

-
- - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– removeNavigationRuleForTriggerStepIdentifier: -

- -
-
- -
- - -
-

Removes the navigation rule, if any, associated with the specified trigger step identifier.

-
- - - -
- (void)removeNavigationRuleForTriggerStepIdentifier:(NSString *)triggerStepIdentifier
- - - -
-

Parameters

- - - - - - - -
triggerStepIdentifier

The identifier of the step whose rule is to be removed.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

  stepNavigationRules -

- -
-
- -
- - -
-

A dictionary of step navigation rules in the task, keyed by trigger step identifier.

-
- - - -
@property (nonatomic, copy, readonly) NSDictionary<NSString*ORKStepNavigationRule*> *stepNavigationRules
- - - - - - - - - -
-

Discussion

-

Each object in the dictionary should be a ORKStepNavigationRule subclass.

-
- - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– setSkipNavigationRule:forStepIdentifier: -

- -
-
- -
- - -
-

Adds a skip step navigation rule for a step identifier.

-
- - - -
- (void)setSkipNavigationRule:(ORKSkipStepNavigationRule *)skipStepNavigationRule forStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - -
skipStepNavigationRule

The skip step navigation rule to be used to determine if the - step should be skipped. A strong reference to the rule is - kept by the task.

stepIdentifier

The identifier of the step that is checked against the skip - rule.

-
- - - - - - - -
-

Discussion

-

The rule will be used to decide if the identified step needs to be skipped. You cannot add two -different skip navigation rules to the same step identifier; only the most recently added rule is -kept.

-
- - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– skipNavigationRuleForStepIdentifier: -

- -
-
- -
- - -
-

Returns the skip step navigation rule associated with a step identifier, or nil if there is no -skip rule associated with that step identifier.

-
- - - -
- (nullable ORKSkipStepNavigationRule *)skipNavigationRuleForStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - -
stepIdentifier

The identifier of the step whose skip rule you want to retrieve.

-
- - - -
-

Return Value

-

A skip step navigation rule, or nil if the step identifier has none.

-
- - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– removeSkipNavigationRuleForStepIdentifier: -

- -
-
- -
- - -
-

Removes the skip step navigation rule, if any, associated with the specified step identifier.

-
- - - -
- (void)removeSkipNavigationRuleForStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - -
stepIdentifier

The identifier of the step whose rule is to be removed.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

  skipStepNavigationRules -

- -
-
- -
- - -
-

A dictionary of step navigation rules in the task, keyed by trigger step identifier.

-
- - - -
@property (nonatomic, copy, readonly) NSDictionary<NSString*ORKSkipStepNavigationRule*> *skipStepNavigationRules
- - - - - - - - - -
-

Discussion

-

Each object in the dictionary should be a ORKStepNavigationRule subclass.

-
- - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– setStepModifier:forStepIdentifier: -

- -
-
- -
- - -
-

Adds a step modifier for a step identifier.

-
- - - -
- (void)setStepModifier:(ORKStepModifier *)stepModifier forStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - -
stepModifier

The step modifier associated with this step

stepIdentifier

The identifier of the step that is checked against the skip -rule.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– stepModifierForStepIdentifier: -

- -
-
- -
- - -
-

Returns the step modifier associated with a step identifier, or nil if there is no -step modifier associated with that step identifier.

-
- - - -
- (nullable ORKStepModifier *)stepModifierForStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - -
stepIdentifier

The identifier of the step to be modified

-
- - - -
-

Return Value

-

A step modifier, or nil if the step identifier has none.

-
- - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

– removeStepModifierForStepIdentifier: -

- -
-
- -
- - -
-

Removes the step modifier, if any, associated with the specified step identifier.

-
- - - -
- (void)removeStepModifierForStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - -
stepIdentifier

The identifier of the step whose rule is to be removed.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

  stepModifiers -

- -
-
- -
- - -
-

A dictionary of step modifiers in the task, keyed by trigger step identifier.

-
- - - -
@property (nonatomic, copy, readonly) NSDictionary<NSString*ORKStepModifier*> *stepModifiers
- - - - - - - - - -
-

Discussion

-

Each object in the dictionary should be a ORKStepModifier subclass.

-
- - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
- -

  shouldReportProgress -

- -
-
- -
- - -
-

Determines whether the task should report its progress as a linear ordered task or not. -The default value of this property is NO.

-
- - - -
@property (nonatomic) BOOL shouldReportProgress
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKNavigableOrderedTask.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– initWithIdentifier:steps: -

- -
-
- -
- - -
-

Returns an initialized ordered task using the specified identifier and array of steps.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier steps:(NSArray<ORKStep*> *)steps
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier for the task.

steps

An array of ORKStep objects in the order in which they should be presented.

-
- - - -
-

Return Value

-

An initialized ordered task.

-
- - - - - - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
- -

– stepAfterStep:withResult: -

- -
-
- -
- - - - -
- (ORKStep *)stepAfterStep:(ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepBeforeStep:withResult: -

- -
-
- -
- - - - -
- (ORKStep *)stepBeforeStep:(ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– progressOfCurrentStep:withResult: -

- -
-
- -
- - - - -
- (ORKTaskProgress)progressOfCurrentStep:(ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns an ordered task initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the ordered task.

-
- - - -
-

Return Value

-

An initialized ordered task.

-
- - - - - -
-

Discussion

-

An ordered task can be serialized and deserialized with NSKeyedArchiver. Note -that this serialization includes strings that might need to be -localized.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNavigablePageStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNavigablePageStep.html deleted file mode 100644 index 41d1176ada..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNavigablePageStep.html +++ /dev/null @@ -1,443 +0,0 @@ - - - - - - ORKNavigablePageStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNavigablePageStep Class Reference

- - -
- - - - - - - -
Inherits fromORKPageStep : ORKStep : NSObject
Declared inORKNavigablePageStep.h
ORKNavigablePageStep.m
- - - - -
- -

Overview

-

The ORKNavigablePageStep class is a concrete subclass of ORKPageStep, used for presenting a subgrouping of -ORKStepViewController views using a UIPageViewController. It allows for using an ORKOrderedTask as -the model object used to define navigation, and has been added specifically to allow developers to use -ORKNavigableOrderedTask and other subclasses of ORKOrderedTask with the ORKPageStep.

- -

To use ORKNavigablePageStep, instantiate the object, fill in its properties, and include it in a task. -Next, create a task view controller for the task and present it.

- -

The base class implementation will instatiate a read-only ORKPageStepViewController to display -a series of substeps. For each substep, the ORKStepViewController will be instantiated and added -as a child of the UIPageViewController contained by the parent ORKPageStepViewController..

- -

Customization can be handled by overriding the base class implementations in either ORKNavigablePageStep -or ORKPageStepViewController.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:steps: -

- -
-
- -
- - -
-

Returns an initialized page step using the specified identifier and array of steps.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier steps:(NSArray<ORKStep*> *)steps
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier for the step.

steps

An array of ORKStep objects in the order in which they should be presented.

-
- - - -
-

Return Value

-

An initialized page step.

-
- - - - - - - - - - - -
-

Declared In

-

ORKPageStep.h

-
- - -
-
-
- -

– initWithIdentifier:pageTask: -

- -
-
- -
- - -
-

Returns an initialized page step using the specified identifier and task.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier pageTask:(ORKOrderedTask *)task
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier for the step.

task

The task used to run the subtask.

-
- - - -
-

Return Value

-

An initialized navigable page step.

-
- - - - - - - - - - - -
-

Declared In

-

ORKNavigablePageStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a page step initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the ordered task.

-
- - - -
-

Return Value

-

An initialized navigable page step.

-
- - - - - -
-

Discussion

-

A page step can be serialized and deserialized with NSKeyedArchiver. Note -that this serialization includes strings that might need to be localized.

-
- - - - - - - -
-

Declared In

-

ORKNavigablePageStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  pageTask -

- -
-
- -
- - -
-

The subtask used to determine the next/previous steps that are in this grouping

-
- - - -
@property (nonatomic, copy, readonly) ORKOrderedTask *pageTask
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKNavigablePageStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNumericAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNumericAnswerFormat.html deleted file mode 100644 index 25f19dd6fc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNumericAnswerFormat.html +++ /dev/null @@ -1,786 +0,0 @@ - - - - - - ORKNumericAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNumericAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKNumericAnswerFormat class defines the attributes for a numeric -answer format that participants enter using a numeric keyboard.

- -

If you specify maximum or minimum values and the user enters a value outside the -specified range, the question step view controller does not allow navigation -until the participant provides a value that is within the valid range.

- -

Questions and form items that use this answer format produce an -ORKNumericQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithStyle: -

- -
-
- -
- - -
-

Returns an initialized numeric answer format using the specified style.

-
- - - -
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style
- - - -
-

Parameters

- - - - - - - -
style

The style of the numeric answer (decimal or integer).

-
- - - -
-

Return Value

-

An initialized numeric answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithStyle:unit: -

- -
-
- -
- - -
-

Returns an initialized numeric answer format using the specified style and unit designation.

-
- - - -
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style unit:(nullable NSString *)unit
- - - -
-

Parameters

- - - - - - - - - - - - -
style

The style of the numeric answer (decimal or integer).

unit

A string that displays a localized version of the unit designation.

-
- - - -
-

Return Value

-

An initialized numeric answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithStyle:unit:minimum:maximum: -

- -
-
- -
- - -
-

Returns an initialized numeric answer format using the specified style, unit designation, and range -values.

-
- - - -
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style unit:(nullable NSString *)unit minimum:(nullable NSNumber *)minimum maximum:(nullable NSNumber *)maximum
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
style

The style of the numeric answer (decimal or integer).

unit

A string that displays a localized version of the unit designation.

minimum

The minimum value to apply, or nil if none is specified.

maximum

The maximum value to apply, or nil if none is specified.

-
- - - -
-

Return Value

-

An initialized numeric answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithStyle:unit:minimum:maximum:maximumFractionDigits: -

- -
-
- -
- - -
-

Returns an initialized numeric answer format using the specified style, unit designation, and range -values.

-
- - - -
- (instancetype)initWithStyle:(ORKNumericAnswerStyle)style unit:(nullable NSString *)unit minimum:(nullable NSNumber *)minimum maximum:(nullable NSNumber *)maximum maximumFractionDigits:(nullable NSNumber *)maximumFractionDigits
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
style

The style of the numeric answer (decimal or integer).

unit

A string that displays a localized version of the unit designation.

minimum

The minimum value to apply, or nil if none is specified.

maximum

The maximum value to apply, or nil if none is specified.

maximumFractionDigits

The maximum fraction digits, or nil if no maximum is specified.

-
- - - -
-

Return Value

-

An initialized numeric answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  style -

- -
-
- -
- - -
-

The style of numeric entry (decimal or integer). (read-only)

-
- - - -
@property (readonly) ORKNumericAnswerStyle style
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  unit -

- -
-
- -
- - -
-

A string that displays a localized version of the unit designation next to the numeric value. -(read-only)

-
- - - -
@property (copy, readonly, nullable) NSString *unit
- - - - - - - - - -
-

Discussion

-

Examples of unit designations are days, lbs, and liters. -The unit string is included in the ORKNumericQuestionResult object.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimum -

- -
-
- -
- - -
-

The minimum allowed value for the numeric answer.

-
- - - -
@property (copy, nullable) NSNumber *minimum
- - - - - - - - - -
-

Discussion

-

The default value of this property is nil, which means that no minimum value is displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximum -

- -
-
- -
- - -
-

The maximum allowed value for the numeric answer.

-
- - - -
@property (copy, nullable) NSNumber *maximum
- - - - - - - - - -
-

Discussion

-

The default value of this property is nil, which means that no maximum value is displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumFractionDigits -

- -
-
- -
- - -
-

The maximum number of fraction digits to the right of the decimal point for the -numeric answer.

-
- - - -
@property (copy, nullable) NSNumber *maximumFractionDigits
- - - - - - - - - -
-

Discussion

-

The default value of this property is nil, which means that there’s no maximum number of fraction -digits.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultNumericAnswer -

- -
-
- -
- - -
-

The default numeric answer.

-
- - - -
@property (copy, nullable) NSNumber *defaultNumericAnswer
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNumericQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNumericQuestionResult.html deleted file mode 100644 index 8a646ab257..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKNumericQuestionResult.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - ORKNumericQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNumericQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKNumericQuestionResult class represents a question or form item that uses an answer format that produces a numeric answer.

- -

Examples of this type of answer format include ORKScaleAnswerFormat and ORKNumericAnswerFormat.

- -

A numeric question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  numericAnswer -

- -
-
- -
- - -
-

The number collected, or nil if the user skipped the question.

-
- - - -
@property (nonatomic, copy, nullable) NSNumber *numericAnswer
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
- -

  unit -

- -
-
- -
- - -
-

The unit string displayed to the user when the value was entered, or nil if no unit string was displayed.

-
- - - -
@property (nonatomic, copy, nullable) NSString *unit
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKOperation.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKOperation.html deleted file mode 100644 index 72db11f2d3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKOperation.html +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - ORKOperation Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKOperation Class Reference

- - -
- - - - - - - -
Inherits fromNSOperation
Declared inORKOperation.h
ORKOperation.m
- - - - -
- -

Overview

-

A concurrent operation for collecting data for upload.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– safeFinish -

- -
-
- -
- - -
-

Finishes the operation cleanly.

-
- - - -
- (void)safeFinish
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKOperation.h

-
- - -
-
-
- -

– doTimeout -

- -
-
- -
- - -
-

Sets the error to indicate a timeout, and finishes.

-
- - - -
- (void)doTimeout
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKOperation.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  startBlock -

- -
-
- -
- - -
-

Block that will be called inside the lock during -start, -just after transitioning to RKOperationExecuting.

-
- - - -
@property (nonatomic, strong) ORKOperationBlock startBlock
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKOperation.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKOrderedTask.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKOrderedTask.html deleted file mode 100644 index 84bf93c901..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKOrderedTask.html +++ /dev/null @@ -1,3084 +0,0 @@ - - - - - - ORKOrderedTask Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKOrderedTask Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
ORKTask
Declared inORKOrderedTask.h
ORKOrderedTask.m
- - - - -
- -

Overview

-

The ORKOrderedTask class implements all the methods in the ORKTask protocol and represents a -task that assumes a fixed order for its steps.

- -

In the ResearchKit framework, any simple sequential task, such as a survey or an active task, can -be represented as an ordered task.

- -

If you want further custom conditional behaviors in a task, it can be easier to subclass -ORKOrderedTask or ORKNavigableOrderedTask and override particular ORKTask methods than it is -to implement the ORKTask protocol directly. Override the methods stepAfterStep:withResult: and -stepBeforeStep:withResult:, and call super for all other methods.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:steps: -

- -
-
- -
- - -
-

Returns an initialized ordered task using the specified identifier and array of steps.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier steps:(NSArray<ORKStep*> *)steps
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier for the task.

steps

An array of ORKStep objects in the order in which they should be presented.

-
- - - -
-

Return Value

-

An initialized ordered task.

-
- - - - - - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
- -

– copyWithSteps: -

- -
-
- -
- - -
-

Return a mutated copy of self with the steps included in the given array.

-
- - - -
- (instancetype)copyWithSteps:(NSArray<ORKStep*> *)steps
- - - -
-

Parameters

- - - - - - - -
steps

An array of ORKStep objects in the order in which they should be presented.

-
- - - -
-

Return Value

-

An initialized ordered task.

-
- - - - - -
-

Discussion

-

This method is intended to allow for mutating an ordered task (or subclass) while retaining -the original class and properties that may not be publicly exposed, but with a mutated set -of steps. An example of where this might be useful is if before performing an ORKPredefinedActiveTask, -the app needed to query the participant about medications, diet or sleep. The app -would need to mutate the steps in order to insert their own steps. While an ORKOrderedTask could -then be created with the same identifier and the new steps, subclass information such rules on an -ORKNavigableOrderedTask would be lost.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the task parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

The implementation of this method should check that all the task parameters are correct. An invalid task -is considered an unrecoverable error: the implementation should throw an exception on parameter validation failure. -For example, the ORKOrderedTask implementation makes sure that all its step identifiers are unique, throwing an -exception otherwise.

- -

This method is usually called by a task view controller when its task is set.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– identifier -

- -
-
- -
- - -
-

The unique identifier for this task.

-
- - - -
- (NSString *)identifier
- - - - - - - - - -
-

Discussion

-

The identifier should be a short string that identifies the task. The identifier is copied -into the ORKTaskResult objects generated by the task view controller for this -task. You can use a human-readable string for the task identifier -or a UUID; the exact string you use depends on your app.

- -

In the case of apps whose tasks come from a server, the unique -identifier for the task may be in an external database.

- -

The task view controller uses the identifier when constructing the task result. -The identifier can also be used during UI state restoration to identify the -task that needs to be restored.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– indexOfStep: -

- -
-
- -
- - -
-

Find the index of a given step.

-
- - - -
- (NSUInteger)indexOfStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to look for

-
- - - -
-

Return Value

-

The index position of the step (or NSNotFound if not found)

-
- - - - - - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
- -

– stepAfterStep:withResult: -

- -
-
- -
- - - - -
- (ORKStep *)stepAfterStep:(ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepBeforeStep:withResult: -

- -
-
- -
- - - - -
- (ORKStep *)stepBeforeStep:(ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepWithIdentifier: -

- -
-
- -
- - -
-

Returns the step that matches the specified identifier.

-
- - - -
- (ORKStep *)stepWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The identifier of the step to restore.

-
- - - -
-

Return Value

-

The step that matches the specified identifier.

-
- - - - - -
-

Discussion

-

Implementing this method allows state restoration of a task -to a particular step. If you don’t implement this method, ORKTaskViewController restores the state -to the first step of the task.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– progressOfCurrentStep:withResult: -

- -
-
- -
- - - - -
- (ORKTaskProgress)progressOfCurrentStep:(ORKStep *)step withResult:(ORKTaskResult *)taskResult
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

The set of HealthKit types that steps in the task need to be able to -read. (read-only)

-
- - - -
- (NSSet *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

The value of this property is a set of HKObjectType values to request for reading from HealthKit during this task. After the last of the initial instruction steps, the task view controller -requests access to these HealthKit types.

- -

To set this property, you can scan the steps in the task -and collate the HealthKit types that are requested by each active step, question, or -form step that has a Health answer format, and then include any additional types known -to be required. (Note that ORKOrderedTask does something similar for this property.)

- -

See also: requestedHealthKitTypesForWriting.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– requestedHealthKitTypesForWriting -

- -
-
- -
- - -
-

The set of HealthKit types for which the task needs to request write access.

-
- - - -
- (NSSet *)requestedHealthKitTypesForWriting
- - - - - - - - - -
-

Discussion

-

The requested HKObjectType values for writing can be returned by an extended task, -to request write access to these HealthKit types together with the read access -requested by the task view controller by calling requestedHealthKitTypesForReading.

- -

See also: requestedHealthKitTypesForReading.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– requestedPermissions -

- -
-
- -
- - -
-

The set of permissions requested by the task.

-
- - - -
- (ORKPermissionMask)requestedPermissions
- - - - - - - - - -
-

Discussion

-

By default in ORKOrderedTask object, these permissions are collected from the -recorder configurations associated with the active steps in the task.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– providesBackgroundAudioPrompts -

- -
-
- -
- - -
-

A Boolean value indicating whether this task involves spoken audio prompts. (read-only)

-
- - - -
- (BOOL)providesBackgroundAudioPrompts
- - - - - - - - - -
-

Discussion

-

If the value of this property is YES, the shared AVAudioSession is configured for playback in the background. -The audio UIBackgroundMode value must be set in the application’s Info.plist file -for this to be effective.

- -

By default, this property looks for active steps that have -audio prompts or count down enabled, and returns YES if such steps exist in -the task.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns an ordered task initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the ordered task.

-
- - - -
-

Return Value

-

An initialized ordered task.

-
- - - - - -
-

Discussion

-

An ordered task can be serialized and deserialized with NSKeyedArchiver. Note -that this serialization includes strings that might need to be -localized.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
-
- - - -

Properties

- -
-
- -

  steps -

- -
-
- -
- - -
-

The array of steps in the task. (read-only)

-
- - - -
@property (nonatomic, copy, readonly) NSArray<ORKStep*> *steps
- - - - - - - - - -
-

Discussion

-

Each element in the array must be a subclass of ORKStep. -The associated task view controller presents the steps in -array order.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
- -

  progressLabelColor -

- -
-
- -
- - -
-

Color property of the progress label. -Default is black.

-
- - - -
@property (nonatomic) UIColor *progressLabelColor
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKOrderedTask.h

-
- - -
-
-
-
- - - -

ORKPredefinedActiveTask Methods

- -
-
- -

+ amslerGridTaskWithIdentifier:intendedUseDescription:options: -

- -
-
- -
- - -
-

Returns a predefined Amsler Grid task that helps in detecting problems in user’s vision.

-
- - - -
+ (ORKOrderedTask *)amslerGridTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data collected. - If the value of this parameter is nil, the default localized text is displayed.

options

Options that affect the features of the predefined task.

-
- - - - - - - -
-

Discussion

-

In an Amsler Grid task, the participant is shown a square grid. The participant is asked to mark the areas where they notice disctortions in the grid.

- -

Data collected by the task is in the form of an ORKAmslerGridResult object.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ holePegTestTaskWithIdentifier:intendedUseDescription:dominantHand:numberOfPegs:threshold:rotated:timeLimit:options: -

- -
-
- -
- - -
-

Returns a predefined task that measures the upper extremity function.

-
- - - -
+ (ORKNavigableOrderedTask *)holePegTestTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription dominantHand:(ORKBodySagittal)dominantHand numberOfPegs:(int)numberOfPegs threshold:(double)threshold rotated:(BOOL)rotated timeLimit:(NSTimeInterval)timeLimit options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data -collected. If the value of this parameter is nil, the default -localized text will be displayed.

dominantHand

The participant dominant hand that will be tested first.

numberOfPegs

The number of pegs to place in the pegboard.

threshold

The threshold value used for the detection area.

rotated

A test variant that also requires peg rotation.

timeLimit

The duration allowed to validate the peg position.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active hole peg test task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a hole peg test task, the participant is asked to fill holes with pegs.

- -

A hole peg test task can be used to assess arm and hand function, especially in patients with severe disability.

- -

Data collected in this task is in the form of an ORKHolePegTestResult object.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ twoFingerTappingIntervalTaskWithIdentifier:intendedUseDescription:duration:handOptions:options: -

- -
-
- -
- - -
-

Returns a predefined task that consists of two finger tapping (Optionally with a hand specified)

-
- - - -
+ (ORKOrderedTask *)twoFingerTappingIntervalTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(NSString *)intendedUseDescription duration:(NSTimeInterval)duration handOptions:(ORKPredefinedTaskHandOption)handOptions options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the default - localized text will be displayed.

duration

The length of the count down timer that runs while touch data is - collected.

handOptions

Options for determining which hand(s) to test.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active two finger tapping task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a two finger tapping task, the participant is asked to rhythmically and alternately tap two -targets on the device screen.

- -

A two finger tapping task can be used to assess basic motor capabilities including speed, accuracy, -and rhythm.

- -

Data collected in this task includes touch activity and accelerometer information.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ audioTaskWithIdentifier:intendedUseDescription:speechInstruction:shortSpeechInstruction:duration:recordingSettings:checkAudioLevel:options: -

- -
-
- -
- - -
-

Returns a predefined task that enables an audio recording WITH a check of the audio level.

-
- - - -
+ (ORKNavigableOrderedTask *)audioTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription speechInstruction:(nullable NSString *)speechInstruction shortSpeechInstruction:(nullable NSString *)shortSpeechInstruction duration:(NSTimeInterval)duration recordingSettings:(nullable NSDictionary *)recordingSettings checkAudioLevel:(BOOL)checkAudioLevel options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data -collected. If the value of this parameter is nil, default -localized text is used.

speechInstruction

Instructional content describing what the user needs to do when -recording begins. If the value of this parameter is nil, -default localized text is used.

shortSpeechInstruction

Instructional content shown during audio recording. If the value of -this parameter is nil, default localized text is used.

duration

The length of the count down timer that runs while audio data is -collected.

recordingSettings

See “AV Foundation Audio Settings Constants” for possible values.

checkAudioLevel

If YES then add navigational rules to check the background noise level.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active audio task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In an audio recording task, the participant is asked to make some kind of sound -with their voice, and the audio data is collected.

- -

An audio task can be used to measure properties of the user’s voice, such as -frequency range, or the ability to pronounce certain sounds.

- -

If checkAudioLevel == YES then a navigation rule is added to do a simple check of the background -noise level. If the background noise is too loud, then the participant is instructed to move to a -quieter location before trying again.

- -

Data collected in this task consists of audio information.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ fitnessCheckTaskWithIdentifier:intendedUseDescription:walkDuration:restDuration:options: -

- -
-
- -
- - -
-

Returns a predefined task that consists of a fitness check.

-
- - - -
+ (ORKOrderedTask *)fitnessCheckTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(NSString *)intendedUseDescription walkDuration:(NSTimeInterval)walkDuration restDuration:(NSTimeInterval)restDuration options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the default - localized text is displayed.

walkDuration

The duration of the walk (the maximum is 10 minutes).

restDuration

The duration of the post walk rest period.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active fitness check task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a fitness check task, the participant is asked to walk for a specified duration -(typically several minutes). During this period, various sensor data is collected and returned by -the task view controller’s delegate. Sensor data can include accelerometer, device motion, -pedometer, location, and heart rate data where available.

- -

At the conclusion of the walk, if heart rate data is available, the participant is asked to sit -down and rest for a period. Data collection continues during this period.

- -

By default, the task includes an instruction step that explains what the user needs to do during -the task, but this can be excluded with ORKPredefinedTaskOptionExcludeInstructions.

- -

Data collected from this task can be used to compute measures of general fitness.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ shortWalkTaskWithIdentifier:intendedUseDescription:numberOfStepsPerLeg:restDuration:options: -

- -
-
- -
- - -
-

Returns a predefined task that consists of a short walk.

-
- - - -
+ (ORKOrderedTask *)shortWalkTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(NSString *)intendedUseDescription numberOfStepsPerLeg:(NSInteger)numberOfStepsPerLeg restDuration:(NSTimeInterval)restDuration options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the default - localized text is displayed.

numberOfStepsPerLeg

The number of steps the participant is asked to walk. If the - pedometer is unavailable, a distance is suggested and a suitable - count down timer is displayed for each leg of the walk.

restDuration

The duration of the rest period. When the value of this parameter is - nonzero, the user is asked to stand still for the specified rest - period after the turn sequence has been completed, and baseline - data is collected.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active short walk task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a short walk task, the participant is asked to walk a short distance, which may be indoors. -Typical uses of the resulting data are to assess stride length, smoothness, sway, or other aspects -of the participant’s gait.

- -

The presentation of the short walk task differs from the fitness check task in that the distance is -replaced by the number of steps taken, and the walk is split into a series of legs. After each leg, -the user is asked to turn and reverse direction.

- -

The data collected by this task can include accelerometer, device motion, and pedometer data.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ walkBackAndForthTaskWithIdentifier:intendedUseDescription:walkDuration:restDuration:options: -

- -
-
- -
- - -
-

Returns a predefined task that consists of a short walk back and forth.

-
- - - -
+ (ORKOrderedTask *)walkBackAndForthTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(NSString *)intendedUseDescription walkDuration:(NSTimeInterval)walkDuration restDuration:(NSTimeInterval)restDuration options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data -collected. If the value of this parameter is nil, the default -localized text is displayed.

walkDuration

The duration of the walking period.

restDuration

The duration of the rest period. When the value of this parameter is -nonzero, the user is asked to stand still for the specified rest -period after the turn sequence has been completed, and baseline -data is collected.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active short walk task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a short walk task, the participant is asked to walk a short distance, which may be indoors. -Typical uses of the resulting data are to assess stride length, smoothness, sway, or other aspects -of the participant’s gait.

- -

The presentation of the back and forth walk task differs from the short walk in that the participant -is asked to walk back and forth rather than walking in a straight line for a certain number of steps.

- -

The participant is then asked to turn in a full circle and then stand still.

- -

This task is intended to allow the participant to walk in a confined space where the participant -does not have access to a long hallway to walk in a continuous straight line. Additionally, by asking -the participant to turn in a full circle and then stand still, the activity can access balance and -concentration.

- -

The data collected by this task can include accelerometer, device motion, and pedometer data.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ kneeRangeOfMotionTaskWithIdentifier:limbOption:intendedUseDescription:options: -

- -
-
- -
- - -
-

The knee range of motion task returns a task that measures the range of motion for either a left or right knee.

-
- - - -
+ (ORKOrderedTask *)kneeRangeOfMotionTaskWithIdentifier:(NSString *)identifier limbOption:(ORKPredefinedTaskLimbOption)limbOption intendedUseDescription:(NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

limbOption

Which knee is being measured.

intendedUseDescription

A localized string describing the intended use of the data collected. If the value of this parameter is nil, default localized text is used.

options

Options that affect the features of the predefined task.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ shoulderRangeOfMotionTaskWithIdentifier:limbOption:intendedUseDescription:options: -

- -
-
- -
- - -
-

The shoulder range of motion task returns a task that measures the range of motion for either a left or right shoulder.

-
- - - -
+ (ORKOrderedTask *)shoulderRangeOfMotionTaskWithIdentifier:(NSString *)identifier limbOption:(ORKPredefinedTaskLimbOption)limbOption intendedUseDescription:(NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

limbOption

Which shoulder is being measured.

intendedUseDescription

A localized string describing the intended use of the data collected. If the value of this parameter is nil, default localized text is used.

options

Options that affect the features of the predefined task.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ spatialSpanMemoryTaskWithIdentifier:intendedUseDescription:initialSpan:minimumSpan:maximumSpan:playSpeed:maximumTests:maximumConsecutiveFailures:customTargetImage:customTargetPluralName:requireReversal:options: -

- -
-
- -
- - -
-

Returns a predefined task that tests spatial span memory.

-
- - - -
+ (ORKOrderedTask *)spatialSpanMemoryTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(NSString *)intendedUseDescription initialSpan:(NSInteger)initialSpan minimumSpan:(NSInteger)minimumSpan maximumSpan:(NSInteger)maximumSpan playSpeed:(NSTimeInterval)playSpeed maximumTests:(NSInteger)maximumTests maximumConsecutiveFailures:(NSInteger)maximumConsecutiveFailures customTargetImage:(UIImage *)customTargetImage customTargetPluralName:(NSString *)customTargetPluralName requireReversal:(BOOL)requireReversal options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the default - localized text is displayed.

initialSpan

The sequence length of the initial memory pattern.

minimumSpan

The minimum pattern sequence length.

maximumSpan

The maximum pattern sequence length.

playSpeed

The time per sequence item; a smaller value means faster sequence - play.

maximumTests

The maximum number of rounds to conduct.

maximumConsecutiveFailures

The maximum number of consecutive failures the user can make before - the task is terminated.

customTargetImage

The image to use for the task. By default, and if the value of this - parameter is nil, the image is a flower. To supply a custom - image, create a template image to which iOS adds the tint color.

customTargetPluralName

The name associated with customTargetImage; by default, the value - of this parameter is @“flowers”.

requireReversal

A Boolean value that indicates whether to require the user to tap - the sequence in reverse order.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active spatial span memory task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a spatial span memory task, the participant is asked to repeat pattern sequences of increasing -length in a game-like environment. You can use this task to assess visuospatial memory and -executive function.

- -

In each round of the task, an array of -target images are shown in a grid (by default, the images are flowers). The round consists of a -demonstration phase and an interactive phase. In the demonstration phase, some of the flowers -change color in a specific sequence. After the demonstration, the user is asked to tap the flowers -in the same sequence for the interactive phase.

- -

The span (that is, the length of the pattern sequence) is automatically varied during the task, -increasing after users succeed and decreasing after they fail, within the range specified by -minimum and maximum values that you specify. You can also customize the speed of sequence playback -and the shape of the tap target.

- -

A spatial span memory task finishes when the user has either completed the maximum number of tests -or made the maximum number of errors.

- -

Data collected by the task is in the form of an ORKSpatialSpanMemoryResult object.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ speechRecognitionTaskWithIdentifier:intendedUseDescription:speechRecognizerLocale:speechRecognitionImage:speechRecognitionText:shouldHideTranscript:allowsEdittingTranscript:options: -

- -
-
- -
- - -
-

Returns a predefined Speech Recognition task that transcribes participant’s speech.

-
- - - -
+ (ORKOrderedTask *)speechRecognitionTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription speechRecognizerLocale:(ORKSpeechRecognizerLocale)speechRecognizerLocale speechRecognitionImage:(nullable UIImage *)speechRecognitionImage speechRecognitionText:(nullable NSString *)speechRecognitionText shouldHideTranscript:(BOOL)shouldHideTranscript allowsEdittingTranscript:(BOOL)allowsEdittingTranscript options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data collected. - If the value of this parameter is nil, the default localized text is displayed.

speechRecognizerLocale

An enum that represents the locale to be used by speech recognition API.

speechRecognitionImage

The image shown to the participant.

speechRecognitionText

The text shown to the participant.

shouldHideTranscript

The boolean value used to show or hide the transcription from the user.

allowsEdittingTranscript

The boolean value used to present step that allows editting transcription.

options

Options that affect the features of the predefined task.

-
- - - - - - - -
-

Discussion

-

In a Speech Recognition task, the participant is shown a text or image or both. The participant has to read the text aloud, or describe the image.

- -

A Speech Recognition task finishes when the user presses the Stop Recording button.

- -

Data collected by the task is in the form of an ORKSpeechRecognitionResult object.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ speechInNoiseTaskWithIdentifier:intendedUseDescription:options: -

- -
-
- -
- - -
-

Returns a predefined task that tests speech audiometry.

-
- - - -
+ (ORKOrderedTask *)speechInNoiseTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data -collected. If the value of this parameter is nil, default -localized text is used.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active speech in noise task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a speech in noise task, the participant is asked to listen to some sentences mixed with background noise at varying signal to noise ratio (SNR).

- -

You can use a speech in noise task to measure the speech reception threshold (SRT) of an individual.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ stroopTaskWithIdentifier:intendedUseDescription:numberOfAttempts:options: -

- -
-
- -
- - -
-

Returns a predefined Stroop task that tests participants selective attention and cognitive flexibility.

-
- - - -
+ (ORKOrderedTask *)stroopTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription numberOfAttempts:(NSInteger)numberOfAttempts options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data -collected. If the value of this parameter is nil, the default -localized text is displayed.

numberOfAttempts

Total number of stroop questions to include in the task.

options

Options that affect the features of the predefined task.

-
- - - - - - - -
-

Discussion

-

In a stroop task, the participant is shown a text. The text is a name of a color, but the text is printed in a color that may or may not be denoted by the name. In each attempt of the task, the participant has to press the button that corresponds to the first letter of the color in which the text is printed. The participant has to ignore the name of the color written in the text, but respond based on the color of the text.

- -

A stroop task finishes when the user has completed all the attempts, irrespective of correct or incorrect answers.

- -

Data collected by the task is in the form of an ORKStroopResult object.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ toneAudiometryTaskWithIdentifier:intendedUseDescription:speechInstruction:shortSpeechInstruction:toneDuration:options: -

- -
-
- -
- - -
-

Returns a predefined task that tests tone audiometry.

-
- - - -
+ (ORKOrderedTask *)toneAudiometryTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription speechInstruction:(nullable NSString *)speechInstruction shortSpeechInstruction:(nullable NSString *)shortSpeechInstruction toneDuration:(NSTimeInterval)toneDuration options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, default - localized text is used.

speechInstruction

Instructional content describing what the user needs to do when - recording begins. If the value of this parameter is nil, - default localized text is used.

shortSpeechInstruction

Instructional content shown during audio recording. If the value of - this parameter is nil, default localized text is used.

toneDuration

The maximum length of the duration for each tone (each tone can be - interrupted sooner, after the participant presses the main - button).

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active tone audiometry task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a tone audiometry task, the participant is asked to listen to some tones with different audio -frequencies, playing on different channels (left and right), with the volume being progressively -increased until the participant taps a button.

- -

You can use a tone audiometry task to measure properties of the user’s hearing, based on their -reaction to a wide range of frequencies.

- -

Data collected in this task consists of audio signal amplitude for specific frequencies and -channels.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ dBHLToneAudiometryTaskWithIdentifier:intendedUseDescription:options: -

- -
-
- -
- - -
-

Returns a predefined task that tests dBHL tone audiometry.

-
- - - -
+ (ORKOrderedTask *)dBHLToneAudiometryTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data -collected. If the value of this parameter is nil, default -localized text is used.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active dBHL tone audiometry task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In the dBHL tone audiometry task, the participant is asked to listen to some tones with different audio -frequencies, playing on different channels (left and right), that vary in dB HL values depending on whether or not the user tapped the button.

- -

You can use a tone audiometry task to measure the hearing threshold of the user.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ towerOfHanoiTaskWithIdentifier:intendedUseDescription:numberOfDisks:options: -

- -
-
- -
- - -
-

Returns a predefined task that consists of a Tower of Hanoi puzzle.

-
- - - -
+ (ORKOrderedTask *)towerOfHanoiTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription numberOfDisks:(NSUInteger)numberOfDisks options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the - default localized text is displayed.

numberOfDisks

The number of disks in the puzzle; the default value for this property is 3.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active device motion reaction time task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a Tower of Hanoi task, the participant is asked to solve the classic puzzle in as few moves as possible. -You can use this task to assess the participant’s problem-solving skills.

- -

A Tower of Hanoi task finishes when the participant has completed the puzzle correctly or concedes that he or she cannot solve it.

- -

Data collected by the task is in the form of an ORKTowerOfHanoiResult object. Data collected in this task consists of how many moves were taken and whether the puzzle was successfully completed or not.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ reactionTimeTaskWithIdentifier:intendedUseDescription:maximumStimulusInterval:minimumStimulusInterval:thresholdAcceleration:numberOfAttempts:timeout:successSound:timeoutSound:failureSound:options: -

- -
-
- -
- - -
-

Returns a predefined task that tests the participant’s reaction time.

-
- - - -
+ (ORKOrderedTask *)reactionTimeTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription maximumStimulusInterval:(NSTimeInterval)maximumStimulusInterval minimumStimulusInterval:(NSTimeInterval)minimumStimulusInterval thresholdAcceleration:(double)thresholdAcceleration numberOfAttempts:(int)numberOfAttempts timeout:(NSTimeInterval)timeout successSound:(UInt32)successSoundID timeoutSound:(UInt32)timeoutSoundID failureSound:(UInt32)failureSoundID options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the - study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the - default localized text is displayed.

maximumStimulusInterval

The maximum interval before the stimulus is delivered.

minimumStimulusInterval

The minimum interval before the stimulus is delivered.

thresholdAcceleration

The acceleration required to end a reaction time test.

numberOfAttempts

The number of successful attempts required before the task is - complete. The active step result will contain this many - child results if the task is completed.

timeout

The interval permitted after the stimulus until the test fails, - if the threshold is not reached.

successSoundID

The sound to play after a successful attempt.

timeoutSoundID

The sound to play after an attempt that times out.

failureSoundID

The sound to play after an unsuccessful attempt.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active device motion reaction time task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a reaction time task, the participant is asked to move the device sharply in any -direction in response to a visual cue. You can use this task to accurately assess the participant’s -simple reaction time.

- -

A reaction time task finishes when the participant has completed the required -number of attempts successfully. An attempt is successful when the participant exerts acceleration -greater than thresholdAcceleration to the device after the stimulus has been delivered and before -timeout has elapsed. An attempt is unsuccessful if acceleration greater than -thresholdAcceleration is applied to the device before the stimulus or if this does not occur -before timeout has elapsed. If unsuccessful, the result is not reported and the participant must -try again to proceed with the task.

- -

Data collected by the task is in the form of ORKReactionTimeResult objects. These -objects contain a timestamp representing the delivery of the stimulus and an ORKFileResult, which -references the motion data collected during an attempt. The researcher can use these to evaluate -the response to the stimulus and calculate the reaction time.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ timedWalkTaskWithIdentifier:intendedUseDescription:distanceInMeters:timeLimit:turnAroundTimeLimit:includeAssistiveDeviceForm:options: -

- -
-
- -
- - -
-

Returns a predefined task that consists of a timed walk, with a distinct turn around step.

-
- - - -
+ (ORKOrderedTask *)timedWalkTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription distanceInMeters:(double)distanceInMeters timeLimit:(NSTimeInterval)timeLimit turnAroundTimeLimit:(NSTimeInterval)turnAroundTimeLimit includeAssistiveDeviceForm:(BOOL)includeAssistiveDeviceForm options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data -collected. If the value of this parameter is nil, the default -localized text is displayed.

distanceInMeters

The timed walk distance in meters.

timeLimit

The time limit to complete the trials.

turnAroundTimeLimit

The time limit to complete the turn around step, passing zero or negative value to this parameter will bypass the turnAroundTime step.

includeAssistiveDeviceForm

A Boolean value that indicates whether to inlude the form step -about the usage of an assistive device.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active timed walk task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a timed walk task, the participant is asked to walk for a specific distance as quickly as -possible, but safely. Then the participant is asked to turn around. The task is immediately -administered again by having the patient walk back the same distance. -A timed walk task can be used to measure lower extremity function.

- -

The presentation of the timed walk task differs from both the fitness check task and the short -walk task in that the distance is fixed. After a first walk, the user is asked to turn, then reverse -direction.

- -

The data collected by this task can include accelerometer, device motion, pedometer data, -and location where available.

- -

Data collected by the task is in the form of an ORKTimedWalkResult object.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ PSATTaskWithIdentifier:intendedUseDescription:presentationMode:interStimulusInterval:stimulusDuration:seriesLength:options: -

- -
-
- -
- - -
-

Returns a predefined task that consists of the paced serial addition test (PSAT).

-
- - - -
+ (ORKOrderedTask *)PSATTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription presentationMode:(ORKPSATPresentationMode)presentationMode interStimulusInterval:(NSTimeInterval)interStimulusInterval stimulusDuration:(NSTimeInterval)stimulusDuration seriesLength:(NSInteger)seriesLength options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the default - localized text is displayed.

presentationMode

The presentation mode of the PSAT test (auditory or visual or both).

interStimulusInterval

The time interval between two digits presented.

stimulusDuration

The time duration the digit is shown on screen (only for - visual PSAT, that is PVSAT and PAVSAT).

seriesLength

The number of digits that will be presented during the task.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active PSAT task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a PSAT task, the participant is asked to add a new digit to the one immediately before it -every 2 or 3 seconds.

- -

A PSAT task can be used to measure the cognitive function that assesses auditory and/or -visual information processing speed and flexibility, as well as calculation ability.

- -

Data collected by the task is in the form of an ORKPSATResult object.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ tremorTestTaskWithIdentifier:intendedUseDescription:activeStepDuration:activeTaskOptions:handOptions:options: -

- -
-
- -
- - -
-

Returns a predefined task that measures hand tremor.

-
- - - -
+ (ORKNavigableOrderedTask *)tremorTestTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription activeStepDuration:(NSTimeInterval)activeStepDuration activeTaskOptions:(ORKTremorActiveTaskOption)activeTaskOptions handOptions:(ORKPredefinedTaskHandOption)handOptions options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the default - localized text is displayed.

activeStepDuration

The duration for each active step in the task.

activeTaskOptions

Options that affect which active steps are presented for this task.

handOptions

Options for determining which hand(s) to test.

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active tremor test task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a tremor assessment task, the participant is asked to hold the device with their most affected -hand in various positions while accelerometer and motion data are captured.

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
- -

+ trailmakingTaskWithIdentifier:intendedUseDescription:trailmakingInstruction:trailType:options: -

- -
-
- -
- - -
-

Returns a predefined task that measures visual attention and task switching.

-
- - - -
+ (ORKOrderedTask *)trailmakingTaskWithIdentifier:(NSString *)identifier intendedUseDescription:(nullable NSString *)intendedUseDescription trailmakingInstruction:(nullable NSString *)trailmakingInstruction trailType:(ORKTrailMakingTypeIdentifier)trailType options:(ORKPredefinedTaskOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The task identifier to use for this task, appropriate to the study.

intendedUseDescription

A localized string describing the intended use of the data - collected. If the value of this parameter is nil, the default - localized text is displayed.

trailmakingInstruction

Instructional content describing what the user needs to do when - the task begins. If the value of this parameter is nil,

trailType

Type of trail to display. Either ORKTrailMakingTypeIdentifierA or ORKTrailMakingTypeIdentifierB

options

Options that affect the features of the predefined task.

-
- - - -
-

Return Value

-

An active trail making test task that can be presented with an ORKTaskViewController object.

-
- - - - - -
-

Discussion

-

In a trail making test, the participant is asked to connect a series of cicles labeled 1,2,3… or -1,A,2,B,3,C… and time to complete the test is recorded.

- -

ORKTrailMakingTypeIdentifierA uses the pattern: 1-2-3-4-5-6-7. -ORKTrailMakingTypeIdentifierB uses the pattern: 1-A-2-B-3-C-4-D-5-E-6-F-7

-
- - - - - - - -
-

Declared In

-

ORKOrderedTask+ORKPredefinedActiveTask.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPDFViewerStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPDFViewerStep.html deleted file mode 100644 index 4ce0b23493..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPDFViewerStep.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - ORKPDFViewerStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPDFViewerStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKPDFViewerStep.h
ORKPDFViewerStep.m
- - - - -
- -

Overview

-

The ORKPDFViewerStep class is a concrete subclass of ORKStep, used for presenting a PDF document for reading and limited editing.

- -

To use ORKPDFViewerStep, instantiate the object, fill in its properties, and include it in a task. -Next, create a task view controller for the task and present it.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPDFViewerStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPDFViewerStepViewController.html deleted file mode 100644 index feaf5ccb07..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPDFViewerStepViewController.html +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - ORKPDFViewerStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPDFViewerStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKPDFViewerStepViewController.h
ORKPDFViewerStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATResult.html deleted file mode 100644 index 6032c635c8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATResult.html +++ /dev/null @@ -1,537 +0,0 @@ - - - - - - ORKPSATResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPSATResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKPSATResult.h
ORKPSATResult.m
- - - - -
- -

Overview

-

The ORKPSATResult class records the results of a PSAT test.

- -

The PSAT result object records the initial digit, an array of addition samples, the total of correct answers -and also various attributes of the PSAT test.

- -

The PSAT samples are generated by the framework as the task proceeds. -When the task completes, it may be appropriate to serialize them for transmission to a server, -or to immediately perform analysis on them.

-
- - - - - -
- - - - - - -
-
- -

  presentationMode -

- -
-
- -
- - -
-

The PSAT presentation mode.

-
- - - -
@property (nonatomic, assign) ORKPSATPresentationMode presentationMode
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  interStimulusInterval -

- -
-
- -
- - -
-

The time interval between two digits presented. -PSAT-2" is 2 seconds; PSAT-3" is 3 seconds.

-
- - - -
@property (nonatomic, assign) NSTimeInterval interStimulusInterval
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  stimulusDuration -

- -
-
- -
- - -
-

The amount of time a digit is shown on the screen (0 second for PASAT).

-
- - - -
@property (nonatomic, assign) NSTimeInterval stimulusDuration
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  length -

- -
-
- -
- - -
-

The length of the series, that is, the number of additions.

-
- - - -
@property (nonatomic, assign) NSInteger length
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  totalCorrect -

- -
-
- -
- - -
-

The number of correct sums given (out of ‘length’ possible ones).

-
- - - -
@property (nonatomic, assign) NSInteger totalCorrect
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  totalDyad -

- -
-
- -
- - -
-

The number of consecutive correct answers (out of ‘length - 1’ possible ones). -Used to overcome the alternate answer strategy.

-
- - - -
@property (nonatomic, assign) NSInteger totalDyad
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  totalTime -

- -
-
- -
- - -
-

The total time needed to answer all additions (that is, the sum of all the samples times).

-
- - - -
@property (nonatomic, assign) NSTimeInterval totalTime
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  initialDigit -

- -
-
- -
- - -
-

The initial digit.

-
- - - -
@property (nonatomic, assign) NSInteger initialDigit
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  samples -

- -
-
- -
- - -
-

An array of collected samples, in which each item is an ORKPSATSample -object that represents an addition sample.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKPSATSample*> *samples
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATSample.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATSample.html deleted file mode 100644 index a189e6981a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATSample.html +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - ORKPSATSample Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPSATSample Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKPSATResult.h
ORKPSATResult.m
- - - - -
- -

Overview

-

The ORKPSATSample class represents a numeric answer to an addition question. -If the answer is correct, the sample object records the presented digit and the numeric answer. -A PSAT sample is included in an ORKPSATResult object and is recorded -by the step view controller for the corresponding task.

- -

A PSAT sample is typically generated by the framework as the task proceeds. -When the task completes, it may be appropriate to serialize the sample for -transmission to a server, or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  correct -

- -
-
- -
- - -
-

A Boolean value indicating whether the addition answer was the correct one.

-
- - - -
@property (nonatomic, assign, getter=isCorrect) BOOL correct
- - - - - - - - - -
-

Discussion

-

The value of this property is YES when the addition result is the correct -one, and NO otherwise.

-
- - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  digit -

- -
-
- -
- - -
-

The presented digit.

-
- - - -
@property (nonatomic, assign) NSInteger digit
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  answer -

- -
-
- -
- - -
-

The numeric answer; --1 if no answer is provided.

-
- - - -
@property (nonatomic, assign) NSInteger answer
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
- -

  time -

- -
-
- -
- - -
-

The time interval between the new digit and the answer, or test duration if no answer is provided.

-
- - - -
@property (nonatomic, assign) NSTimeInterval time
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPSATResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATStep.html deleted file mode 100644 index 77605e6cc5..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATStep.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - ORKPSATStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPSATStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKPSATStep.h
ORKPSATStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATStepViewController.html deleted file mode 100644 index f42de1b44d..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPSATStepViewController.html +++ /dev/null @@ -1,479 +0,0 @@ - - - - - - ORKPSATStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPSATStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKPSATStepViewController.h
ORKPSATStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– suspend -

- -
-
- -
- - -
-

Suspends the active step.

-
- - - -
- (void)suspend
- - - - - - - - - -
-

Discussion

-

Call this method to suspend data recording and the step’s timer.

- -

This method may called automatically when the app is suspended. -The view controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– resume -

- -
-
- -
- - -
-

Resumes the active step.

-
- - - -
- (void)resume
- - - - - - - - - -
-

Discussion

-

Call this method when the step should be resumed. Calls to this method should -be paired with previous calls to suspend.

- -

This method may be called automatically when the app is resumed. The view -controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

When the step is resumed, the UI should resume at the point where the user left off, -or, if that does not make sense for the particular step, to the most recent -suitable point.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– finish -

- -
-
- -
- - -
-

Finishes the active step.

-
- - - -
- (void)finish
- - - - - - - - - -
-

Discussion

-

Call this method to finish the active step. If the active step is configured with -a timer, this method is called automatically when the timer expires.

- -

Finishing the active step stops all data recording and stops any timers. In steps that have the -shouldContinueOnFinish property set, forward navigation to the next step -may ensue.

- -

This method does nothing if the step has already finished.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageResult.html deleted file mode 100644 index cf758c2e26..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageResult.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - ORKPageResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPageResult Class Reference

- - -
- - - - - - - -
Inherits fromORKTaskResult : ORKCollectionResult : ORKResult : NSObject
Declared inORKCollectionResult.m
ORKCollectionResult_Private.h
- - - - -
- -

Overview

-

The ORKPageResult is an ORKTaskResult subclass of a collection of ORKStepResult -objects. This is considered private, and it is used internally by ORKPageStepViewController -to track the result set.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageStep.html deleted file mode 100644 index f6e1fb41a0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageStep.html +++ /dev/null @@ -1,778 +0,0 @@ - - - - - - ORKPageStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPageStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKPageStep.h
ORKPageStep.m
- - - - -
- -

Overview

-

The ORKPageStep class is a concrete subclass of ORKStep, used for presenting a subgrouping of -ORKStepViewController views using a UIPageViewController.

- -

To use ORKPageStep, instantiate the object, fill in its properties, and include it in a task. -Next, create a task view controller for the task and present it.

- -

The base class implementation will instatiate a read-only ORKPageStepViewController to display -a series of substeps. For each substep, the ORKStepViewController will be instantiated and added -as a child of the UIPageViewController contained by the parent ORKPageStepViewController..

- -

Customization can be handled by overriding the base class implementations in either ORKPageStep -or ORKPageStepViewController.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:steps: -

- -
-
- -
- - -
-

Returns an initialized page step using the specified identifier and array of steps.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier steps:(NSArray<ORKStep*> *)steps
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The unique identifier for the step.

steps

An array of ORKStep objects in the order in which they should be presented.

-
- - - -
-

Return Value

-

An initialized page step.

-
- - - - - - - - - - - -
-

Declared In

-

ORKPageStep.h

-
- - -
-
-
- -

– steps -

- -
-
- -
- - -
-

The array of steps in the page step. (read-only)

-
- - - -
- (NSArray<ORKStep*> *)steps
- - - - - - - - - -
-

Discussion

-

Each element in the array must be a subclass of ORKStep. -The associated page step view controller presents the steps in -array order.

-
- - - - - - - -
-

Declared In

-

ORKPageStep.h

-
- - -
-
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– requestedPermissions -

- -
-
- -
- - -
-

The set of access permissions required for the step. (read-only)

-
- - - -
- (ORKPermissionMask)requestedPermissions
- - - - - - - - - -
-

Discussion

-

The permission mask is used by the task view controller to determine the types of -access to request from users when they complete the initial instruction steps -in a task. If your step requires access to APIs that limit access, include -the permissions you require in this mask.

- -

By default, the property scans the recorders and collates the permissions -required by the recorders. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

The set of HealthKit types the step requests for reading. (read-only)

-
- - - -
- (NSSet<HKObjectType*> *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

The task view controller uses this set of types when constructing a list of -all the HealthKit types required by all the steps in a task, so that it can -present the HealthKit access dialog just once during that task.

- -

By default, the property scans the recorders and collates the HealthKit -types the recorders require. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– stepAfterStepWithIdentifier:withResult: -

- -
-
- -
- - -
-

Returns the step after the specified step, if there is one.

-
- - - -
- (ORKStep *)stepAfterStepWithIdentifier:(NSString *)identifier withResult:(ORKTaskResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The reference step identifier. Pass nil to specify the first step.

result

A snapshot of the current set of results.

-
- - - -
-

Return Value

-

The step that comes after the specified step, or nil if there isn’t one.

-
- - - - - -
-

Discussion

-

The page view controller calls this method to determine the step to display after the specified step. -The page view controller can also call this method every time the result updates, to determine if the -new result changes which steps are available.

-
- - - - - - - -
-

Declared In

-

ORKPageStep.h

-
- - -
-
-
- -

– stepBeforeStepWithIdentifier:withResult: -

- -
-
- -
- - -
-

Returns the step that precedes the specified step, if there is one.

-
- - - -
- (ORKStep *)stepBeforeStepWithIdentifier:(NSString *)identifier withResult:(ORKTaskResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The reference step identifier.

result

A snapshot of the current set of results.

-
- - - -
-

Return Value

-

The step that precedes the reference step, or nil if there isn’t one.

-
- - - - - -
-

Discussion

-

The page view controller calls this method to determine the step to display before the specified step. -The page view controller can also call this method every time the result changes, to determine if the -new result changes which steps are available.

-
- - - - - - - -
-

Declared In

-

ORKPageStep.h

-
- - -
-
-
- -

– stepWithIdentifier: -

- -
-
- -
- - -
-

Returns the step that matches the specified identifier.

-
- - - -
- (ORKStep *)stepWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The identifier of the step to restore.

-
- - - -
-

Return Value

-

The step that matches the specified identifier, or nil if there isn’t one.

-
- - - - - - - - - - - -
-

Declared In

-

ORKPageStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a page step initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the ordered task.

-
- - - -
-

Return Value

-

An initialized page step.

-
- - - - - -
-

Discussion

-

A page step can be serialized and deserialized with NSKeyedArchiver. Note -that this serialization includes strings that might need to be localized.

-
- - - - - - - -
-

Declared In

-

ORKPageStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageStepViewController.html deleted file mode 100644 index b8b3f41161..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPageStepViewController.html +++ /dev/null @@ -1,476 +0,0 @@ - - - - - - ORKPageStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPageStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKPageStepViewController.h
ORKPageStepViewController.m
- - - - - - -
- - - - -

Other Methods

- -
-
- -

  pageStep -

- -
-
- -
- - -
-

The ORKPageStep associated with this view controller.

-
- - - -
@property (nonatomic, readonly, nullable) ORKPageStep *pageStep
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPageStepViewController.h

-
- - -
-
-
- -

– stepViewControllerForStep: -

- -
-
- -
- - -
-

Returns the step view controller to associate with this step. By default, this will -return the step view controller instantiated by the given step.

-
- - - -
- (ORKStepViewController *)stepViewControllerForStep:(ORKStep *)step
- - - - - -
-

Return Value

-

ORKStepViewController subclass for this step.

-
- - - - - - - - - - - -
-

Declared In

-

ORKPageStepViewController.h

-
- - -
-
-
- -

– resultSource -

- -
-
- -
- - -
-

Returns an ORKTaskResultSource for the steps that are included as substeps for this -page view controller.

-
- - - -
- (id<ORKTaskResultSource>)resultSource
- - - - - -
-

Return Value

-

ORKTaskResultSource for the step results

-
- - - - - - - - - - - -
-

Declared In

-

ORKPageStepViewController.h

-
- - -
-
-
- -

– goToStep:direction:animated: -

- -
-
- -
- - -
-

Go to the given step.

-
- - - -
- (void)goToStep:(ORKStep *)step direction:(UIPageViewControllerNavigationDirection)direction animated:(BOOL)animated
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
step

The step to go to

direction

The direction in which navigate

animated

Should the change of view controllers be animated.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKPageStepViewController.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– initWithStep:result: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step to be presented.

result

The current step result for this step.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeResult.html deleted file mode 100644 index 6433f6c253..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeResult.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - ORKPasscodeResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKPasscodeResult.h
ORKPasscodeResult.m
- - - - -
- -

Overview

-

The ORKPasscodeResult class records the results of a passcode step.

- -

The passcode result object contains a boolean indicating whether the passcode was saved or not.

-
- - - - - -
- - - - - - -
-
- -

  passcodeSaved -

- -
-
- -
- - -
-

A boolean indicating if a passcode was saved or not.

-
- - - -
@property (nonatomic, assign, getter=isPasscodeSaved) BOOL passcodeSaved
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeResult.h

-
- - -
-
-
- -

  touchIdEnabled -

- -
-
- -
- - -
-

A boolean that indicates if the user has enabled/disabled TouchID

-
- - - -
@property (nonatomic, assign, getter=isTouchIdEnabled) BOOL touchIdEnabled
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeStep.html deleted file mode 100644 index 55ed135909..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeStep.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - ORKPasscodeStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKPasscodeStep.h
ORKPasscodeStep.m
- - - - -
- -

Overview

-

An ORKPasscodeStep object provides the participant a passcode creation step.

- -

It is recommended to use a passcode step as part of the consent process to ensure -that the participant signing the consent is the same participant completing other -modules within that context.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ passcodeStepWithIdentifier:passcodeFlow: -

- -
-
- -
- - -
-

Returns a new passcode step with the specified identifier and passcode flow.

-
- - - -
+ (instancetype)passcodeStepWithIdentifier:(NSString *)identifier passcodeFlow:(ORKPasscodeFlow)passcodeFlow
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The identifier of the step (a step identifier should be unique within the task).

passcodeFlow

The passcode flow to be used for the step.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeStep.h

-
- - -
-
-
- -

  passcodeFlow -

- -
-
- -
- - -
-

The passcode flow to be used for the step.

-
- - - -
@property (nonatomic) ORKPasscodeFlow passcodeFlow
- - - - - - - - - -
-

Discussion

-

The default value of this property is ORKPasscodeFlowCreate.

-
- - - - - - - -
-

Declared In

-

ORKPasscodeStep.h

-
- - -
-
-
- -

  passcodeType -

- -
-
- -
- - -
-

The passcode type to be used for the step.

-
- - - -
@property (nonatomic) ORKPasscodeType passcodeType
- - - - - - - - - -
-

Discussion

-

The default value of this property is ORKPasscodeType4Digit.

-
- - - - - - - -
-

Declared In

-

ORKPasscodeStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeStepViewController.html deleted file mode 100644 index 459e3da42f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeStepViewController.html +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - ORKPasscodeStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKPasscodeStepViewController.h
ORKPasscodeStepViewController.m
- - - - -
- -

Overview

-

An ORKPasscodeStepViewController object is the view controller for an ORKPasscodeStep object.

- -

A passcode view controller can be instantiated indirectly by adding a passcode step to a consent task -and present the task using a task view controller. When appropriate, the task view controller instantiates the step -view controller for the step.

-
- - - - - -
- - - - - - -
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– addResult: -

- -
-
- -
- - -
-

Add a result to the step view controller’s ORKStepResult. By default, the property for -the step view controller’s result will instantiate a copy of the result each time it is -called. Therefore, the result cannot be mutated by adding a result to its result array.

-
- - - -
- (void)addResult:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - -
result

The result to add to the step results.

-
- - - - - - - -
-

Discussion

-

This method can be called by a delegate to add a result to a given step in a way that will -be retained by the step.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– promptTouchIdWithDelay -

- -
-
- -
- - -
-

Device does not support Touch ID.

-
- - - -
- (void)promptTouchIdWithDelay
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeStepViewController.m

-
- - -
-
-
- -

+ savePasscode:withTouchIdEnabled: -

- -
-
- -
- - -
-

Stores the given passcode as the user’s unlock passcode to the keychain.

-
- - - -
+ (void)savePasscode:(NSString *)passcode withTouchIdEnabled:(BOOL)touchIdEnabled
- - - -
-

Parameters

- - - - - - - - - - - - -
passcode

The passcode to store

touchIdEnabled

Whether TouchId will be available during passcode entry

-
- - - - - - - -
-

Discussion

-

This method will raise an exception if passcode is nil.

-
- - - - - - - -
-

Declared In

-

ORKPasscodeStepViewController_Internal.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeViewController.html deleted file mode 100644 index 7c1ae5af08..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPasscodeViewController.html +++ /dev/null @@ -1,452 +0,0 @@ - - - - - - ORKPasscodeViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeViewController Class Reference

- - -
- - - - - - - -
Inherits fromUINavigationController
Declared inORKPasscodeViewController.h
ORKPasscodeViewController.m
- - - - -
- -

Overview

-

An ORKPasscodeStepViewController object is the view controller for an ORKPasscodeStep object.

- -

A passcode view controller can also be instantiated directly for authentication and editing by using one -of the factory methods below. Each factory method requires a delegate to be implemented.

-
- - - - - -
- - - - - - -
-
- -

+ passcodeAuthenticationViewControllerWithText:delegate: -

- -
-
- -
- - -
-

An authenticaiton passcode view controller allows a user to be authenticated using -the passcode stored in the keychain.

-
- - - -
+ (instancetype)passcodeAuthenticationViewControllerWithText:(NSString *)text delegate:(id<ORKPasscodeDelegate>)delegate
- - - -
-

Parameters

- - - - - - - - - - - - -
text

The message displayed to the user.

delegate

The delegate for the passcode view controller.

-
- - - -
-

Return Value

-

A passcode authentication view controller.

-
- - - - - -
-

Discussion

-

A passcode must already have been created using a passcode step before presenting -this view controller (see ORKPasscodeStep).

- -

You must check to see if the passcode is stored in the keychain before presenting -this view controller. A helper method, isPasscodeStoredInKeychain, is provided as -part of this class.

-
- - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

+ passcodeEditingViewControllerWithText:delegate:passcodeType: -

- -
-
- -
- - -
-

An editing passcode view controller allows a user to be authenticated using -the passcode stored in the keychain and create a new passcode.

-
- - - -
+ (instancetype)passcodeEditingViewControllerWithText:(NSString *)text delegate:(id<ORKPasscodeDelegate>)delegate passcodeType:(ORKPasscodeType)passcodeType
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
text

The message displayed to the user.

delegate

The delegate for the passcode view controller.

passcodeType

The passcode type for the new passcode.

-
- - - -
-

Return Value

-

A passcode editing view controller.

-
- - - - - -
-

Discussion

-

A passcode must already have been created using a passcode step before presenting -this view controller (see ORKPasscodeStep).

- -

You must check to see if the passcode is stored in the keychain before presenting -this view controller. A helper method, isPasscodeStoredInKeychain, is provided as -part of this class.

-
- - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

+ isPasscodeStoredInKeychain -

- -
-
- -
- - -
-

Returns ‘YES’ if a passcode is stored in the keychain, otherwise ‘NO’.

-
- - - -
+ (BOOL)isPasscodeStoredInKeychain
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

+ removePasscodeFromKeychain -

- -
-
- -
- - -
-

Returns ‘YES’ if passcode was successfully removed from the keychain, otherwise ‘NO’.

-
- - - -
+ (BOOL)removePasscodeFromKeychain
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

+ forcePasscode:withTouchIdEnabled: -

- -
-
- -
- - -
-

This method allows to force the passcode to be a certain value. You only want to use this capability when you’re moving your existing users -from a custom passcode entry mechanism to the one provided by ResearchKit.

-
- - - -
+ (void)forcePasscode:(NSString *)passcode withTouchIdEnabled:(BOOL)touchIdEnabled
- - - -
-

Parameters

- - - - - - - - - - - - -
passcode

The passcode to store

touchIdEnabled

Whether TouchId will be available during passcode entry

-
- - - - - - - -
-

Discussion

-

This method will raise an exception if passcode is nil.

-
- - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPedometerRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPedometerRecorder.html deleted file mode 100644 index 8e27d896ad..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPedometerRecorder.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - ORKPedometerRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPedometerRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKPedometerRecorder.h
ORKPedometerRecorder.m
- - - - -
- -

Overview

-

A recorder that requests and collects device motion data from CoreMotion at a fixed frequency.

- -

The accelerometer recorder continues to record if the application enters the -background using UIApplication’s background task support.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized pedometer recorder.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier step:(nullable ORKStep *)step outputDirectory:(nullable NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

step

The step that requested this recorder.

outputDirectory

The directory in which the pedometer data should be stored.

-
- - - -
-

Return Value

-

An initialized pedometer recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKPedometerRecorder.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPedometerRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPedometerRecorderConfiguration.html deleted file mode 100644 index f15e6b88e9..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPedometerRecorderConfiguration.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - ORKPedometerRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPedometerRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKPedometerRecorder.m
ORKRecorder.h
- - - - -
- -

Overview

-

The ORKPedometerRecorderConfiguration class represents a configuration -that records pedometer data during an active step.

- -

Pedometer data consists of information about the processed steps provided by CoreMotion, obtained -from a CMPedometer object. The pedometer object essentially reports the total number of steps taken since the -start of recording, updating the value every time a significant number of steps have -been detected.

- -

Pedometer data is serialized to JSON and returned as an ORKFileResult object. -For details on the format, see CMPedometerData+ORKJSONDictionary.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized pedometer recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized pedometer recorder configuration.

-
- - - - - -
-

Discussion

-

The recorder instantiates a CMPedometer object, so no additional parameters besides -the identifier are required.

- -

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new pedometer recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the pedometer recorder configuration.

-
- - - -
-

Return Value

-

A new pedometer recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedPermissionMask -

- -
-
- -
- - -
-

Returns the permission mask indicating the permissions required for this configuration.

-
- - - -
- (ORKPermissionMask)requestedPermissionMask
- - - - - - - - - -
-

Discussion

-

This method is typically overridden in new recorder configuration subclasses.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPicker.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPicker.html deleted file mode 100644 index 4c337f91ed..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPicker.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - ORKPicker Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPicker Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKPicker.h
ORKPicker.m
- - - - -
- -

Overview

-

Creates a picker appropriate to the type required by answerformat

-
- - - - - -
- - - - - - -
-
- -

+ pickerWithAnswerFormat:answer:delegate: -

- -
-
- -
- - -
-

Creates a picker appropriate to the type required by answerformat

-
- - - -
+ (id<ORKPicker>)pickerWithAnswerFormat:(ORKAnswerFormat *)answerFormat answer:(id)answer delegate:(id<ORKPickerDelegate>)delegate
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
answerFormat

An ORKAnswerFormat object which specified the format of the result

answer

A default answer (to set as the picker’s current result), or nil if no answer specified.

delegate

A delegate who conforms to ORKPickerDelegate

-
- - - -
-

Return Value

-

The picker object

-
- - - - - - - - - - - -
-

Declared In

-

ORKPicker.m

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPieChartView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPieChartView.html deleted file mode 100644 index 7d1e1cef32..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPieChartView.html +++ /dev/null @@ -1,787 +0,0 @@ - - - - - - ORKPieChartView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPieChartView Class Reference

- - -
- - - - - - - -
Inherits fromUIView
Declared inORKPieChartView.h
ORKPieChartView.m
- - - - -
- -

Overview

-

The ORKPieChartView class presents data provided by an object conforming to the -ORKPieChartViewDataSource protocol as a pie chart.

-
- - - - - -
- - - - - - -
-
- -

  dataSource -

- -
-
- -
- - -
-

The data source object responsible for populating the pie chart with data.

-
- - - -
@property (nonatomic, weak, nullable) id<ORKPieChartViewDataSource> dataSource
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  lineWidth -

- -
-
- -
- - -
-

The width of the line used to draw the circular sections of the pie chart.

-
- - - -
@property (nonatomic) IBInspectable CGFloat lineWidth
- - - - - - - - - -
-

Discussion

-

If you do not set a value for this property, the pie chart view assumes a sensible value. If -you set a number higher than the radius of the pie chart, the pie chart draws a completely -filled pie.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  title -

- -
-
- -
- - -
-

The text to display as a title in the pie chart view.

-
- - - -
@property (nonatomic, copy, nullable) IBInspectable NSString *title
- - - - - - - - - -
-

Discussion

-

If you do not set a value for this property, the pie chart does not display a title.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  text -

- -
-
- -
- - -
-

The text to display beneath the title in the pie chart view.

-
- - - -
@property (nonatomic, copy, nullable) IBInspectable NSString *text
- - - - - - - - - -
-

Discussion

-

If you do not set a value for this property, the pie chart does not display any text beneath the -title.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  titleColor -

- -
-
- -
- - -
-

The color used for the text of the title label.

-
- - - -
@property (nonatomic, strong, null_resettable) IBInspectable UIColor *titleColor
- - - - - - - - - -
-

Discussion

-

The default value for this property is a light gray color. Setting this property to nil resets it -to its default value.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  textColor -

- -
-
- -
- - -
-

The color used for the text of the text label.

-
- - - -
@property (nonatomic, strong, null_resettable) IBInspectable UIColor *textColor
- - - - - - - - - -
-

Discussion

-

The default value for this property is a light gray color. Setting this property to nil resets it -to its default value.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  showsTitleAboveChart -

- -
-
- -
- - -
-

A Boolean value indicating whether the title and text labels should be drawn above the chart.

-
- - - -
@property (nonatomic) IBInspectable BOOL showsTitleAboveChart
- - - - - - - - - -
-

Discussion

-

If this value of this property is NO, the title and text are drawn at the center of the chart. -The default value for this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  showsPercentageLabels -

- -
-
- -
- - -
-

A Boolean value indicating whether the pie chart should draw percentage labels next to each -segement.

-
- - - -
@property (nonatomic) IBInspectable BOOL showsPercentageLabels
- - - - - - - - - -
-

Discussion

-

The default value for this property is YES.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  drawsClockwise -

- -
-
- -
- - -
-

A Boolean value indicating whether the pie chart drawing animation draws clockwise or -counterclockwise.

-
- - - -
@property (nonatomic) IBInspectable BOOL drawsClockwise
- - - - - - - - - -
-

Discussion

-

The default value for this property is YES.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  noDataText -

- -
-
- -
- - -
-

The string that will be displayed if the sum of the values of all segments is zero.

-
- - - -
@property (nonatomic, copy, null_resettable) IBInspectable NSString *noDataText
- - - - - - - - - -
-

Discussion

-

The default value for this property is an appropriate message string. Setting this property to -nil resets it to its default value.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– animateWithDuration: -

- -
-
- -
- - -
-

Animates the pie chart when it is first displayed on the screen.

-
- - - -
- (void)animateWithDuration:(NSTimeInterval)animationDuration
- - - -
-

Parameters

- - - - - - - -
animationDuration

The duration of the appearing animation.

-
- - - - - - - -
-

Discussion

-

You can optionally call this method from the viewWillAppear: implementation of the view -controller that owns the pie chart view.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– reloadData -

- -
-
- -
- - -
-

Reloads the plotted data.

-
- - - -
- (void)reloadData
- - - - - - - - - -
-

Discussion

-

Call this method to reload the data and re-plot the graph. You should call it if the data provided by the dataSource changes.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

  radiusScaleFactor -

- -
-
- -
- - -
-

A scaling facor for the radius of the pie chart. -Increase it to increase the radius of the pie chart and vice versa.

-
- - - -
@property (nonatomic) CGFloat radiusScaleFactor
- - - - - - - - - -
-

Discussion

-

Defaults to 0.5.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPredicateSkipStepNavigationRule.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPredicateSkipStepNavigationRule.html deleted file mode 100644 index a6b3c43c78..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPredicateSkipStepNavigationRule.html +++ /dev/null @@ -1,432 +0,0 @@ - - - - - - ORKPredicateSkipStepNavigationRule Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPredicateSkipStepNavigationRule Class Reference

- - -
- - - - - - - -
Inherits fromORKSkipStepNavigationRule : NSObject
Declared inORKStepNavigationRule.h
ORKStepNavigationRule.m
- - - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithResultPredicate: -

- -
-
- -
- - -
-

Returns an initialized predicate skip step navigation rule using the specified result predicate.

-
- - - -
- (instancetype)initWithResultPredicate:(NSPredicate *)resultPredicate
- - - -
-

Parameters

- - - - - - - -
resultPredicate

A result predicate. If the result predicate matches, the step - will skip.

-
- - - -
-

Return Value

-

An initialized skip predicate step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new predicate step navigation rule that was initialized from data in the given -unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the step navigation rule.

-
- - - -
-

Return Value

-

A new predicate skip step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  additionalTaskResults -

- -
-
- -
- - -
-

An optional array of additional task results.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKTaskResult*> *additionalTaskResults
- - - - - - - - - -
-

Discussion

-

With this property, a task can have different navigation behavior depending on the results of -related tasks that the user may have already completed. The predicate skip step navigation rule can -use the question results within these tasks, in addition to the current task question results, to -match the result predicates.

- -

You must ensure that all the task result identifiers are unique and that they are different from -the ongoing task result identifier. Also ensure that no task result contains question -results with duplicate identifiers. Question results can have equal identifiers provided that -they belong to different task results.

- -

Each object in the array should be of the ORKTaskResult class.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  resultPredicate -

- -
-
- -
- - -
-

The result predicate to match.

-
- - - -
@property (nonatomic, strong, readonly) NSPredicate *resultPredicate
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– stepShouldSkipWithTaskResult: -

- -
-
- -
- - -
-

Returns whether the targeted step should skip.

-
- - - -
- (BOOL)stepShouldSkipWithTaskResult:(ORKTaskResult *)taskResult
- - - -
-

Parameters

- - - - - - - -
taskResult

The up-to-date task result, used for calculating whether the task should - skip.

-
- - - -
-

Return Value

-

YES if the step should skip.

-
- - - - - -
-

Discussion

-

Subclasses must implement this method to calculate if the targeted step should skip based on the -passed task result.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPredicateStepNavigationRule.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPredicateStepNavigationRule.html deleted file mode 100644 index 0bc34d9a3f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKPredicateStepNavigationRule.html +++ /dev/null @@ -1,723 +0,0 @@ - - - - - - ORKPredicateStepNavigationRule Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPredicateStepNavigationRule Class Reference

- - -
- - - - - - - -
Inherits fromORKStepNavigationRule : NSObject
Declared inORKStepNavigationRule.h
ORKStepNavigationRule.m
- - - - -
- -

Overview

-

The ORKPredicateStepNavigationRule can be used to match any answer combination in the results of -the ongoing task (or in those of previously completed tasks) and jump accordingly. You must provide -one or more result predicates (each predicate can match one or more step results within the task).

- -

Predicate step navigation rules contain an arbitrary number of result predicates with a -corresponding number of destination step identifiers, plus an optional default step identifier that -is used if none of the result predicates match. One result predicate can match one or more question -results; if matching several question results, that predicate can belong to the same or to -different task results). This rule allows you to define arbitrarily complex task navigation -behaviors.

- -

The ORKResultPredicate class provides convenience class methods to build predicates for all the -ORKQuestionResult subtypes. Predicates must supply both the task result identifier and the -question result identifier, in addition to one or more expected answers.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithResultPredicates:destinationStepIdentifiers:defaultStepIdentifier: -

- -
-
- -
- - -
-

Returns an initialized predicate step navigation rule using the specified result predicates, -destination step identifiers, and an optional default step identifier.

-
- - - -
- (instancetype)initWithResultPredicates:(NSArray<NSPredicate*> *)resultPredicates destinationStepIdentifiers:(NSArray<NSString*> *)destinationStepIdentifiers defaultStepIdentifier:(nullable NSString *)defaultStepIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
resultPredicates

An array of result predicates. Each result predicate can match - one or more question results in the ongoing task result or - in any of the additional task results.

destinationStepIdentifiers

An array of possible destination step identifiers. This array - must contain one step identifier for each of the predicates - in the result predicates parameters. If you want for a - certain predicate match to end te task, you achieve that by - using the ORKNullStepIdentifier constant.

defaultStepIdentifier

The identifier of the step, which is used if none of the - result predicates match. If this argument is nil and none - of the predicates match, the default ordered task navigation - behavior takes place (that is, the task goes to the next - step in order).

-
- - - -
-

Return Value

-

An initialized predicate step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

– initWithResultPredicates:destinationStepIdentifiers: -

- -
-
- -
- - -
-

Returns an initialized predicate step navigation rule using the specified result predicates and -destination step identifiers.

-
- - - -
- (instancetype)initWithResultPredicates:(NSArray<NSPredicate*> *)resultPredicates destinationStepIdentifiers:(NSArray<NSString*> *)destinationStepIdentifiers
- - - -
-

Parameters

- - - - - - - - - - - - -
resultPredicates

An array of result predicates. Each result predicate can match - one or more question results in the ongoing task result or - in any of the additional task results.

destinationStepIdentifiers

An array of possible destination step identifiers. This array - must contain one step identifier for each of the predicates - in the result predicates parameters.

-
- - - -
-

Return Value

-

An initialized predicate step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new predicate step navigation rule that was initialized from data in the given -unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the step navigation rule.

-
- - - -
-

Return Value

-

A new predicate step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  additionalTaskResults -

- -
-
- -
- - -
-

An optional array of additional task results.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKTaskResult*> *additionalTaskResults
- - - - - - - - - -
-

Discussion

-

With this property, a task can have different navigation behavior depending on the results of -related tasks that the user may have already completed. The predicate step navigation rule can use -the question results within these tasks, in addition to the current task question results, to match -the result predicates.

- -

You must ensure that all the task result identifiers are unique and that they are different from -the ongoing task result identifier. Also ensure that no task result contains question -results with duplicate identifiers. Question results can have equal identifiers provided that -they belong to different task results.

- -

Each object in the array should be of the ORKTaskResult class.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  resultPredicates -

- -
-
- -
- - -
-

The array of result predicates.

-
- - - -
@property (nonatomic, copy, readonly) NSArray<NSPredicate*> *resultPredicates
- - - - - - - - - -
-

Discussion

-

This property contains one result predicate for each of the step identifiers in the -destinationStepIdentifiers property.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  destinationStepIdentifiers -

- -
-
- -
- - -
-

The array of destination step identifiers. It contains one step identifier for each of the -predicates in the resultPredicates parameter.

-
- - - -
@property (nonatomic, copy, readonly) NSArray<NSString*> *destinationStepIdentifiers
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
- -

  defaultStepIdentifier -

- -
-
- -
- - -
-

The identifier of the step that is used if none of the result predicates match.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSString *defaultStepIdentifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– initWithResultPredicates:destinationStepIdentifiers:defaultStepIdentifier:validateArrays: -

- -
-
- -
- - -
-

Returns an initialized predicate step navigation rule using the specified result predicates, -destination step identifiers, and an optional default step identifier.

-
- - - -
- (instancetype)initWithResultPredicates:(NSArray<NSPredicate*> *)resultPredicates destinationStepIdentifiers:(NSArray<NSString*> *)destinationStepIdentifiers defaultStepIdentifier:(NSString *)defaultStepIdentifier validateArrays:(BOOL)validateArrays
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
resultPredicates

An array of result predicates. Each result predicate can match - one or more step results in the ongoing task.

destinationStepIdentifiers

An array of possible destination step identifiers. This array - must contain one step identifier for each of the predicates - in the resultPredicates parameter.

defaultStepIdentifier

The identifier of the step which is used if none of the - result predicates match. If this argument is nil and none - of the predicates match, the default ordered task navigation - behavior takes place (that is, the task goes to the next step in - order).

validateArrays

YES to throw an exception if result predicates or - destination step identifiers are nil or empty; NO to skip - their validation.

-
- - - -
-

Return Value

-

An initialized predicate step navigation rule.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule_Private.h

-
- - -
-
-
- -

– identifierForDestinationStepWithTaskResult: -

- -
-
- -
- - -
-

Returns the target step identifier.

-
- - - -
- (NSString *)identifierForDestinationStepWithTaskResult:(ORKTaskResult *)taskResult
- - - -
-

Parameters

- - - - - - - -
taskResult

The up-to-date task result, used for calculating the destination step.

-
- - - -
-

Return Value

-

The identifier of the destination step.

-
- - - - - -
-

Discussion

-

Subclasses must implement this method to calculate the next step based on the passed task result. -The ORKNullStepIdentifier constant can be returned to indicate that the ongoing task should end -after the step navigation rule is triggered.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionResult.html deleted file mode 100644 index 51a5c25c3c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionResult.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - ORKQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKQuestionResult class is the base class for leaf results from an item that uses an answer format (ORKAnswerFormat).

- -

A question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

- -

See also: ORKQuestionStep and ORKFormItem.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– isSaveable -

- -
-
- -
- - -
-

A boolean value indicating whether this result can be saved in a save and -restore procedure.

-
- - - -
- (BOOL)isSaveable
- - - - - - - - - -
-

Discussion

-

This is currently considered a private method, but overriding the getter in a result -is the correct way to prevent this result being considered as saveable for -the purpose of deciding whether to offer a “Save” option when the user -cancels a task in progress.

- -

ORKResult subclasses should return YES if they have data that the user -might want to be able to restore if the task were interrupted and later -resumed from the current state.

-
- - - - - - - -
-

Declared In

-

ORKResult_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  questionType -

- -
-
- -
- - -
-

A value that indicates the type of question the result came from.

-
- - - -
@property (nonatomic) ORKQuestionType questionType
- - - - - - - - - -
-

Discussion

-

The value of questionType generally correlates closely with the class, but it can be -easier to use this value in a switch statement in Objective-C.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStep.html deleted file mode 100644 index 52c8a3e5d8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStep.html +++ /dev/null @@ -1,847 +0,0 @@ - - - - - - ORKQuestionStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKQuestionStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKQuestionStep.h
ORKQuestionStep.m
- - - - -
- -

Overview

-

The ORKQuestionStep class is a concrete subclass of ORKStep that represents -a step in which a single question is presented to the user.

- -

To use a question step, instantiate an ORKQuestionStep object, fill in its properties, and include it -in a task. Next, create a task view controller for the task and present it. -When the task completes, the user’s answer is encoded in the result hierarchy -in the task view controller.

- -

When a task view controller presents an ORKQuestionStep object, it instantiates an ORKQuestionStepViewController object to present the step. The actual -visual presentation depends on the answer format.

- -

When you need to present more than one question at the same time, it can be appropriate -to use ORKFormStep instead of ORKQuestionStep.

- -

The result of a question step is an ORKStepResult object that includes a single child -(ORKQuestionResult).

- -

Deprecated in v2.0 (scheduled for removal).

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

+ questionStepWithIdentifier:title:question:answer: -

- -
-
- -
- - -
-

Returns a new question step that includes the specified identifier, title, question, and answer format.

-
- - - -
+ (instancetype)questionStepWithIdentifier:(NSString *)identifier title:(nullable NSString *)title question:(nullable NSString *)question answer:(nullable ORKAnswerFormat *)answerFormat
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The identifier of the step (a step identifier should be unique within the task).

title

A localized string that represents the primary text of the question.

question

A localized string that represents the question as a text.

answerFormat

The format in which the answer is expected.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The question type. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

The value of this property is derived from the answer format.

-
- - - - - - - -
-

Declared In

-

ORKQuestionStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

The set of HealthKit types the step requests for reading. (read-only)

-
- - - -
- (NSSet<HKObjectType*> *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

The task view controller uses this set of types when constructing a list of -all the HealthKit types required by all the steps in a task, so that it can -present the HealthKit access dialog just once during that task.

- -

By default, the property scans the recorders and collates the HealthKit -types the recorders require. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  answerFormat -

- -
-
- -
- - -
-

The format of the answer.

-
- - - -
@property (nonatomic, strong, nullable) ORKAnswerFormat *answerFormat
- - - - - - - - - -
-

Discussion

-

For example, the answer format might include the type of data to collect, the constraints -to place on the answer, or a list of available choices (in the case of single -or multiple select questions).

-
- - - - - - - -
-

Declared In

-

ORKQuestionStep.h

-
- - -
-
-
- -

  question -

- -
-
- -
- - -
-

The question for the step.

-
- - - -
@property (nonatomic, strong, nullable) NSString *question
- - - - - - - - - -
-

Discussion

-

Different from the step title.

-
- - - - - - - -
-

Declared In

-

ORKQuestionStep.h

-
- - -
-
-
- -

  placeholder -

- -
-
- -
- - -
-

A localized string that represents the placeholder text displayed before an answer has been entered.

-
- - - -
@property (nonatomic, copy, nullable) NSString *placeholder
- - - - - - - - - -
-

Discussion

-

For numeric and text-based answers, the placeholder content is displayed in the -text field or text area when an answer has not yet been entered.

-
- - - - - - - -
-

Declared In

-

ORKQuestionStep.h

-
- - -
-
-
- -

  useCardView -

- -
-
- -
- - -
-

A property to present the question with a card view. Default to YES;

-
- - - -
@property (nonatomic) BOOL useCardView
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKQuestionStep.h

-
- - -
-
-
-
- - - -

Deprecated Methods

- -
-
- -

+ questionStepWithIdentifier:title:answer: -

- -
-
- -
- - -
-

Returns a new question step that includes the specified identifier, title, question, and answer format.

-
- - - -
+ (instancetype)questionStepWithIdentifier:(NSString *)identifier title:(nullable NSString *)title answer:(nullable ORKAnswerFormat *)answerFormat
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The identifier of the step (a step identifier should be unique within the task).

title

A localized string that represents the question.

answerFormat

The format in which the answer is expected.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDeprecated.h

-
- - -
-
-
- -

+ questionStepWithIdentifier:title:text:answer: -

- -
-
- -
- - -
-

Returns a new question step that includes the specified identifier, title, question, and answer format.

-
- - - -
+ (instancetype)questionStepWithIdentifier:(NSString *)identifier title:(nullable NSString *)title text:(nullable NSString *)text answer:(nullable ORKAnswerFormat *)answerFormat
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The identifier of the step (a step identifier should be unique within the task).

title

A localized string that represents the question.

text

The primary text shown below the title string.

answerFormat

The format in which the answer is expected.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDeprecated.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStepCustomView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStepCustomView.html deleted file mode 100644 index 95922c08cd..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStepCustomView.html +++ /dev/null @@ -1,239 +0,0 @@ - - - - - - ORKQuestionStepCustomView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKQuestionStepCustomView Class Reference

- - -
- - - - - - - -
Inherits fromUIView
Declared inORKCustomStepView.h
ORKCustomStepView.m
- - - - -
- -

Overview

-

The ORKQuestionStepCustomView class is a base class for views that are used to -display question steps (ORKQuestionStep objects) in a question step view controller -(an ORKQuestionStepViewController object).

- -

Typically, you subclass ORKQuestionStepCustomView only when you need to implement a new -answer format for the survey engine.

- -

To ensure that your subclass is allocated the display space it requires, you should implement -sizeThatFits:, or include internal constraints, or report an intrinsic content size.

-
- - - - - -
- - - - - - -
-
- -

  delegate -

- -
-
- -
- - -
-

The delegate of the question step custom view.

-
- - - -
@property (nonatomic, weak, nullable) id<ORKQuestionStepCustomViewDelegate> delegate
- - - - - - - - - -
-

Discussion

-

A question step custom view should report changes in its result property.

-
- - - - - - - -
-

Declared In

-

ORKCustomStepView.h

-
- - -
-
-
- -

  answer -

- -
-
- -
- - -
-

The answer to the question, which should be represented as a JSON-serializable atomic type.

-
- - - -
@property (nonatomic, copy, nullable) id answer
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKCustomStepView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStepViewController.html deleted file mode 100644 index 83764a62c3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKQuestionStepViewController.html +++ /dev/null @@ -1,603 +0,0 @@ - - - - - - ORKQuestionStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKQuestionStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKQuestionStepViewController.h
ORKQuestionStepViewController.m
- - - - -
- -

Overview

-

The ORKQuestionStepViewController class is the concrete ORKStepViewController -implementation for ORKQuestionStep.

- -

You should not need to instantiate an ORKQuestionStepViewController object -directly. Instead, create an ORKQuestionStep object, include it in a task -the task using a task view controller. The task view -controller automatically instantiates the question step view controller -when it needs to present a question step.

- -

To use ORKQuestionStepViewController directly, create an ORKQuestionStep object and use -initWithStep: to initialize it. To receive the result of the question, and to determine -when to dismiss the view controller, implement ORKStepViewControllerDelegate.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithStep:result: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step to be presented.

result

The current step result for this step.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– skipForward -

- -
-
- -
- - -
-

This method is called when the user taps the skip button. By default, it calls goForward.

-
- - - -
- (void)skipForward
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– goForward -

- -
-
- -
- - -
-

Navigates forward to the next step.

-
- - - -
- (void)goForward
- - - - - - - - - -
-

Discussion

-

When a user taps a Next button, the information passes through this method. You can use this method as an override -point or a target action for a subclass.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– goBackward -

- -
-
- -
- - -
-

Navigates backward to the previous step.

-
- - - -
- (void)goBackward
- - - - - - - - - -
-

Discussion

-

When a user taps the Back button, the information passes through this method. You can use this method as an override -point or a target action for a subclass.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- - - -

Extension Methods

- -
-
- -

  customQuestionView -

- -
-
- -
- - -
-

Provide a custom question view.

-
- - - -
@property (nonatomic, strong, nullable) ORKQuestionStepCustomView *customQuestionView
- - - - - - - - - -
-

Discussion

-

If a question requires a custom control for data entry, provide a suitable -custom step view. This view should provide -sizeThatFits: or autolayout -constraints which determine the vertical space required.

-
- - - - - - - -
-

Declared In

-

ORKQuestionStepViewController_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionResult.html deleted file mode 100644 index 8f6ade9c61..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionResult.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - ORKRangeOfMotionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRangeOfMotionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKRangeOfMotionResult.h
ORKRangeOfMotionResult.m
- - - - -
- -

Overview

-

The ORKRangeOfMotionResult class records the results of a range of motion active task.

- -

An ORKRangeOfMotionResult object records the flexion and extension values in degrees.

-
- - - - - -
- - - - - - -
-
- -

  flexed -

- -
-
- -
- - -
-

The degrees when bent.

-
- - - -
@property (nonatomic, assign) double flexed
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRangeOfMotionResult.h

-
- - -
-
-
- -

  extended -

- -
-
- -
- - -
-

The degrees when extended.

-
- - - -
@property (nonatomic, assign) double extended
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRangeOfMotionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionStep.html deleted file mode 100644 index 82e5ad3d0b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionStep.html +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - ORKRangeOfMotionStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRangeOfMotionStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKRangeOfMotionStep.h
ORKRangeOfMotionStep.m
- - - - -
- -

Overview

-

The ORKRangeOfMotionStep class represents a step that takes a range of motion measurement.

-
- - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionStepViewController.html deleted file mode 100644 index 42210ceb6a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRangeOfMotionStepViewController.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - ORKRangeOfMotionStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRangeOfMotionStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKRangeOfMotionStepViewController.h
ORKRangeOfMotionStepViewController.m
- - - - -
- -

Overview

-

This class is used by the ORKRangeOfMotionStep. Its result corresponds to the device’s orientation -as recorded by CoreMotion.

-
- - - - - -
- - - - - - -
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeResult.html deleted file mode 100644 index b287c8ce31..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeResult.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - ORKReactionTimeResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKReactionTimeResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKReactionTimeResult.h
ORKReactionTimeResult.m
- - - - -
- -

Overview

-

The ORKReactionTimeResult class represents the result of a single successful attempt within an ORKReactionTimeStep.

- -

The timestamp property is equal to the value of systemUptime (in NSProcessInfo) when the stimulus occurred. -Each entry of motion data in this file contains a time interval which may be directly compared to timestamp in order to determine the elapsed time since the stimulus.

- -

The fileResult property references the motion data recorded from the beginning of the attempt until the threshold acceleration was reached. -Using the time taken to reach the threshold acceleration as the reaction time of a participant will yield a rather crude measurement. Rather, you should devise your own method using the data recorded to obtain an accurate approximation of the true reaction time.

- -

A reaction time result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize the sample for transmission to a server -or to immediately perform analysis on it.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeStep.html deleted file mode 100644 index 575a7d0e44..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeStep.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - ORKReactionTimeStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKReactionTimeStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKReactionTimeStep.h
ORKReactionTimeStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeViewController.html deleted file mode 100644 index af0255d037..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReactionTimeViewController.html +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - ORKReactionTimeViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKReactionTimeViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKReactionTimeViewController.h
ORKReactionTimeViewController.m
- - - - - - -
- - - - - - -
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorder.html deleted file mode 100644 index 85335c5c7b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorder.html +++ /dev/null @@ -1,818 +0,0 @@ - - - - - - ORKRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRecorder Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKRecorder.h
ORKRecorder.m
- - - - -
- -

Overview

-

A recorder is the runtime companion to an ORKRecorderConfiguration object, and is -usually generated by one.

- -

During active tasks, it is often useful to collect one or more pieces of data -from sensors on the device. In research tasks, it’s not always -necessary to display that data, but it’s important to record it in a controlled manner.

- -

An active step (ORKActiveStep) has an array of recorder configurations -(ORKRecorderConfiguration) that identify the types of data it needs to record -for the duration of the step. When a step starts, the active step view controller -instantiates a recorder for each of the step’s recorder configurations. -The step view controller starts the recorder when the active step is started, and stops the -recorder when the active step is finished.

- -

The results of recording are typically written to a file specified by the value of the outputDirectory property.

- -

Usually, the ORKActiveStepViewController object is the recorder’s delegate, and it -receives callbacks when errors occur or when recording is complete.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized recorder.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier step:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder.

step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

An initialized recorder.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– viewController:willStartStepWithView: -

- -
-
- -
- - -
-

A preparation step to provide viewController and view before record starting.

-
- - - -
- (void)viewController:(UIViewController *)viewController willStartStepWithView:(UIView *)view
- - - -
-

Parameters

- - - - - - - - - - - - -
viewController

The view controller that is about to ‘start’

view

Primary active view for the step.

-
- - - - - - - -
-

Discussion

-

The step view controller should call this method before starting the recorder, -so that recorders that need a view or gesture recognizer in order to function -can attach themselves.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– logName -

- -
-
- -
- - -
-

Returns the log prefix for the log file.

-
- - - -
- (NSString *)logName
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– applyFileProtection:toFileAtURL: -

- -
-
- -
- - -
-

Helper for subclasses to request that file protection be applied to a file on disk.

-
- - - -
- (void)applyFileProtection:(ORKFileProtectionMode)fileProtection toFileAtURL:(NSURL *)url
- - - -
-

Parameters

- - - - - - - - - - - - -
fileProtection

Level of file protection desired

url

URL of file to protect.

-
- - - - - - - -
-

Discussion

-

This method is exposed to facilitate unit testing.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Configuration

- -
-
- -

  identifier -

- -
-
- -
- - -
-

A short string that uniquely identifies the recorder (usually assigned by the recorder configuration).

-
- - - -
@property (nonatomic, copy, readonly) NSString *identifier
- - - - - - - - - -
-

Discussion

-

The identifier is reproduced in the results of a recorder created from this configuration. In fact, the only way to link a result -(an ORKFileResult object) to the recorder that generated it is to look at the value of -identifier. To accurately identify recorder results, you need to ensure that recorder identifiers -are unique within each step.

- -

In some cases, it can be useful to link the recorder identifier to a unique identifier in a -database; in other cases, it can make sense to make the identifier human -readable.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

  step -

- -
-
- -
- - -
-

The step that produced this recorder, configured during initialization.

-
- - - -
@property (nonatomic, strong, readonly, nullable) ORKStep *step
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

  configuration -

- -
-
- -
- - -
-

The configuration that produced this recorder.

-
- - - -
@property (nonatomic, strong, readonly, nullable) ORKRecorderConfiguration *configuration
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

  outputDirectory -

- -
-
- -
- - -
-

The file URL of the output directory configured during initialization.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSURL *outputDirectory
- - - - - - - - - -
-

Discussion

-

Typically, you set the outputDirectory property for the ORKTaskViewController object -before presenting the task.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- - - -

Runtime Life Cycle

- -
-
- -

  recording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
@property (nonatomic, readonly, getter=isRecording) BOOL recording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorderConfiguration.html deleted file mode 100644 index f2e204cbd7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorderConfiguration.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - - ORKRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRecorderConfiguration Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSSecureCoding
Declared inORKRecorder.h
ORKRecorder.m
- - - - -
- -

Overview

-

The ORKRecorderConfiguration class is the abstract base class for recorder configurations -that can be attached to an active step (ORKActiveStep).

- -

Recorder configurations provide an easy way to collect CoreMotion -or other sensor data into a serialized format during the duration of an active step. -If you want to filter or process the data in real time, it is better to -use the existing APIs directly.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

- -

To add a new recorder, subclass both ORKRecorderConfiguration and ORKRecorder, -and add the new ORKRecorderConfiguration subclass to an ORKActiveStep object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the recorder configuration.

-
- - - -
-

Return Value

-

A new recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

Returns the HealthKit types for which this recorder requires read access in a set of HKSampleType objects.

-
- - - -
- (NSSet<HKObjectType*> *)requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

Typically, the task view controller automatically collects -and collates the types of HealthKit data requested by each of the active steps in a task, -and requests access to them at the end of the initial instruction -steps in the task.

- -

If your recorder requires or would benefit from read access to HealthKit at -runtime during the task, return the appropriate set of HKSampleType objects.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedPermissionMask -

- -
-
- -
- - -
-

Returns the permission mask indicating the permissions required for this configuration.

-
- - - -
- (ORKPermissionMask)requestedPermissionMask
- - - - - - - - - -
-

Discussion

-

This method is typically overridden in new recorder configuration subclasses.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  identifier -

- -
-
- -
- - -
-

A short string that uniquely identifies the recorder configuration within the step.

-
- - - -
@property (nonatomic, copy, readonly) NSString *identifier
- - - - - - - - - -
-

Discussion

-

The identifier is reproduced in the results of a recorder created from this configuration. In fact, the only way to link a result -(an ORKFileResult object) to the recorder that generated it is to look at the value of -identifier. To accurately identify recorder results, you need to ensure that recorder identifiers -are unique within each step.

- -

In some cases, it can be useful to link the recorder identifier to a unique identifier in a -database; in other cases, it can make sense to make the identifier human -readable.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorderTests.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorderTests.html deleted file mode 100644 index 94eb62badc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRecorderTests.html +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - ORKRecorderTests Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRecorderTests Class Reference

- - -
- - - - - - - - - - -
Inherits fromXCTestCase
Conforms toORKRecorderDelegate
Declared inORKRecorderTests.m
- - - - - - -
- - - - - - -
-
- -

– recorder:didCompleteWithResult: -

- -
-
- -
- - -
-

Tells the delegate that the recorder has completed with the specified result.

-
- - - -
- (void)recorder:(ORKRecorder *)recorder didCompleteWithResult:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
recorder

The generating recorder object.

result

The generated result.

-
- - - - - - - -
-

Discussion

-

Typically, this method is called once when recording is stopped.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorder:didFailWithError: -

- -
-
- -
- - -
-

Tells the delegate that recording failed.

-
- - - -
- (void)recorder:(ORKRecorder *)recorder didFailWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
recorder

The generating recorder object.

error

The error that occurred.

-
- - - - - - - -
-

Discussion

-

Typically, this method is called once when the error occurred.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRegistrationStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRegistrationStep.html deleted file mode 100644 index fa5302ae65..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKRegistrationStep.html +++ /dev/null @@ -1,763 +0,0 @@ - - - - - - ORKRegistrationStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRegistrationStep Class Reference

- - -
- - - - - - - -
Inherits fromORKFormStep : ORKStep : NSObject
Declared inORKRegistrationStep.h
ORKRegistrationStep.m
- - - - -
- -

Overview

-

The ORKRegistrationStep class represents a form step that provides fields commonly used -for account registration.

- -

The registration step contains email and password fields by default. Optionally, any -of the additional fields can be included based on context and requirements.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:title:text:passcodeValidationRegularExpression:passcodeInvalidMessage:options: -

- -
-
- -
- - -
-

Returns an initialized registration step using the specified identifier, -title, text, options, passcodeValidationRegularExpression, and passcodeInvalidMessage.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier title:(NSString *)title text:(NSString *)text passcodeValidationRegularExpression:(NSRegularExpression *)passcodeValidationRegularExpression passcodeInvalidMessage:(NSString *)passcodeInvalidMessage options:(ORKRegistrationStepOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
identifier

The string that identifies the step (see ORKStep).

title

The title of the form (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

passcodeValidationRegularExpression

The regular expression used to validate the passcode form item (see ORKTextAnswerFormat).

passcodeInvalidMessage

The invalid message displayed for invalid input (see ORKTextAnswerFormat).

options

The options used for the step (see ORKRegistrationStepOption).

-
- - - -
-

Return Value

-

An initialized registration step object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - -
-
-
- -

– initWithIdentifier:title:text:options: -

- -
-
- -
- - -
-

Returns an initialized registration step using the specified identifier, -title, text, and options.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier title:(NSString *)title text:(NSString *)text options:(ORKRegistrationStepOption)options
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
identifier

The string that identifies the step (see ORKStep).

title

The title of the form (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

options

The options used for the step (see ORKRegistrationStepOption).

-
- - - -
-

Return Value

-

An initialized registration step object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - -
-
-
- -

– initWithIdentifier:title:text: -

- -
-
- -
- - -
-

Returns an initialized form step using the specified identifier, title, and text.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier title:(NSString *)title text:(NSString *)text
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The string that identifies the step (see ORKStep).

title

The title of the form (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

-
- - - -
-

Return Value

-

As initialized form step object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– formItems -

- -
-
- -
- - -
-

The array of items in the form.

-
- - - -
- (NSArray<ORKFormItem*> *)formItems
- - - - - - - - - -
-

Discussion

-

A form step that contains no items is considered invalid and an exception will be thrown -when it is presented.

-
- - - - - - - -
-

Declared In

-

ORKFormStep.h

-
- - -
-
-
- -

– passcodeValidationRegularExpression -

- -
-
- -
- - -
-

The regular expression used to validate the passcode form item. -This is a transparent property pointing to its definition in ORKTextAnswerFormat.

-
- - - -
- (NSRegularExpression *)passcodeValidationRegularExpression
- - - - - - - - - -
-

Discussion

-

The passcode invalid message property must also be set along with this property. -By default, there is no validation on the passcode.

-
- - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - -
-
-
- -

– passcodeInvalidMessage -

- -
-
- -
- - -
-

The invalid message displayed if the passcode does not match the validation regular expression. -This is a transparent property pointing to its definition in ORKTextAnswerFormat.

-
- - - -
- (NSString *)passcodeInvalidMessage
- - - - - - - - - -
-

Discussion

-

The passcode validation regular expression property must also be set along with this property. -By default, there is no invalid message.

-
- - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - -
-
-
- -

– phoneNumberValidationRegularExpression -

- -
-
- -
- - -
-

The regular expression used to validate the phone number form item. -This is a transparent property pointing to its definition in ORKTextAnswerFormat.

-
- - - -
- (NSRegularExpression *)phoneNumberValidationRegularExpression
- - - - - - - - - -
-

Discussion

-

The phone number invalid message property must also be set along with this property. -By default, there is no validation on the phone number.

-
- - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - -
-
-
- -

– phoneNumberInvalidMessage -

- -
-
- -
- - -
-

The invalid message displayed if the phone number does not match the validation regular expression. -This is a transparent property pointing to its definition in ORKTextAnswerFormat.

-
- - - -
- (NSString *)phoneNumberInvalidMessage
- - - - - - - - - -
-

Discussion

-

The phone number validation regular expression property must also be set along with this property. -By default, there is no invalid message.

-
- - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  options -

- -
-
- -
- - -
-

The options used for the step.

-
- - - -
@property (nonatomic, readonly) ORKRegistrationStepOption options
- - - - - - - - - -
-

Discussion

-

These options allow one or more fields to be included in the registration step.

-
- - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResult.html deleted file mode 100644 index e847064f84..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResult.html +++ /dev/null @@ -1,507 +0,0 @@ - - - - - - ORKResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKResult Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKResult.h
ORKResult.m
- - - - -
- -

Overview

-

The ORKResult class defines the attributes of a result from one step or a group -of steps. When you use the ResearchKit framework APIs, you typically get a result from the result property -of either ORKTaskViewController or ORKStepViewController. -Certain types of results can contain other results, which together express a hierarchy; examples of these types of results are ORKCollectionResult subclasses, such as ORKStepResult and ORKTaskResult.

- -

When you receive a result, you can store it temporarily by archiving it with -NSKeyedArchiver, because all ORKResult objects implement NSSecureCoding. If you want to serialize the result object to other formats, you’re responsible for implementing this.

- -

The result object hierarchy does not necessarily include all the data collected -during a task. Some result objects, such as ORKFileResult, may refer to files -in the filesystem that were generated during the task. These files are easy to find, because they are all -located in the output directory of the task view controller.

- -

It’s recommended that you use NSFileProtectionComplete (at a minimum) to protect these files, and that you similarly protect all serialization of ORKResult objects that you write to disk. It is also generally helpful to keep the results together with the referenced files as you submit them to a back-end server. For example, it can be convenient to zip all data corresponding to a particular task result into a single compressed archive.

- -

Every object in the result hierarchy has an identifier that should correspond -to the identifier of an object in the original step hierarchy. Similarly, every -object has a start date and an end date that correspond to the range of -times during which the result was collected. In an ORKStepResult object, for example, -the start and end dates cover the range of time during which the step view controller was visible on -screen.

- -

When you implement a new type of step, it is usually helpful to create a new -ORKResult subclass to hold the type of result data the step can generate, unless it makes sense to use an existing subclass. Return your custom result subclass as one of the results attached to the step’s ORKStepResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized result using the specified identifier.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the result.

-
- - - - - - - -
-

Discussion

-

Typically, objects such as ORKStepViewController and ORKTaskViewController instantiate result (and ORKResult subclass) objects; you seldom need to instantiate a result object in your code.

-
- - - - - - - -
-

Declared In

-

ORKResult.h

-
- - -
-
-
- -

  identifier -

- -
-
- -
- - -
-

A meaningful identifier for the result.

-
- - - -
@property (nonatomic, copy) NSString *identifier
- - - - - - - - - -
-

Discussion

-

The identifier can be used to identify the question -that was asked or the task that was completed to produce the result. Typically, the identifier is copied from the originating object by the view controller or recorder that produces it.

- -

For example, a task result receives its identifier from a task, -a step result receives its identifier from a step, -and a question result receives its identifier from a step or a form item. -Results that are generated by recorders also receive an identifier that corresponds to -that recorder.

-
- - - - - - - -
-

Declared In

-

ORKResult.h

-
- - -
-
-
- -

  startDate -

- -
-
- -
- - -
-

The time when the task, step, or data collection began.

-
- - - -
@property (nonatomic, copy) NSDate *startDate
- - - - - - - - - -
-

Discussion

-

The value of this property is set by the view controller or recorder that produces the result, -to indicate when data collection started.

- -

Note that for instantaneous items, startDate and endDate can have the same value, and should -generally correspond to the end of the instantaneous data collection period.

-
- - - - - - - -
-

Declared In

-

ORKResult.h

-
- - -
-
-
- -

  endDate -

- -
-
- -
- - -
-

The time when the task, step, or data collection stopped.

-
- - - -
@property (nonatomic, copy) NSDate *endDate
- - - - - - - - - -
-

Discussion

-

The value of this property is set by the view controller or recorder that produces the result, -to indicate when data collection stopped.

- -

Note that for instantaneous items, startDate and endDate can have the same value, and should -generally correspond to the end of the instantaneous data collection period.

-
- - - - - - - -
-

Declared In

-

ORKResult.h

-
- - -
-
-
- -

  userInfo -

- -
-
- -
- - -
-

Metadata that describes the conditions under which the result was acquired.

-
- - - -
@property (nonatomic, copy, nullable) NSDictionary *userInfo
- - - - - - - - - -
-

Discussion

-

The userInfo dictionary can be set by the view controller or recorder -that produces the result. However, it’s often a better choice to use a new ORKResult subclass for passing additional information back to code that uses -the framework, because using -typed accessors is safer than using a dictionary.

- -

The user info dictionary must contain only keys and values that are suitable for property -list or JSON serialization.

-
- - - - - - - -
-

Declared In

-

ORKResult.h

-
- - -
-
-
-
- - - -

Extension Methods

- -
-
- -

  saveable -

- -
-
- -
- - -
-

A boolean value indicating whether this result can be saved in a save and -restore procedure.

-
- - - -
@property (nonatomic, readonly, getter=isSaveable) BOOL saveable
- - - - - - - - - -
-

Discussion

-

This is currently considered a private method, but overriding the getter in a result -is the correct way to prevent this result being considered as saveable for -the purpose of deciding whether to offer a “Save” option when the user -cancels a task in progress.

- -

ORKResult subclasses should return YES if they have data that the user -might want to be able to restore if the task were interrupted and later -resumed from the current state.

-
- - - - - - - -
-

Declared In

-

ORKResult_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResultPredicate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResultPredicate.html deleted file mode 100644 index a09d37e93c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResultPredicate.html +++ /dev/null @@ -1,1693 +0,0 @@ - - - - - - ORKResultPredicate Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKResultPredicate Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKResultPredicate.h
ORKResultPredicate.m
- - - - -
- -

Overview

-

The ORKResultPredicate class provides convenience class methods to build predicates for most of -the ORKQuestionResult subtypes.

- -

You use result predicates to create ORKPredicateStepNavigationRule objects. The result predicates -are used to match specific ORKQuestionResult instances (created in response to the participant’s -answers) and navigate accordingly. You can match results both in an ongoing task or in previously -completed tasks.

- -

You chose which question result to match by using an ORKResultSelector object.

- -

Note that each ORKStep object produces one ORKStepResult collection object. A step -result produced by an ORKQuestionStep object contains one ORKQuestionResult object which has

- -

the same identifier as the step that generated it. A step result produced by an ORKFormStep -object can contain one or more ORKQuestionResult objects that have the identifiers of the -ORKFormItem objects that generated them.

- -

For matching a single-question step result, you only need to set the resultIdentifier when -building the result selector object. The stepIdentifier will take the same value.

- -

For matching a form item result, you need to build a result selector with a stepIdentifier (the -form step identifier) and a resultIdentifier (the form item result identifier).

- -

For matching results in the ongoing task, leave the taskIdentifier in the the form step identifier -as nil. For matching results in different tasks, set the taskIdentifier appropriately.

-
- - - - - -
- - - - - - -
-
- -

+ predicateForNilQuestionResultWithResultSelector: -

- -
-
- -
- - -
-

Returns a predicate matching a result of the kind ORKQuestionResult whose answer is nil. -A question result has a nil answer if it was generated by a step that was skipped by -the user or if it was part of a form step and the question was left unanswered.

-
- - - -
+ (NSPredicate *)predicateForNilQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector
- - - -
-

Parameters

- - - - - - - -
resultSelector

The result selector object which specifies the question result you are -interested in.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForScaleQuestionResultWithResultSelector:expectedAnswer: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKScaleQuestionResult whose answer is the -specified integer value.

-
- - - -
+ (NSPredicate *)predicateForScaleQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector expectedAnswer:(NSInteger)expectedAnswer
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you are - interested in.

expectedAnswer

The expected integer value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForScaleQuestionResultWithResultSelector:minimumExpectedAnswerValue:maximumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKScaleQuestionResult whose answer is within the -specified double values.

-
- - - -
+ (NSPredicate *)predicateForScaleQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedAnswerValue:(double)minimumExpectedAnswerValue maximumExpectedAnswerValue:(double)maximumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

minimumExpectedAnswerValue

The minimum expected double value. Pass ORKIgnoreDoubleValue - if you don’t want to compare the answer against a maximum - double value.

maximumExpectedAnswerValue

The maximum expected double value. Pass ORKIgnoreDoubleValue - if you don’t want to compare the answer against a maximum - double value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForScaleQuestionResultWithResultSelector:minimumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKScaleQuestionResult whose answer is greater than -or equal to the specified double value.

-
- - - -
+ (NSPredicate *)predicateForScaleQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedAnswerValue:(double)minimumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

minimumExpectedAnswerValue

The minimum expected double value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForScaleQuestionResultWithResultSelector:maximumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKScaleQuestionResult whose answer is less than or -equal to the specified double value.

-
- - - -
+ (NSPredicate *)predicateForScaleQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector maximumExpectedAnswerValue:(double)maximumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

maximumExpectedAnswerValue

The maximum expected double value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForChoiceQuestionResultWithResultSelector:expectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKChoiceQuestionResult whose answer is equal to -the specified object.

-
- - - -
+ (NSPredicate *)predicateForChoiceQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector expectedAnswerValue:(id<NSCopying,NSCoding,NSObject>)expectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you - are interested in.

expectedAnswerValue

The expected answer object.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForChoiceQuestionResultWithResultSelector:expectedAnswerValues: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKChoiceQuestionResult whose answers are equal to -the specified objects.

-
- - - -
+ (NSPredicate *)predicateForChoiceQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector expectedAnswerValues:(NSArray<id<NSCopying,NSCoding,NSObject> > *)expectedAnswerValues
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you - are interested in.

expectedAnswerValues

An array with a some or of all of the expected answer objects.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForChoiceQuestionResultWithResultSelector:matchingPattern: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKChoiceQuestionResult whose answer matches the -specified regular expression pattern. This predicate can solely be used to match choice results -which only contain string answers.

-
- - - -
+ (NSPredicate *)predicateForChoiceQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector matchingPattern:(NSString *)pattern
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you are - interested in.

pattern

An ICU-compliant regular expression pattern that matches the answer string.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForChoiceQuestionResultWithResultSelector:matchingPatterns: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKChoiceQuestionResult whose answers match the -specified regular expression patterns.

-
- - - -
+ (NSPredicate *)predicateForChoiceQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector matchingPatterns:(NSArray<NSString*> *)patterns
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you are - interested in.

patterns

An array of ICU-compliant regular expression patterns that match the answer strings.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForBooleanQuestionResultWithResultSelector:expectedAnswer: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKBooleanQuestionResult whose answer is the -specified Boolean value.

-
- - - -
+ (NSPredicate *)predicateForBooleanQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector expectedAnswer:(BOOL)expectedAnswer
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you are - interested in.

expectedAnswer

The expected boolean value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForTextQuestionResultWithResultSelector:expectedString: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKTextQuestionResult whose answer is equal to the -specified string.

-
- - - -
+ (NSPredicate *)predicateForTextQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector expectedString:(NSString *)expectedString
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you are - interested in.

expectedString

The expected result string.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForTextQuestionResultWithResultSelector:matchingPattern: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKTextQuestionResult whose answer matches the -specified regular expression pattern.

-
- - - -
+ (NSPredicate *)predicateForTextQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector matchingPattern:(NSString *)pattern
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you are - interested in.

pattern

An ICU-compliant regular expression pattern that matches the answer string.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForNumericQuestionResultWithResultSelector:expectedAnswer: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKNumericQuestionResult whose answer is the -specified integer value.

-
- - - -
+ (NSPredicate *)predicateForNumericQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector expectedAnswer:(NSInteger)expectedAnswer
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you are - interested in.

expectedAnswer

The expected integer value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForNumericQuestionResultWithResultSelector:minimumExpectedAnswerValue:maximumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKNumericQuestionResult whose answer is within the -specified double values.

-
- - - -
+ (NSPredicate *)predicateForNumericQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedAnswerValue:(double)minimumExpectedAnswerValue maximumExpectedAnswerValue:(double)maximumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

minimumExpectedAnswerValue

The minimum expected double value. Pass ORKIgnoreDoubleValue - if you don’t want to compare the answer against a maximum - double value.

maximumExpectedAnswerValue

The maximum expected double value. Pass ORKIgnoreDoubleValue - if you don’t want to compare the answer against a minimum - double value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForNumericQuestionResultWithResultSelector:minimumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKNumericQuestionResult whose answer is greater -than or equal to the specified double value.

-
- - - -
+ (NSPredicate *)predicateForNumericQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedAnswerValue:(double)minimumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

minimumExpectedAnswerValue

The minimum expected double value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForNumericQuestionResultWithResultSelector:maximumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKNumericQuestionResult whose answer is less than -or equal to the specified double value.

-
- - - -
+ (NSPredicate *)predicateForNumericQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector maximumExpectedAnswerValue:(double)maximumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

maximumExpectedAnswerValue

The maximum expected double value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForTimeOfDayQuestionResultWithResultSelector:minimumExpectedHour:minimumExpectedMinute:maximumExpectedHour:maximumExpectedMinute: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKTimeOfDayQuestionResult whose answer is within -the specified hour and minute values.

-
- - - -
+ (NSPredicate *)predicateForTimeOfDayQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedHour:(NSInteger)minimumExpectedHour minimumExpectedMinute:(NSInteger)minimumExpectedMinute maximumExpectedHour:(NSInteger)maximumExpectedHour maximumExpectedMinute:(NSInteger)maximumExpectedMinute
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result you - are interested in.

minimumExpectedHour

The minimum expected hour component value.

minimumExpectedMinute

The minimum expected minute component value.

maximumExpectedHour

The maximum integer hour component value.

maximumExpectedMinute

The maximum expected minute component value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - -
-

Discussion

-

Note that ORKTimeOfDayQuestionResult internally stores its answer as an NSDateComponents object. -If you are interested in additional components, you must build the predicate manually.

-
- - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForTimeIntervalQuestionResultWithResultSelector:minimumExpectedAnswerValue:maximumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKTimeIntervalQuestionResult whose answer is -within the specified NSTimeInterval values.

-
- - - -
+ (NSPredicate *)predicateForTimeIntervalQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedAnswerValue:(NSTimeInterval)minimumExpectedAnswerValue maximumExpectedAnswerValue:(NSTimeInterval)maximumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

minimumExpectedAnswerValue

The minimum expected NSTimeInterval value. Pass - ORKIgnoreTimeIntervlValue if you don’t want to compare the - answer against a maximum NSTimeInterval value.

maximumExpectedAnswerValue

The maximum expected NSTimeInterval value. Pass - ORKIgnoreTimeIntervlValue if you don’t want to compare the - answer against a minimum NSTimeInterval value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForTimeIntervalQuestionResultWithResultSelector:minimumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKTimeIntervalQuestionResult whose answer is the -specified integer value.

-
- - - -
+ (NSPredicate *)predicateForTimeIntervalQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedAnswerValue:(NSTimeInterval)minimumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

minimumExpectedAnswerValue

The minimum expected NSTimeInterval value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForTimeIntervalQuestionResultWithResultSelector:maximumExpectedAnswerValue: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKTimeIntervalQuestionResult whose answer is the -specified integer value.

-
- - - -
+ (NSPredicate *)predicateForTimeIntervalQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector maximumExpectedAnswerValue:(NSTimeInterval)maximumExpectedAnswerValue
- - - -
-

Parameters

- - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

maximumExpectedAnswerValue

The maximum expected NSTimeInterval value.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForDateQuestionResultWithResultSelector:minimumExpectedAnswerDate:maximumExpectedAnswerDate: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKDateQuestionResult whose answer is a date within -the specified dates.

-
- - - -
+ (NSPredicate *)predicateForDateQuestionResultWithResultSelector:(ORKResultSelector *)resultSelector minimumExpectedAnswerDate:(nullable NSDate *)minimumExpectedAnswerDate maximumExpectedAnswerDate:(nullable NSDate *)maximumExpectedAnswerDate
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in.

minimumExpectedAnswerDate

The minimum expected date. Pass nil if you don’t want to - compare the answer against a minimum date.

maximumExpectedAnswerDate

The maximum expected date. Pass nil if you don’t want to - compare the answer against a maximum date.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ predicateForConsentWithResultSelector:didConsent: -

- -
-
- -
- - -
-

Returns a predicate matching a result of type ORKConsentSignatureResult whose consented value -matches the specified boolean value.

-
- - - -
+ (NSPredicate *)predicateForConsentWithResultSelector:(ORKResultSelector *)resultSelector didConsent:(BOOL)didConsent
- - - -
-

Parameters

- - - - - - - -
resultSelector

The result selector object which specifies the question result - you are interested in. Note that when creating this result - selector you must provide the desired step identifier as the - stepIdentifier argument and the corresponding signature - identifier as the resultIdentifier argument). The step - identifier will normally refer to the result of a - ORKConsentReviewStep and the signature identifier will - refer to the contained ORKConsentSignatureResult - corresponding to the signature collected by the consent - review step.

-
- - - -
-

Return Value

-

A result predicate.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResultSelector.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResultSelector.html deleted file mode 100644 index 2edeb40cd8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKResultSelector.html +++ /dev/null @@ -1,830 +0,0 @@ - - - - - - ORKResultSelector Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKResultSelector Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKResultPredicate.h
ORKResultPredicate.m
- - - - -
- -

Overview

-

The ORKResultSelector class unequivocally identifies a result within a set of task results.

- -

You must use an instance of this object to specify the question result you are interested in when -building a result predicate. See ORKResultPredicate for more information.

- -

A result selector object contains a result identifier and, optionally, a task identifier and a step -identifier. If the task identifier is nil, the selector refers to a result in the ongoing task. -If you set the step identifier to nil, its value will be the same as the result identifier.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ selectorWithTaskIdentifier:stepIdentifier:resultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
+ (instancetype)selectorWithTaskIdentifier:(NSString *)taskIdentifier stepIdentifier:(NSString *)stepIdentifier resultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
taskIdentifier

An optional task identifier string.

stepIdentifier

An optional step identifier string.

resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ selectorWithStepIdentifier:resultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
+ (instancetype)selectorWithStepIdentifier:(NSString *)stepIdentifier resultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - -
stepIdentifier

An optional step identifier string.

resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ selectorWithTaskIdentifier:resultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
+ (instancetype)selectorWithTaskIdentifier:(NSString *)taskIdentifier resultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - -
taskIdentifier

An optional task identifier string.

resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

+ selectorWithResultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
+ (instancetype)selectorWithResultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - -
resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

– initWithTaskIdentifier:stepIdentifier:resultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
- (instancetype)initWithTaskIdentifier:(NSString *)taskIdentifier stepIdentifier:(NSString *)stepIdentifier resultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
taskIdentifier

An optional task identifier string.

stepIdentifier

An optional step identifier string.

resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

– initWithTaskIdentifier:resultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
- (instancetype)initWithTaskIdentifier:(NSString *)taskIdentifier resultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - -
taskIdentifier

An optional task identifier string.

resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

– initWithStepIdentifier:resultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
- (instancetype)initWithStepIdentifier:(NSString *)stepIdentifier resultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - - - - - - -
stepIdentifier

An optional step identifier string.

resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

– initWithResultIdentifier: -

- -
-
- -
- - -
-

Returns a result selector initialized with the specified arguments.

-
- - - -
- (instancetype)initWithResultIdentifier:(NSString *)resultIdentifier
- - - -
-

Parameters

- - - - - - - -
resultIdentifier

The result identifier string.

-
- - - -
-

Return Value

-

A result selector.

-
- - - - - - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

– stepIdentifier -

- -
-
- -
- - -
-

The encapsulated step identifier.

-
- - - -
- (NSString *)stepIdentifier
- - - - - - - - - -
-

Discussion

-

Setting this property to nil makes it have the same value as the result identifier.

-
- - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  taskIdentifier -

- -
-
- -
- - -
-

The encapsulated task identifier.

-
- - - -
@property (nonatomic, copy, nullable) NSString *taskIdentifier
- - - - - - - - - -
-

Discussion

-

A nil value means that the referenced task is the current one.

-
- - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
- -

  resultIdentifier -

- -
-
- -
- - -
-

The encapsulated result identifier.

-
- - - -
@property (nonatomic, copy) NSString *resultIdentifier
- - - - - - - - - -
-

Discussion

-

This property cannot be nil.

-
- - - - - - - -
-

Declared In

-

ORKResultPredicate.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReviewStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReviewStep.html deleted file mode 100644 index 1e1110f6a4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReviewStep.html +++ /dev/null @@ -1,566 +0,0 @@ - - - - - - ORKReviewStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKReviewStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKReviewStep.h
ORKReviewStep.m
- - - - -
- -

Overview

-

The ORKReviewStep class is a concrete subclass of ORKStep that represents -a step in which existing question results can be reviewed by the user.

- -

There are two separate scenarios for using ORKReviewStep. The first one is to embed a review step within an ongoing -survey, which means an instance of ORKReviewStep might be placed at the end or in the middle of a task. The second -scenario is meant to use ORKReviewStep standalone for reviewing an already completed task.

- -

To use a review step, instantiate an ORKReviewStep object, fill in its properties, and include it in a task. Next, -create a task view controller for the task and present it.

- -

When a task view controller presents an ORKReviewStep object, it instantiates an ORKReviewStepViewController object -to present the step. This view controller lists both steps and step results to provide all entered data at a glance. It -also allows the user to navigate directly to a certain step. However, results may only be changed from there, if the -review step is used within an ongoing survey (embedded).

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ standaloneReviewStepWithIdentifier:steps:resultSource: -

- -
-
- -
- - -
-

Returns a new standalone review step that includes the specified identifier, steps, and result source.

-
- - - -
+ (instancetype)standaloneReviewStepWithIdentifier:(NSString *)identifier steps:(NSArray *)steps resultSource:(id<ORKTaskResultSource,NSSecureCoding>)resultSource
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The identifier of the step (a step identifier should be unique within the task).

steps

The steps that should be reviewed. Currently, only question, instruction and - form steps can be reviewed. Any other step type will be ignored.

resultSource

The source that should be consulted to obtain the corresponding step results.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKReviewStep.h

-
- - -
-
-
- -

+ embeddedReviewStepWithIdentifier: -

- -
-
- -
- - -
-

Returns a new embedded review step that includes the specified identifier. Steps and step results are directly taken -from the current task.

-
- - - -
+ (instancetype)embeddedReviewStepWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The identifier of the step (a step identifier should be unique within the task).

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKReviewStep.h

-
- - -
-
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  steps -

- -
-
- -
- - -
-

The steps to be reviewed. (read-only)

-
- - - -
@property (nonatomic, copy, readonly) NSArray<ORKStep*> *steps
- - - - - - - - - -
-

Discussion

-

This property contains all steps that are included in the review process. Currently, only question, instruction and -form steps can be reviewed. Any other step type will be ignored.

-
- - - - - - - -
-

Declared In

-

ORKReviewStep.h

-
- - -
-
-
- -

  resultSource -

- -
-
- -
- - -
-

The result source to obtain step results from. (read-only)

-
- - - -
@property (nonatomic, readonly) id<ORKTaskResultSource,NSSecureCoding> resultSource
- - - - - - - - - -
-

Discussion

-

This property contains the source that should be consulted to obtain step results.

-
- - - - - - - -
-

Declared In

-

ORKReviewStep.h

-
- - -
-
-
- -

  excludeInstructionSteps -

- -
-
- -
- - -
-

A Boolean value indicating whether instruction steps should be excluded from review.

-
- - - -
@property (nonatomic) BOOL excludeInstructionSteps
- - - - - - - - - -
-

Discussion

-

The default value of this property is NO. When the value is YES, any instances of ORKInstructionStep are -excluded from the review step in either embedded or standalone mode.

-
- - - - - - - -
-

Declared In

-

ORKReviewStep.h

-
- - -
-
-
-
- - - -

Extension Methods

- -
-
- -

  isStandalone -

- -
-
- -
- - -
-

A Boolean value indicating whether this review step is used in standalone mode (read-only).

-
- - - -
@property (nonatomic, readonly) BOOL isStandalone
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKReviewStep_Internal.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReviewStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReviewStepViewController.html deleted file mode 100644 index 86841bf1e9..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKReviewStepViewController.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - ORKReviewStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKReviewStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKReviewStepViewController.h
ORKReviewStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleAnswerFormat.html deleted file mode 100644 index eaee5d0fa7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleAnswerFormat.html +++ /dev/null @@ -1,1084 +0,0 @@ - - - - - - ORKScaleAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScaleAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKScaleAnswerFormatclass represents an answer format that includes a slider control.

- -

The scale answer format produces an ORKScaleQuestionResult object that contains an integer whose -value is between the scale’s minimum and maximum values, and represents one of the quantized step -values.

- -

The following are the rules bound with scale answer format -

- -
    -
  • Minimum number of step in a task should not be less than 1.
  • -
  • Minimum number of section on a scale (step count) should not be less than 1.
  • -
  • Maximum number of section on a scale (step count) should not be more than 13.
  • -
  • The lower bound value in scale answer format cannot be lower than - 10000.
  • -
  • The upper bound value in scale answer format cannot be more than 10000.
  • -
- -
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithMaximumValue:minimumValue:defaultValue:step:vertical:maximumValueDescription:minimumValueDescription: -

- -
-
- -
- - -
-

Returns an initialized scale answer format using the specified values.

-
- - - -
- (instancetype)initWithMaximumValue:(NSInteger)maximumValue minimumValue:(NSInteger)minimumValue defaultValue:(NSInteger)defaultValue step:(NSInteger)step vertical:(BOOL)vertical maximumValueDescription:(nullable NSString *)maximumValueDescription minimumValueDescription:(nullable NSString *)minimumValueDescription
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
maximumValue

The upper bound of the scale.

minimumValue

The lower bound of the scale.

defaultValue

The default value of the scale. If this value is out of range, - the slider is displayed without a default value.

step

The size of each discrete offset on the scale.

vertical

Pass YES to use a vertical scale; for the default horizontal - scale, pass NO.

maximumValueDescription

A localized label to describe the maximum value of the scale. - For none, pass nil.

minimumValueDescription

A localized label to describe the minimum value of the scale. - For none, pass nil.

-
- - - -
-

Return Value

-

An initialized scale answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMaximumValue:minimumValue:defaultValue:step:vertical: -

- -
-
- -
- - -
-

Returns an initialized scale answer format using the specified values.

-
- - - -
- (instancetype)initWithMaximumValue:(NSInteger)maximumValue minimumValue:(NSInteger)minimumValue defaultValue:(NSInteger)defaultValue step:(NSInteger)step vertical:(BOOL)vertical
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
maximumValue

The upper bound of the scale.

minimumValue

The lower bound of the scale.

defaultValue

The default value of the scale. If this value is out of range, the slider is - displayed without a default value.

step

The size of each discrete offset on the scale.

vertical

Pass YES to use a vertical scale; for the default horizontal scale, - pass NO.

-
- - - -
-

Return Value

-

An initialized scale answer format.

-
- - - - - -
-

Discussion

-

This method is a convenience initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMaximumValue:minimumValue:defaultValue:step: -

- -
-
- -
- - -
-

Returns an initialized horizontal scale answer format using the specified values.

-
- - - -
- (instancetype)initWithMaximumValue:(NSInteger)maximumValue minimumValue:(NSInteger)minimumValue defaultValue:(NSInteger)defaultValue step:(NSInteger)step
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
maximumValue

The upper bound of the scale.

minimumValue

The lower bound of the scale.

defaultValue

The default value of the scale. If this value is out of range, the slider is - displayed without a default value.

step

The size of each discrete offset on the scale.

-
- - - -
-

Return Value

-

An initialized scale answer format.

-
- - - - - -
-

Discussion

-

This method is a convenience initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximum -

- -
-
- -
- - -
-

The upper bound of the scale. (read-only)

-
- - - -
@property (readonly) NSInteger maximum
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimum -

- -
-
- -
- - -
-

The lower bound of the scale. (read-only)

-
- - - -
@property (readonly) NSInteger minimum
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  step -

- -
-
- -
- - -
-

The size of each discrete offset on the scale. (read-only)

-
- - - -
@property (readonly) NSInteger step
- - - - - - - - - -
-

Discussion

-

The value of this property should be greater than zero. -The difference between maximumValue and minimumValue should be divisible -by the step value.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultValue -

- -
-
- -
- - -
-

The default value for the slider. (read-only)

-
- - - -
@property (readonly) NSInteger defaultValue
- - - - - - - - - -
-

Discussion

-

If the value of this property is less than minimum or greater than maximum, the slider has no -default. Otherwise, the value is rounded to the nearest valid step value.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  vertical -

- -
-
- -
- - -
-

A Boolean value indicating whether the scale is oriented vertically. (read-only)

-
- - - -
@property (readonly, getter=isVertical) BOOL vertical
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  numberFormatter -

- -
-
- -
- - -
-

Number formatter applied to the minimum, maximum, and slider values. Can be overridden by -subclasses.

-
- - - -
@property (readonly) NSNumberFormatter *numberFormatter
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumValueDescription -

- -
-
- -
- - -
-

A localized label to describe the maximum value of the scale. (read-only)

-
- - - -
@property (readonly, nullable) NSString *maximumValueDescription
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimumValueDescription -

- -
-
- -
- - -
-

A localized label to describe the minimum value of the scale. (read-only)

-
- - - -
@property (readonly, nullable) NSString *minimumValueDescription
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumImage -

- -
-
- -
- - -
-

An image for the upper bound of the slider. The recommended image size is 30 x 30 points. -The maximum range label will not be visible.

-
- - - -
@property (strong, nullable) UIImage *maximumImage
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimumImage -

- -
-
- -
- - -
-

An image for the lower bound of the slider. The recommended image size is 30 x 30 points. -The minimum range label will not be visible.

-
- - - -
@property (strong, nullable) UIImage *minimumImage
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  gradientColors -

- -
-
- -
- - -
-

The colors to use when drawing a color gradient above the slider. Colors are drawn such that -lower indexes correspond to the minimum side of the scale, while colors at higher indexes in -the array corresond to the maximum side of the scale.

-
- - - -
@property (copy, nullable) NSArray<UIColor*> *gradientColors
- - - - - - - - - -
-

Discussion

-

Setting this value to nil results in no gradient being drawn. Defaults to nil.

- -

An example usage would set an array of red and green to visually indicate a scale from bad to good.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  gradientLocations -

- -
-
- -
- - -
-

Indicates the position of gradient stops for the colors specified in gradientColors. -Gradient stops are specified as values between 0 and 1. The values must be monotonically -increasing.

-
- - - -
@property (copy, nullable) NSArray<NSNumber*> *gradientLocations
- - - - - - - - - -
-

Discussion

-

If nil, the stops are spread uniformly across the range. Defaults to nil.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleQuestionResult.html deleted file mode 100644 index 6b0d65f1a7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleQuestionResult.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - ORKScaleQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScaleQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKScaleQuestionResult class represents the answer to a continuous or -discrete-value scale answer format.

- -

A scale question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  scaleAnswer -

- -
-
- -
- - -
-

The answer obtained from the scale question.

-
- - - -
@property (nonatomic, copy, nullable) NSNumber *scaleAnswer
- - - - - - - - - -
-

Discussion

-

The value of this property is nil when the user skipped the question or otherwise did not -enter an answer.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeDescriptionLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeDescriptionLabel.html deleted file mode 100644 index 84c6e73311..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeDescriptionLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKScaleRangeDescriptionLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScaleRangeDescriptionLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKScaleRangeLabel : ORKLabel : UILabel
Declared inORKScaleRangeDescriptionLabel.h
ORKScaleRangeDescriptionLabel.m
- - - - -
- -

Overview

-

Start/End description of the range in scale slider.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeImageView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeImageView.html deleted file mode 100644 index 82169f27a7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeImageView.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKScaleRangeImageView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScaleRangeImageView Class Reference

- - -
- - - - - - - -
Inherits fromUIImageView
Declared inORKScaleRangeImageView.h
ORKScaleRangeImageView.m
- - - - -
- -

Overview

-

Start/End image of the range in scale slider.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeLabel.html deleted file mode 100644 index 24c88dd2ee..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleRangeLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKScaleRangeLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScaleRangeLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKScaleRangeLabel.h
ORKScaleRangeLabel.m
- - - - -
- -

Overview

-

Start/End of the range in scale slider.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleValueLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleValueLabel.html deleted file mode 100644 index 8686f3e317..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKScaleValueLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKScaleValueLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScaleValueLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKScaleValueLabel.h
ORKScaleValueLabel.m
- - - - -
- -

Overview

-

Large label shown separately from the scale slider to indicate the current value.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSelectionSubTitleLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSelectionSubTitleLabel.html deleted file mode 100644 index 1176cfb74c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSelectionSubTitleLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKSelectionSubTitleLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSelectionSubTitleLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKSelectionSubTitleLabel.h
ORKSelectionSubTitleLabel.m
- - - - -
- -

Overview

-

Details text in selection question’s choice cell.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSelectionTitleLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSelectionTitleLabel.html deleted file mode 100644 index 224a0375aa..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSelectionTitleLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKSelectionTitleLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSelectionTitleLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKSelectionTitleLabel.h
ORKSelectionTitleLabel.m
- - - - -
- -

Overview

-

Title line in selection question’s choice cell.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKShoulderRangeOfMotionStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKShoulderRangeOfMotionStep.html deleted file mode 100644 index 25632e6fd6..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKShoulderRangeOfMotionStep.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - ORKShoulderRangeOfMotionStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKShoulderRangeOfMotionStep Class Reference

- - -
- - - - - - - -
Inherits fromORKRangeOfMotionStep : ORKActiveStep : ORKStep : NSObject
Declared inORKShoulderRangeOfMotionStep.h
ORKShoulderRangeOfMotionStep.m
- - - - -
- -

Overview

-

The ORKShoulderRangeOfMotionStep class represents a step that takes a range of motion measurement -for either a left or right shoulder.

-
- - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKShoulderRangeOfMotionStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKShoulderRangeOfMotionStepViewController.html deleted file mode 100644 index 15683901df..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKShoulderRangeOfMotionStepViewController.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - ORKShoulderRangeOfMotionStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKShoulderRangeOfMotionStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKRangeOfMotionStepViewController : ORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKShoulderRangeOfMotionStepViewController.h
ORKShoulderRangeOfMotionStepViewController.m
- - - - -
- -

Overview

-

This class override its parent’s result because here -a flex result of 0 degrees would mean the device is at a 90 degree angle.

-
- - - - - -
- - - - - - -
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureResult.html deleted file mode 100644 index 6fbbaaf373..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureResult.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - ORKSignatureResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSignatureResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKSignatureResult.h
ORKSignatureResult.m
- - - - -
- -

Overview

-

The ORKSignatureResult class represents the result of a signature step (ORKSignatureStep).

- -

A signature result is produced by the task view controller when it presents a signature step.

-
- - - - - -
- - - - - - -
-
- -

  signatureImage -

- -
-
- -
- - -
-

The signature image generated by this step.

-
- - - -
@property (nonatomic, nullable) UIImage *signatureImage
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSignatureResult.h

-
- - -
-
-
- -

  signaturePath -

- -
-
- -
- - -
-

The bezier path components used to create the signature image.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<UIBezierPath*> *signaturePath
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSignatureResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureStep.html deleted file mode 100644 index edb145f7af..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureStep.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - ORKSignatureStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSignatureStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKSignatureStep.h
ORKSignatureStep.m
- - - - -
- -

Overview

-

The ORKSignatureStep class is used to represent collecting a signature. -Typically, the consent signature is collected as a part of the consent review process.

- -

However, since in some cases the signature is collected after displaying custom -consent review steps, it is exposed to allow showing this as it’s own step.

- -

To use a consent signature step, configure it and include it in a task. Then -present the task in a task view controller.

- -

The result of this step is an ORKSignatureResult which will include both the UIImage and -the path used to draw the image.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureStepViewController.html deleted file mode 100644 index 211173cca3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureStepViewController.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - ORKSignatureStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSignatureStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKSignatureStepViewController.h
ORKSignatureStepViewController.m
- - - - -
- -

Overview

-

The ORKSignatureStepViewController class is a step view controller subclass -used to manage a signature step (ORKSignatureStep).

- -

You should not need to instantiate a signature step view controller directly. Instead, include -a signature step in a task, and present a task view controller for that stask.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep:result: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step to be presented.

result

The current step result for this step.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureView.html deleted file mode 100644 index 7fee5bfe8e..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSignatureView.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - ORKSignatureView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSignatureView Class Reference

- - -
- - - - - - - -
Inherits fromUIView
Declared inORKSignatureView.h
ORKSignatureView.m
- - - - - - -
- - - - - - -
-
- -

  lineWidthVariation -

- -
-
- -
- - -
-

lineWidthVariation defines the max amount by which the line -width can vary (default 3pts).

-
- - - -
@property (nonatomic) CGFloat lineWidthVariation
- - - - - - - - - -
-

Discussion

-

The exact amount of the variation is determined by the amount -of force applied on 3D touch capable devices or by the speed -of the stroke if 3D touch is not available.

- -

If the user is signing with an Apple Pencil, its force will be used.

-
- - - - - - - -
-

Declared In

-

ORKSignatureView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSkipStepNavigationRule.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSkipStepNavigationRule.html deleted file mode 100644 index 3af4b58ded..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSkipStepNavigationRule.html +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - ORKSkipStepNavigationRule Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSkipStepNavigationRule Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKStepNavigationRule.h
ORKStepNavigationRule.m
- - - - -
- -

Overview

-

The ORKSkipStepNavigationRule class is the abstract base class for concrete skip step navigation -rules.

- -

Skip step navigation rules can be used within an ORKNavigableOrderedTask object. You assign skip -step navigation rules to be triggered before a task step is shown. Each step can have one skip rule -at most.

- -

Subclasses must implement the identifierForDestinationStepWithTaskResult: method, which returns -the identifier of the destination step for the rule.

- -

Two concrete subclasses are included: ORKPredicateStepNavigationRule can match any answer -combination in the results of the ongoing task and jump accordingly; ORKDirectStepNavigationRule -unconditionally navigates to the step specified by the destination step identifier.

-
- - - - - -
- - - - - - -
-
- -

– stepShouldSkipWithTaskResult: -

- -
-
- -
- - -
-

Returns whether the targeted step should skip.

-
- - - -
- (BOOL)stepShouldSkipWithTaskResult:(ORKTaskResult *)taskResult
- - - -
-

Parameters

- - - - - - - -
taskResult

The up-to-date task result, used for calculating whether the task should - skip.

-
- - - -
-

Return Value

-

YES if the step should skip.

-
- - - - - -
-

Discussion

-

Subclasses must implement this method to calculate if the targeted step should skip based on the -passed task result.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanGame.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanGame.html deleted file mode 100644 index 60983db3d1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanGame.html +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - ORKSpatialSpanGame Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanGame Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKSpatialSpanGame.h
ORKSpatialSpanGame.m
- - - - -
- -

Overview

-

The ORKSpatialSpanGame class represents a model object that represents one game-like experience in a spatial span memory task.

- -

A game consists of a subset of a permutation of the integers [0 .. gameSize - 1], -which represent the sequence of targets that should be tapped.

-
- - - - - -
- - - - - - -
-
- -

– initWithGameSize:sequenceLength:seed: -

- -
-
- -
- - -
-

Returns an initialized spatial span game using the specified game size, sequence length, and seed.

-
- - - -
- (instancetype)initWithGameSize:(NSInteger)gameSize sequenceLength:(NSInteger)sequenceLength seed:(uint32_t)seed
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
gameSize

The number of tiles in the game.

sequenceLength

The number of elements in the sequence that the user has to remember.

seed

The generator that should be used for generating the sequence. A value of 0 means that a random seed is used.

-
- - - - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanGame.h

-
- - -
-
-
- -

  gameSize -

- -
-
- -
- - -
-

The number of tiles in the game.

-
- - - -
@property (nonatomic, readonly) NSInteger gameSize
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanGame.h

-
- - -
-
-
- -

  sequenceLength -

- -
-
- -
- - -
-

The length of the sequence. A sequence is a sub-array of a random permutation of integers (0..gameSize-1) that has a length of sequenceLength.

-
- - - -
@property (nonatomic, readonly) NSInteger sequenceLength
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanGame.h

-
- - -
-
-
- -

  seed -

- -
-
- -
- - -
-

The seed to use to generate the sequence. Note that if you pass seed to another game, you get the same game.

-
- - - -
@property (nonatomic, readonly) uint32_t seed
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanGame.h

-
- - -
-
-
- -

– enumerateSequenceWithHandler: -

- -
-
- -
- - -
-

Enumerates the sequence, calling the block once for each element.

-
- - - -
- (void)enumerateSequenceWithHandler:(void ( ^ ) ( NSInteger step , NSInteger tileIndex , BOOL isLastStep , BOOL *stop ))handler
- - - -
-

Parameters

- - - - - - - -
handler

The block to be called for each element in the sequence. The handler block takes the following parameters:

- -

step The step in the sequence. The step starts at 0 and increments by one on each call. -tileIndex The index in [ 0 .. gameSize ] that corresponds to the step’s element of the sequence. -isLastStep A Boolean value that indicates if this is the last step in the sequence. -stop A Boolean value that indicates if the enumeration should be terminated (pass NO to terminate the enumeration).

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanGame.h

-
- - -
-
-
- -

– tileIndexForStep: -

- -
-
- -
- - -
-

Returns the value of the specified step in the sequence.

-
- - - -
- (NSInteger)tileIndexForStep:(NSInteger)step
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanGame.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanGameState.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanGameState.html deleted file mode 100644 index cd397f4e8b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanGameState.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - ORKSpatialSpanGameState Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanGameState Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKSpatialSpanGameState.h
ORKSpatialSpanGameState.m
- - - - - - -
- - - - - - -
-
- -

– enumerateTilesWithHandler: -

- -
-
- -
- - -
-

Enumerates all tiles, indicating the state of each tile at the specified state of the game.

-
- - - -
- (void)enumerateTilesWithHandler:(void ( ^ ) ( NSInteger tileIndex , ORKSpatialSpanTargetState state , BOOL *stop ))handler
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanGameState.h

-
- - -
-
-
- -

– playTileIndex: -

- -
-
- -
- - -
-

Returns a result indicating whether the user’s tap was correct, incorrect, or ignorable.

-
- - - -
- (ORKSpatialSpanResult)playTileIndex:(NSInteger)tileIndex
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanGameState.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryGameRecord.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryGameRecord.html deleted file mode 100644 index 5a9bcce712..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryGameRecord.html +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - ORKSpatialSpanMemoryGameRecord Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanMemoryGameRecord Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKSpatialSpanMemoryResult.h
ORKSpatialSpanMemoryResult.m
- - - - -
- -

Overview

-

The ORKSpatialSpanMemoryGameRecord class records the results of a -single playable instance of the spatial span memory game.

- -

A spatial span memory game record is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

- -

These records are found in the records property of an ORKSpatialSpanMemoryResult object.

-
- - - - - -
- - - - - - -
-
- -

  seed -

- -
-
- -
- - -
-

An integer used as the seed for the sequence.

-
- - - -
@property (nonatomic, assign) uint32_t seed
- - - - - - - - - -
-

Discussion

-

If you pass a specific seed value to another game, you get the same sequence.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  sequence -

- -
-
- -
- - -
-

An array of NSNumber objects that represent the sequence that was presented to the user.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<NSNumber*> *sequence
- - - - - - - - - -
-

Discussion

-

The sequence is an array of length sequenceLength that contains a random permutation of integers (0..gameSize-1)

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  gameSize -

- -
-
- -
- - -
-

The size of the game.

-
- - - -
@property (nonatomic, assign) NSInteger gameSize
- - - - - - - - - -
-

Discussion

-

The game size is the number of targets, such as flowers, in the game.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  targetRects -

- -
-
- -
- - -
-

An array of NSValue objects wrapped in CGRect that record the frames of the target -tiles as displayed, relative to the step view.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<NSValue*> *targetRects
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  touchSamples -

- -
-
- -
- - -
-

An array of ORKSpatialSpanMemoryGameTouchSample objects that record the onscreen locations -the user tapped during the game.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKSpatialSpanMemoryGameTouchSample*> *touchSamples
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  gameStatus -

- -
-
- -
- - -
-

A value indicating whether the user completed the sequence and, if the game was not completed, why not.

-
- - - -
@property (nonatomic, assign) ORKSpatialSpanMemoryGameStatus gameStatus
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  score -

- -
-
- -
- - -
-

An integer that records the number of points obtained during this game toward -the total score.

-
- - - -
@property (nonatomic, assign) NSInteger score
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryGameTouchSample.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryGameTouchSample.html deleted file mode 100644 index 5696a397d4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryGameTouchSample.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - - - ORKSpatialSpanMemoryGameTouchSample Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanMemoryGameTouchSample Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKSpatialSpanMemoryResult.h
ORKSpatialSpanMemoryResult.m
- - - - -
- -

Overview

-

The ORKSpatialSpanMemoryGameTouchSample class represents a tap during the -spatial span memory game.

- -

A spatial span memory game touch sample is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  timestamp -

- -
-
- -
- - -
-

A timestamp (in seconds) from the beginning of the game.

-
- - - -
@property (nonatomic, assign) NSTimeInterval timestamp
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  targetIndex -

- -
-
- -
- - -
-

The index of the target that was tapped.

-
- - - -
@property (nonatomic, assign) NSInteger targetIndex
- - - - - - - - - -
-

Discussion

-

Usually, this index is a value that ranges between 0 and the number of targets, -indicating which target was tapped.

- -

If the touch was outside all of the targets, the value of this property is -1.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  location -

- -
-
- -
- - -
-

A point that records the touch location in the step’s view.

-
- - - -
@property (nonatomic, assign) CGPoint location
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  correct -

- -
-
- -
- - -
-

A Boolean value indicating whether the tapped target was the correct one.

-
- - - -
@property (nonatomic, assign, getter=isCorrect) BOOL correct
- - - - - - - - - -
-

Discussion

-

The value of this property is YES when the tapped target is the correct -one, and NO otherwise.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryResult.html deleted file mode 100644 index 730e26d9ba..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryResult.html +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - ORKSpatialSpanMemoryResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanMemoryResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKSpatialSpanMemoryResult.h
ORKSpatialSpanMemoryResult.m
- - - - -
- -

Overview

-

The ORKSpatialSpanMemoryResult class represents the result of a spatial span memory step (ORKSpatialSpanMemoryStep).

- -

A spatial span memory result records the score displayed to the user, the number of games, the -objects recording the actual game, and the user’s taps in response -to the game.

- -

A spatial span memory result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  score -

- -
-
- -
- - -
-

The score in the game.

-
- - - -
@property (nonatomic, assign) NSInteger score
- - - - - - - - - -
-

Discussion

-

The score is an integer value that monotonically increases during the game, across multiple rounds.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  numberOfGames -

- -
-
- -
- - -
-

The number of games.

-
- - - -
@property (nonatomic, assign) NSInteger numberOfGames
- - - - - - - - - -
-

Discussion

-

The number of rounds that the user participated in, including successful, -failed, and timed out rounds.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  numberOfFailures -

- -
-
- -
- - -
-

The number of failures.

-
- - - -
@property (nonatomic, assign) NSInteger numberOfFailures
- - - - - - - - - -
-

Discussion

-

The number of rounds in which the user participated, but did not correctly -complete the sequence.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
- -

  gameRecords -

- -
-
- -
- - -
-

An array that contains the results of the games played.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKSpatialSpanMemoryGameRecord*> *gameRecords
- - - - - - - - - -
-

Discussion

-

Each item in the array is an ORKSpatialSpanMemoryGameRecord object.

-
- - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryStep.html deleted file mode 100644 index 39aa03c84f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryStep.html +++ /dev/null @@ -1,318 +0,0 @@ - - - - - - ORKSpatialSpanMemoryStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanMemoryStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKSpatialSpanMemoryStep.h
ORKSpatialSpanMemoryStep.m
- - - - -
- -

Overview

-

Spatian span memory step.

- -

This step type is used to present the interactive spatial span memory activity. You are not -supposed to use this step on its own. Use ORKOrderedTask’s +spatialSpanMemoryTaskWithIdentifier:intendedUseDescription:initialSpan:minimumSpan:maximumSpan:playSpeed:maximumTests:maximumConsecutiveFailures:customTargetImage:customTargetPluralName:requireReversal:options: method to get a complete spatial -span memory activity task instead.

-
- - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryStepViewController.html deleted file mode 100644 index 09a233db13..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpatialSpanMemoryStepViewController.html +++ /dev/null @@ -1,489 +0,0 @@ - - - - - - ORKSpatialSpanMemoryStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanMemoryStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKSpatialSpanMemoryStepViewController.h
ORKSpatialSpanMemoryStepViewController.m
- - - - -
- -

Overview

-

View controller corresponding to ORKSpatialSpanMemoryStep.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– suspend -

- -
-
- -
- - -
-

Suspends the active step.

-
- - - -
- (void)suspend
- - - - - - - - - -
-

Discussion

-

Call this method to suspend data recording and the step’s timer.

- -

This method may called automatically when the app is suspended. -The view controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– resume -

- -
-
- -
- - -
-

Resumes the active step.

-
- - - -
- (void)resume
- - - - - - - - - -
-

Discussion

-

Call this method when the step should be resumed. Calls to this method should -be paired with previous calls to suspend.

- -

This method may be called automatically when the app is resumed. The view -controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

When the step is resumed, the UI should resume at the point where the user left off, -or, if that does not make sense for the particular step, to the most recent -suitable point.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– finish -

- -
-
- -
- - -
-

Finishes the active step.

-
- - - -
- (void)finish
- - - - - - - - - -
-

Discussion

-

Call this method to finish the active step. If the active step is configured with -a timer, this method is called automatically when the timer expires.

- -

Finishing the active step stops all data recording and stops any timers. In steps that have the -shouldContinueOnFinish property set, forward navigation to the next step -may ensue.

- -

This method does nothing if the step has already finished.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechInNoiseStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechInNoiseStep.html deleted file mode 100644 index df3ac73d68..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechInNoiseStep.html +++ /dev/null @@ -1,593 +0,0 @@ - - - - - - ORKSpeechInNoiseStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpeechInNoiseStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKSpeechInNoiseStep.h
ORKSpeechInNoiseStep.m
- - - - -
- -

Overview

-

This active step programatically mixes the speech file with noise file and applies the filter.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– shouldContinueOnFinish -

- -
-
- -
- - -
-

A Boolean value indicating whether to transition automatically when the step finishes.

-
- - - -
- (BOOL)shouldContinueOnFinish
- - - - - - - - - -
-

Discussion

-

When the value of this property is YES, the active step view controller automatically performs the -continue action when the [ORKActiveStepViewController finish] method -is called.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  speechFileNameWithExtension -

- -
-
- -
- - -
-

This property accepts the speech file.

-
- - - -
@property (nonatomic, copy, nullable) NSString *speechFileNameWithExtension
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechInNoiseStep.h

-
- - -
-
-
- -

  noiseFileNameWithExtension -

- -
-
- -
- - -
-

This property accepts the noise file.

-
- - - -
@property (nonatomic, copy, nullable) NSString *noiseFileNameWithExtension
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechInNoiseStep.h

-
- - -
-
-
- -

  filterFileNameWithExtension -

- -
-
- -
- - -
-

This property accepts the filter file.

-
- - - -
@property (nonatomic, copy, nullable) NSString *filterFileNameWithExtension
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechInNoiseStep.h

-
- - -
-
-
- -

  gainAppliedToNoise -

- -
-
- -
- - -
-

The linear gain applied to the noise file before mixing it with the speech file.

-
- - - -
@property (nonatomic, assign) double gainAppliedToNoise
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechInNoiseStep.h

-
- - -
-
-
- -

  willAudioLoop -

- -
-
- -
- - -
-

This boolean determines the repetitions of the file.

-
- - - -
@property (nonatomic, assign) BOOL willAudioLoop
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechInNoiseStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitionStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitionStep.html deleted file mode 100644 index fa6ba4a0dc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitionStep.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - ORKSpeechRecognitionStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpeechRecognitionStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKSpeechRecognitionStep.h
ORKSpeechRecognitionStep.m
- - - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– shouldContinueOnFinish -

- -
-
- -
- - -
-

A Boolean value indicating whether to transition automatically when the step finishes.

-
- - - -
- (BOOL)shouldContinueOnFinish
- - - - - - - - - -
-

Discussion

-

When the value of this property is YES, the active step view controller automatically performs the -continue action when the [ORKActiveStepViewController finish] method -is called.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  speechRecognizerLocale -

- -
-
- -
- - -
-

The language for speech recognition

-
- - - -
@property (nonatomic, copy) ORKSpeechRecognizerLocale speechRecognizerLocale
- - - - - - - - - -
-

Discussion

-

The default value of this property is @“en-US”.

-
- - - - - - - -
-

Declared In

-

ORKSpeechRecognitionStep.h

-
- - -
-
-
- -

  shouldHideTranscript -

- -
-
- -
- - -
-

The property to hide transcription as the user speaks.

-
- - - -
@property (nonatomic) BOOL shouldHideTranscript
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognitionStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitionStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitionStepViewController.html deleted file mode 100644 index 792d1a80ff..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitionStepViewController.html +++ /dev/null @@ -1,525 +0,0 @@ - - - - - - ORKSpeechRecognitionStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpeechRecognitionStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKSpeechRecognitionStepViewController.h
ORKSpeechRecognitionStepViewController.m
- - - - -
- -

Overview

-

Step view controller corresponding to ORKSpeechRecognitionStep.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– recordersDidChange -

- -
-
- -
- - -
-

Tells the view controller that the set of recorders changed.

-
- - - -
- (void)recordersDidChange
- - - - - - - - - -
-

Discussion

-

This method is usually called by the active step view controller in response -to start or resume.

- -

Subclasses may override this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– resume -

- -
-
- -
- - -
-

Resumes the active step.

-
- - - -
- (void)resume
- - - - - - - - - -
-

Discussion

-

Call this method when the step should be resumed. Calls to this method should -be paired with previous calls to suspend.

- -

This method may be called automatically when the app is resumed. The view -controller can be configured not to suspend even if the app -goes into the background (for more information, see suspendIfInactive).

- -

When the step is resumed, the UI should resume at the point where the user left off, -or, if that does not make sense for the particular step, to the most recent -suitable point.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– goForward -

- -
-
- -
- - -
-

Navigates forward to the next step.

-
- - - -
- (void)goForward
- - - - - - - - - -
-

Discussion

-

When a user taps a Next button, the information passes through this method. You can use this method as an override -point or a target action for a subclass.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– recordersWillStart -

- -
-
- -
- - -
-

Tells the view controller that the recorders are about to start.

-
- - - -
- (void)recordersWillStart
- - - - - - - - - -
-

Discussion

-

This method is called by the active step view controller after instantiating -the recorders, but before starting them.

- -

Subclasses may override this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitonResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitonResult.html deleted file mode 100644 index 16b0cb431a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognitonResult.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - ORKSpeechRecognitonResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpeechRecognitonResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKSpeechRecognitionResult.h
ORKSpeechRecognitionResult.m
- - - - -
- -

Overview

-

The ORKSpeechRecognitionResult class represents the result of a single successful attempt of an ORKSpeechRecognitionStep.

- -

A speech recognition result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize the sample for transmission to a server or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  transcription -

- -
-
- -
- - -
-

A hypothesized textual representation of recognized speech -SFTranscription is described at: https://developer.apple.com/documentation/speech/sftranscription

-
- - - -
@property (nonatomic, copy, nullable) SFTranscription *transcription
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognitionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognizer.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognizer.html deleted file mode 100644 index 4e55ec0c8a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSpeechRecognizer.html +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - ORKSpeechRecognizer Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpeechRecognizer Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKSpeechRecognizer.h
ORKSpeechRecognizer.m
- - - - -
- -

Overview

-

The ORKSpeechRecognizer class is a wrapper for the Speech API framework

-
- - - - - -
- - - - - - -
-
- -

+ requestAuthorization -

- -
-
- -
- - -
-

Asks the user to grant your app permission to perform speech recognition.

-
- - - -
+ (void)requestAuthorization
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognizer.h

-
- - -
-
-
- -

– startRecognitionWithLocale:reportPartialResults:responseDelegate:errorHandler: -

- -
-
- -
- - -
-

Starts speech recognition for the specified locale

-
- - - -
- (void)startRecognitionWithLocale:(NSLocale *)locale reportPartialResults:(BOOL)reportPartialResults responseDelegate:(id<ORKSpeechRecognitionDelegate>)delegate errorHandler:(void ( ^ ) ( NSError *error ))handler
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
locale

Device’s locale

reportPartialResults

A boolean value that indicates whether partial, nonfinal results for each utterance are reported.

delegate

The delegate for speech recognition response

handler

A handler to report errors

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognizer.h

-
- - -
-
-
- -

– addAudio: -

- -
-
- -
- - -
-

Appends audio to the end of the recognition request.

-
- - - -
- (void)addAudio:(AVAudioPCMBuffer *)audioBuffer
- - - -
-

Parameters

- - - - - - - -
audioBuffer

A buffer of audio

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognizer.h

-
- - -
-
-
- -

– endAudio -

- -
-
- -
- - -
-

Indicates that the audio source is finished and no more audio will be appended to the -recognition request.

-
- - - -
- (void)endAudio
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognizer.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStep.html deleted file mode 100644 index ba73e38df7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStep.html +++ /dev/null @@ -1,941 +0,0 @@ - - - - - - ORKStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStep Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKStep.h
ORKStep.m
- - - - -
- -

Overview

-

ORKStep is the base class for the steps that can compose a task for presentation -in an ORKTaskViewController object. Each ORKStep object represents one logical piece of data -entry or activity in a larger task.

- -

A step can be a question, an active test, or a simple instruction. An ORKStep -subclass is usually paired with an ORKStepViewController subclass that displays the step.

- -

To use a step, instantiate an ORKStep object and populate its properties. Add the step to a task, -such as an ORKOrderedTask object, and then present the task using a task view controller (an -ORKTaskViewController object).

- -

To implement a new type of step, subclass ORKStep and add your additional -properties. Separately, subclass ORKStepViewController and implement -your user interface. Note that if your step is timed or requires sensor data collection, -you should consider subclassing ORKActiveStep and ORKActiveStepViewController -instead.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– copyWithIdentifier: -

- -
-
- -
- - -
-

Returns a copy of this step initialized with the specified identifier.

-
- - - -
- (instancetype)copyWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier for the new step to be returned.

-
- - - -
-

Return Value

-

A new step.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  identifier -

- -
-
- -
- - -
-

A short string that uniquely identifies the step within the task.

-
- - - -
@property (nonatomic, copy, readonly) NSString *identifier
- - - - - - - - - -
-

Discussion

-

The identifier is reproduced in the results of a step. In fact, the only way to link a result -(an ORKStepResult object) to the step that generated it is to look at the value of -identifier. To accurately identify step results, you need to ensure that step identifiers -are unique within each task.

- -

In some cases, it can be useful to link the step identifier to a unique identifier in a -database; in other cases, it can make sense to make the identifier human -readable.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  restorable -

- -
-
- -
- - -
-

A Boolean value indicating whether a task can be restored to the step -during state restoration. (read-only)

-
- - - -
@property (nonatomic, readonly, getter=isRestorable) BOOL restorable
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is YES, but subclasses of ORKStep might use NO.

- -

If a task cannot be restored to the step, the task is typically restored to the -last restorable step in the task, or to the first step, if -no restorable steps are available.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  optional -

- -
-
- -
- - -
-

A Boolean value indicating whether the user can skip the step -without providing an answer.

-
- - - -
@property (nonatomic, getter=isOptional) BOOL optional
- - - - - - - - - -
-

Discussion

-

The default value of this property is YES. When the value is NO, the Skip button does not -appear on this step.

- -

This property may not be meaningful for all steps; for example, an active step -might not provide a way to skip, because it requires a timer to finish.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  title -

- -
-
- -
- - -
-

The primary text to display for the step in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *title
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  text -

- -
-
- -
- - -
-

Additional text to display for the step in a localized string.

-
- - - -
@property (nonatomic, copy, nullable) NSString *text
- - - - - - - - - -
-

Discussion

-

The additional text is displayed in a smaller font below title. If you need to display a -long question, it can work well to keep the title short and put the additional content in -the text property.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  task -

- -
-
- -
- - -
-

The task that contains the step.

-
- - - -
@property (nonatomic, weak, nullable) id<ORKTask> task
- - - - - - - - - -
-

Discussion

-

The value of task is usually set when a step is added to the ORKOrderedTask object. -Although it’s a good idea to set this property when you implement a custom task, it’s important -to note that the use of this property is a convenience, and should not be relied -upon within the ResearchKit framework.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  requestedPermissions -

- -
-
- -
- - -
-

The set of access permissions required for the step. (read-only)

-
- - - -
@property (nonatomic, readonly) ORKPermissionMask requestedPermissions
- - - - - - - - - -
-

Discussion

-

The permission mask is used by the task view controller to determine the types of -access to request from users when they complete the initial instruction steps -in a task. If your step requires access to APIs that limit access, include -the permissions you require in this mask.

- -

By default, the property scans the recorders and collates the permissions -required by the recorders. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

  requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

The set of HealthKit types the step requests for reading. (read-only)

-
- - - -
@property (nonatomic, readonly, nullable) NSSet<HKObjectType*> *requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

The task view controller uses this set of types when constructing a list of -all the HealthKit types required by all the steps in a task, so that it can -present the HealthKit access dialog just once during that task.

- -

By default, the property scans the recorders and collates the HealthKit -types the recorders require. Subclasses may override this implementation.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– stepViewControllerClass -

- -
-
- -
- - - - -
- (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– instantiateStepViewControllerWithResult: -

- -
-
- -
- - -
-

Instantiates a step view controller for this class.

-
- - - -
- (ORKStepViewController *)instantiateStepViewControllerWithResult:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - -
result

The result associated with this step

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - -
-

Discussion

-

This method is called when a step is about to be presented. The default implementation returns -a view controller that is appropriate to this step by allocating an instance of ORKStepViewController -using the stepViewControllerClass method and initializing that instance by calling initWithIdentifier:result: -on the provided ORKStepViewController class instance.

- -

Override this method if you need to customize the behavior before presenting the step or if -the view controller is presented using a nib or storyboard.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Extension Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - -
-

Returns the class that the task view controller should instantiate to display -this step.

-
- - - -
+ (Class)stepViewControllerClass
- - - - - - - - - -
-

Discussion

-

This method is used within the framework so that steps can define their -step view controller pairing.

- -

Outside the framework, developers should instantiate the required view -controller in their task view controller delegate to override the task -view controller’s default.

-
- - - - - - - -
-

Declared In

-

ORKStep_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepModifier.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepModifier.html deleted file mode 100644 index 9dfb1b925b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepModifier.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - ORKStepModifier Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStepModifier Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKStepNavigationRule.h
ORKStepNavigationRule.m
- - - - -
- -

Overview

-

The ORKStepModifier class is an abstract base class for an object that can be used to modify a step -if a given navigation rule is matched.

- -

Step modifiers can be used within an ORKNavigableOrderedTask object. You assign step modifiers -to be triggered after a task step is shown. Each step can have one step modifier at most.

-
- - - - - -
- - - - - - -
-
- -

– modifyStep:withTaskResult: -

- -
-
- -
- - -
-

Modify the steps for a task.

-
- - - -
- (void)modifyStep:(ORKStep *)step withTaskResult:(ORKTaskResult *)taskResult
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step that is associated with this modifier

taskResult

The current task result

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepNavigationRule.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepNavigationRule.html deleted file mode 100644 index 81bff57d35..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepNavigationRule.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - ORKStepNavigationRule Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStepNavigationRule Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKStepNavigationRule.h
ORKStepNavigationRule.m
- - - - -
- -

Overview

-

The ORKStepNavigationRule class is the abstract base class for concrete step navigation rules.

- -

Step navigation rules can be used within an ORKNavigableOrderedTask object. You assign step -navigation rules to be triggered by the task steps. Each step can have one rule at most.

- -

Subclasses must implement the identifierForDestinationStepWithTaskResult: method, which returns -the identifier of the destination step for the rule.

- -

Two concrete subclasses are included: ORKPredicateStepNavigationRule can match any answer -combination in the results of the ongoing task and jump accordingly; ORKDirectStepNavigationRule -unconditionally navigates to the step specified by the destination step identifier.

-
- - - - - -
- - - - - - -
-
- -

– identifierForDestinationStepWithTaskResult: -

- -
-
- -
- - -
-

Returns the target step identifier.

-
- - - -
- (NSString *)identifierForDestinationStepWithTaskResult:(ORKTaskResult *)taskResult
- - - -
-

Parameters

- - - - - - - -
taskResult

The up-to-date task result, used for calculating the destination step.

-
- - - -
-

Return Value

-

The identifier of the destination step.

-
- - - - - -
-

Discussion

-

Subclasses must implement this method to calculate the next step based on the passed task result. -The ORKNullStepIdentifier constant can be returned to indicate that the ongoing task should end -after the step navigation rule is triggered.

-
- - - - - - - -
-

Declared In

-

ORKStepNavigationRule.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepResult.html deleted file mode 100644 index 2e130be61e..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepResult.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - ORKStepResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStepResult Class Reference

- - -
- - - - - - - -
Inherits fromORKCollectionResult : ORKResult : NSObject
Declared inORKCollectionResult.h
ORKCollectionResult.m
- - - - -
- -

Overview

-

The ORKStepResult class represents a collection result produced by a step view controller to -hold all child results produced by the step.

- -

A step result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

- -

For example, an ORKQuestionStep object produces an ORKQuestionResult object that becomes -a child of the ORKStepResult object. Similarly, an ORKActiveStep object may produce individual -child result objects for each of the recorder configurations that was active -during that step.

- -

The results property of the ORKCollectionResult object contains the step results -for the task.

-
- - - - - -
- - - - - - -
-
- -

– initWithStepIdentifier:results: -

- -
-
- -
- - -
-

Returns an initialized step result using the specified identifier.

-
- - - -
- (instancetype)initWithStepIdentifier:(NSString *)stepIdentifier results:(nullable NSArray<ORKResult*> *)results
- - - -
-

Parameters

- - - - - - - - - - - - -
stepIdentifier

The identifier of the step.

results

The array of child results. The value of this parameter can be nil or empty -if no results were collected.

-
- - - -
-

Return Value

-

An initialized step result.

-
- - - - - - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
- -

  enabledAssistiveTechnology -

- -
-
- -
- - -
-

This property indicates whether the Voice Over or Switch Control assistive technologies were active -while performing the corresponding step.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSString *enabledAssistiveTechnology
- - - - - - - - - -
-

Discussion

-

This information can be used, for example, to take into consideration the extra time needed by -handicapped participants to complete some tasks, such as the Tower of Hanoi activity.

- -

The property can have the following values: -- UIAccessibilityNotificationVoiceOverIdentifier if Voice Over was active -- UIAccessibilityNotificationSwitchControlIdentifier if Switch Control was active

- -

Note that the Voice Over and Switch Control assistive technologies are mutually exclusive.

- -

If the property is nil, none of these assistive technologies was used.

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepViewController.html deleted file mode 100644 index b3c6a99139..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStepViewController.html +++ /dev/null @@ -1,1132 +0,0 @@ - - - - - - ORKStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromUIViewController
Declared inORKStepViewController.h
ORKStepViewController.m
- - - - -
- -

Overview

-

The ORKStepViewController class is a base class for view controllers that are -presented by an ORKTaskViewController object for the steps in a task.

- -

In the ResearchKit framework, each step collects some information or data from the user. -Typically, the task view controller instantiates the step view controller -before presenting the next step (ORKStep) in the task.

- -

When you create a new type of step, you usually have to subclass -ORKStepViewController to manage the step. For examples of subclasses, see -ORKQuestionStepViewController and ORKFormStepViewController. In contrast, the view -controller for an active step is typically a subclass of ORKActiveStepViewController, -because active steps include the concept of life cycle.

- -

If you are simply trying to change some of the runtime behaviors of ORKStepViewController, -it’s usually not necessary to subclass it. Instead, implement the -[ORKTaskViewControllerDelegate taskViewController:stepViewControllerWillAppear:] method in -the ORKTaskViewControllerDelegate protocol, and modify the appropriate properties -of the step view controller. For example, to change the title of the Learn More -or Next buttons, set the learnMoreButtonTitle or continueButtonTitle -properties in your implementation of this delegate method.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(nullable ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– initWithStep:result: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step to be presented.

result

The current step result for this step.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  step -

- -
-
- -
- - -
-

The step presented by the step view controller.

-
- - - -
@property (nonatomic, strong, nullable) ORKStep *step
- - - - - - - - - -
-

Discussion

-

If you use a storyboard to initialize the step view controller, initWithStep: isn’t called, -so you need to set the step property directly before the step view controller is presented.

- -

Setting the value of step after the controller has been presented is an error that -generates an exception. -Modifying the value of step after the controller has been presented is an error that -has undefined results.

- -

Subclasses that override the setter of this property must call super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  delegate -

- -
-
- -
- - -
-

The delegate of the step view controller.

-
- - - -
@property (nonatomic, weak, nullable) id<ORKStepViewControllerDelegate> delegate
- - - - - - - - - -
-

Discussion

-

The delegate is usually the ORKTaskViewController object that presents the step view -controller. If you need to intercept the delegate methods, you can -assign an intermediary object as the delegate and forward the messages -to the task view controller.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  continueButtonTitle -

- -
-
- -
- - -
-

A localized string that represents the title of the Continue button.

-
- - - -
@property (nonatomic, copy, nullable) NSString *continueButtonTitle
- - - - - - - - - -
-

Discussion

-

Most steps display a button that enables forward navigation. This button can have titles -such as Next, Continue, or Done. Use this property to override the forward navigation -button title for the step.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  learnMoreButtonTitle -

- -
-
- -
- - -
-

A localized string that represents the title of the Learn More button.

-
- - - -
@property (nonatomic, copy, nullable) NSString *learnMoreButtonTitle
- - - - - - - - - -
-

Discussion

-

Many steps have a button that lets users view more information about the -step than can fit on the screen. Use this property to override the title -of the Learn More button for the step.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  skipButtonTitle -

- -
-
- -
- - -
-

A localized string that represents the title of the “Skip” button.

-
- - - -
@property (nonatomic, copy, nullable) NSString *skipButtonTitle
- - - - - - - - - -
-

Discussion

-

Many steps are optional and can be skipped. Set this property to override -the title of the Skip button for the step. Note that setting this property -has no effect if the Skip button is not visible, which is the case in a required question step.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  backButtonItem -

- -
-
- -
- - -
-

The back button item.

-
- - - -
@property (nonatomic, strong, nullable) UIBarButtonItem *backButtonItem
- - - - - - - - - -
-

Discussion

-

The back button item controls the Back button displayed in the navigation bar when -the step view controller is current. -This property lets you control the appearance and target of the -Back button at runtime.

- -

When the value of the property is nil, the Back button is not displayed; otherwise, the title, target, -and action associated with the Back button item are used (other properties of UIBarButtonItem -are ignored).

- -

The back button item is updated during view loading and when the value of the step property -is changed, but they are safe to set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  cancelButtonItem -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
@property (nonatomic, strong, nullable) UIBarButtonItem *cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
@property (nonatomic, copy, readonly, nullable) ORKStepResult *result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– addResult: -

- -
-
- -
- - -
-

Add a result to the step view controller’s ORKStepResult. By default, the property for -the step view controller’s result will instantiate a copy of the result each time it is -called. Therefore, the result cannot be mutated by adding a result to its result array.

-
- - - -
- (void)addResult:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - -
result

The result to add to the step results.

-
- - - - - - - -
-

Discussion

-

This method can be called by a delegate to add a result to a given step in a way that will -be retained by the step.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– hasPreviousStep -

- -
-
- -
- - -
-

Returns a Boolean value indicating whether there is a previous step.

-
- - - -
- (BOOL)hasPreviousStep
- - - - - -
-

Return Value

-

YES if there is a previous step; otherwise, NO.

-
- - - - - -
-

Discussion

-

This method is a convenience accessor that subclasses can call to make a delegate callback to -determine whether a previous step exists. Subclasses can also override this method if the step -view controller should always behave as if backward navigation is disabled.

- -

See also: stepViewControllerHasPreviousStep:

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– hasNextStep -

- -
-
- -
- - -
-

Returns a Boolean value indicating whether there is a next step.

-
- - - -
- (BOOL)hasNextStep
- - - - - -
-

Return Value

-

YES if there is a next step; otherwise, NO.

-
- - - - - -
-

Discussion

-

This method is a convenience method that subclasses can call to make a delegate callback to -determine whether a next step exists.

- -

See also: stepViewControllerHasNextStep:

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  taskViewController -

- -
-
- -
- - -
-

The presenting task view controller. (read-only)

-
- - - -
@property (nonatomic, weak, readonly, nullable) ORKTaskViewController *taskViewController
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– goForward -

- -
-
- -
- - -
-

Navigates forward to the next step.

-
- - - -
- (void)goForward
- - - - - - - - - -
-

Discussion

-

When a user taps a Next button, the information passes through this method. You can use this method as an override -point or a target action for a subclass.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– goBackward -

- -
-
- -
- - -
-

Navigates backward to the previous step.

-
- - - -
- (void)goBackward
- - - - - - - - - -
-

Discussion

-

When a user taps the Back button, the information passes through this method. You can use this method as an override -point or a target action for a subclass.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– skipForward -

- -
-
- -
- - -
-

This method is called when the user taps the skip button. By default, it calls goForward.

-
- - - -
- (void)skipForward
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

  hasBeenPresented -

- -
-
- -
- - -
-

A Boolean value indicating whether the view controller has been presented before.

-
- - - -
@property (nonatomic, readonly) BOOL hasBeenPresented
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStreamingAudioRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStreamingAudioRecorder.html deleted file mode 100644 index d0f9a9192b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStreamingAudioRecorder.html +++ /dev/null @@ -1,474 +0,0 @@ - - - - - - ORKStreamingAudioRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStreamingAudioRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKStreamingAudioRecorder.h
ORKStreamingAudioRecorder.m
- - - - -
- -

Overview

-

The ORKStreamingAudioRecorder class represents a recorder that uses the app’s -AVAudioSession object to record audio.

- -

To audio recording will be discontinued if task enters the background.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:step:outputDirectory: -

- -
-
- -
- - -
-

Returns an initialized audio recorder using the specified step, and output directory.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier step:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The unique identifier of the recorder (assigned by the recorder configuration).

step

The step that requested this recorder.

outputDirectory

The directory in which the audio output should be stored.

-
- - - -
-

Return Value

-

An initialized audio recorder.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStreamingAudioRecorder.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– isRecording -

- -
-
- -
- - -
-

A Boolean value indicating whether the recorder is currently recording.

-
- - - -
- (BOOL)isRecording
- - - - - -
-

Return Value

-

YES if the recorder is recording; otherwise, NO.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  audioEngine -

- -
-
- -
- - -
-

Reference to the audio recorder being used.

-
- - - -
@property (nonatomic, strong, readonly, nullable) AVAudioEngine *audioEngine
- - - - - - - - - -
-

Discussion

-

The value of this property is used in the audio task in order to display recorded volume and metering in real time during the task.

-
- - - - - - - -
-

Declared In

-

ORKStreamingAudioRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStreamingAudioRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStreamingAudioRecorderConfiguration.html deleted file mode 100644 index 4a41e41e53..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStreamingAudioRecorderConfiguration.html +++ /dev/null @@ -1,385 +0,0 @@ - - - - - - ORKStreamingAudioRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStreamingAudioRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKRecorder.h
ORKStreamingAudioRecorder.m
- - - - -
- -

Overview

-

The ORKStreamingAudioRecorderConfiguration class represents a configuration that records streaming -audio data during an active step.

- -

An ORKStreamingAudioRecorderConfiguration generates an ORKStreamingAudioRecorder object.

- -

To use a recorder, include its configuration in the recorderConfigurations property -of an ORKActiveStep object, include that step in a task, and present it with -a task view controller.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized audio recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized audio recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new audio recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the audio recorder configuration.

-
- - - -
-

Return Value

-

A new audio recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– requestedPermissionMask -

- -
-
- -
- - -
-

Returns the permission mask indicating the permissions required for this configuration.

-
- - - -
- (ORKPermissionMask)requestedPermissionMask
- - - - - - - - - -
-

Discussion

-

This method is typically overridden in new recorder configuration subclasses.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopResult.html deleted file mode 100644 index 560b5e9a37..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopResult.html +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - ORKStroopResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStroopResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKStroopResult.h
ORKStroopResult.m
- - - - -
- -

Overview

-

The ORKStroopResult class represents the result of a single successful attempt within an ORKStroopStep.

- -

A stroop result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize the sample for transmission to a server or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  startTime -

- -
-
- -
- - -
-

The startTime property is equal to the start time of the each step.

-
- - - -
@property (nonatomic, assign) NSTimeInterval startTime
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStroopResult.h

-
- - -
-
-
- -

  endTime -

- -
-
- -
- - -
-

The endTime property is equal to the timestamp when user answers a particular step by selecting a color.

-
- - - -
@property (nonatomic, assign) NSTimeInterval endTime
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStroopResult.h

-
- - -
-
-
- -

  color -

- -
-
- -
- - -
-

The color property is the color of the question string.

-
- - - -
@property (nonatomic, copy) NSString *color
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStroopResult.h

-
- - -
-
-
- -

  text -

- -
-
- -
- - -
-

The text property is the text of the question string.

-
- - - -
@property (nonatomic, copy) NSString *text
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStroopResult.h

-
- - -
-
-
- -

  colorSelected -

- -
-
- -
- - -
-

The colorSelected corresponds to the button tapped by the user as an answer.

-
- - - -
@property (nonatomic, copy, nullable) NSString *colorSelected
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStroopResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopStep.html deleted file mode 100644 index 6350af7a2b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopStep.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - ORKStroopStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStroopStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKStroopStep.h
ORKStroopStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopStepViewController.html deleted file mode 100644 index 08bb48ec43..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKStroopStepViewController.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - ORKStroopStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStroopStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKStroopStepViewController.h
ORKStroopStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSubheadlineLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSubheadlineLabel.html deleted file mode 100644 index c52a9fa1d1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKSubheadlineLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKSubheadlineLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSubheadlineLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKSubheadlineLabel.h
ORKSubheadlineLabel.m
- - - - -
- -

Overview

-

Step’s details text under title.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableStep.html deleted file mode 100644 index c7dc134f43..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableStep.html +++ /dev/null @@ -1,698 +0,0 @@ - - - - - - ORKTableStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTableStep Class Reference

- - -
- - - - - - - - - - -
Inherits fromORKStep : NSObject
Conforms toORKTableStepSource
Declared inORKTableStep.h
ORKTableStep.m
- - - - -
- -

Overview

-

The ORKTableStep class is a concrete subclass of ORKStep, used for presenting a list of model -objects in a UITableView.

- -

To use ORKTableStep, instantiate the object, fill in its properties, and include it -in a task. Next, create a task view controller for the task and present it.

- -

The base class implementation will instatiate a read-only ORKTableStepViewController to display -the list of items using UITableViewCell with the text set to the -description for each item in -the items array.

- -

Customization can be handled by overriding the base class implementations in either ORKTableStep -or ORKTableStepViewController.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  items -

- -
-
- -
- - -
-

The array of items in table. These items must conform to NSCopying and NSSecureCoding protocols.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<id<NSObject,NSCopying,NSSecureCoding> > *items
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

  isBulleted -

- -
-
- -
- - -
-

Boolean flag representing if the table data should be displayed in a bulleted format.

-
- - - -
@property (nonatomic) BOOL isBulleted
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

  bulletIconNames -

- -
-
- -
- - -
-

The array of icon names to display instead of bullets.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<NSString*> *bulletIconNames
- - - - - - - - - -
-

Discussion

-

Images are only visible if the isBulleted property is set to YES. Images names must reference -images in you application project not the ResearchKit framework.

-
- - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– numberOfSections -

- -
-
- -
- - -
-

Returns the number of sections in the tableview used to display this step. Default = 1.

-
- - - -
- (NSInteger)numberOfSections
- - - - - -
-

Return Value

-

The number of sections in the tableview.

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– numberOfRowsInSection: -

- -
-
- -
- - -
-

Returns the number of rows in the section. Default = items.count

-
- - - -
- (NSInteger)numberOfRowsInSection:(NSInteger)section
- - - -
-

Parameters

- - - - - - - -
section

The section of the table

-
- - - -
-

Return Value

-

The number of rows in the tableview section

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– objectForRowAtIndexPath: -

- -
-
- -
- - -
-

Returns the model object for this section/row. Default = items[indexPath.row]

-
- - - -
- (id<NSObject,NSCopying,NSSecureCoding>)objectForRowAtIndexPath:(NSIndexPath *)indexPath
- - - -
-

Parameters

- - - - - - - -
indexPath

The indexpath of the section/row for the cell

-
- - - -
-

Return Value

-

The model object for this section/row

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– reuseIdentifierForRowAtIndexPath: -

- -
-
- -
- - -
-

Returns the reuseIdentifier for the object at this index path. Default = ORKBasicCellReuseIdentifier

-
- - - -
- (NSString *)reuseIdentifierForRowAtIndexPath:(NSIndexPath *)indexPath
- - - -
-

Parameters

- - - - - - - -
indexPath

The indexpath of the section/row for the cell

-
- - - -
-

Return Value

-

The model object for this section/row

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– registerCellsForTableView: -

- -
-
- -
- - -
-

Optional override for registering UITableViewCell instances. The default registers for ORKBasicCellReuseIdentifier.

-
- - - -
- (void)registerCellsForTableView:(UITableView *)tableView
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– configureCell:indexPath:tableView: -

- -
-
- -
- - -
-

Optional override for configuring a cell. The default will set the text label using the object description for -the object at a given index path.

-
- - - -
- (void)configureCell:(UITableViewCell *)cell indexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableStepViewController.html deleted file mode 100644 index c6962ef3bc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableStepViewController.html +++ /dev/null @@ -1,480 +0,0 @@ - - - - - - ORKTableStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTableStepViewController Class Reference

- - -
- - - - - - - - - - -
Inherits fromORKStepViewController : UIViewController
Conforms toUITableViewDataSource
UITableViewDelegate
Declared inORKTableStepViewController.h
ORKTableStepViewController.m
- - - - -
- -

Overview

-

The ORKTableStepViewController class is an base class that inherits from ORKStepViewController -and provides a UITableView.

- -

ORKTableStepViewController is designed to take advantage of the internal class methods -used by ORKFormStepViewController, ORKQuestionStepViewController and ORKReviewStepViewController -to allow for a consistent UI in a custom implementation of a main view that is a UITableView.

- -

This will class will setup a consistent look for the title, text, learn more, skip and next UI elements -that are used by these classes as well as most of the other view controllers within this framework by -automatically adding them as the header and footer of the tableview.

- -

The base class implementation REQUIRES using an ORKTableStep as its data source. If you do not inherit -the step from ORKTableStep, then subclasses MUST override -cellForRowAtIndexPath.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  tableStep -

- -
-
- -
- - -
-

The step associated with this view controller if it conforms to ORKTableStepSource.

-
- - - -
@property (nonatomic, readonly, nullable) id<ORKTableStepSource> tableStep
- - - - - -
-

Return Value

-

The step associated with this view controller if it conforms to ORKTableStepSource.

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStepViewController.h

-
- - -
-
-
- -

  tableView -

- -
-
- -
- - -
-

The table view managed by the controller object.

-
- - - -
@property (nonatomic, readonly) UITableView *tableView
- - - - - -
-

Return Value

-

The table view managed by the controller object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStepViewController.h

-
- - -
-
-
- -

– continueButtonEnabled -

- -
-
- -
- - -
-

Whether or not the continue button should be enabled for this step. Default = YES

-
- - - -
- (BOOL)continueButtonEnabled
- - - - - -
-

Return Value

-

State of continue button

-
- - - - - -
-

Discussion

-

Set to NO if there is a validation that needs to be handled before the step -can progress. Your implementation is responsible for overriding selection as needed -to trigger validation and state changes.

-
- - - - - - - -
-

Declared In

-

ORKTableStepViewController.h

-
- - -
-
-
- -

– updateButtonStates -

- -
-
- -
- - -
-

Update the button state for the skip and continue buttons

-
- - - -
- (void)updateButtonStates
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTableStepViewController.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- - - -

Extension Methods

- -
-
- -

  tableViewStyle -

- -
-
- -
- - -
-

The style to use for the tableView. default = UITableViewStyleGrouped if more than one section -and UITableViewStylePlain if there is only 1 section.

-
- - - -
@property (nonatomic, readonly) UITableViewStyle tableViewStyle
- - - - - -
-

Return Value

-

The style to use for the tableView. default = UITableViewStyleGrouped if more than one section -and UITableViewStylePlain if there is only 1 section.

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStepViewController_Internal.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableViewCell.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableViewCell.html deleted file mode 100644 index 0dfce634ea..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTableViewCell.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKTableViewCell Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTableViewCell Class Reference

- - -
- - - - - - - -
Inherits fromUITableViewCell
Declared inORKTableViewCell.h
ORKTableViewCell.m
- - - - -
- -

Overview

-

Base class, not being used directly.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTapCountLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTapCountLabel.html deleted file mode 100644 index 453c7c4a74..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTapCountLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKTapCountLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTapCountLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKTapCountLabel.h
ORKTapCountLabel.m
- - - - -
- -

Overview

-

Display tapping count in tapping interval active task

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalResult.html deleted file mode 100644 index 45a92e17a0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalResult.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - ORKTappingIntervalResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTappingIntervalResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKTappingIntervalResult.h
ORKTappingIntervalResult.m
- - - - -
- -

Overview

-

The ORKTappingIntervalResult class records the results of a tapping interval test.

- -

The tapping interval result object records an array of touch samples (one for each tap) and also the geometry of the -task at the time it was displayed. You can use the information in the object for reference in interpreting the touch -samples.

- -

A tapping interval sample is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  samples -

- -
-
- -
- - -
-

An array of collected samples, in which each item is an ORKTappingSample object that represents a -tapping event.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKTappingSample*> *samples
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
- -

  stepViewSize -

- -
-
- -
- - -
-

The size of the bounds of the step view containing the tap targets.

-
- - - -
@property (nonatomic) CGSize stepViewSize
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
- -

  buttonRect1 -

- -
-
- -
- - -
-

The frame of the left button, in points, relative to the step view bounds.

-
- - - -
@property (nonatomic) CGRect buttonRect1
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
- -

  buttonRect2 -

- -
-
- -
- - -
-

The frame of the right button, in points, relative to the step view bounds.

-
- - - -
@property (nonatomic) CGRect buttonRect2
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalStep.html deleted file mode 100644 index 84505d6960..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalStep.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - ORKTappingIntervalStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTappingIntervalStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKTappingIntervalStep.h
ORKTappingIntervalStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalStepViewController.html deleted file mode 100644 index 64292afb0c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingIntervalStepViewController.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - ORKTappingIntervalStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTappingIntervalStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKTappingIntervalStepViewController.h
ORKTappingIntervalStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingSample.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingSample.html deleted file mode 100644 index 588fc45fc9..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTappingSample.html +++ /dev/null @@ -1,348 +0,0 @@ - - - - - - ORKTappingSample Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTappingSample Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKTappingIntervalResult.h
ORKTappingIntervalResult.m
- - - - -
- -

Overview

-

The ORKTappingSample class represents a single tap on a button.

- -

The tapping sample object records the location of the tap, the -button that was tapped, and the time at which the event occurred. A tapping sample is -included in an ORKTappingIntervalResult object, and is recorded by the -step view controller for the corresponding task when a tap is -recognized.

- -

A tapping sample is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize the sample for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  timestamp -

- -
-
- -
- - -
-

A relative timestamp indicating the time of the tap event.

-
- - - -
@property (nonatomic, assign) NSTimeInterval timestamp
- - - - - - - - - -
-

Discussion

-

The timestamp is relative to the value of startDate in the ORKResult object that includes this -sample.

-
- - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
- -

  duration -

- -
-
- -
- - -
-

A duration of the tap event.

-
- - - -
@property (nonatomic, assign) NSTimeInterval duration
- - - - - - - - - -
-

Discussion

-

The duration store time interval between touch down and touch release events.

-
- - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
- -

  buttonIdentifier -

- -
-
- -
- - -
-

An enumerated value that indicates which button was tapped, if any.

-
- - - -
@property (nonatomic, assign) ORKTappingButtonIdentifier buttonIdentifier
- - - - - - - - - -
-

Discussion

-

If the value of this property is ORKTappingButtonIdentifierNone, it indicates that the tap -was near, but not inside, one of the target buttons.

-
- - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
- -

  location -

- -
-
- -
- - -
-

The location of the tap within the step’s view.

-
- - - -
@property (nonatomic, assign) CGPoint location
- - - - - - - - - -
-

Discussion

-

The location coordinates are relative to a rectangle whose size corresponds to -the stepViewSize in the enclosing ORKTappingIntervalResult object.

-
- - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTaskResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTaskResult.html deleted file mode 100644 index 5623e0fa74..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTaskResult.html +++ /dev/null @@ -1,404 +0,0 @@ - - - - - - ORKTaskResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTaskResult Class Reference

- - -
- - - - - - - - - - -
Inherits fromORKCollectionResult : ORKResult : NSObject
Conforms toORKTaskResultSource
Declared inORKCollectionResult.h
ORKCollectionResult.m
- - - - -
- -

Overview

-

An ORKTaskResult object is a collection result that contains all the step results -generated from one run of a task or ordered task (that is, ORKTask or ORKOrderedTask) in a task view controller.

- -

A task result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

- -

The results property of the ORKCollectionResult object contains the step results -for the task.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithTaskIdentifier:taskRunUUID:outputDirectory: -

- -
-
- -
- - -
-

Returns an intialized task result using the specified identifiers and directory.

-
- - - -
- (instancetype)initWithTaskIdentifier:(NSString *)identifier taskRunUUID:(NSUUID *)taskRunUUID outputDirectory:(nullable NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The identifier of the task that produced this result.

taskRunUUID

The UUID of the run of the task that produced this result.

outputDirectory

The directory in which any files referenced by results can be found.

-
- - - -
-

Return Value

-

An initialized task result.

-
- - - - - - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
- -

  taskRunUUID -

- -
-
- -
- - -
-

A unique identifier (UUID) for the presentation of the task that generated -the result.

-
- - - -
@property (nonatomic, copy, readonly) NSUUID *taskRunUUID
- - - - - - - - - -
-

Discussion

-

The unique identifier for a run of the task typically comes directly -from the task view controller that was used to run the task.

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
- -

  outputDirectory -

- -
-
- -
- - -
-

The directory in which the generated data files were stored while the task was run.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSURL *outputDirectory
- - - - - - - - - -
-

Discussion

-

The directory comes directly from the task view controller that was used to run this -task. Generally, when archiving the results of a task, it is useful to archive -all the files found in the output directory.

- -

The file URL also prefixes the file URLs referenced in any child -ORKFileResult objects.

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– stepResultForStepIdentifier: -

- -
-
- -
- - -
-

Returns a step result for the specified step identifier, if one exists.

-
- - - -
- (ORKStepResult *)stepResultForStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - -
stepIdentifier

The identifier for which to search.

-
- - - -
-

Return Value

-

The result for the specified step, or nil for none.

-
- - - - - -
-

Discussion

-

When it’s about to present a step, the task view controller needs to look up a -suitable default answer. The answer can be used to prepopulate a survey with -the results obtained on a previous run of the same task, by passing an -ORKTaskResult object (which itself implements this protocol).

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTaskViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTaskViewController.html deleted file mode 100644 index e75df15b54..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTaskViewController.html +++ /dev/null @@ -1,1764 +0,0 @@ - - - - - - ORKTaskViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTaskViewController Class Reference

- - -
- - - - - - - - - - -
Inherits fromUIViewController
Conforms toORKStepViewControllerDelegate
UIViewControllerRestoration
Declared inORKTaskViewController.h
ORKTaskViewController.m
- - - - -
- -

Overview

-

The ORKTaskViewController class is the primary entry point for the presentation of the -ResearchKit framework UI. Note that a task view controller usually presents an ORKOrderedTask instance, but it can present any object that implements ORKTask.

- -

The task view controller is intended for modal presentation, which lets the user cancel participation in the task at any time. Typically, the task view -controller displays a navigation bar and conducts right-to-left -navigation for each step as the user progresses through the task.

- -

The task view controller supports UI state restoration, which allows users to continue a long task when they resume your app. To enable state restoration, set the restoration -identifier and take the appropriate action to restore the task view controller when your app restarts or resumes.

- -

The task view controller also lets users save their progress in the middle of a task. To support -this scenario in your app, implement [ORKTaskViewControllerDelegate taskViewControllerSupportsSaveAndRestore:] in your -task view controller delegate, and return YES. If the task completes with the -status ORKTaskViewControllerFinishReasonSaved, copy and store the value of the -restorationData property. When the user resumes the task, create a -new task view controller using the initWithTask:restorationData: initializer, -and present it.

- -

It is possible to configure the task view controller to prefill surveys with -data from another source, such as a previous run of the same task. -Set the defaultResultSource property to use this feature.

- -

When conducting active tasks which may produce file results, always set the -outputDirectory property. Files generated during active steps are written to -the output directory that you specify, and references to these files are returned by ORKFileResult -objects in the result hierarchy.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithNibName:bundle: -

- -
-
- -
- - -
-

Returns a newly initialized task view controller using the nib file in the specified bundle.

-
- - - -
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- - - -
-

Parameters

- - - - - - - - - - - - -
nibNameOrNil

The name of the nib file from which to instantiate the task view controller.

nibBundleOrNil

The name of the bundle in which to search for the nib file.

-
- - - -
-

Return Value

-

A new task view controller.

-
- - - - - -
-

Discussion

-

This method is a designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new task view controller initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

The coder from which to initialize the task view controller.

-
- - - -
-

Return Value

-

A new task view controller.

-
- - - - - -
-

Discussion

-

This method lets you instantiate a task view controller from a storyboard, although this is an atypical use case. This method is a designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– initWithTask:taskRunUUID: -

- -
-
- -
- - -
-

Returns a newly initialized task view controller.

-
- - - -
- (instancetype)initWithTask:(id<ORKTask>)task taskRunUUID:(NSUUID *)taskRunUUID
- - - -
-

Parameters

- - - - - - - - - - - - -
task

The task to be presented.

taskRunUUID

The UUID of this instance of the task. If nil, a new UUID is generated.

-
- - - -
-

Return Value

-

A new task view controller.

-
- - - - - -
-

Discussion

-

This method is the primary designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– initWithTask:restorationData:delegate: -

- -
-
- -
- - -
-

Creates a new task view controller from the specified restoration data.

-
- - - -
- (instancetype)initWithTask:(id<ORKTask>)task restorationData:(NSData *)data delegate:(id<ORKTaskViewControllerDelegate>)delegate
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
task

The task to be presented.

data

Data obtained from the restorationData property of a previous - task view controller instance.

delegate

The delegate for the task view controller.

-
- - - -
-

Return Value

-

A new task view controller.

-
- - - - - -
-

Discussion

-

Call this method to restart a task when you have restoration data stored for a -previous run of the task, in which the user canceled their current task and saved their progress.

- -

This method restores the presentation of the task to the point at which the user stopped. -If the restoration data is not valid, an exception may be thrown.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskRunUUID -

- -
-
- -
- - -
-

A unique identifier (UUID) for this presentation of the task.

-
- - - -
- (NSUUID *)taskRunUUID
- - - - - - - - - -
-

Discussion

-

The task run UUID is a unique identifier for this run of the task view controller. -All results produced by this instance are tagged with this UUID.

- -

The task run UUID is preserved across UI state restoration, or across task -save and restore.

Note: It is an error to set the value of taskRunUUID after the first time the task view controller -is presented.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the task result. (read-only)

-
- - - -
- (ORKTaskResult *)result
- - - - - - - - - -
-

Discussion

-

Use this property to obtain or inspect the results of the task. The results -are hierarchical; the children of result are ORKStepResult instances, -one for each step that the user visited during the task.

- -

If the user uses the Back button to go back through the steps, the -results of steps that are ahead of the currently visible step are not included -in the result.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– restorationData -

- -
-
- -
- - -
-

Snapshot data that can be used for future restoration.

-
- - - -
- (NSData *)restorationData
- - - - - - - - - -
-

Discussion

-

When the user taps Cancel during a task and selects the Save option, -the [ORKTaskViewControllerDelegate taskViewController:didFinishWithReason:error:] -method is called with ORKTaskViewControllerFinishReasonSaved. When that happens, -use restorationData to obtain restoration data that can be used to restore -the task at a later date.

- -

Use initWithTask:restorationData: to create a new task view controller that -restores the current state.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– suspend -

- -
-
- -
- - -
-

Suspends the task.

-
- - - -
- (void)suspend
- - - - - - - - - -
-

Discussion

-

Call this method to suspend an active step. To resume later, call -resume. Not all active steps will respond to suspend / resume, so test -thoroughly to verify correct behavior in your tasks.

- -

This method will disable any background audio prompt session, and suspend -any active step in progress.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController_Private.h

-
- - -
-
-
- -

– resume -

- -
-
- -
- - -
-

Resumes any current active step.

-
- - - -
- (void)resume
- - - - - - - - - -
-

Discussion

-

Call this method to force resuming an active step may call this -method. Should be paired with a call to suspend.

- -

This method re-enables background audio prompts, if needed, and resumes -any active step. If not in an active step, it has no effect.

- -

See also: suspend

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController_Private.h

-
- - -
-
-
- -

– goForward -

- -
-
- -
- - -
-

Forces navigation to the next step.

-
- - - -
- (void)goForward
- - - - - - - - - -
-

Discussion

-

Call this method to force forward navigation. This method is called by the framework -if the user takes an action that requires navigation, or if the step is timed -and the timer completes.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– goBackward -

- -
-
- -
- - -
-

Forces navigation to the previous step.

-
- - - -
- (void)goBackward
- - - - - - - - - -
-

Discussion

-

Call this method to force backward navigation. This method is called by the framework -if the user takes an action that requires backward navigation.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– stepViewControllerWillAppear: -

- -
-
- -
- - -
-

Tells the delegate that the step view controller’s view is about to appear.

-
- - - -
- (void)stepViewControllerWillAppear:(ORKStepViewController *)viewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - - - - - -
-

Discussion

-

This method is called from the step view controller’s viewWillAppear: method. -You can use this method to customize the appearance of the step view -controller without subclassing it.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewController:didFinishWithNavigationDirection: -

- -
-
- -
- - -
-

Tells the delegate when the user has done something that requires navigation, such as -tap the Back or a Next button, or enter a response to a nonoptional -survey question.

-
- - - -
- (void)stepViewController:(ORKStepViewController *)stepViewController didFinishWithNavigationDirection:(ORKStepViewControllerNavigationDirection)direction
- - - -
-

Parameters

- - - - - - - - - - - - -
stepViewController

The step view controller providing the callback.

direction

Direction of navigation requested.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerDidFail:withError: -

- -
-
- -
- - -
-

Tells the delegate when a step fails due to an error.

-
- - - -
- (void)stepViewControllerDidFail:(ORKStepViewController *)stepViewController withError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
stepViewController

The step view controller providing the callback.

error

The error detected.

-
- - - - - - - -
-

Discussion

-

A step view controller can use this method to report its failure to the task view controller. -The task view controller sends the error to its delegate indicating that the task has failed (using ORKTaskViewControllerFinishReasonFailed). -Note that recorder errors are reported by calling the ORKStepViewControllerDelegate method stepViewController:recorder:didFailWithError:.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerResultDidChange: -

- -
-
- -
- - -
-

Tells the delegate when a substantial change has occurred to the result.

-
- - - -
- (void)stepViewControllerResultDidChange:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - - - - - -
-

Discussion

-

The result is always available in the step view controller. Although the result is continuously changing -while the step view controller is active (because the time stamp in the result property is different each time it’s called), this method is called only when a substantive change -to the result occurs, such as when the user enters a survey answer or completes -an active step.

- -

In your implementation of this delegate method, you can collect the value of result from the step view controller.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerHasPreviousStep: -

- -
-
- -
- - -
-

Asks the delegate whether there is a previous step.

-
- - - -
- (BOOL)stepViewControllerHasPreviousStep:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - -
-

Return Value

-

YES if a Back button should be visible; otherwise, NO.

-
- - - - - -
-

Discussion

-

If there is a previous step, the step view controller adds a Back button to its -navigation item; if not, no Back button is added to the navigation item.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerHasNextStep: -

- -
-
- -
- - -
-

Asks the delegate whether there is a next step.

-
- - - -
- (BOOL)stepViewControllerHasNextStep:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - -
-

Return Value

-

YES if there is a step following the current one; otherwise, NO.

-
- - - - - -
-

Discussion

-

Depending on the result of the step, the step view controller can adjust the language for the -Next button.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewController:recorder:didFailWithError: -

- -
-
- -
- - -
-

Tells the delegate when a recorder error has been detected during the step.

-
- - - -
- (void)stepViewController:(ORKStepViewController *)stepViewController recorder:(ORKRecorder *)recorder didFailWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
stepViewController

The step view controller providing the callback.

recorder

The recorder that detected the error.

error

The error detected.

-
- - - - - - - -
-

Discussion

-

Recorder errors can occur during active steps, usually due to the -unavailability of sensor data or disk space in which to record results.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setNavigationBarHidden:animated: -

- -
-
- -
- - -
-

Shows or hides the navigation bar, with optional animation.

-
- - - -
- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated
- - - -
-

Parameters

- - - - - - - - - - - - -
hidden

YES to hide the navigation bar; otherwise, NO.

animated

YES to animate the show or hide operation; otherwise, NO.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– navigationBar -

- -
-
- -
- - -
-

The navigation bar for the task view controller. (read-only)

-
- - - -
- (UINavigationBar *)navigationBar
- - - - - - - - - -
-

Discussion

-

You can use this method to customize the appearance of the task view controller’s navigation bar.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  delegate -

- -
-
- -
- - -
-

The delegate for the task view controller.

-
- - - -
@property (nonatomic, weak, nullable) id<ORKTaskViewControllerDelegate> delegate
- - - - - - - - - -
-

Discussion

-

There are many optional methods in the task view controller protocol, but the delegate must support -completion. When the task view controller completes its task, it is the delegate’s -responsibility to dismiss it.

- -

See also: [ORKTaskViewControllerDelegate taskViewController:didFinishWithReason:error:].

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

  task -

- -
-
- -
- - -
-

The task for this task view controller.

-
- - - -
@property (nonatomic, strong, nullable) id<ORKTask> task
- - - - - - - - - -
-

Discussion

-

The task functions as the data source for an ORKTaskViewController object, providing -the steps that the user must complete in order to complete the task. -It is an error to change the task after presenting the task view controller.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

  defaultResultSource -

- -
-
- -
- - -
-

A source that the task view controller can consult to obtain default answers -for questions provided in question steps and form steps.

-
- - - -
@property (nonatomic, strong, nullable) id<ORKTaskResultSource> defaultResultSource
- - - - - - - - - -
-

Discussion

-

The source can provide default answers, perhaps based on previous runs of -the same task, which will be used to prefill question and form items. -For example, an ORKTaskResult object from a previous run of the task can function as -an ORKTaskResultSource object, because ORKTaskResult implements the protocol.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

  outputDirectory -

- -
-
- -
- - -
-

File URL for the directory in which to store generated data files.

-
- - - -
@property (nonatomic, copy, nullable) NSURL *outputDirectory
- - - - - - - - - -
-

Discussion

-

Active steps with recorders (and potentially other steps) can save data -to files during the progress of the task. This property specifies where such -data should be written. If no output directory is specified, active steps -that require writing data to disk, such as those with recorders, will typically -fail at runtime.

- -

In general, set this property after instantiating the task view -controller and before presenting it.

- -

Before presenting the view controller, set the outputDirectory property to specify a -path where files should be written when an ORKFileResult object must be returned for -a step.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

  showsProgressInNavigationBar -

- -
-
- -
- - -
-

A Boolean value indicating whether progress is shown in the navigation bar.

-
- - - -
@property (nonatomic, assign) BOOL showsProgressInNavigationBar
- - - - - - - - - -
-

Discussion

-

Setting this property to YES does not display progress if you don’t also implement the progress -method of ORKTask.

- -

The default value of this property is YES. To disable the display of progress in the navigation bar, set the value to NO.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

  currentStepViewController -

- -
-
- -
- - -
-

The current step view controller.

-
- - - -
@property (nonatomic, strong, readonly, nullable) ORKStepViewController *currentStepViewController
- - - - - - - - - -
-

Discussion

-

The task view controller instantiates and presents a series of step view -controllers. The current step view controller is the one that is currently -visible on screen.

- -

The value of this property may be nil if the task view controller has not yet been presented.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

  navigationBarHidden -

- -
-
- -
- - -
-

A Boolean value indicating whether the navigation bar is hidden.

-
- - - -
@property (nonatomic, getter=isNavigationBarHidden) BOOL navigationBarHidden
- - - - - - - - - -
-

Discussion

-

By default, the task view controller includes a visible navigation bar. To disable the display of the navigation bar, set this property to NO.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextAnswerFormat.html deleted file mode 100644 index 3c7ea8d93b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextAnswerFormat.html +++ /dev/null @@ -1,874 +0,0 @@ - - - - - - ORKTextAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTextAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKTextAnswerFormat class represents the answer format for questions that collect a text -response -from the user.

- -

An ORKTextAnswerFormat object produces an ORKTextQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithValidationRegularExpression:invalidMessage: -

- -
-
- -
- - -
-

Returns an initialized text answer format using the regular expression.

-
- - - -
- (instancetype)initWithValidationRegularExpression:(NSRegularExpression *)validationRegularExpression invalidMessage:(NSString *)invalidMessage
- - - -
-

Parameters

- - - - - - - - - - - - -
validationRegularExpression

The regular expression used to validate the text.

invalidMessage

The text presented to the user when invalid input is received.

-
- - - -
-

Return Value

-

An initialized validated text answer format.

-
- - - - - -
-

Discussion

-

This method is one of the designated initializers.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMaximumLength: -

- -
-
- -
- - -
-

Returns an initialized text answer format using the specified maximum string length.

-
- - - -
- (instancetype)initWithMaximumLength:(NSInteger)maximumLength
- - - -
-

Parameters

- - - - - - - -
maximumLength

The maximum number of characters to accept. When the value of this parameter - is 0, there is no maximum.

-
- - - -
-

Return Value

-

An initialized text answer format.

-
- - - - - -
-

Discussion

-

This method is one of the designated initializers.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  validationRegularExpression -

- -
-
- -
- - -
-

The regular expression used to validate user’s input.

-
- - - -
@property (nonatomic, copy, nullable) NSRegularExpression *validationRegularExpression
- - - - - - - - - -
-

Discussion

-

The default value is nil. If set to nil, no validation will be performed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  invalidMessage -

- -
-
- -
- - -
-

The text presented to the user when invalid input is received.

-
- - - -
@property (nonatomic, copy, nullable) NSString *invalidMessage
- - - - - - - - - -
-

Discussion

-

The default value is nil.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultTextAnswer -

- -
-
- -
- - -
-

The text to be used as an answer if user input is not mandatory.

-
- - - -
@property (nonatomic, copy, nullable) NSString *defaultTextAnswer
- - - - - - - - - -
-

Discussion

-

The default value is nil. If set to nil, user input is mandatory to answer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumLength -

- -
-
- -
- - -
-

The maximum length of the text users can enter.

-
- - - -
@property NSInteger maximumLength
- - - - - - - - - -
-

Discussion

-

When the value of this property is 0, there is no maximum.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  multipleLines -

- -
-
- -
- - -
-

A Boolean value indicating whether to expect more than one line of input.

-
- - - -
@property BOOL multipleLines
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is YES.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  autocapitalizationType -

- -
-
- -
- - -
-

The autocapitalization type that applies to the user’s input.

-
- - - -
@property UITextAutocapitalizationType autocapitalizationType
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is UITextAutocapitalizationTypeSentences.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  autocorrectionType -

- -
-
- -
- - -
-

The autocorrection type that applies to the user’s input.

-
- - - -
@property UITextAutocorrectionType autocorrectionType
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is UITextAutocorrectionTypeDefault.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  spellCheckingType -

- -
-
- -
- - -
-

The spell checking type that applies to the user’s input.

-
- - - -
@property UITextSpellCheckingType spellCheckingType
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is UITextSpellCheckingTypeDefault.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  keyboardType -

- -
-
- -
- - -
-

The keyboard type that applies to the user’s input.

-
- - - -
@property UIKeyboardType keyboardType
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is UIKeyboardTypeDefault.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  secureTextEntry -

- -
-
- -
- - -
-

Identifies whether the text object should hide the text being entered.

-
- - - -
@property (nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextButton.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextButton.html deleted file mode 100644 index 2e246ea9e4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextButton.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKTextButton Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTextButton Class Reference

- - -
- - - - - - - -
Inherits fromUIButton
Declared inORKTextButton.h
ORKTextButton.m
- - - - -
- -

Overview

-

“Skip” button or “Learn More” button.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextChoice.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextChoice.html deleted file mode 100644 index b49690c93a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextChoice.html +++ /dev/null @@ -1,573 +0,0 @@ - - - - - - ORKTextChoice Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTextChoice Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSObject
NSSecureCoding
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKTextChoice class defines the text for a choice in answer formats such -as ORKTextChoiceAnswerFormat and ORKValuePickerAnswerFormat.

- -

When a participant chooses a text choice item, the value recorded in a result -is specified by the value property.

-
- - - - - -
- - - - - - -
-
- -

+ choiceWithText:detailText:value:exclusive: -

- -
-
- -
- - -
-

Returns a text choice object that includes the specified primary text, detail text, -and exclusivity.

-
- - - -
+ (instancetype)choiceWithText:(NSString *)text detailText:(nullable NSString *)detailText value:(id<NSCopying,NSCoding,NSObject>)value exclusive:(BOOL)exclusive
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
text

The primary text that describes the choice in a localized string.

detailText

The detail text to display below the primary text, in a localized string.

value

The value to record in a result object when this item is selected.

exclusive

Whether this choice is to be considered exclusive within the set of choices.

-
- - - -
-

Return Value

-

A text choice instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

+ choiceWithText:value: -

- -
-
- -
- - -
-

Returns a choice object that includes the specified primary text.

-
- - - -
+ (instancetype)choiceWithText:(NSString *)text value:(id<NSCopying,NSCoding,NSObject>)value
- - - -
-

Parameters

- - - - - - - - - - - - -
text

The primary text that describes the choice in a localized string.

value

The value to record in a result object when this item is selected.

-
- - - -
-

Return Value

-

A text choice instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithText:detailText:value:exclusive: -

- -
-
- -
- - -
-

Returns an initialized text choice object using the specified primary text, detail text, -and exclusivity.

-
- - - -
- (instancetype)initWithText:(NSString *)text detailText:(nullable NSString *)detailText value:(id<NSCopying,NSCoding,NSObject>)value exclusive:(BOOL)exclusive
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
text

The primary text that describes the choice in a localized string.

detailText

The detail text to display below the primary text, in a localized string.

value

The value to record in a result object when this item is selected.

exclusive

Whether this choice is to be considered exclusive within the set of choices.

-
- - - -
-

Return Value

-

An initialized text choice.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  text -

- -
-
- -
- - -
-

The text that describes the choice in a localized string.

-
- - - -
@property (copy, readonly) NSString *text
- - - - - - - - - -
-

Discussion

-

In general, it’s best when the text can fit on one line.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  value -

- -
-
- -
- - -
-

The value to return when this choice is selected.

-
- - - -
@property (copy, readonly) id<NSCopying,NSCoding,NSObject> value
- - - - - - - - - -
-

Discussion

-

The value of this property is expected to be a scalar property list type, such as NSNumber -or NSString. If no value is provided, the index of the option in the options list in the -answer format is used.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  detailText -

- -
-
- -
- - -
-

The text that provides additional details about the choice in a localized string.

-
- - - -
@property (copy, readonly, nullable) NSString *detailText
- - - - - - - - - -
-

Discussion

-

The detail text can span multiple lines. Note that ORKValuePickerAnswerFormat ignores detail -text.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  exclusive -

- -
-
- -
- - -
-

In a multiple choice format, this indicates whether this choice requires all other choices to be -unselected.

-
- - - -
@property (readonly) BOOL exclusive
- - - - - - - - - -
-

Discussion

-

In general, this is used to indicate a “None of the above” choice.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextChoiceAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextChoiceAnswerFormat.html deleted file mode 100644 index a716d28339..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextChoiceAnswerFormat.html +++ /dev/null @@ -1,420 +0,0 @@ - - - - - - ORKTextChoiceAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTextChoiceAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKTextChoiceAnswerFormat class represents an answer format that lets participants choose -from a fixed set of text choices in a multiple or single choice question.

- -

The text choices are presented in a table view, using one row for each answer. -The text for each answer is given more prominence than the detailText in the row, but -both are shown.

- -

The text choice answer format produces an ORKChoiceQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithStyle:textChoices: -

- -
-
- -
- - -
-

Returns an initialized text choice answer format using the specified question style and array of -text choices.

-
- - - -
- (instancetype)initWithStyle:(ORKChoiceAnswerStyle)style textChoices:(NSArray<ORKTextChoice*> *)textChoices
- - - -
-

Parameters

- - - - - - - - - - - - -
style

The style of question, such as single or multiple choice.

textChoices

An array of ORKTextChoice objects.

-
- - - -
-

Return Value

-

An initialized text choice answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  style -

- -
-
- -
- - -
-

The style of the question (that is, single or multiple choice).

-
- - - -
@property (readonly) ORKChoiceAnswerStyle style
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  textChoices -

- -
-
- -
- - -
-

An array of ORKTextChoice objects that represent the choices that are displayed to participants.

-
- - - -
@property (copy, readonly) NSArray<ORKTextChoice*> *textChoices
- - - - - - - - - -
-

Discussion

-

The choices are presented as a table view, using one row for each answer. -The text for each answer is given more prominence than the detailText in the row, but -both are shown.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextFieldView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextFieldView.html deleted file mode 100644 index 5ef26e804c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextFieldView.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKTextFieldView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTextFieldView Class Reference

- - -
- - - - - - - -
Inherits fromUIView
Declared inORKTextFieldView.h
ORKTextFieldView.m
- - - - -
- -

Overview

-

Manages a text field with unit label and a clear button: [text unit (x)]

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextQuestionResult.html deleted file mode 100644 index 5d28c031de..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextQuestionResult.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - ORKTextQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTextQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKTextQuestionResult class represents the answer to a question or -form item that uses an ORKTextAnswerFormat format.

- -

A text question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  textAnswer -

- -
-
- -
- - -
-

The answer that the user entered.

-
- - - -
@property (nonatomic, copy, nullable) NSString *textAnswer
- - - - - - - - - -
-

Discussion

-

If the user skipped the question, the value of this property is nil.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextScaleAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextScaleAnswerFormat.html deleted file mode 100644 index eacf3ec41b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTextScaleAnswerFormat.html +++ /dev/null @@ -1,650 +0,0 @@ - - - - - - ORKTextScaleAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTextScaleAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKTextScaleAnswerFormat represents an answer format that includes a discrete slider control -with a text label next to each step.

- -

The scale answer format produces an ORKChoiceQuestionResult object that contains the selected text -choice’s value.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithTextChoices:defaultIndex:vertical: -

- -
-
- -
- - -
-

Returns an initialized text scale answer format using the specified values.

-
- - - -
- (instancetype)initWithTextChoices:(NSArray<ORKTextChoice*> *)textChoices defaultIndex:(NSInteger)defaultIndex vertical:(BOOL)vertical
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
textChoices

An array of text choices which will be used to determine the - number of steps in the slider, and - to fill the text label next to each of the steps. The array must - contain between 2 and 8 text choices.

defaultIndex

The default index of the scale. If this value is out of range, - the slider is displayed without a default value.

vertical

Pass YES to use a vertical scale; for the default horizontal - scale, pass NO.

-
- - - -
-

Return Value

-

An initialized text scale answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithTextChoices:defaultIndex: -

- -
-
- -
- - -
-

Returns an initialized text scale answer format using the specified values.

-
- - - -
- (instancetype)initWithTextChoices:(NSArray<ORKTextChoice*> *)textChoices defaultIndex:(NSInteger)defaultIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
textChoices

An array of text choices which will be used to determine the - number of steps in the slider, and - to fill the text label next to each of the steps. The array must - contain between 2 and 8 text choices.

defaultIndex

The default index of the scale. If this value is out of range, - the slider is displayed without a default value.

-
- - - -
-

Return Value

-

An initialized text scale answer format.

-
- - - - - -
-

Discussion

-

This method is a convenience initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  textChoices -

- -
-
- -
- - -
-

An array of text choices which provides the text to be shown next to each of the slider steps. -(read-only)

-
- - - -
@property (copy, readonly) NSArray<ORKTextChoice*> *textChoices
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultIndex -

- -
-
- -
- - -
-

The default index for the slider. (read-only)

-
- - - -
@property (readonly) NSInteger defaultIndex
- - - - - - - - - -
-

Discussion

-

If the value of this property is less than zero or greater than the number of text choices, -the slider has no default value.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  vertical -

- -
-
- -
- - -
-

A Boolean value indicating whether the scale is oriented vertically. (read-only)

-
- - - -
@property (readonly, getter=isVertical) BOOL vertical
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  gradientColors -

- -
-
- -
- - -
-

The colors to use when drawing a color gradient above the slider. Colors are drawn such that -lower indexes correspond to the minimum side of the scale, while colors at higher indexes in -the array corresond to the maximum side of the scale.

-
- - - -
@property (copy, nullable) NSArray<UIColor*> *gradientColors
- - - - - - - - - -
-

Discussion

-

Setting this value to nil results in no gradient being drawn. Defaults to nil.

- -

An example usage would set an array of red and green to visually indicate a scale from bad to good.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  gradientLocations -

- -
-
- -
- - -
-

Indicates the position of gradient stops for the colors specified in gradientColors. -Gradient stops are specified as values between 0 and 1. The values must be monotonically -increasing.

-
- - - -
@property (copy, nullable) NSArray<NSNumber*> *gradientLocations
- - - - - - - - - -
-

Discussion

-

If nil, the stops are spread uniformly across the range. Defaults to nil.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeIntervalAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeIntervalAnswerFormat.html deleted file mode 100644 index fec7021834..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeIntervalAnswerFormat.html +++ /dev/null @@ -1,426 +0,0 @@ - - - - - - ORKTimeIntervalAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTimeIntervalAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKTimeIntervalAnswerFormat class represents the answer format for questions that ask users - to specify a time interval.

- -

The time interval answer format is suitable for time intervals up to 24 hours. If you need to track -time intervals of longer duration, use a different answer format, such as -ORKValuePickerAnswerFormat.

- -

Note that the time interval answer format does not support the selection of 0.

- -

A time interval answer format produces an ORKTimeIntervalQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithDefaultInterval:step: -

- -
-
- -
- - -
-

Returns an initialized time interval answer format using the specified default interval and step -value.

-
- - - -
- (instancetype)initWithDefaultInterval:(NSTimeInterval)defaultInterval step:(NSInteger)step
- - - -
-

Parameters

- - - - - - - - - - - - -
defaultInterval

The default value to display in the picker.

step

The step in the interval, in minutes. The value of this parameter must - be between 1 and 30.

-
- - - -
-

Return Value

-

An initialized time interval answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultInterval -

- -
-
- -
- - -
-

The initial time interval displayed in the picker.

-
- - - -
@property (readonly) NSTimeInterval defaultInterval
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  step -

- -
-
- -
- - -
-

The size of the allowed step in the interval, in minutes.

-
- - - -
@property (readonly) NSInteger step
- - - - - - - - - -
-

Discussion

-

By default, the value of this property is 1. The minimum value is 1, and the maximum value is 30.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeIntervalQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeIntervalQuestionResult.html deleted file mode 100644 index 03033f92db..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeIntervalQuestionResult.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - ORKTimeIntervalQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTimeIntervalQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKTimeIntervalQuestionResult class represents the result of a question -that uses the ORKTimeIntervalAnswerFormat format.

- -

A time interval question result is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  intervalAnswer -

- -
-
- -
- - -
-

The selected interval, in seconds.

-
- - - -
@property (nonatomic, copy, nullable) NSNumber *intervalAnswer
- - - - - - - - - -
-

Discussion

-

The value of this property is nil if the user skipped the question.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeOfDayAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeOfDayAnswerFormat.html deleted file mode 100644 index 491d381f4c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeOfDayAnswerFormat.html +++ /dev/null @@ -1,321 +0,0 @@ - - - - - - ORKTimeOfDayAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTimeOfDayAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKTimeOfDayAnswerFormat class represents the answer format for questions that require users -to enter a time of day.

- -

A time of day answer format produces an ORKTimeOfDayQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithDefaultComponents: -

- -
-
- -
- - -
-

Returns an initialized time of day answer format using the specified default value.

-
- - - -
- (instancetype)initWithDefaultComponents:(nullable NSDateComponents *)defaultComponents
- - - -
-

Parameters

- - - - - - - -
defaultComponents

The default value with which to configure the picker.

-
- - - -
-

Return Value

-

An initialized time of day answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultComponents -

- -
-
- -
- - -
-

The default time of day to display in the picker. (read-only)

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSDateComponents *defaultComponents
- - - - - - - - - -
-

Discussion

-

Note that both the hour and minute components are observed. If the value of this property is nil, -the picker displays the current time of day.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeOfDayQuestionResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeOfDayQuestionResult.html deleted file mode 100644 index b65dc4c3d6..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimeOfDayQuestionResult.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - ORKTimeOfDayQuestionResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTimeOfDayQuestionResult Class Reference

- - -
- - - - - - - -
Inherits fromORKQuestionResult : ORKResult : NSObject
Declared inORKQuestionResult.h
ORKQuestionResult.m
- - - - -
- -

Overview

-

The ORKTimeOfDayQuestionResult class represents the result of a question that uses the ORKTimeOfDayAnswerFormat format.

-
- - - - - -
- - - - - - -
-
- -

  dateComponentsAnswer -

- -
-
- -
- - -
-

The date components picked by the user.

-
- - - -
@property (nonatomic, copy, nullable) NSDateComponents *dateComponentsAnswer
- - - - - - - - - -
-

Discussion

-

Typically only hour, minute, and AM/PM data are of interest.

-
- - - - - - - -
-

Declared In

-

ORKQuestionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkResult.html deleted file mode 100644 index 70cfeb8665..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkResult.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - ORKTimedWalkResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTimedWalkResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKTimedWalkResult.h
ORKTimedWalkResult.m
- - - - -
- -

Overview

-

The ORKTimedWalkResult class records the results of a Timed Walk test.

- -

The timed walk result object records the duration to complete the trial with a specific distance -and time limit.

-
- - - - - -
- - - - - - -
-
- -

  distanceInMeters -

- -
-
- -
- - -
-

The timed walk distance in meters.

-
- - - -
@property (nonatomic, assign) double distanceInMeters
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTimedWalkResult.h

-
- - -
-
-
- -

  timeLimit -

- -
-
- -
- - -
-

The time limit to complete the trials.

-
- - - -
@property (nonatomic, assign) NSTimeInterval timeLimit
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTimedWalkResult.h

-
- - -
-
-
- -

  duration -

- -
-
- -
- - -
-

The trial duration (that is, the time taken to do the walk).

-
- - - -
@property (nonatomic, assign) NSTimeInterval duration
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTimedWalkResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkStep.html deleted file mode 100644 index b147faeaa9..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkStep.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - ORKTimedWalkStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTimedWalkStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKTimedWalkStep.h
ORKTimedWalkStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkStepViewController.html deleted file mode 100644 index c3770c2593..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTimedWalkStepViewController.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - - - ORKTimedWalkStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTimedWalkStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKTimedWalkStepViewController.h
ORKTimedWalkStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– finish -

- -
-
- -
- - -
-

Finishes the active step.

-
- - - -
- (void)finish
- - - - - - - - - -
-

Discussion

-

Call this method to finish the active step. If the active step is configured with -a timer, this method is called automatically when the timer expires.

- -

Finishing the active step stops all data recording and stops any timers. In steps that have the -shouldContinueOnFinish property set, forward navigation to the next step -may ensue.

- -

This method does nothing if the step has already finished.

- -

Subclasses should call super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryResult.html deleted file mode 100644 index 80929face6..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryResult.html +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - ORKToneAudiometryResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKToneAudiometryResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKToneAudiometryResult.h
ORKToneAudiometryResult.m
- - - - -
- -

Overview

-

The ORKToneAudiometryResult class records the results of a tone audiometry test.

- -

The audiometry samples are generated by the framework when the task completes. -It may be appropriate to serialize them for transmission to a server, -or to immediately perform analysis on them.

-
- - - - - -
- - - - - - -
-
- -

  outputVolume -

- -
-
- -
- - -
-

The system wide output volume set by the user during the audiometry test.

-
- - - -
@property (nonatomic, copy, nullable) NSNumber *outputVolume
- - - - - - - - - -
-

Discussion

-

A value in the range 0.0 to 1.0, with 0.0 representing the minimum volume -and 1.0 representing the maximum volume.

-
- - - - - - - -
-

Declared In

-

ORKToneAudiometryResult.h

-
- - -
-
-
- -

  samples -

- -
-
- -
- - -
-

An array of collected samples, in which each item is an ORKToneAudiometrySample -object that represents an audiometry sample.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKToneAudiometrySample*> *samples
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKToneAudiometryResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometrySample.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometrySample.html deleted file mode 100644 index 592ea09341..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometrySample.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - ORKToneAudiometrySample Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKToneAudiometrySample Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKToneAudiometryResult.h
ORKToneAudiometryResult.m
- - - - -
- -

Overview

-

The ORKToneAudiometrySample class represents an audio amplitude associated -with a frequency and a channel.

- -

The sample object records the amplitude, the frequency, and the channel for the audio -tone being played. A tone audiometry sample is included in an ORKToneAudiometryResult -object, and is recorded by the step view controller for the corresponding task -when a tap is recognized for a given tone.

- -

A tone audiometry sample is typically generated by the framework as the task proceeds. -When the task completes, it may be appropriate to serialize the sample for -transmission to a server or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  frequency -

- -
-
- -
- - -
-

The frequency value in hertz for the tone associated with the sample.

-
- - - -
@property (nonatomic, assign) double frequency
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKToneAudiometryResult.h

-
- - -
-
-
- -

  channel -

- -
-
- -
- - -
-

The channel, either left or right, for the tone associated with the sample.

-
- - - -
@property (nonatomic, assign) ORKAudioChannel channel
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKToneAudiometryResult.h

-
- - -
-
-
- -

  channelSelected -

- -
-
- -
- - -
-

The channel selected by the user.

-
- - - -
@property (nonatomic, assign) ORKAudioChannel channelSelected
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKToneAudiometryResult.h

-
- - -
-
-
- -

  amplitude -

- -
-
- -
- - -
-

The audio signal amplitude.

-
- - - -
@property (nonatomic, assign) double amplitude
- - - - - - - - - -
-

Discussion

-

The minimum audio sample amplitude needed for the participant to recognize the sound (a double value between 0 and 1).

-
- - - - - - - -
-

Declared In

-

ORKToneAudiometryResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryStep.html deleted file mode 100644 index c29a120234..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryStep.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - ORKToneAudiometryStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKToneAudiometryStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKToneAudiometryStep.h
ORKToneAudiometryStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryStepViewController.html deleted file mode 100644 index 6f0e3c5df5..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKToneAudiometryStepViewController.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - ORKToneAudiometryStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKToneAudiometryStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKToneAudiometryStepViewController.h
ORKToneAudiometryStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchAnywhereStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchAnywhereStep.html deleted file mode 100644 index b72060a259..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchAnywhereStep.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - ORKTouchAnywhereStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTouchAnywhereStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKTouchAnywhereStep.h
ORKTouchAnywhereStep.m
- - - - -
- -

Overview

-

The ORKTouchAnywhereStep class represents a step that displays a title with custom instructions -and the text “Touch anywhere to continue.” The user can touch almost anywhere on the -screen and the step will end and the task will continue. The back button is still -tappable.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier:instructionText: -

- -
-
- -
- - -
-

Init with an identifier and instruction text. Instruction text should be used to tell the user -where to place the device before touching anywhere.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier instructionText:(NSString *)instructionText
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTouchAnywhereStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchRecorder.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchRecorder.html deleted file mode 100644 index f04d3c5887..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchRecorder.html +++ /dev/null @@ -1,424 +0,0 @@ - - - - - - ORKTouchRecorder Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTouchRecorder Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorder : NSObject
Declared inORKTouchRecorder.h
ORKTouchRecorder.m
- - - - -
- -

Overview

-

The ORKTouchRecorder class defines the attributes and behavior of touch events recorder.

- -

This class is considered private because its interface is not yet considered -stable. It is not currently used by any of the pre-defined active tasks.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– viewController:willStartStepWithView: -

- -
-
- -
- - -
-

A preparation step to provide viewController and view before record starting.

-
- - - -
- (void)viewController:(UIViewController *)viewController willStartStepWithView:(UIView *)view
- - - -
-

Parameters

- - - - - - - - - - - - -
viewController

The view controller that is about to ‘start’

view

Primary active view for the step.

-
- - - - - - - -
-

Discussion

-

The step view controller should call this method before starting the recorder, -so that recorders that need a view or gesture recognizer in order to function -can attach themselves.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts data recording.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

If an error occurs when recording starts, it is returned through the delegate.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– stop -

- -
-
- -
- - -
-

Stops data recording, which generally triggers the return of results.

-
- - - -
- (void)stop
- - - - - - - - - -
-

Discussion

-

If an error occurs when stopping the recorder, it is returned through the delegate. -Subclasses should call finishRecordingWithError: rather than calling super.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– finishRecordingWithError: -

- -
-
- -
- - -
-

Indicates that recording has failed; stop recording and report the error to the -delegate

-
- - - -
- (void)finishRecordingWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - -
error

Error that occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  touchView -

- -
-
- -
- - -
-

The ORKTouchRecorder attaches a gesture recognizer to touchView to receive touch events.

-
- - - -
@property (nonatomic, strong, readonly, nullable) UIView *touchView
- - - - - - - - - -
-

Discussion

-

Use viewController:willStartStepWithView: to set the touchView property before -the touch recorder starts.

-
- - - - - - - -
-

Declared In

-

ORKTouchRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchRecorderConfiguration.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchRecorderConfiguration.html deleted file mode 100644 index 422da14797..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTouchRecorderConfiguration.html +++ /dev/null @@ -1,333 +0,0 @@ - - - - - - ORKTouchRecorderConfiguration Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTouchRecorderConfiguration Class Reference

- - -
- - - - - - - -
Inherits fromORKRecorderConfiguration : NSObject
Declared inORKRecorder_Private.h
ORKTouchRecorder.m
- - - - -
- -

Overview

-

The ORKTouchRecorderConfiguration is a recorder configuration class for -generating an ORKTouchRecorder.

- -

It is currently considered private, and is not used in any of the active tasks.

-
- - - - - -
- - - - - - -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized touch recorder configuration.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the recorder configuration.

-
- - - -
-

Return Value

-

An initialized touch recorder configuration.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
- -

– recorderForStep:outputDirectory: -

- -
-
- -
- - -
-

Returns a recorder instance using this configuration.

-
- - - -
- (ORKRecorder *)recorderForStep:(ORKStep *)step outputDirectory:(NSURL *)outputDirectory
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step for which this recorder is being created.

outputDirectory

The directory in which all output file data should be written (if producing ORKFileResult instances).

-
- - - -
-

Return Value

-

A configured recorder instance.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - -
-

Returns a new touch recorder configuration initialized from data in the given unarchiver.

-
- - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - -
-

Parameters

- - - - - - - -
aDecoder

Coder from which to initialize the touch recorder configuration.

-
- - - -
-

Return Value

-

A new touch recorder configuration.

-
- - - - - - - - - - - -
-

Declared In

-

ORKRecorder_Private.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiMove.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiMove.html deleted file mode 100644 index 5f08d35e4a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiMove.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - ORKTowerOfHanoiMove Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTowerOfHanoiMove Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKTowerOfHanoiResult.h
ORKTowerOfHanoiResult.m
- - - - -
- -

Overview

-

The ORKTowerOfHanoiMove class represents a single move in a Tower of Hanoi puzzle.

- -

The Tower of Hanoi move object records the indexes of the donor and recipient towers -and the time at which the event occurred. A towerOfHanoiMove instance is included in -an ORKTowerOfHanoiResult object and is recorded by the step view controller for the -corresponding task when a move is made.

- -

A Tower of Hanoi move is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize the move for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  timestamp -

- -
-
- -
- - -
-

A relative timestamp indicating the time of the tap event.

-
- - - -
@property (nonatomic, assign) NSTimeInterval timestamp
- - - - - - - - - -
-

Discussion

-

The timestamp is relative to the value of startDate in the ORKResult object that includes this move. -The start date of that object represents the time at which the first move was made.

-
- - - - - - - -
-

Declared In

-

ORKTowerOfHanoiResult.h

-
- - -
-
-
- -

  donorTowerIndex -

- -
-
- -
- - -
-

The index of the donor tower in the move.

-
- - - -
@property (nonatomic, assign) NSUInteger donorTowerIndex
- - - - - - - - - -
-

Discussion

-

The Tower of Hanoi puzzle has three towers, and so the value of this property is -therefore always 0, 1, or 2. The indexes sequentially represent the towers from left to right when they are laid out -horizontally and from top to bottom when they are layed out vertically. The index for a given tower is consistent -between changes to and from the horizontal and vertical layouts.

-
- - - - - - - -
-

Declared In

-

ORKTowerOfHanoiResult.h

-
- - -
-
-
- -

  recipientTowerIndex -

- -
-
- -
- - -
-

The index of the recipient tower in the move.

-
- - - -
@property (nonatomic, assign) NSUInteger recipientTowerIndex
- - - - - - - - - -
-

Discussion

-

The Tower of Hanoi puzzle has three towers, and so the value of this property is -therefore always 0, 1, or 2. The indexes sequentially represent the towers from left to right when they are laid out -horizontally and from top to bottom when they are layed out vertically. The index for a given tower is consistent -between changes to and from the horizontal and vertical layouts.

-
- - - - - - - -
-

Declared In

-

ORKTowerOfHanoiResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiResult.html deleted file mode 100644 index 220ed2599a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiResult.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - ORKTowerOfHanoiResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTowerOfHanoiResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKTowerOfHanoiResult.h
ORKTowerOfHanoiResult.m
- - - - -
- -

Overview

-

The ORKTowerOfHanoiResult class records the results of a Tower of Hanoi active task.

- -

An ORKTowerOfHanoiResult object records an array of ORKTowerOfHanoiMove objects (one for each move) -and a Boolean value representing whether the puzzle was solved or not.

- -

An ORKTowerOfHanoiResult object is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize it for transmission to a server -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  puzzleWasSolved -

- -
-
- -
- - -
-

A Boolean value indicating whether the puzzle was solved.

-
- - - -
@property (nonatomic, assign) BOOL puzzleWasSolved
- - - - - - - - - -
-

Discussion

-

The value of this property is YES when the puzzle was solved and NO otherwise.

-
- - - - - - - -
-

Declared In

-

ORKTowerOfHanoiResult.h

-
- - -
-
-
- -

  moves -

- -
-
- -
- - -
-

An array of moves, in which each item is an ORKTowerOfHanoiMove object that represents a move.

-
- - - -
@property (nonatomic, copy, nullable) NSArray<ORKTowerOfHanoiMove*> *moves
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTowerOfHanoiResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiStep.html deleted file mode 100644 index 064e470b84..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiStep.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - - - ORKTowerOfHanoiStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTowerOfHanoiStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKTowerOfHanoiStep.h
ORKTowerOfHanoiStep.m
- - - - -
- -

Overview

-

Tower of Hanoi step.

- -

This step is used to present the interactive Tower of Hanoi activity.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  numberOfDisks -

- -
-
- -
- - -
-

The number of disks in the puzzle.

-
- - - -
@property (nonatomic, assign) NSUInteger numberOfDisks
- - - - - - - - - -
-

Discussion

-

It is not recommended that you use a large number of disks. As this provides a poor user experience. -The default value of this property is 3.

-
- - - - - - - -
-

Declared In

-

ORKTowerOfHanoiStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– shouldContinueOnFinish -

- -
-
- -
- - -
-

A Boolean value indicating whether to transition automatically when the step finishes.

-
- - - -
- (BOOL)shouldContinueOnFinish
- - - - - - - - - -
-

Discussion

-

When the value of this property is YES, the active step view controller automatically performs the -continue action when the [ORKActiveStepViewController finish] method -is called.

- -

The default value of this property is NO.

-
- - - - - - - -
-

Declared In

-

ORKActiveStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiViewController.html deleted file mode 100644 index ebca61dea1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTowerOfHanoiViewController.html +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - ORKTowerOfHanoiViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTowerOfHanoiViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKTowerOfHanoiStepViewController.h
ORKTowerOfHanoiStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– skipForward -

- -
-
- -
- - -
-

This method is called when the user taps the skip button. By default, it calls goForward.

-
- - - -
- (void)skipForward
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingResult.html deleted file mode 100644 index df87f6a342..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingResult.html +++ /dev/null @@ -1,300 +0,0 @@ - - - - - - ORKTrailmakingResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTrailmakingResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKTrailmakingResult.h
ORKTrailmakingResult.m
- - - - -
- -

Overview

-

The ORKTrailmakingResult class represents the result of a signature step (ORKTrailmakingStep).

- -

A trail making result is produced by the task view controller when it presents a trail making step.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - -
-

Returns an initialized result using the specified identifier.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The unique identifier of the result.

-
- - - - - - - -
-

Discussion

-

Typically, objects such as ORKStepViewController and ORKTaskViewController instantiate result (and ORKResult subclass) objects; you seldom need to instantiate a result object in your code.

-
- - - - - - - -
-

Declared In

-

ORKResult.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  taps -

- -
-
- -
- - -
-

An array of all taps completed during the test

-
- - - -
@property (nonatomic, copy) NSArray<ORKTrailmakingTap*> *taps
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTrailmakingResult.h

-
- - -
-
-
- -

  numberOfErrors -

- -
-
- -
- - -
-

The number of errors generated during the test

-
- - - -
@property (nonatomic) NSUInteger numberOfErrors
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTrailmakingResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingStep.html deleted file mode 100644 index ecbe8c5269..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingStep.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - - - ORKTrailmakingStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTrailmakingStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKTrailmakingStep.h
ORKTrailmakingStep.m
- - - - - - -
- - - - -

Other Methods

- -
-
- -

  trailType -

- -
-
- -
- - -
-

The type of trail to show. Default = ORKTrailMakingTypeIdentifierA

-
- - - -
@property (nonatomic, copy) ORKTrailMakingTypeIdentifier trailType
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTrailmakingStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingStepViewController.html deleted file mode 100644 index f8274a8a13..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingStepViewController.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - ORKTrailmakingStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTrailmakingStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKTrailmakingStepViewController.h
ORKTrailmakingStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingTap.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingTap.html deleted file mode 100644 index 4f303af6bf..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKTrailmakingTap.html +++ /dev/null @@ -1,287 +0,0 @@ - - - - - - ORKTrailmakingTap Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTrailmakingTap Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toNSCopying
NSSecureCoding
Declared inORKTrailmakingResult.h
ORKTrailmakingResult.m
- - - - -
- -

Overview

-

The ORKTrailmakingTap class represents a single tap in a trail making test.

- -

The Trailmaking tap move object records the indexes of tap, if it was in error or not -and the time at which the event occurred. A trailmakingTap instance is included in -an ORKTrailmakingResult object and is recorded by the step view controller for the -corresponding task when a tap is made.

- -

A trail making tap is typically generated by the framework as the task proceeds. When the task -completes, it may be appropriate to serialize the move for transmission to a server, -or to immediately perform analysis on it.

-
- - - - - -
- - - - - - -
-
- -

  timestamp -

- -
-
- -
- - -
-

A relative timestamp indicating the time of the tap event.

-
- - - -
@property (nonatomic, assign) NSTimeInterval timestamp
- - - - - - - - - -
-

Discussion

-

The timestamp is relative to the value of startDate in the ORKResult object that includes this move. -The start date of that object represents the time at which the first move was made.

-
- - - - - - - -
-

Declared In

-

ORKTrailmakingResult.h

-
- - -
-
-
- -

  index -

- -
-
- -
- - -
-

The index of the button tapped.

-
- - - -
@property (nonatomic, assign) NSUInteger index
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTrailmakingResult.h

-
- - -
-
-
- -

  incorrect -

- -
-
- -
- - -
-

If the button was tapped in error.

-
- - - -
@property (nonatomic, assign) BOOL incorrect
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTrailmakingResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKUnitLabel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKUnitLabel.html deleted file mode 100644 index a9f28bb8d6..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKUnitLabel.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - ORKUnitLabel Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKUnitLabel Class Reference

- - -
- - - - - - - -
Inherits fromORKLabel : UILabel
Declared inORKUnitLabel.h
ORKUnitLabel.m
- - - - -
- -

Overview

-

Text label for units during numeric value entry

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValuePickerAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValuePickerAnswerFormat.html deleted file mode 100644 index fc8469c409..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValuePickerAnswerFormat.html +++ /dev/null @@ -1,378 +0,0 @@ - - - - - - ORKValuePickerAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKValuePickerAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKValuePickerAnswerFormat class represents an answer format that lets participants use a -value picker to choose from a fixed set of text choices.

- -

When the number of choices is relatively large and the text that describes each choice -is short, you might want to use the value picker answer format instead of the text choice answer -format (ORKTextChoiceAnswerFormat). When the text that describes each choice is long, or there -are only a very small number of choices, it’s usually better to use the text choice answer format.

- -

Note that the value picker answer format reports itself as being of the single choice question -type. The value picker answer format produces an ORKChoiceQuestionResult object.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– initWithTextChoices: -

- -
-
- -
- - -
-

Returns a value picker answer format using the specified array of text choices.

-
- - - -
- (instancetype)initWithTextChoices:(NSArray<ORKTextChoice*> *)textChoices
- - - -
-

Parameters

- - - - - - - -
textChoices

Array of ORKTextChoice objects.

-
- - - -
-

Return Value

-

An initialized value picker answer format.

-
- - - - - -
-

Discussion

-

Note that the detailText property of each choice is ignored. Be sure to create localized text for -each choice that is short enough to fit in a UIPickerView object.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  textChoices -

- -
-
- -
- - -
-

An array of text choices that represent the options to display in the picker. (read-only)

-
- - - -
@property (copy, readonly) NSArray<ORKTextChoice*> *textChoices
- - - - - - - - - -
-

Discussion

-

Note that the detailText property of each choice is ignored. Be sure to create localized text for -each choice that is short enough to fit in a UIPickerView object.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the parameters of the answer format to ensure that they can be displayed.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

Typically, this method is called by the validation methods of the owning objects, which are -themselves called when a step view controller that contains this answer format is -about to be displayed.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueRange.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueRange.html deleted file mode 100644 index 3409e1cdcb..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueRange.html +++ /dev/null @@ -1,507 +0,0 @@ - - - - - - ORKValueRange Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKValueRange Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toORKValueCollectionType
Declared inORKChartTypes.h
ORKChartTypes.m
- - - - -
- -

Overview

-

The ORKValueRange class represents a range between two values of the double type. It can be used -in graph chart plots to draw value ranges.

-
- - - - - -
- - - - - - -
-
- -

– initWithMinimumValue:maximumValue: -

- -
-
- -
- - -
-

Returns a value range initialized using the specified minimumValue and maximumValue.

-
- - - -
- (instancetype)initWithMinimumValue:(double)minimumValue maximumValue:(double)maximumValue
- - - -
-

Parameters

- - - - - - - - - - - - -
minimumValue

The minimumValue to set.

maximumValue

The maximumValue to set.

-
- - - -
-

Return Value

-

A value range object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

– initWithValue: -

- -
-
- -
- - -
-

Returns a value range initialized using the specified value for both minimumValue and -maximumValue. This is useful for plotting data points that model a single value with no range.

-
- - - -
- (instancetype)initWithValue:(double)value
- - - -
-

Parameters

- - - - - - - -
value

The minimumValue and maximumValue to set.

-
- - - -
-

Return Value

-

A value range object.

-
- - - - - -
-

Discussion

-

This method is a convenience initializer.

-
- - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

– init -

- -
-
- -
- - -
-

Returns a value range initialized using the ORKDoubleInvalidValue value for both minimumValue -and maximumValue. This denotes an unset or invalid value range. It is useful, for example, for -representing unavailable data in discontinous graph chart plots.

-
- - - -
- (instancetype)init
- - - - - -
-

Return Value

-

A value range object initialized with the ORKDoubleInvalidValue value.

-
- - - - - -
-

Discussion

-

This method is a convenience initializer.

-
- - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

  maximumValue -

- -
-
- -
- - -
-

The upper limit of the value range.

-
- - - -
@property (nonatomic) double maximumValue
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

  minimumValue -

- -
-
- -
- - -
-

The lower limit of the value range.

-
- - - -
@property (nonatomic) double minimumValue
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

  isEmptyRange -

- -
-
- -
- - -
-

A Boolean value indicating that minimumValue is equal to maximumValue. (read-only)

-
- - - -
@property (nonatomic, readonly) BOOL isEmptyRange
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

  isUnset -

- -
-
- -
- - -
-

A Boolean value indicating that both minimum value and maximum value are equal to the -ORKDoubleInvalidValue value. (read-only)

-
- - - -
@property (nonatomic, readonly) BOOL isUnset
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueRangeGraphChartView.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueRangeGraphChartView.html deleted file mode 100644 index 261a517f49..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueRangeGraphChartView.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - ORKValueRangeGraphChartView Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKValueRangeGraphChartView Class Reference

- - -
- - - - - - - -
Inherits fromORKGraphChartView : UIView
Declared inORKGraphChartView.h
ORKGraphChartView.m
- - - - -
- -

Overview

-

The ORKValueRangeGraphChartView class is an abstract class which holds a data source comforming -to the ORKValueRangeGraphChartViewDataSource protocol, common to concrete subclasseses.

- -

You should not instantiate this class directly; use one of the subclasses instead. The concrete -subclasses are ORKLineGraphChartView and ORKDiscreteGraphChartView.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  dataSource -

- -
-
- -
- - -
-

The data source responsible for providing the data required to populate the graph chart view.

-
- - - -
@property (nonatomic, weak) id<ORKValueRangeGraphChartViewDataSource> dataSource
- - - - - - - - - -
-

Discussion

-

See the ORKValueRangeGraphChartViewDataSource protocol.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– reloadData -

- -
-
- -
- - -
-

Reloads the plotted data.

-
- - - -
- (void)reloadData
- - - - - - - - - -
-

Discussion

-

Call this method to reload the data and re-plot the graph. You should call it if the data provided by the dataSource changes.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueStack.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueStack.html deleted file mode 100644 index 93229e18aa..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKValueStack.html +++ /dev/null @@ -1,393 +0,0 @@ - - - - - - ORKValueStack Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKValueStack Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toORKValueCollectionType
Declared inORKChartTypes.h
ORKChartTypes.m
- - - - -
- -

Overview

-

The ORKValueStack class represents an arbitrary list of values of the double type. It can be used -in graph chart plots to draw stacked values.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– init -

- -
-
- -
- - -
-

Returns an empty value stack.

-
- - - -
- (instancetype)init
- - - - - -
-

Return Value

-

An empty value stack object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

– initWithStackedValues: -

- -
-
- -
- - -
-

Returns a value stack initialized with the passed NSNumber array.

-
- - - -
- (instancetype)initWithStackedValues:(NSArray<NSNumber*> *)stackedValues
- - - -
-

Parameters

- - - - - - - -
stackedValues

An array containing NSNumber objects.

-
- - - -
-

Return Value

-

A value stack object initialized with the passed NSNumber values.

-
- - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

  stackedValues -

- -
-
- -
- - -
-

An array of NSNumber objects, each one representing a stacked double value.

-
- - - -
@property (nonatomic, copy, readonly) NSArray<NSNumber*> *stackedValues
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
- -

  totalValue -

- -
-
- -
- - -
-

The total sum of the stacked double values

-
- - - -
@property (nonatomic) double totalValue
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– isUnset -

- -
-
- -
- - -
-

A Boolean value indicating that the value is unset. (read-only)

-
- - - -
- (BOOL)isUnset
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVerificationStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVerificationStep.html deleted file mode 100644 index 57e93bc0c6..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVerificationStep.html +++ /dev/null @@ -1,446 +0,0 @@ - - - - - - ORKVerificationStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVerificationStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKVerificationStep.h
ORKVerificationStep.m
- - - - -
- -

Overview

-

The ORKVerificationStep class represents a step that serves as placeholder -step to use while the user attempts to verify their account.

- -

The verification step contains a text field and a resend email button. The button -actions must be overriden inside a subclassed verification view controller to provide -navigation logic.

- -

The developer should redirect user back to the app once the verification is done -and move forward automatically.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– stepViewControllerClass -

- -
-
- -
- - - - -
- (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:text:verificationViewControllerClass: -

- -
-
- -
- - -
-

Returns an initialized verification step using the specified identifier, -title, text, and class.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier text:(NSString *)text verificationViewControllerClass:(Class)verificationViewControllerClass
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
identifier

The string that identifies the step (see ORKStep).

text

The text shown immediately below the title (see ORKStep).

verificationViewControllerClass

The subclassed verification view controller class.

-
- - - -
-

Return Value

-

An initialized verification step object.

-
- - - - - - - - - - - -
-

Declared In

-

ORKVerificationStep.h

-
- - -
-
-
- -

– verificationViewControllerClass -

- -
-
- -
- - -
-

The view controller subclass used for the step.

-
- - - -
- (Class)verificationViewControllerClass
- - - - - - - - - -
-

Discussion

-

The subclass allows you to override button actions in order to provide navigation logic -for the button items on the step.

-
- - - - - - - -
-

Declared In

-

ORKVerificationStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVerificationStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVerificationStepViewController.html deleted file mode 100644 index b5f9966ecc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVerificationStepViewController.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - ORKVerificationStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVerificationStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKVerificationStepViewController.h
ORKVerificationStepViewController.m
- - - - -
- -

Overview

-

The ORKVerificationStepViewController class is the concrete ORKStepViewController -implementation for ORKVerificationStep.

- -

You should subclass a verification step view controller and override the button action -methods to provide your navigation logic. All override methods are required.

-
- - - - - -
- - - - - - -
-
- -

– resendEmailButtonTapped -

- -
-
- -
- - -
-

Action method for the resend email button.

-
- - - -
- (void)resendEmailButtonTapped
- - - - - - - - - -
-

Discussion

-

Override this method to provide custom logic for the button action.

-
- - - - - - - -
-

Declared In

-

ORKVerificationStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoCaptureStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoCaptureStep.html deleted file mode 100644 index d8a60296f8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoCaptureStep.html +++ /dev/null @@ -1,679 +0,0 @@ - - - - - - ORKVideoCaptureStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVideoCaptureStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKVideoCaptureStep.h
ORKVideoCaptureStep.m
- - - - -
- -

Overview

-

The ORKVideoCaptureStep class represents a step that captures a video through the device -camera. A template image can optionally be laid over the camera preview to assist in properly -capturing the video.

- -

To use the video capture step, optionally set the templateImage and templateImageInsets -properties, incorporate the step into a task, and present the task with a task view controller.

- -

If implementing a video capture task like this one, remember that people will -take your instructions literally. So be cautious. Make sure your template image -is high contrast and very visible against a variety of backgrounds.

- -

The recording length can be a max of 20 minutes. It defaults to 2 minutes.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  templateImage -

- -
-
- -
- - -
-

An image to be displayed over the camera preview.

-
- - - -
@property (nonatomic, strong) UIImage *templateImage
- - - - - - - - - -
-

Discussion

-

The image is stretched to fit the available space while retaining its aspect ratio. -When choosing a size for this asset, be sure to take into account the variations in device -form factors.

-
- - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
- -

  templateImageInsets -

- -
-
- -
- - -
-

Insets to be used in positioning and sizing the templateImage.

-
- - - -
@property (nonatomic) UIEdgeInsets templateImageInsets
- - - - - - - - - -
-

Discussion

-

The insets are interpreted as percentages relative to the preview frame size. The left -and right insets are relative to the width of the preview frame. The top and bottom -insets are relative to the height of the preview frame.

-
- - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
- -

  duration -

- -
-
- -
- - -
-

The duration, in seconds, for the recording.

-
- - - -
@property (nonatomic) NSNumber *duration
- - - - - - - - - -
-

Discussion

-

The maximum that this can be set to is 20.0 minutes (60*20 seconds). -The minimum that this can be set to is 0.01 minutes (1 second).

- -

The default value is 2.0 minutes (60*2 seconds).

-
- - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
- -

  audioMute -

- -
-
- -
- - -
-

A Boolean indicating whether the audio is recorded or not.

-
- - - -
@property (nonatomic, getter=isAudioMute) BOOL audioMute
- - - - - - - - - -
-

Discussion

-

The default value is NO.

-
- - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
- -

  flashMode -

- -
-
- -
- - -
-

Constants indicating the mode of the flash on the receiver’s device, if it has one.

-
- - - -
@property (nonatomic) AVCaptureFlashMode flashMode
- - - - - - - - - -
-

Discussion

-

The default value is AVCaptureFlashModeOff (see AVCaptureFlashMode).

-
- - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
- -

  devicePosition -

- -
-
- -
- - -
-

Constants indicating the physical position of an AVCaptureDevice’s hardware on the system.

-
- - - -
@property (nonatomic) AVCaptureDevicePosition devicePosition
- - - - - - - - - -
-

Discussion

-

The default value is AVCaptureDevicePositionBack (see AVCaptureDevicePosition). -If AVCaptureDevicePositionUnspecified is set, then it defaults to AVCaptureDevicePositionBack.

-
- - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
- -

  accessibilityInstructions -

- -
-
- -
- - -
-

An accessibility hint of the capture preview.

-
- - - -
@property (nonatomic, copy) NSString *accessibilityInstructions
- - - - - - - - - -
-

Discussion

-

This property can be used to specify accessible instructions for capturing the video. The -use of this property can assist when the templateImage may not be visible -to the user.

- -

For example, if you want to capture a video of the user’s right hand, you may use a template -image that displays the outline of the right hand. You may also want to set this property -to a string such as @“Extend your right hand, palm side down, one foot from your device. -Tap the Capture Video button, or two finger tap on the preview, to capture a video of your -extended right hand.”

-
- - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
- -

  accessibilityHint -

- -
-
- -
- - -
-

An accessibility hint of the capture button.

-
- - - -
@property (nonatomic, copy) NSString *accessibilityHint
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKVideoCaptureStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoCaptureStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoCaptureStepViewController.html deleted file mode 100644 index 0587bc37be..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoCaptureStepViewController.html +++ /dev/null @@ -1,394 +0,0 @@ - - - - - - ORKVideoCaptureStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVideoCaptureStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKVideoCaptureStepViewController.h
ORKVideoCaptureStepViewController.m
- - - - -
- -

Overview

-

The ORKVideoCaptureStepViewController class represents the step view controller that -corresponds to an ORKVideoCaptureStep class.

- -

It is not usually necessary to instantiate this view controller directly. -Instead, add a video capture step to a task, and present the task in a task -view controller.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep:result: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step result:(ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
step

The step to be presented.

result

The current step result for this step.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– setCancelButtonItem: -

- -
-
- -
- - -
-

The cancel button item.

-
- - - -
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem
- - - - - - - - - -
-

Discussion

-

The cancel button item controls the Cancel button displayed in the navigation bar -when the step view controller is current. -This property lets you control the appearance and target of the -Cancel button at runtime.

- -

When the value of the property is nil, the Cancel button is not displayed; otherwise, the title, target, -and action associated with the Cancel button item are used (other properties of UIBarButtonItem -are ignored).

- -

The cancel button item is updated during view loading and when the value of the step property -is changed, but is safe to -set in the taskViewController:stepViewControllerWillAppear: delegate callback.

- -

Subclasses can safely modify this property any time after calling viewWillAppear: on super.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStep.html deleted file mode 100644 index 712febf12a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStep.html +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - ORKVideoInstructionStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVideoInstructionStep Class Reference

- - -
- - - - - - - -
Inherits fromORKInstructionStep : ORKStep : NSObject
Declared inORKVideoInstructionStep.h
ORKVideoInstructionStep.m
- - - - -
- -

Overview

-

An ORKVideoInstructionStep object gives the participant video-based instructions for a task.

- -

You can use video instruction steps to present video content during a task.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  videoURL -

- -
-
- -
- - -
-

The URL of the video to play (local or remote)

-
- - - -
@property (nonatomic, copy, nullable) NSURL *videoURL
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKVideoInstructionStep.h

-
- - -
-
-
- -

  thumbnailTime -

- -
-
- -
- - -
-

The time (in seconds) at which the thumbnail image is created.

-
- - - -
@property (nonatomic) NSUInteger thumbnailTime
- - - - - - - - - -
-

Discussion

-

When presented, the step view controller will display a preview image of the video to play. -This property tells the step view controller at what time of the video this thumbnail image -should be created.

- -

Default is 0, negative values will be ignored.

-
- - - - - - - -
-

Declared In

-

ORKVideoInstructionStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStepResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStepResult.html deleted file mode 100644 index 5500199842..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStepResult.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - ORKVideoInstructionStepResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVideoInstructionStepResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKVideoInstructionStepResult.h
ORKVideoInstructionStepResult.m
- - - - -
- -

Overview

-

The ORKVideoInstructionStepResult class represents the result of a video insruction step (ORKVideoInstructionStep).

- -

A video instruction result is produced by the task view controller when it presents a video instruction step.

-
- - - - - -
- - - - - - -
-
- -

  playbackStoppedTime -

- -
-
- -
- - -
-

The time (in seconds) after video playback stopped, or NaN if the video was never played.

-
- - - -
@property (nonatomic) Float64 playbackStoppedTime
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKVideoInstructionStepResult.h

-
- - -
-
-
- -

  playbackCompleted -

- -
-
- -
- - -
-

Returns ‘YES’ if the video was watched until the end, or ‘NO’ if video playback was stopped half way.

-
- - - -
@property (nonatomic) BOOL playbackCompleted
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKVideoInstructionStepResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStepViewController.html deleted file mode 100644 index 9c93c38da4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVideoInstructionStepViewController.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - ORKVideoInstructionStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVideoInstructionStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKInstructionStepViewController : ORKStepViewController : UIViewController
Declared inORKVideoInstructionStepViewController.h
ORKVideoInstructionStepViewController.m
- - - - -
- -

Overview

-

An ORKVideoInstructionStepViewController object is the view controller for an ORKVideoInstructionStep object.

- -

In general, you don’t need to instantiate an video instruction step view controller directly. -Instead, add an video instruction step to a task and present the task using a -task view controller. When appropriate, the task view controller instantiates the step -view controller for the step.

-
- - - - - -
- - - - - - -
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVisualConsentStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVisualConsentStep.html deleted file mode 100644 index 6a8ce371da..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVisualConsentStep.html +++ /dev/null @@ -1,349 +0,0 @@ - - - - - - ORKVisualConsentStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVisualConsentStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKVisualConsentStep.h
ORKVisualConsentStep.m
- - - - -
- -

Overview

-

The ORKVisualConsentStep class represents a step in the visual consent sequence.

- -

To use a visual consent step, first create a consent document with at least one -section (at least one section must not be of type ORKConsentSectionTypeOnlyInDocument) and attach the document to a visual consent step. Put the visual consent step -into a ResearchKit task, and present it with a task view controller.

- -

In the ResearchKit framework, an ORKVisualConsentStep object is used to present a series of simple -graphics to help study participants understand the content of an informed -consent document. The default graphics include animated transitions. -The textual content you need to provide in the consentDocument property should relate to the specific study being run and should be localized.

- -

An ORKVisualConsentStep object produces an ORKStepResult object, in which the dates indicate the total amount of time participants have spent in the consent process, and the route by which they can exit the consent process.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier:document: -

- -
-
- -
- - -
-

Returns an initialized visual consent step using the specified identifier and consent document.

-
- - - -
- (instancetype)initWithIdentifier:(NSString *)identifier document:(ORKConsentDocument *)consentDocument
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The identifier of the visual consent step, unique within the document.

consentDocument

The informed consent document.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKVisualConsentStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  consentDocument -

- -
-
- -
- - -
-

The consent document whose sections determine the order and appearance of scenes -in the visual consent step.

-
- - - -
@property (nonatomic, strong, nullable) ORKConsentDocument *consentDocument
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKVisualConsentStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVisualConsentStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVisualConsentStepViewController.html deleted file mode 100644 index 01e6ba60fb..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKVisualConsentStepViewController.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - ORKVisualConsentStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKVisualConsentStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKVisualConsentStepViewController.h
ORKVisualConsentStepViewController.m
- - - - -
- -

Overview

-

The ORKVisualConsentStepViewController class is a view controller subclass -used to manage a visual consent step (ORKVisualConsentStep).

- -

You should not need to instantiate a visual consent step view controller directly. Instead, include -a visual consent step in a task, and present a task view controller for that -task.

-
- - - - - -
- - - - - - -
-
- -

  animationView -

- -
-
- -
- - -
-

The view in which animations are displayed.

-
- - - -
@property (nonatomic, strong, nullable) UIView *animationView
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKVisualConsentStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWaitStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWaitStep.html deleted file mode 100644 index e66a8947bc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWaitStep.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - ORKWaitStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWaitStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKWaitStep.h
ORKWaitStep.m
- - - - -
- -

Overview

-

The ORKWaitStep class represents a step that displays a label and an activity -indicator mask.

- -

This task can be used to indicate to a user that a process is occuring that does - not need their input, and possibly indicate the progress that process has made. - To update the progress on screen, use the methods provided on the - ORKWaitStepViewController this step represents. Once the processing is complete, -goForward must be called on the ORKWaitStepViewController in order for the user to -be able to continue.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  indicatorType -

- -
-
- -
- - -
-

This property specifies the type of progress bar that will be displayed.

-
- - - -
@property (nonatomic) ORKProgressIndicatorType indicatorType
- - - - - - - - - -
-

Discussion

-

ORKProgressIndicatorTypeIndeterminate (default) is for indeterminate duration operations -ORKProgressIndicatorTypeProgressBar is for determinate duration operations

-
- - - - - - - -
-

Declared In

-

ORKWaitStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWaitStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWaitStepViewController.html deleted file mode 100644 index af2ea98586..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWaitStepViewController.html +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - ORKWaitStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWaitStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKStepViewController : UIViewController
Declared inORKWaitStepViewController.h
ORKWaitStepViewController.m
- - - - -
- -

Overview

-

The ORKWaitStepViewController class represents the step view controller that corresponds to an ORKWaitStep.

- -

It is not usually necessary to instantiate this view controller directly. -Instead, add a wait step to a task, and present the task in a task -view controller.

-
- - - - - -
- - - - - - -
-
- -

– setProgress:animated: -

- -
-
- -
- - -
-

Updates the amount of progress displayed in the progress bar if the current indicator mask is set to progress bar.

-
- - - -
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated
- - - -
-

Parameters

- - - - - - - - - - - - -
progress

The fraction of work completed on the range of zero to one.

animated

If true, the update is animated.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKWaitStepViewController.h

-
- - -
-
-
- -

– updateText: -

- -
-
- -
- - -
-

Updates the text on the step with the process that is occuring.

-
- - - -
- (void)updateText:(NSString *)text
- - - -
-

Parameters

- - - - - - - -
text

The description of the process that is occuring.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKWaitStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWalkingTaskStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWalkingTaskStep.html deleted file mode 100644 index 6553269c5c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWalkingTaskStep.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - ORKWalkingTaskStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWalkingTaskStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKWalkingTaskStep.h
ORKWalkingTaskStep.m
- - - - -
- -

Overview

-

The ORKWalkingTaskStep class implements a step that’s used in the predefined -walking task.

- -

You don’t usually need to instantiate a walking step directly; -instead, it is instantiated as part of a predefined task. See the -predefined active tasks defined in ORKOrderedTask.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

  numberOfStepsPerLeg -

- -
-
- -
- - -
-

The number of steps the user should be asked to take in each leg of the -walking task step.

-
- - - -
@property (nonatomic, assign) NSInteger numberOfStepsPerLeg
- - - - - - - - - -
-

Discussion

-

The step finishes when the number of steps have been completed, -or after 1.5 * numberOfStepsPerLeg seconds, whichever comes first.

-
- - - - - - - -
-

Declared In

-

ORKWalkingTaskStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWalkingTaskStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWalkingTaskStepViewController.html deleted file mode 100644 index 308c8c014f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWalkingTaskStepViewController.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - ORKWalkingTaskStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWalkingTaskStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKWalkingTaskStepViewController.h
ORKWalkingTaskStepViewController.m
- - - - -
- -

Overview

-

View controller corresponding to the ORKWalkingTaskStep.

- -

Observes the results of the pedometer, in order to finish early -when the threshold number of steps have been observed.

-
- - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStep.html deleted file mode 100644 index 780f4690c7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStep.html +++ /dev/null @@ -1,401 +0,0 @@ - - - - - - ORKWebViewStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWebViewStep Class Reference

- - -
- - - - - - - -
Inherits fromORKStep : NSObject
Declared inORKWebViewStep.h
ORKWebViewStep.m
- - - - -
- -

Overview

-

The ORKWebViewStep class represents a step that displays an embedded webview.

- -

This may be useful in cases where extreme custom styling is necessary, or an instrument -with specific requirements does not yet have a native implementation.

- -

In order to proceed to the next step from inside the webviewstep, you must execute this -line of javascript when the user should proceed:

- -

window.webkit.messageHandlers.ResearchKit.postMessage(answer);

- -

Where “answer” is the string answer that will be captured in the WebViewStepResult. -A string answer is required or the user will be unable to proceed.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

+ webViewStepWithIdentifier:html: -

- -
-
- -
- - -
-

Returns a new web view step that includes the specified identifier and will display the specified html.

-
- - - -
+ (instancetype)webViewStepWithIdentifier:(NSString *)identifier html:(NSString *)html
- - - -
-

Parameters

- - - - - - - - - - - - -
identifier

The identifier of the step (a step identifier should be unique within the task).

html

The html to be displayed in the webview.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKWebViewStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

  html -

- -
-
- -
- - -
-

Embedded html used for displaying the webview.

-
- - - -
@property (nonatomic, copy, nullable) NSString *html
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKWebViewStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStepResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStepResult.html deleted file mode 100644 index 2cf158aaa0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStepResult.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - ORKWebViewStepResult Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWebViewStepResult Class Reference

- - -
- - - - - - - -
Inherits fromORKResult : NSObject
Declared inORKWebViewStepResult.h
ORKWebViewStepResult.m
- - - - -
- -

Overview

-

The ORKWebViewStepResult class represents the result of a web view step (ORKWebViewStep).

- -

A web view result is produced by the task view controller when it presents a web view step.

-
- - - - - -
- - - - - - -
-
- -

  result -

- -
-
- -
- - -
-

The answer produced by the webview.

-
- - - -
@property (nonatomic, nullable) NSString *result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKWebViewStepResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStepViewController.html deleted file mode 100644 index cf77acd501..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWebViewStepViewController.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - ORKWebViewStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWebViewStepViewController Class Reference

- - -
- - - - - - - - - - -
Inherits fromORKStepViewController : UIViewController
Conforms toWKNavigationDelegate
WKScriptMessageHandler
Declared inORKWebViewStepViewController.h
ORKWebViewStepViewController.m
- - - - -
- -

Overview

-

The ORKWebViewStepViewController class is a step view controller subclass -used to manage a web view step (ORKWebViewStep).

- -

You should not need to instantiate a web view step view controller directly. Instead, include -a web view step in a task, and present a task view controller for that task.

-
- - - - - -
- - - - - - -
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWeightAnswerFormat.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWeightAnswerFormat.html deleted file mode 100644 index 6e2d117308..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKWeightAnswerFormat.html +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - ORKWeightAnswerFormat Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKWeightAnswerFormat Class Reference

- - -
- - - - - - - -
Inherits fromORKAnswerFormat : NSObject
Declared inORKAnswerFormat.h
ORKAnswerFormat.m
- - - - -
- -

Overview

-

The ORKWeightAnswerFormat class represents the answer format for questions that require users -to enter a weight.

- -

A weight answer format produces an ORKNumericQuestionResult object. The result is always reported -in the metric system using the kg unit.

-
- - - - - -
- - - - -

Other Methods

- -
-
- -

– init -

- -
-
- -
- - -
-

Returns an initialized weight answer format using the measurement system specified in the current -locale.

-
- - - -
- (instancetype)init
- - - - - -
-

Return Value

-

An initialized weight answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMeasurementSystem: -

- -
-
- -
- - -
-

Returns an initialized weight answer format using the specified measurement system.

-
- - - -
- (instancetype)initWithMeasurementSystem:(ORKMeasurementSystem)measurementSystem
- - - -
-

Parameters

- - - - - - - -
measurementSystem

The measurement system to use. See ORKMeasurementSystem for the -accepted values.

-
- - - -
-

Return Value

-

An initialized weight answer format.

-
- - - - - -
-

Discussion

-

This method is the designated initializer.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMeasurementSystem:numericPrecision: -

- -
-
- -
- - -
-

Returns an initialized weight answer format using the specified measurement system and numeric -precision.

-
- - - -
- (instancetype)initWithMeasurementSystem:(ORKMeasurementSystem)measurementSystem numericPrecision:(ORKNumericPrecision)numericPrecision
- - - -
-

Parameters

- - - - - - - - - - - - -
measurementSystem

The measurement system to use. See ORKMeasurementSystem for the - accepted values.

numericPrecision

The numeric precision used by the picker. If you pass - ORKNumericPrecisionDefault, the picker will use 0.5 kg - increments for the metric measurement system and whole pound - increments for the USC measurement system, which mimics the - default iOS behavior. If you pass ORKNumericPrecisionLow, the - picker will use 1 kg increments for the metric measurement - system and whole pound increments for the USC measurement - system. If you pass ORKNumericPrecisionHigher, the picker - use 0.01 gr increments for the metric measurement system, - and ounce increments for the USC measurement system.

-
- - - -
-

Return Value

-

An initialized weight answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

– initWithMeasurementSystem:numericPrecision:minimumValue:maximumValue:defaultValue: -

- -
-
- -
- - -
-

Returns an initialized weight answer format using the specified measurement system, numeric -precision, and default, minimum and maximum values.

-
- - - -
- (instancetype)initWithMeasurementSystem:(ORKMeasurementSystem)measurementSystem numericPrecision:(ORKNumericPrecision)numericPrecision minimumValue:(double)minimumValue maximumValue:(double)maximumValue defaultValue:(double)defaultValue
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
measurementSystem

The measurement system to use. See ORKMeasurementSystem for the - accepted values.

numericPrecision

The numeric precision used by the picker. If you pass - ORKNumericPrecisionDefault, the picker will use 0.5 kg - increments for the metric measurement system and whole pound - increments for the USC measurement system, which mimics the - default iOS behavior. If you pass ORKNumericPrecisionLow, the - picker will use 1 kg increments for the metric measurement - system and whole pound increments for the USC measurement - system. If you pass ORKNumericPrecisionHigher, the picker - use 0.01 gr increments for the metric measurement system, - and ounce increments for the USC measurement system.

minimumValue

The minimum value that is displayed in the picker. If you specify - ORKDefaultValue, the minimum values are 0 kg when using the - metric measurement system and 0 lbs when using the USC - measurement system.

maximumValue

The maximum value that is displayed in the picker. If you specify - ORKDefaultValue, the maximum values are 657 kg when using the - metric measurement system and 1,450 lbs when using the USC - measurement system.

defaultValue

The default value to be initially selected in the picker. If you - specify ORKDefaultValue, the initally selected values are - 60 kg when using the metric measurement system and 133 lbs when - using the USC measurement system. This value must be between - minimumValue and maximumValue.

-
- - - -
-

Return Value

-

An initialized weight answer format.

-
- - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  measurementSystem -

- -
-
- -
- - -
-

Indicates the measurement system used by the answer format.

-
- - - -
@property (readonly) ORKMeasurementSystem measurementSystem
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  numericPrecision -

- -
-
- -
- - -
-

The numeric precision used by the picker.

-
- - - -
@property (readonly, getter=isAdditionalPrecision) ORKNumericPrecision numericPrecision
- - - - - - - - - -
-

Discussion

-

An ORKNumericPrecisionDefault value indicates that the picker will use 0.5 kg increments for the -metric measurement system and whole pound increments for the USC measurement system, which mimics -the default iOS behavior. An ORKNumericPrecisionLow value indicates that the picker will use -1 kg increments for the metric measurement system and whole pound increments for the USC -measurement system. An ORKNumericPrecisionHigher value indicates that the picker will use -0.01 gr increments for the metric measurement system and ounce increments for the USC measurement -system.

- -

The default value of this property is ORKNumericPrecisionDefault.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  minimumValue -

- -
-
- -
- - -
-

The minimum value that is displayed in the picker.

-
- - - -
@property (readonly) double minimumValue
- - - - - - - - - -
-

Discussion

-

When this property has a value equal to ORKDefaultValue, the minimum values are 0 kg when using -the metric measurement system and 0 lbs when using the USC measurement system.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  maximumValue -

- -
-
- -
- - -
-

The maximum value that is displayed in the picker.

-
- - - -
@property (readonly) double maximumValue
- - - - - - - - - -
-

Discussion

-

When this property has a value equal to ORKDefaultValue, the maximum values are 657 kg when using -the metric measurement system and 1,450 lbs when using the USC measurement system.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
- -

  defaultValue -

- -
-
- -
- - -
-

The default value to initially selected in the picker.

-
- - - -
@property (readonly) double defaultValue
- - - - - - - - - -
-

Discussion

-

When this property has a value equal to ORKDefaultValue, the initally selected values are 60 kg -when using the metric measurement system and 133 lbs when using the USC measurement system. This -value must be between minimumValue and maximumValue.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- - - -

Other Methods

- -
-
- -

– questionType -

- -
-
- -
- - -
-

The type of question. (read-only)

-
- - - -
- (ORKQuestionType)questionType
- - - - - - - - - -
-

Discussion

-

You can use this enumerated value in your Objective-C code to switch on -a rough approximation of the type of question that is being asked.

- -

Note that answer format subclasses override the getter to return the appropriate question -type.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryAudioGenerator.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryAudioGenerator.html deleted file mode 100644 index e9f03c58fc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryAudioGenerator.html +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - ORKdBHLToneAudiometryAudioGenerator Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKdBHLToneAudiometryAudioGenerator Class Reference

- - -
- - - - - - - -
Inherits fromNSObject
Declared inORKdBHLToneAudiometryAudioGenerator.h
ORKdBHLToneAudiometryAudioGenerator.m
- - - - - - -
- - - - - - -
-
- -

– stop -

- -
-
- -
- - -
-

Stops the audio being played.

-
- - - -
- (void)stop
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKdBHLToneAudiometryAudioGenerator.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryOnboardingStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryOnboardingStep.html deleted file mode 100644 index 19757db383..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryOnboardingStep.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - ORKdBHLToneAudiometryOnboardingStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKdBHLToneAudiometryOnboardingStep Class Reference

- - -
- - - - - - - -
Inherits fromORKFormStep : ORKStep : NSObject
Declared inORKdBHLToneAudiometryOnboardingStep.h
ORKdBHLToneAudiometryOnboardingStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryOnboardingStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryOnboardingStepViewController.html deleted file mode 100644 index 97f5ca6110..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryOnboardingStepViewController.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - ORKdBHLToneAudiometryOnboardingStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKdBHLToneAudiometryOnboardingStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKFormStepViewController : ORKStepViewController : UIViewController
Declared inORKdBHLToneAudiometryOnboardingStepViewController.h
ORKdBHLToneAudiometryOnboardingStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– goForward -

- -
-
- -
- - -
-

Navigates forward to the next step.

-
- - - -
- (void)goForward
- - - - - - - - - -
-

Discussion

-

When a user taps a Next button, the information passes through this method. You can use this method as an override -point or a target action for a subclass.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryStep.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryStep.html deleted file mode 100644 index e5bdaffcea..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryStep.html +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - ORKdBHLToneAudiometryStep Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKdBHLToneAudiometryStep Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStep : ORKStep : NSObject
Declared inORKdBHLToneAudiometryStep.h
ORKdBHLToneAudiometryStep.m
- - - - - - -
- - - - - - -
-
- -

+ stepViewControllerClass -

- -
-
- -
- - - - -
+ (Class)stepViewControllerClass
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithIdentifier: -

- -
-
- -
- - - - -
- (instancetype)initWithIdentifier:(NSString *)identifier
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Checks the parameters of the step and throws exceptions on invalid parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

This method is called when there is a need to validate the step’s parameters, which is typically -the case when adding a step to an ORKStepViewController object, and when presenting the -step view controller.

- -

Subclasses should override this method to provide validation of their additional -properties, and must call super.

-
- - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
- -

– initWithCoder: -

- -
-
- -
- - - - -
- (instancetype)initWithCoder:(NSCoder *)aDecoder
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryStepViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryStepViewController.html deleted file mode 100644 index 23da587c4a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/ORKdBHLToneAudiometryStepViewController.html +++ /dev/null @@ -1,361 +0,0 @@ - - - - - - ORKdBHLToneAudiometryStepViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKdBHLToneAudiometryStepViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKActiveStepViewController : ORKStepViewController : UIViewController
Declared inORKdBHLToneAudiometryStepViewController.h
ORKdBHLToneAudiometryStepViewController.m
- - - - - - -
- - - - - - -
-
- -

– initWithStep: -

- -
-
- -
- - -
-

Returns a new step view controller for the specified step.

-
- - - -
- (instancetype)initWithStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - -
step

The step to be presented.

-
- - - -
-

Return Value

-

A newly initialized step view controller.

-
- - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– result -

- -
-
- -
- - -
-

The current state of the result. (read-only)

-
- - - -
- (ORKStepResult *)result
- - - - - - - - - -
-

Discussion

-

The task view controller uses this property to get the results for the -step, and to collate them into the task result.

- -

The current step result and any subsidiary results representing data collected -so far are available in this property. You can detect significant changes to the result, -such as when the user enters a new answer, using the -stepViewControllerResultDidChange: delegate callback.

- -

Subclasses must use this property to return the current results. -Subclasses may call super to obtain -a clean, empty result object appropriate for the step, to which they can -attach appropriate child results.

- -

The implementations of this method in the ResearchKit framework currently create a new -result object on every call, so do not call this method unless it is -actually necessary.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepDidFinish -

- -
-
- -
- - -
-

Tells the view controller that the active step has finished.

-
- - - -
- (void)stepDidFinish
- - - - - - - - - -
-

Discussion

-

This method is an override point for subclasses, called by the base class when -the step has just finished.

- -

The default implementation does nothing except in the case of steps that have countdown -enabled. When countdown is enabled in a step, the view controller attempts to navigate automatically to the next step, if so configured.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
- -

– start -

- -
-
- -
- - -
-

Starts the active step.

-
- - - -
- (void)start
- - - - - - - - - -
-

Discussion

-

Call this method to start the timer on the active step, if there is one, and -to start any data recording.

- -

When you start the step, recorders are instantiated based on their configurations and then started. All -timers should start, and the UI should show users that the step is in progress.

- -

This method does nothing if the step has already started.

- -

Subclasses should super when overriding this method.

-
- - - - - - - -
-

Declared In

-

ORKActiveStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/TestTaskViewControllerDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/TestTaskViewControllerDelegate.html deleted file mode 100644 index dcfd4f80f1..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/TestTaskViewControllerDelegate.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - TestTaskViewControllerDelegate Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

TestTaskViewControllerDelegate Class Reference

- - -
- - - - - - - - - - -
Inherits fromNSObject
Conforms toORKTaskViewControllerDelegate
Declared inORKTaskTests.m
- - - - - - -
- - - - - - -
-
- -

– taskViewController:didFinishWithReason:error: -

- -
-
- -
- - -
-

Tells the delegate that the task has finished.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskViewControllerFinishReason)reason error:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
taskViewController

The ORKTaskViewControllerinstance that is returning the result.

reason

An ORKTaskViewControllerFinishReason value indicating how the user chose to complete the task.

error

If failure occurred, an NSError object indicating the reason for the failure. The value of this parameter is nil if result does not indicate failure.

-
- - - - - - - -
-

Discussion

-

The task view controller calls this method when an unrecoverable error occurs, -when the user has canceled the task (with or without saving), or when the user -completes the last step in the task.

- -

In most circumstances, the receiver should dismiss the task view controller -in response to this method, and may also need to collect and process the results -of the task.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:stepViewControllerWillDisappear:navigationDirection: -

- -
-
- -
- - -
-

Tells the delegate that a step will disappear.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillDisappear:(ORKStepViewController *)stepViewController navigationDirection:(ORKStepViewControllerNavigationDirection)direction
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

stepViewController

The ORKStepViewController that has just finished.

direction

The ORKStepViewControllerNavigationDirection of navigation.

-
- - - - - - - -
-

Discussion

-

This is called in the ORKStepViewControllerDelegate method for stepViewController:didFinishWithNavigationDirection: -after saving the result of the step to the task view controller and before navigating to the next/previous step.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/VerificationViewController.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/VerificationViewController.html deleted file mode 100644 index d4ef6429d4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Classes/VerificationViewController.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - VerificationViewController Class Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

VerificationViewController Class Reference

- - -
- - - - - - - -
Inherits fromORKVerificationStepViewController : ORKStepViewController : UIViewController
Declared inTaskFactory+Onboarding.m
- - - - -
- -

Overview

-

A subclass is required for the verification step.

- -

The implementation below demonstrates how to subclass and override button actions.

-
- - - - - -
- - - - - - -
-
- -

– resendEmailButtonTapped -

- -
-
- -
- - -
-

Action method for the resend email button.

-
- - - -
- (void)resendEmailButtonTapped
- - - - - - - - - -
-

Discussion

-

Override this method to provide custom logic for the button action.

-
- - - - - - - -
-

Declared In

-

ORKVerificationStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKAmslerGridEyeSide.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKAmslerGridEyeSide.html deleted file mode 100644 index c65fcbafe3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKAmslerGridEyeSide.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - ORKAmslerGridEyeSide Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAmslerGridEyeSide Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKAmslerGridEyeSide

- - -
-

Eye side for amsler grid

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKAmslerGridEyeSide ) {
- -    ORKAmslerGridEyeSideNotSpecified = 0,
- -    ORKAmslerGridEyeSideLeft,
- -    ORKAmslerGridEyeSideRight,
- - };
- -
- -
-

Constants

-
- -
ORKAmslerGridEyeSideNotSpecified
-
- - -
 Not Specified
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKAmslerGridEyeSideLeft
-
- - -
 Left Eye
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKAmslerGridEyeSideRight
-
- - -
 Right Eye
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKAudioChannel.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKAudioChannel.html deleted file mode 100644 index 2b5433dba7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKAudioChannel.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - ORKAudioChannel Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAudioChannel Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKAudioChannel

- - -
-

Audio channel constants.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKAudioChannel ) {
- -    ORKAudioChannelLeft,
- -    ORKAudioChannelRight,
- - };
- -
- -
-

Constants

-
- -
ORKAudioChannelLeft
-
- - -

The left audio channel.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKAudioChannelRight
-
- - -

The right audio channel.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKBodySagittal.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKBodySagittal.html deleted file mode 100644 index f9295cda5f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKBodySagittal.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - ORKBodySagittal Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKBodySagittal Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKBodySagittal

- - -
-

Body side constants.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKBodySagittal ) {
- -    ORKBodySagittalLeft,
- -    ORKBodySagittalRight,
- - };
- -
- -
-

Constants

-
- -
ORKBodySagittalLeft
-
- - -

The left side.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKBodySagittalRight
-
- - -

The right side.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKChoiceAnswerStyle.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKChoiceAnswerStyle.html deleted file mode 100644 index 096c63340c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKChoiceAnswerStyle.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - ORKChoiceAnswerStyle Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKChoiceAnswerStyle Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKChoiceAnswerStyle

- - -
-

An enumeration of the types of answer choices available.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKChoiceAnswerStyle ) {
- -    ORKChoiceAnswerStyleSingleChoice,
- -    ORKChoiceAnswerStyleMultipleChoice,
- - };
- -
- -
-

Constants

-
- -
ORKChoiceAnswerStyleSingleChoice
-
- - -
 A single choice question lets the participant pick a single predefined answer option.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKChoiceAnswerStyleMultipleChoice
-
- - -
 A multiple choice question lets the participant pick one or more predefined answer options.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKConsentReviewPhase.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKConsentReviewPhase.html deleted file mode 100644 index 772f79c688..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKConsentReviewPhase.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - ORKConsentReviewPhase Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentReviewPhase Constants Reference

- - -
- - - - -
Declared inORKConsentReviewStepViewController.m
- - - - - - - -

ORKConsentReviewPhase

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKConsentReviewPhase ) {
- -    ORKConsentReviewPhaseName,
- -    ORKConsentReviewPhaseReviewDocument,
- -    ORKConsentReviewPhaseSignature,
- - };
- -
- -
-

Constants

-
- -
ORKConsentReviewPhaseName
-
- - -

- Declared In ORKConsentReviewStepViewController.m. -

- -
- -
ORKConsentReviewPhaseReviewDocument
-
- - -

- Declared In ORKConsentReviewStepViewController.m. -

- -
- -
ORKConsentReviewPhaseSignature
-
- - -

- Declared In ORKConsentReviewStepViewController.m. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKConsentSectionType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKConsentSectionType.html deleted file mode 100644 index de4a599b38..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKConsentSectionType.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - ORKConsentSectionType Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKConsentSectionType Constants Reference

- - -
- - - - -
Declared inORKConsentSection.h
- - - - - - - -

ORKConsentSectionType

- - -
-

ORKConsentSectionType enumerates the predefined visual consent sections -available in the ResearchKit framework.

- -

Although the visuals are predefined, and default localized titles and Learn -More button titles are provided, you need to provide in ORKConsentSection the summary strapline on each visual consent -page and the actual Learn More content, because these items are specific to each individual -study.

- -

Not every section is applicable to every study, and most studies -are likely to require additional sections.

-
- - - - -
-

Constants

-
- -
ORKConsentSectionTypeOverview
-
- - -
 Overview of the informed consent process.
-
- This content can inform the user of what to expect during the process,
- and provide general background information on the purpose of the study.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeDataGathering
-
- - -
 A section informing the user that sensor data will be collected.
-
- This content can identify which sensors will be used, for how long,
- and for what purpose.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypePrivacy
-
- - -
 A section describing the privacy policies for the study.
-
- This content can describe how data is protected, the processes used
- to sanitize the collected data or make it anonymous, and address the risks
- involved.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeDataUse
-
- - -
 A section describing how the collected data will be used.
-
- This content can include details about those who will have access to the data, the types of
- analysis that will be performed, and the degree of control the participant
- may have over the data after it is collected.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeTimeCommitment
-
- - -
A section describing how much time is required for the study.
-
- This content can help users understand what to expect as they participate in the study.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeStudySurvey
-
- - -
 A section describing survey use in the study.
-
- This content can explain how survey data will be collected, for what purpose,
- and make it clear to what extent participation is optional.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeStudyTasks
-
- - -
 A section describing active task use in the study.
-
- This content can describe what types of tasks need to be performed, how
- often, and for what purpose. Any risks that are involved can
- also be communicated in this section.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeWithdrawing
-
- - -
 A section describing how to withdraw from the study.
-
- This section can describe the policies
- that govern the collected data if the user decides to withdraw.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeCustom
-
- - -
 A custom section.
-
- Custom sections don't have a predefined title, summary, content, image,
- or animation. A consent document may have as many or as few custom sections
- as needed.
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
ORKConsentSectionTypeOnlyInDocument
-
- - -
 Document-only sections.
-
- Document-only sections are ignored for a visual consent step and are only
- displayed in a consent review step (assuming no value is provided for the  `htmlReviewContent` property).
-
- - - - - - -

- Declared In ORKConsentSection.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKConsentSection.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKDateAnswerStyle.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKDateAnswerStyle.html deleted file mode 100644 index 033c719dc2..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKDateAnswerStyle.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - ORKDateAnswerStyle Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDateAnswerStyle Constants Reference

- - -
- - - - -
Declared inORKAnswerFormat.h
- - - - - - - -

ORKDateAnswerStyle

- - -
-

The style of date picker to use in an ORKDateAnswerFormat object.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKDateAnswerStyle ) {
- -    ORKDateAnswerStyleDateAndTime,
- -    ORKDateAnswerStyleDate,
- - };
- -
- -
-

Constants

-
- -
ORKDateAnswerStyleDateAndTime
-
- - -
 The date and time question type asks participants to choose a time or a combination of date
- and time, from a picker.
-
- - - - - - -

- Declared In ORKAnswerFormat.h. -

- -
- -
ORKDateAnswerStyleDate
-
- - -
 The date question type asks participants to choose a particular date from a picker.
-
- - - - - - -

- Declared In ORKAnswerFormat.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKErrorCode.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKErrorCode.html deleted file mode 100644 index 44c0a84d41..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKErrorCode.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - ORKErrorCode Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKErrorCode Constants Reference

- - -
- - - - -
Declared inORKErrors.h
- - - - - - - -

ORKErrorCode

- - -
-

ORKErrorCode codes are used for errors in the domain ORKErrorDomain.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKErrorCode ) {
- -    ORKErrorObjectNotFound = 1,
- -    ORKErrorInvalidObject,
- -    ORKErrorException,
- -    ORKErrorMultipleErrors,
- - };
- -
- -
-

Constants

-
- -
ORKErrorObjectNotFound
-
- - -

No matching object was found.

- - - - - - -

- Declared In ORKErrors.h. -

- -
- -
ORKErrorInvalidObject
-
- - -

An object was invalid and processing could not continue.

- - - - - - -

- Declared In ORKErrors.h. -

- -
- -
ORKErrorException
-
- - -

An exception was caught during an operation.

- - - - - - -

- Declared In ORKErrors.h. -

- -
- -
ORKErrorMultipleErrors
-
- - -

Multiple errors were encountered during an operation.

- - - - - - -

- Declared In ORKErrors.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKErrors.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKFileProtectionMode.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKFileProtectionMode.html deleted file mode 100644 index b30c21e155..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKFileProtectionMode.html +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - ORKFileProtectionMode Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKFileProtectionMode Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKFileProtectionMode

- - -
-

File protection mode constants.

- -

The file protection mode constants correspond directly to NSFileProtection constants, but are -more convenient to manipulate than strings. Complete file protection is -highly recommended for files containing personal data that will be kept -persistently.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKFileProtectionMode ) {
- -    ORKFileProtectionNone = 0,
- -    ORKFileProtectionCompleteUntilFirstUserAuthentication,
- -    ORKFileProtectionCompleteUnlessOpen,
- -    ORKFileProtectionComplete,
- - };
- -
- -
-

Constants

-
- -
ORKFileProtectionNone
-
- - -

No file protection.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKFileProtectionCompleteUntilFirstUserAuthentication
-
- - -

Complete file protection until first user authentication.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKFileProtectionCompleteUnlessOpen
-
- - -

Complete file protection unless there was an open file handle before lock.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKFileProtectionComplete
-
- - -

Complete file protection while the device is locked.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKGraphAnimationType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKGraphAnimationType.html deleted file mode 100644 index f431f8c78b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKGraphAnimationType.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - ORKGraphAnimationType Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKGraphAnimationType Constants Reference

- - -
- - - - -
Declared inORKGraphChartView_Internal.h
- - - - - - - -

ORKGraphAnimationType

- -
- - -

Definition

- typedef NS_ENUM(NSUInteger, ORKGraphAnimationType ) {
- -    ORkGraphAnimationTypeNone,
- -    ORKGraphAnimationTypeFade,
- -    ORKGraphAnimationTypeGrow,
- -    ORKGraphAnimationTypePop,
- - };
- -
- -
-

Constants

-
- -
ORkGraphAnimationTypeNone
-
- - -

- Declared In ORKGraphChartView_Internal.h. -

- -
- -
ORKGraphAnimationTypeFade
-
- - -

- Declared In ORKGraphChartView_Internal.h. -

- -
- -
ORKGraphAnimationTypeGrow
-
- - -

- Declared In ORKGraphChartView_Internal.h. -

- -
- -
ORKGraphAnimationTypePop
-
- - -

- Declared In ORKGraphChartView_Internal.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKMeasurementSystem.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKMeasurementSystem.html deleted file mode 100644 index a99d1728ca..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKMeasurementSystem.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - ORKMeasurementSystem Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKMeasurementSystem Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKMeasurementSystem

- - -
-

Measurement system.

- -

Used by ORKHeightAnswerFormat and ORKWeightAnswerFormat.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKMeasurementSystem ) {
- -    ORKMeasurementSystemLocal = 0,
- -    ORKMeasurementSystemMetric,
- -    ORKMeasurementSystemUSC,
- - };
- -
- -
-

Constants

-
- -
ORKMeasurementSystemLocal
-
- - -

Measurement system in use by the current locale.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKMeasurementSystemMetric
-
- - -

Metric measurement system.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKMeasurementSystemUSC
-
- - -

United States customary system.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNavigationContainerButtonStyle.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNavigationContainerButtonStyle.html deleted file mode 100644 index 7d4ec42f63..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNavigationContainerButtonStyle.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - ORKNavigationContainerButtonStyle Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNavigationContainerButtonStyle Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKNavigationContainerButtonStyle

- - -
-

An enumeration of the types of button styles for Navigation Containers.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKNavigationContainerButtonStyle ) {
- -    ORKNavigationContainerButtonStyleTextStandard = 0,
- -    ORKNavigationContainerButtonStyleTextBold,
- -    ORKNavigationContainerButtonStyleRoundedRect,
- - };
- -
- -
-

Constants

-
- -
ORKNavigationContainerButtonStyleTextStandard
-
- - -
 A standard ORKText button.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKNavigationContainerButtonStyleTextBold
-
- - -
 A text button with Bold title.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKNavigationContainerButtonStyleRoundedRect
-
- - -
 A rounded rect button.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumberFormattingStyle.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumberFormattingStyle.html deleted file mode 100644 index 9eba14a7b8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumberFormattingStyle.html +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - ORKNumberFormattingStyle Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNumberFormattingStyle Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKNumberFormattingStyle

- - -
-

An enumeration of the format styles available for scale answers.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKNumberFormattingStyle ) {
- -    ORKNumberFormattingStyleDefault,
- -    ORKNumberFormattingStylePercent,
- - };
- -
- -
-

Constants

-
- -
ORKNumberFormattingStyleDefault
-
- - -
 The default decimal style.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKNumberFormattingStylePercent
-
- - -
 Percent style.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumericAnswerStyle.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumericAnswerStyle.html deleted file mode 100644 index e32fcd4237..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumericAnswerStyle.html +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - ORKNumericAnswerStyle Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNumericAnswerStyle Constants Reference

- - -
- - - - -
Declared inORKAnswerFormat.h
- - - - - - - -

ORKNumericAnswerStyle

- - -
-

The style of answer for an ORKNumericAnswerFormat object, which controls the keyboard that is -presented during numeric entry.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKNumericAnswerStyle ) {
- -    ORKNumericAnswerStyleDecimal,
- -    ORKNumericAnswerStyleInteger,
- - };
- -
- -
-

Constants

-
- -
ORKNumericAnswerStyleDecimal
-
- - -
 A decimal question type asks the participant to enter a decimal number.
-
- - - - - - -

- Declared In ORKAnswerFormat.h. -

- -
- -
ORKNumericAnswerStyleInteger
-
- - -
 An integer question type asks the participant to enter an integer number.
-
- - - - - - -

- Declared In ORKAnswerFormat.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKAnswerFormat.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumericPrecision.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumericPrecision.html deleted file mode 100644 index 6d8e196031..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKNumericPrecision.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - ORKNumericPrecision Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKNumericPrecision Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKNumericPrecision

- - -
-

Numeric precision.

- -

Used by ORKWeightAnswerFormat.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKNumericPrecision ) {
- -    ORKNumericPrecisionDefault = 0,
- -    ORKNumericPrecisionLow,
- -    ORKNumericPrecisionHigh,
- - };
- -
- -
-

Constants

-
- -
ORKNumericPrecisionDefault
-
- - -

Default numeric precision.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKNumericPrecisionLow
-
- - -

Low numeric precision.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKNumericPrecisionHigh
-
- - -

High numeric preicision.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKOperationState.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKOperationState.html deleted file mode 100644 index 952ea4de93..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKOperationState.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - ORKOperationState Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKOperationState Constants Reference

- - -
- - - - -
Declared inORKOperation.h
- - - - - - - -

ORKOperationState

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKOperationState ) {
- -    ORKOperationReady,
- -    ORKOperationExecuting,
- -    ORKOperationFinished,
- - };
- -
- -
-

Constants

-
- -
ORKOperationReady
-
- - -

- Declared In ORKOperation.h. -

- -
- -
ORKOperationExecuting
-
- - -

- Declared In ORKOperation.h. -

- -
- -
ORKOperationFinished
-
- - -

- Declared In ORKOperation.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPDFViewerActionBarOption.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPDFViewerActionBarOption.html deleted file mode 100644 index c7b25febdb..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPDFViewerActionBarOption.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - ORKPDFViewerActionBarOption Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPDFViewerActionBarOption Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKPDFViewerActionBarOption

- - -
-

Enums to exclude options from ORKPDFViewerStep.

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSUInteger, ORKPDFViewerActionBarOption ) {
- -    ORKPDFViewerActionBarOptionExcludeThumbnail = 1 < < 0,
- -    ORKPDFViewerActionBarOptionExcludeAnnotation = 1 < < 1,
- -    ORKPDFViewerActionBarOptionExcludeSearch = 1 < < 2,
- -    ORKPDFViewerActionBarOptionExcludeShare = 1 < < 3,
- - };
- -
- -
-

Constants

-
- -
ORKPDFViewerActionBarOptionExcludeThumbnail
-
- - -

Enums to exclude options from ORKPDFViewerStep.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPDFViewerActionBarOptionExcludeAnnotation
-
- - -

Enums to exclude options from ORKPDFViewerStep.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPDFViewerActionBarOptionExcludeSearch
-
- - -

Enums to exclude options from ORKPDFViewerStep.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPDFViewerActionBarOptionExcludeShare
-
- - -

Enums to exclude options from ORKPDFViewerStep.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPSATPresentationMode.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPSATPresentationMode.html deleted file mode 100644 index 17852bfd5a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPSATPresentationMode.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - ORKPSATPresentationMode Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPSATPresentationMode Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKPSATPresentationMode

- - -
-

Values that identify the presentation mode of paced serial addition tests that are auditory and/or visual (PSAT).

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSInteger, ORKPSATPresentationMode ) {
- -    ORKPSATPresentationModeAuditory = 1 < < 0,
- -    ORKPSATPresentationModeVisual = 1 < < 1,
- - };
- -
- -
-

Constants

-
- -
ORKPSATPresentationModeAuditory
-
- - -

The PASAT (Paced Auditory Serial Addition Test).

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPSATPresentationModeVisual
-
- - -

The PVSAT (Paced Visual Serial Addition Test).

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPageNavigationDirection.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPageNavigationDirection.html deleted file mode 100644 index 730dae4711..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPageNavigationDirection.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - ORKPageNavigationDirection Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPageNavigationDirection Constants Reference

- - -
- - - - -
Declared inORKPageStepViewController.m
- - - - - - - -

ORKPageNavigationDirection

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKPageNavigationDirection ) {
- -    ORKPageNavigationDirectionNone = 0,
- -    ORKPageNavigationDirectionForward = 1,
- -    ORKPageNavigationDirectionReverse = -1,
- - };
- -
- -
-

Constants

-
- -
ORKPageNavigationDirectionNone
-
- - -

- Declared In ORKPageStepViewController.m. -

- -
- -
ORKPageNavigationDirectionForward
-
- - -

- Declared In ORKPageStepViewController.m. -

- -
- -
ORKPageNavigationDirectionReverse
-
- - -

- Declared In ORKPageStepViewController.m. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeFlow.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeFlow.html deleted file mode 100644 index 5b083c1c02..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeFlow.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - ORKPasscodeFlow Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeFlow Constants Reference

- - -
- - - - -
Declared inORKPasscodeStep.h
- - - - - - - -

ORKPasscodeFlow

- - -
-

An enumeration of values used in ORKPasscodeStepViewController to indicate the type of flow used -by the view controller.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSUInteger, ORKPasscodeFlow ) {
- -    ORKPasscodeFlowCreate,
- -    ORKPasscodeFlowAuthenticate,
- -    ORKPasscodeFlowEdit,
- - };
- -
- -
-

Constants

-
- -
ORKPasscodeFlowCreate
-
- - -

An enumeration of values used in ORKPasscodeStepViewController to indicate the type of flow used -by the view controller.

- - - - - - -

- Declared In ORKPasscodeStep.h. -

- -
- -
ORKPasscodeFlowAuthenticate
-
- - -

An enumeration of values used in ORKPasscodeStepViewController to indicate the type of flow used -by the view controller.

- - - - - - -

- Declared In ORKPasscodeStep.h. -

- -
- -
ORKPasscodeFlowEdit
-
- - -

An enumeration of values used in ORKPasscodeStepViewController to indicate the type of flow used -by the view controller.

- - - - - - -

- Declared In ORKPasscodeStep.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKPasscodeStep.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeState.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeState.html deleted file mode 100644 index 5373847790..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeState.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - ORKPasscodeState Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeState Constants Reference

- - -
- - - - -
Declared inORKPasscodeStepViewController_Internal.h
- - - - - - - -

ORKPasscodeState

- -
- - -

Definition

- typedef NS_ENUM(NSUInteger, ORKPasscodeState ) {
- -    ORKPasscodeStateEntry,
- -    ORKPasscodeStateConfirm,
- -    ORKPasscodeStateSaved,
- -    ORKPasscodeStateOldEntry,
- -    ORKPasscodeStateNewEntry,
- -    ORKPasscodeStateConfirmNewEntry,
- - };
- -
- -
-

Constants

-
- -
ORKPasscodeStateEntry
-
- - -

- Declared In ORKPasscodeStepViewController_Internal.h. -

- -
- -
ORKPasscodeStateConfirm
-
- - -

- Declared In ORKPasscodeStepViewController_Internal.h. -

- -
- -
ORKPasscodeStateSaved
-
- - -

- Declared In ORKPasscodeStepViewController_Internal.h. -

- -
- -
ORKPasscodeStateOldEntry
-
- - -

- Declared In ORKPasscodeStepViewController_Internal.h. -

- -
- -
ORKPasscodeStateNewEntry
-
- - -

- Declared In ORKPasscodeStepViewController_Internal.h. -

- -
- -
ORKPasscodeStateConfirmNewEntry
-
- - -

- Declared In ORKPasscodeStepViewController_Internal.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeType.html deleted file mode 100644 index 962ba83e8a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPasscodeType.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - ORKPasscodeType Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeType Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKPasscodeType

- - -
-

Identify the type of passcode authentication for ORKPasscodeStepViewController.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKPasscodeType ) {
- -    ORKPasscodeType4Digit,
- -    ORKPasscodeType6Digit,
- - };
- -
- -
-

Constants

-
- -
ORKPasscodeType4Digit
-
- - -

4 digit pin entry

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPasscodeType6Digit
-
- - -

6 digit pin entry

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPermissionMask.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPermissionMask.html deleted file mode 100644 index 10da42dec8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPermissionMask.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - ORKPermissionMask Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPermissionMask Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKPermissionMask

- - -
-

You can use a permission mask to specify a set of permissions to acquire or -that have been acquired for a task or step.

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSInteger, ORKPermissionMask ) {
- -    ORKPermissionNone = 0,
- -    ORKPermissionCoreMotionActivity = ( 1 < < 1 ),
- -    ORKPermissionCoreMotionAccelerometer = ( 1 < < 2 ),
- -    ORKPermissionAudioRecording = ( 1 < < 3 ),
- -    ORKPermissionCoreLocation = ( 1 < < 4 ),
- -    ORKPermissionCamera = ( 1 < < 5 ),
- - };
- -
- -
-

Constants

-
- -
ORKPermissionNone
-
- - -

No permissions.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPermissionCoreMotionActivity
-
- - -

Access to CoreMotion activity is required.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPermissionCoreMotionAccelerometer
-
- - -

Access to CoreMotion accelerometer data.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPermissionAudioRecording
-
- - -

Access for audio recording.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPermissionCoreLocation
-
- - -

Access to location.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPermissionCamera
-
- - -

Access to camera.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskHandOption.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskHandOption.html deleted file mode 100644 index c17918a6ca..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskHandOption.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - ORKPredefinedTaskHandOption Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPredefinedTaskHandOption Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKPredefinedTaskHandOption

- - -
-

Values that identify the hand(s) to be used in an active task.

- -

By default, the participant will be asked to use their most affected hand.

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSUInteger, ORKPredefinedTaskHandOption ) {
- -    ORKPredefinedTaskHandOptionUnspecified = 0,
- -    ORKPredefinedTaskHandOptionLeft = 1 < < 1,
- -    ORKPredefinedTaskHandOptionRight = 1 < < 2,
- -    ORKPredefinedTaskHandOptionBoth = ORKPredefinedTaskHandOptionLeft | ORKPredefinedTaskHandOptionRight,
- - };
- -
- -
-

Constants

-
- -
ORKPredefinedTaskHandOptionUnspecified
-
- - -

Which hand to use is undefined

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskHandOptionLeft
-
- - -

Task should test the left hand

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskHandOptionRight
-
- - -

Task should test the right hand

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskHandOptionBoth
-
- - -

Task should test both hands (random order)

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskLimbOption.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskLimbOption.html deleted file mode 100644 index db22eec663..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskLimbOption.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - ORKPredefinedTaskLimbOption Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPredefinedTaskLimbOption Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKPredefinedTaskLimbOption

- - -
-

Values that identify the left or right limb to be used in an active task.

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSUInteger, ORKPredefinedTaskLimbOption ) {
- -    ORKPredefinedTaskLimbOptionUnspecified = 0,
- -    ORKPredefinedTaskLimbOptionLeft = 1 < < 1,
- -    ORKPredefinedTaskLimbOptionRight = 1 < < 2,
- -    ORKPredefinedTaskLimbOptionBoth = ORKPredefinedTaskLimbOptionLeft | ORKPredefinedTaskLimbOptionRight,
- - };
- -
- -
-

Constants

-
- -
ORKPredefinedTaskLimbOptionUnspecified
-
- - -

Which limb to use is undefined

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskLimbOptionLeft
-
- - -

Task should test the left limb

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskLimbOptionRight
-
- - -

Task should test the right limb

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskLimbOptionBoth
-
- - -

Task should test the both limbs (random order)

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskOption.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskOption.html deleted file mode 100644 index 72a7a05a8b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKPredefinedTaskOption.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - ORKPredefinedTaskOption Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPredefinedTaskOption Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKPredefinedTaskOption

- - -
-

The ORKPredefinedTaskOption flags let you exclude particular behaviors from the predefined active -tasks in the predefined category of ORKOrderedTask.

- -

By default, all predefined tasks include instructions and conclusion steps, and may also include -one or more data collection recorder configurations. Although not all predefined tasks include all -of these data collection types, the predefined task option flags can be used to explicitly specify -that a task option not be included.

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSUInteger, ORKPredefinedTaskOption ) {
- -    ORKPredefinedTaskOptionNone = 0,
- -    ORKPredefinedTaskOptionExcludeInstructions = ( 1 < < 0 ),
- -    ORKPredefinedTaskOptionExcludeConclusion = ( 1 < < 1 ),
- -    ORKPredefinedTaskOptionExcludeAccelerometer = ( 1 < < 2 ),
- -    ORKPredefinedTaskOptionExcludeDeviceMotion = ( 1 < < 3 ),
- -    ORKPredefinedTaskOptionExcludePedometer = ( 1 < < 4 ),
- -    ORKPredefinedTaskOptionExcludeLocation = ( 1 < < 5 ),
- -    ORKPredefinedTaskOptionExcludeHeartRate = ( 1 < < 6 ),
- -    ORKPredefinedTaskOptionExcludeAudio = ( 1 < < 7 ),
- - };
- -
- -
-

Constants

-
- -
ORKPredefinedTaskOptionNone
-
- - -

Default behavior.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludeInstructions
-
- - -

Exclude the initial instruction steps.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludeConclusion
-
- - -

Exclude the conclusion step.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludeAccelerometer
-
- - -

Exclude accelerometer data collection.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludeDeviceMotion
-
- - -

Exclude device motion data collection.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludePedometer
-
- - -

Exclude pedometer data collection.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludeLocation
-
- - -

Exclude location data collection.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludeHeartRate
-
- - -

Exclude heart rate data collection.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKPredefinedTaskOptionExcludeAudio
-
- - -

Exclude audio data collection.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKProgressIndicatorType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKProgressIndicatorType.html deleted file mode 100644 index f611d8babc..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKProgressIndicatorType.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - ORKProgressIndicatorType Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKProgressIndicatorType Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKProgressIndicatorType

- - -
-

Progress indicator type for ORKWaitStep.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKProgressIndicatorType ) {
- -    ORKProgressIndicatorTypeIndeterminate = 0,
- -    ORKProgressIndicatorTypeProgressBar,
- - };
- -
- -
-

Constants

-
- -
ORKProgressIndicatorTypeIndeterminate
-
- - -

Spinner animation.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKProgressIndicatorTypeProgressBar
-
- - -

Progressbar animation.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKQuestionSection.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKQuestionSection.html deleted file mode 100644 index 4778214568..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKQuestionSection.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - ORKQuestionSection Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKQuestionSection Constants Reference

- - -
- - - - -
Declared inORKQuestionStepViewController.m
- - - - - - - -

ORKQuestionSection

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKQuestionSection ) {
- -    ORKQuestionSectionAnswer = 0,
- -    ORKQuestionSection_COUNT,
- - };
- -
- -
-

Constants

-
- -
ORKQuestionSectionAnswer
-
- - -

- Declared In ORKQuestionStepViewController.m. -

- -
- -
ORKQuestionSection_COUNT
-
- - -

- Declared In ORKQuestionStepViewController.m. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKQuestionType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKQuestionType.html deleted file mode 100644 index 74f811859b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKQuestionType.html +++ /dev/null @@ -1,461 +0,0 @@ - - - - - - ORKQuestionType Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKQuestionType Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKQuestionType

- - -
-

An enumeration of values that identify the different types of questions that the ResearchKit -framework supports.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKQuestionType ) {
- -    ORKQuestionTypeNone,
- -    ORKQuestionTypeScale,
- -    ORKQuestionTypeSingleChoice,
- -    ORKQuestionTypeMultipleChoice,
- -    ORKQuestionTypeMultiplePicker,
- -    ORKQuestionTypeDecimal,
- -    ORKQuestionTypeInteger,
- -    ORKQuestionTypeBoolean,
- -    ORKQuestionTypeText,
- -    ORKQuestionTypeTimeOfDay,
- -    ORKQuestionTypeDateAndTime,
- -    ORKQuestionTypeDate,
- -    ORKQuestionTypeTimeInterval,
- -    ORKQuestionTypeHeight,
- -    ORKQuestionTypeWeight,
- -    ORKQuestionTypeLocation,
- - };
- -
- -
-

Constants

-
- -
ORKQuestionTypeNone
-
- - -
 No question.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeScale
-
- - -
 The scale question type asks participants to place a mark at an appropriate position on a
- continuous or discrete line.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeSingleChoice
-
- - -
 In a single choice question, the participant can pick only one predefined option.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeMultipleChoice
-
- - -
 In a multiple choice question, the participant can pick one or more predefined options.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeMultiplePicker
-
- - -
 In a multiple component choice picker, the participant can pick one choice from each component.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeDecimal
-
- - -
 The decimal question type asks the participant to enter a decimal number.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeInteger
-
- - -
 The integer question type asks the participant to enter an integer number.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeBoolean
-
- - -
 The Boolean question type asks the participant to enter Yes or No (or the appropriate
- equivalents).
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeText
-
- - -
 In a text question, the participant can enter multiple lines of text.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeTimeOfDay
-
- - -
 In a time of day question, the participant can enter a time of day by using a picker.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeDateAndTime
-
- - -
 In a date and time question, the participant can enter a combination of date and time by using
- a picker.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeDate
-
- - -
 In a date question, the participant can enter a date by using a picker.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeTimeInterval
-
- - -
 In a time interval question, the participant can enter a time span by using a picker.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeHeight
-
- - -
 In a height question, the participant can enter a height by using a height picker.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeWeight
-
- - -
 In a weight question, the participant can enter a weight by using a weight picker.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKQuestionTypeLocation
-
- - -
 In a location question, the participant can enter a location using a map view.
-
- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKRegistrationStepOption.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKRegistrationStepOption.html deleted file mode 100644 index f200eb083c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKRegistrationStepOption.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - ORKRegistrationStepOption Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRegistrationStepOption Constants Reference

- - -
- - - - -
Declared inORKRegistrationStep.h
- - - - - - - -

ORKRegistrationStepOption

- - -
-

The ORKRegistrationStepOption flags let you include particular fields in addition -to the default fields (email and password) in the registration step.

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSUInteger, ORKRegistrationStepOption ) {
- -    ORKRegistrationStepDefault = 0,
- -    ORKRegistrationStepIncludeGivenName = ( 1 < < 1 ),
- -    ORKRegistrationStepIncludeFamilyName = ( 1 < < 2 ),
- -    ORKRegistrationStepIncludeGender = ( 1 < < 3 ),
- -    ORKRegistrationStepIncludeDOB = ( 1 < < 4 ),
- -    ORKRegistrationStepIncludePhoneNumber = ( 1 < < 5 ),
- - };
- -
- -
-

Constants

-
- -
ORKRegistrationStepDefault
-
- - -

Default behavior.

- - - - - - -

- Declared In ORKRegistrationStep.h. -

- -
- -
ORKRegistrationStepIncludeGivenName
-
- - -

Include the given name field.

- - - - - - -

- Declared In ORKRegistrationStep.h. -

- -
- -
ORKRegistrationStepIncludeFamilyName
-
- - -

Include the family name field.

- - - - - - -

- Declared In ORKRegistrationStep.h. -

- -
- -
ORKRegistrationStepIncludeGender
-
- - -

Include the gender field.

- - - - - - -

- Declared In ORKRegistrationStep.h. -

- -
- -
ORKRegistrationStepIncludeDOB
-
- - -

Include the date of birth field.

- - - - - - -

- Declared In ORKRegistrationStep.h. -

- -
- -
ORKRegistrationStepIncludePhoneNumber
-
- - -

Include the user phone number.

- - - - - - -

- Declared In ORKRegistrationStep.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKRegistrationStep.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSampleJSONOptions.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSampleJSONOptions.html deleted file mode 100644 index 0656d2d2d6..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSampleJSONOptions.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - ORKSampleJSONOptions Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSampleJSONOptions Constants Reference

- - -
- - - - -
Declared inHKSample+ORKJSONDictionary.h
- - - - - - - -

ORKSampleJSONOptions

- -
- - -

Definition

- typedef NS_OPTIONS(NSInteger, ORKSampleJSONOptions ) {
- -    ORKSampleIncludeMetadata = 0 x1,
- -    ORKSampleIncludeSource = 0 x2,
- -    ORKSampleIncludeUUID = 0 x4,
- - };
- -
- -
-

Constants

-
- -
ORKSampleIncludeMetadata
-
- - -

- Declared In HKSample+ORKJSONDictionary.h. -

- -
- -
ORKSampleIncludeSource
-
- - -

- Declared In HKSample+ORKJSONDictionary.h. -

- -
- -
ORKSampleIncludeUUID
-
- - -

- Declared In HKSample+ORKJSONDictionary.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKScreenMetric.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKScreenMetric.html deleted file mode 100644 index 0dad528dd8..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKScreenMetric.html +++ /dev/null @@ -1,612 +0,0 @@ - - - - - - ORKScreenMetric Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScreenMetric Constants Reference

- - -
- - - - -
Declared inORKSkin.h
- - - - - - - -

ORKScreenMetric

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKScreenMetric ) {
- -    ORKScreenMetricTopToCaptionBaseline,
- -    ORKScreenMetricFontSizeHeadline,
- -    ORKScreenMetricMaxFontSizeHeadline,
- -    ORKScreenMetricFontSizeSurveyHeadline,
- -    ORKScreenMetricMaxFontSizeSurveyHeadline,
- -    ORKScreenMetricFontSizeSubheadline,
- -    ORKScreenMetricFontSizeFootnote,
- -    ORKScreenMetricCaptionBaselineToFitnessTimerTop,
- -    ORKScreenMetricCaptionBaselineToTappingLabelTop,
- -    ORKScreenMetricCaptionBaselineToInstructionBaseline,
- -    ORKScreenMetricInstructionBaselineToLearnMoreBaseline,
- -    ORKScreenMetricLearnMoreBaselineToStepViewTop,
- -    ORKScreenMetricLearnMoreBaselineToStepViewTopWithNoLearnMore,
- -    ORKScreenMetricContinueButtonTopMargin,
- -    ORKScreenMetricContinueButtonTopMarginForIntroStep,
- -    ORKScreenMetricTopToIllustration,
- -    ORKScreenMetricIllustrationToCaptionBaseline,
- -    ORKScreenMetricIllustrationHeight,
- -    ORKScreenMetricInstructionImageHeight,
- -    ORKScreenMetricContinueButtonHeightRegular,
- -    ORKScreenMetricContinueButtonHeightCompact,
- -    ORKScreenMetricContinueButtonWidth,
- -    ORKScreenMetricMinimumStepHeaderHeightForMemoryGame,
- -    ORKScreenMetricMinimumStepHeaderHeightForTowerOfHanoiPuzzle,
- -    ORKScreenMetricTableCellDefaultHeight,
- -    ORKScreenMetricTextFieldCellHeight,
- -    ORKScreenMetricChoiceCellFirstBaselineOffsetFromTop,
- -    ORKScreenMetricChoiceCellLastBaselineToBottom,
- -    ORKScreenMetricChoiceCellLabelLastBaselineToLabelFirstBaseline,
- -    ORKScreenMetricLearnMoreButtonSideMargin,
- -    ORKScreenMetricHeadlineSideMargin,
- -    ORKScreenMetricToolbarHeight,
- -    ORKScreenMetricVerticalScaleHeight,
- -    ORKScreenMetricSignatureViewHeight,
- -    ORKScreenMetricPSATKeyboardViewWidth,
- -    ORKScreenMetricPSATKeyboardViewHeight,
- -    ORKScreenMetricLocationQuestionMapHeight,
- -    ORKScreenMetricTopToIconImageViewTop,
- -    ORKScreenMetricIconImageViewToCaptionBaseline,
- -    ORKScreenMetricVerificationTextBaselineToResendButtonBaseline,
- -    ORKScreenMetric_COUNT,
- - };
- -
- -
-

Constants

-
- -
ORKScreenMetricTopToCaptionBaseline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricFontSizeHeadline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricMaxFontSizeHeadline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricFontSizeSurveyHeadline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricMaxFontSizeSurveyHeadline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricFontSizeSubheadline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricFontSizeFootnote
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricCaptionBaselineToFitnessTimerTop
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricCaptionBaselineToTappingLabelTop
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricCaptionBaselineToInstructionBaseline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricInstructionBaselineToLearnMoreBaseline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricLearnMoreBaselineToStepViewTop
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricLearnMoreBaselineToStepViewTopWithNoLearnMore
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricContinueButtonTopMargin
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricContinueButtonTopMarginForIntroStep
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricTopToIllustration
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricIllustrationToCaptionBaseline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricIllustrationHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricInstructionImageHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricContinueButtonHeightRegular
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricContinueButtonHeightCompact
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricContinueButtonWidth
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricMinimumStepHeaderHeightForMemoryGame
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricMinimumStepHeaderHeightForTowerOfHanoiPuzzle
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricTableCellDefaultHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricTextFieldCellHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricChoiceCellFirstBaselineOffsetFromTop
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricChoiceCellLastBaselineToBottom
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricChoiceCellLabelLastBaselineToLabelFirstBaseline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricLearnMoreButtonSideMargin
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricHeadlineSideMargin
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricToolbarHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricVerticalScaleHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricSignatureViewHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricPSATKeyboardViewWidth
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricPSATKeyboardViewHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricLocationQuestionMapHeight
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricTopToIconImageViewTop
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricIconImageViewToCaptionBaseline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetricVerificationTextBaselineToResendButtonBaseline
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenMetric_COUNT
-
- - -

- Declared In ORKSkin.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKScreenType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKScreenType.html deleted file mode 100644 index d83a310ce9..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKScreenType.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - ORKScreenType Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKScreenType Constants Reference

- - -
- - - - -
Declared inORKSkin.h
- - - - - - - -

ORKScreenType

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKScreenType ) {
- -    ORKScreenTypeiPhoneX,
- -    ORKScreenTypeiPhone6Plus,
- -    ORKScreenTypeiPhone6,
- -    ORKScreenTypeiPhone5,
- -    ORKScreenTypeiPhone4,
- -    ORKScreenTypeiPad,
- -    ORKScreenTypeiPad10_5,
- -    ORKScreenTypeiPad12_9,
- -    ORKScreenType_COUNT,
- - };
- -
- -
-

Constants

-
- -
ORKScreenTypeiPhoneX
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenTypeiPhone6Plus
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenTypeiPhone6
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenTypeiPhone5
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenTypeiPhone4
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenTypeiPad
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenTypeiPad10_5
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenTypeiPad12_9
-
- - -

- Declared In ORKSkin.h. -

- -
- -
ORKScreenType_COUNT
-
- - -

- Declared In ORKSkin.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanMemoryGameStatus.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanMemoryGameStatus.html deleted file mode 100644 index 88acac493d..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanMemoryGameStatus.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - ORKSpatialSpanMemoryGameStatus Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanMemoryGameStatus Constants Reference

- - -
- - - - -
Declared inORKSpatialSpanMemoryResult.h
- - - - - - - -

ORKSpatialSpanMemoryGameStatus

- - -
-

An enumeration of values that describe the status of a round of the spatial span memory game.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKSpatialSpanMemoryGameStatus ) {
- -    ORKSpatialSpanMemoryGameStatusUnknown,
- -    ORKSpatialSpanMemoryGameStatusSuccess,
- -    ORKSpatialSpanMemoryGameStatusFailure,
- -    ORKSpatialSpanMemoryGameStatusTimeout,
- - };
- -
- -
-

Constants

-
- -
ORKSpatialSpanMemoryGameStatusUnknown
-
- - -

Unknown status. The game is still in progress or has not started.

- - - - - - -

- Declared In ORKSpatialSpanMemoryResult.h. -

- -
- -
ORKSpatialSpanMemoryGameStatusSuccess
-
- - -

Success. The user has completed the sequence.

- - - - - - -

- Declared In ORKSpatialSpanMemoryResult.h. -

- -
- -
ORKSpatialSpanMemoryGameStatusFailure
-
- - -

Failure. The user has completed the sequence incorrectly.

- - - - - - -

- Declared In ORKSpatialSpanMemoryResult.h. -

- -
- -
ORKSpatialSpanMemoryGameStatusTimeout
-
- - -

Timeout. The game timed out during play.

- - - - - - -

- Declared In ORKSpatialSpanMemoryResult.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKSpatialSpanMemoryResult.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanResult.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanResult.html deleted file mode 100644 index a978f46694..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanResult.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - ORKSpatialSpanResult Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanResult Constants Reference

- - -
- - - - -
Declared inORKSpatialSpanGameState.h
- - - - - - - -

ORKSpatialSpanResult

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKSpatialSpanResult ) {
- -    ORKSpatialSpanResultIgnore,
- -    ORKSpatialSpanResultCorrect,
- -    ORKSpatialSpanResultIncorrect,
- - };
- -
- -
-

Constants

-
- -
ORKSpatialSpanResultIgnore
-
- - -

- Declared In ORKSpatialSpanGameState.h. -

- -
- -
ORKSpatialSpanResultCorrect
-
- - -

- Declared In ORKSpatialSpanGameState.h. -

- -
- -
ORKSpatialSpanResultIncorrect
-
- - -

- Declared In ORKSpatialSpanGameState.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanStepState.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanStepState.html deleted file mode 100644 index 8a492f9c9a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanStepState.html +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - ORKSpatialSpanStepState Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanStepState Constants Reference

- - -
- - - - -
Declared inORKSpatialSpanMemoryStepViewController.m
- - - - - - - -

ORKSpatialSpanStepState

- - - -
-

Constants

-
- -
ORKSpatialSpanStepStateInitial
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStatePlayback
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStateGameplay
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStateTimeout
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStateFailed
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStateSuccess
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStateRestart
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStateComplete
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStateStopped
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
ORKSpatialSpanStepStatePaused
-
- - -

- Declared In ORKSpatialSpanMemoryStepViewController.m. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanTargetState.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanTargetState.html deleted file mode 100644 index bca06cf35c..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpatialSpanTargetState.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - ORKSpatialSpanTargetState Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpatialSpanTargetState Constants Reference

- - -
- - - - -
Declared inORKSpatialSpanGameState.h
- - - - - - - -

ORKSpatialSpanTargetState

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKSpatialSpanTargetState ) {
- -    ORKSpatialSpanTargetStateQuiescent,
- -    ORKSpatialSpanTargetStateActive,
- -    ORKSpatialSpanTargetStateCorrect,
- -    ORKSpatialSpanTargetStateIncorrect,
- - };
- -
- -
-

Constants

-
- -
ORKSpatialSpanTargetStateQuiescent
-
- - -

- Declared In ORKSpatialSpanGameState.h. -

- -
- -
ORKSpatialSpanTargetStateActive
-
- - -

- Declared In ORKSpatialSpanGameState.h. -

- -
- -
ORKSpatialSpanTargetStateCorrect
-
- - -

- Declared In ORKSpatialSpanGameState.h. -

- -
- -
ORKSpatialSpanTargetStateIncorrect
-
- - -

- Declared In ORKSpatialSpanGameState.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpeechRecognitionErrorCode.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpeechRecognitionErrorCode.html deleted file mode 100644 index 0565784257..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKSpeechRecognitionErrorCode.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - ORKSpeechRecognitionErrorCode Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpeechRecognitionErrorCode Constants Reference

- - -
- - - - -
Declared inORKSpeechRecognitionError.h
- - - - - - - -

ORKSpeechRecognitionErrorCode

- -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKSpeechRecognitionErrorCode ) {
- -    ORKSpeechRecognitionErrorLanguageNotAvailable = 1,
- -    ORKSpeechRecognitionErrorResumeNotSupported,
- -    ORKSpeechRecognitionErrorRecognitionFailed,
- - };
- -
- -
-

Constants

-
- -
ORKSpeechRecognitionErrorLanguageNotAvailable
-
- - -

- Declared In ORKSpeechRecognitionError.h. -

- -
- -
ORKSpeechRecognitionErrorResumeNotSupported
-
- - -

- Declared In ORKSpeechRecognitionError.h. -

- -
- -
ORKSpeechRecognitionErrorRecognitionFailed
-
- - -

- Declared In ORKSpeechRecognitionError.h. -

- -
- -
-
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKStepViewControllerNavigationDirection.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKStepViewControllerNavigationDirection.html deleted file mode 100644 index 2dfe73c88a..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKStepViewControllerNavigationDirection.html +++ /dev/null @@ -1,176 +0,0 @@ - - - - - - ORKStepViewControllerNavigationDirection Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStepViewControllerNavigationDirection Constants Reference

- - -
- - - - -
Declared inORKStepViewController.h
- - - - - - - -

ORKStepViewControllerNavigationDirection

- - -
-

An enumeration of values used in ORKStepViewControllerDelegate to indicate the direction of navigation -requested by the participant.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKStepViewControllerNavigationDirection ) {
- -    ORKStepViewControllerNavigationDirectionForward,
- -    ORKStepViewControllerNavigationDirectionReverse,
- - };
- -
- -
-

Constants

-
- -
ORKStepViewControllerNavigationDirectionForward
-
- - -

Forward navigation. Indicates that the user tapped the Continue or Next button.

- - - - - - -

- Declared In ORKStepViewController.h. -

- -
- -
ORKStepViewControllerNavigationDirectionReverse
-
- - -

Backward navigation. Indicates that the user tapped the Back button.

- - - - - - -

- Declared In ORKStepViewController.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTappingButtonIdentifier.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTappingButtonIdentifier.html deleted file mode 100644 index 730d06668e..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTappingButtonIdentifier.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - ORKTappingButtonIdentifier Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTappingButtonIdentifier Constants Reference

- - -
- - - - -
Declared inORKTappingIntervalResult.h
- - - - - - - -

ORKTappingButtonIdentifier

- - -
-

Values that identify the button that was tapped in a tapping sample.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKTappingButtonIdentifier ) {
- -    ORKTappingButtonIdentifierNone,
- -    ORKTappingButtonIdentifierLeft,
- -    ORKTappingButtonIdentifierRight,
- - };
- -
- -
-

Constants

-
- -
ORKTappingButtonIdentifierNone
-
- - -

The touch landed outside of the two buttons.

- - - - - - -

- Declared In ORKTappingIntervalResult.h. -

- -
- -
ORKTappingButtonIdentifierLeft
-
- - -

The touch landed in the left button.

- - - - - - -

- Declared In ORKTappingIntervalResult.h. -

- -
- -
ORKTappingButtonIdentifierRight
-
- - -

The touch landed in the right button.

- - - - - - -

- Declared In ORKTappingIntervalResult.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTappingIntervalResult.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTaskViewControllerFinishReason.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTaskViewControllerFinishReason.html deleted file mode 100644 index e2763f60a4..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTaskViewControllerFinishReason.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - ORKTaskViewControllerFinishReason Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTaskViewControllerFinishReason Constants Reference

- - -
- - - - -
Declared inORKTaskViewController.h
- - - - - - - -

ORKTaskViewControllerFinishReason

- - -
-

The ORKTaskViewControllerFinishReason value indicates how the task view controller has finished -the task.

-
- - -
- - -

Definition

- typedef NS_ENUM(NSInteger, ORKTaskViewControllerFinishReason ) {
- -    ORKTaskViewControllerFinishReasonSaved,
- -    ORKTaskViewControllerFinishReasonDiscarded,
- -    ORKTaskViewControllerFinishReasonCompleted,
- -    ORKTaskViewControllerFinishReasonFailed,
- - };
- -
- -
-

Constants

-
- -
ORKTaskViewControllerFinishReasonSaved
-
- - -

The task was canceled by the participant or the developer, and the participant asked to save the current result.

- - - - - - -

- Declared In ORKTaskViewController.h. -

- -
- -
ORKTaskViewControllerFinishReasonDiscarded
-
- - -

The task was canceled by the participant or the developer, and the participant asked to discard the current result.

- - - - - - -

- Declared In ORKTaskViewController.h. -

- -
- -
ORKTaskViewControllerFinishReasonCompleted
-
- - -

The task has completed successfully, because all steps have been completed.

- - - - - - -

- Declared In ORKTaskViewController.h. -

- -
- -
ORKTaskViewControllerFinishReasonFailed
-
- - -

An error was detected during the current step.

- - - - - - -

- Declared In ORKTaskViewController.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTremorActiveTaskOption.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTremorActiveTaskOption.html deleted file mode 100644 index 84ec64b952..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Constants/ORKTremorActiveTaskOption.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - ORKTremorActiveTaskOption Constants Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTremorActiveTaskOption Constants Reference

- - -
- - - - -
Declared inORKTypes.h
- - - - - - - -

ORKTremorActiveTaskOption

- - -
-

The ORKTremorActiveTaskOption flags let you exclude particular steps from the predefined active -tasks in the predefined Tremor ORKOrderedTask.

- -

By default, all predefined active tasks will be included. The tremor active task option flags can -be used to explicitly specify that an active task is not to be included.

-
- - -
- - -

Definition

- typedef NS_OPTIONS(NSUInteger, ORKTremorActiveTaskOption ) {
- -    ORKTremorActiveTaskOptionNone = 0,
- -    ORKTremorActiveTaskOptionExcludeHandInLap = ( 1 < < 0 ),
- -    ORKTremorActiveTaskOptionExcludeHandAtShoulderHeight = ( 1 < < 1 ),
- -    ORKTremorActiveTaskOptionExcludeHandAtShoulderHeightElbowBent = ( 1 < < 2 ),
- -    ORKTremorActiveTaskOptionExcludeHandToNose = ( 1 < < 3 ),
- -    ORKTremorActiveTaskOptionExcludeQueenWave = ( 1 < < 4 ),
- - };
- -
- -
-

Constants

-
- -
ORKTremorActiveTaskOptionNone
-
- - -

Default behavior.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKTremorActiveTaskOptionExcludeHandInLap
-
- - -

Exclude the hand-in-lap steps.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKTremorActiveTaskOptionExcludeHandAtShoulderHeight
-
- - -

Exclude the hand-extended-at-shoulder-height steps.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKTremorActiveTaskOptionExcludeHandAtShoulderHeightElbowBent
-
- - -

Exclude the elbow-bent-at-shoulder-height steps.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKTremorActiveTaskOptionExcludeHandToNose
-
- - -

Exclude the elbow-bent-touch-nose steps.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
ORKTremorActiveTaskOptionExcludeQueenWave
-
- - -

Exclude the queen-wave steps.

- - - - - - -

- Declared In ORKTypes.h. -

- -
- -
-
- - - - - - - - -
-

Declared In

-

ORKTypes.h

-
- - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKAnswerOption.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKAnswerOption.html deleted file mode 100644 index 84ecf19cb0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKAnswerOption.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - ORKAnswerOption Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKAnswerOption Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKAnswerFormat_Internal.h
- - - - -
- -

Overview

-

The ORKAnswerOption protocol defines brief option text for a option which can be included within ORK*ChoiceAnswerFormat.

-
- - - - - -
- - - - - - -
-
- -

– text -required method

- -
-
- -
- - -
-

Brief option text.

-
- - - -
- (NSString *)text
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKAnswerFormat_Internal.h

-
- - -
-
-
- -

– value -required method

- -
-
- -
- - -
-

The value to be returned if this option is selected.

-
- - - -
- (nullable id)value
- - - - - - - - - -
-

Discussion

-

Expected to be a scalar type serializable to JSON, e.g. NSNumber or NSString. -If no value is provided, the index of the option in the ORK*ChoiceAnswerFormat options list will be used.

-
- - - - - - - -
-

Declared In

-

ORKAnswerFormat_Internal.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataCollectionManagerDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataCollectionManagerDelegate.html deleted file mode 100644 index 2e619a5a46..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataCollectionManagerDelegate.html +++ /dev/null @@ -1,457 +0,0 @@ - - - - - - ORKDataCollectionManagerDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataCollectionManagerDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKDataCollectionManager.h
- - - - -
- -

Overview

-

The data collection manager delegate is responsible for delivering collected data objects, -and reporting errors during the operation.

-
- - - - - -
- - - - - - -
-
- -

– healthCollector:didCollectSamples: -

- -
-
- -
- - -
-

Method for delivering the collected health data samples.

-
- - - -
- (BOOL)healthCollector:(ORKHealthCollector *)collector didCollectSamples:(NSArray<HKSample*> *)samples
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

samples

Collected health data samples.

-
- - - -
-

Return Value

-

Boolean indicating whether the samples has be accepted. -If NO is returned or this method is not implemented, the manager will stop the collection for the collector and repeat this same collection next time, -until the data is accepted.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– healthCorrelationCollector:didCollectCorrelations: -

- -
-
- -
- - -
-

Method for delivering the collected health correlations.

-
- - - -
- (BOOL)healthCorrelationCollector:(ORKHealthCorrelationCollector *)collector didCollectCorrelations:(NSArray<HKCorrelation*> *)correlations
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

correlations

Collected health correlation samples.

-
- - - -
-

Return Value

-

Boolean indicating whether the samples has be accepted. -If NO is returned or this method is not implemented, the manager will stop the collection for the collector and repeat this same collection next time, -until the data is accepted.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– motionActivityCollector:didCollectMotionActivities: -

- -
-
- -
- - -
-

Method for delivering the collected motion activities.

-
- - - -
- (BOOL)motionActivityCollector:(ORKMotionActivityCollector *)collector didCollectMotionActivities:(NSArray<CMMotionActivity*> *)motionActivities
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

motionActivities

Collected motion activities.

-
- - - -
-

Return Value

-

Boolean indicating whether the samples has be accepted. -If NO is returned or this method is not implemented, the manager will stop the collection for the collector and repeat this same collection next time, -until the data is accepted.

-
- - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– dataCollectionManagerDidCompleteCollection: -

- -
-
- -
- - -
-

Indicating the collection is completed for all the collectors.

-
- - - -
- (void)dataCollectionManagerDidCompleteCollection:(ORKDataCollectionManager *)manager
- - - -
-

Parameters

- - - - - - - -
manager

The data collection manager.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
- -

– collector:didDetectError: -

- -
-
- -
- - -
-

Method for reporting the deteted error during collection.

-
- - - -
- (void)collector:(ORKCollector *)collector didDetectError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
collector

The data collector.

error

The error object.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataCollectionManager.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerDelegate.html deleted file mode 100644 index a2c6cb19fe..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerDelegate.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - ORKDataLoggerDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataLoggerDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKDataLogger.h
- - - - -
- -

Overview

-

The ORKDataLoggerDelegate protocol defines methods that the delegate of an ORKDataLogger object uses to handle data being logged to disk.

-
- - - - - -
- - - - - - -
-
- -

– dataLogger:finishedLogFile: -required method

- -
-
- -
- - -
-

Tells the delegate when a log file rollover occurs.

-
- - - -
- (void)dataLogger:(ORKDataLogger *)dataLogger finishedLogFile:(NSURL *)fileUrl
- - - -
-

Parameters

- - - - - - - - - - - - -
dataLogger

The data logger providing the notification.

fileUrl

The URL of the newly renamed log file.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– dataLoggerByteCountsDidChange: -

- -
-
- -
- - -
-

Tells the delegate if the number of bytes in completed logs changes.

-
- - - -
- (void)dataLoggerByteCountsDidChange:(ORKDataLogger *)dataLogger
- - - -
-

Parameters

- - - - - - - -
dataLogger

The data logger providing the notification.

-
- - - - - - - -
-

Discussion

-

When files are removed or added, or marked as uploaded or unmarked, this delegate method is called a short time later. Multiple directory changes -are rolled up into a single delegate callback.

-
- - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerExtendedDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerExtendedDelegate.html deleted file mode 100644 index ab385600f7..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerExtendedDelegate.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - ORKDataLoggerExtendedDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataLoggerExtendedDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toORKDataLoggerDelegate
Declared inORKDataLogger.h
- - - - - - -
- - - - - - -
-
- -

– dataLoggerThresholdsDidChange: -

- -
-
- -
- - -
-

Tells the delegate that the maximum current log file lifetime changed.

-
- - - -
- (void)dataLoggerThresholdsDidChange:(ORKDataLogger *)dataLogger
- - - -
-

Parameters

- - - - - - - -
dataLogger

Source of this event.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerManagerDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerManagerDelegate.html deleted file mode 100644 index ed96545f10..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKDataLoggerManagerDelegate.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - ORKDataLoggerManagerDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKDataLoggerManagerDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKDataLogger.h
- - - - -
- -

Overview

-

The ORKDataLoggerManagerDelegate protocol defines methods a delegate can implement to receive notifications -when the data loggers managed by a ORKDataLoggerManager reach a certain file size threshold.

-
- - - - - -
- - - - - - -
-
- -

– dataLoggerManager:pendingUploadBytesReachedThreshold: -required method

- -
-
- -
- - -
-

Called by the data logger manager when the total size of files -that are not marked uploaded has reached a threshold.

-
- - - -
- (void)dataLoggerManager:(ORKDataLoggerManager *)dataLoggerManager pendingUploadBytesReachedThreshold:(unsigned long long)pendingUploadBytes
- - - -
-

Parameters

- - - - - - - - - - - - -
dataLoggerManager

The manager that produced the notification.

pendingUploadBytes

The number of bytes managed by all the loggers, which - have not yet been marked uploaded.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
- -

– dataLoggerManager:totalBytesReachedThreshold: -required method

- -
-
- -
- - -
-

Called by the data logger manager when the total size of files -managed by any of the loggers has reached a threshold.

-
- - - -
- (void)dataLoggerManager:(ORKDataLoggerManager *)dataLoggerManager totalBytesReachedThreshold:(unsigned long long)totalBytes
- - - -
-

Parameters

- - - - - - - - - - - - -
dataLoggerManager

The manager that produced the notification.

totalBytes

The total number of bytes of all files managed.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKDataLogger.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKGraphChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKGraphChartViewDataSource.html deleted file mode 100644 index 8163aa0221..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKGraphChartViewDataSource.html +++ /dev/null @@ -1,1046 +0,0 @@ - - - - - - ORKGraphChartViewDataSource Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKGraphChartViewDataSource Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKGraphChartView.h
- - - - -
- -

Overview

-

The abstract ORKGraphChartViewDataSource protocol is the base protocol which conforms the basis -for the ORKValueRangeGraphChartViewDataSource and ORKValueStackGraphChartViewDataSource -protocols, required to populate the concrete ORKGraphChartView subclass.

- -

At a minimum, a data source object must implement the graphChartView:numberOfPointsInPlot: and -graphChartView:plot:valueForPointAtIndex: methods. These methods return -the number of points in a plot and the points themselves. Each point in a plot is represented by -an object of the ORKValueRange or ORKValueStack class, depending on the concrete subprotocol.

- -

A data source object may provide additional information to the graph chart view by implementing the -optional methods.

- -

When configuring an ORKGraphChartView object, assign your data source to its dataSource -property.

-
- - - - - -
- - - - - - -
-
- -

– graphChartView:numberOfDataPointsForPlotIndex: -required method

- -
-
- -
- - -
-

Asks the data source for the number of value points to be plotted by the graph chart view at the -specified plot index.

-
- - - -
- (NSInteger)graphChartView:(ORKGraphChartView *)graphChartView numberOfDataPointsForPlotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph chart view asking for the number of value points.

plotIndex

An index number identifying the plot in the graph chart view. This index - is 0 in a single-plot graph chart view.

-
- - - -
-

Return Value

-

The number of range points in the plot at plotIndex.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– numberOfPlotsInGraphChartView: -required method

- -
-
- -
- - -
-

Asks the data source for the number of plots to be plotted by the graph chart view.

-
- - - -
- (NSInteger)numberOfPlotsInGraphChartView:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view asking for the number of plots.

-
- - - -
-

Return Value

-

The number of plots in the graph chart view.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:colorForPlotIndex: -

- -
-
- -
- - -
-

Asks the data source for the color of the specified plot.

-
- - - -
- (UIColor *)graphChartView:(ORKGraphChartView *)graphChartView colorForPlotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph chart view asking for the color of the segment.

plotIndex

An index number identifying the plot in the graph chart view. This index - is always 0 in single-plot graph chart views.

-
- - - -
-

Return Value

-

The color of the segment at the specified index in a pie chart view.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the first plot uses the graph chart view tintColor, and -all subsequent plots uses the current referenceLineColor.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:fillColorForPlotIndex: -

- -
-
- -
- - -
-

Asks the data source for the fill color of the specified plot.

-
- - - -
- (UIColor *)graphChartView:(ORKGraphChartView *)graphChartView fillColorForPlotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph chart view asking for the color of the segment.

plotIndex

An index number identifying the plot in the graph chart view. This index -is always 0 in single-plot graph chart views.

-
- - - -
-

Return Value

-

The color of the fill layer at the specified index in a line chart view.

-
- - - - - -
-

Discussion

-

The fill color is only used by ORKLineGraphChartView. If this method is not implemented, the -chart uses the main color of the specified plot with a 0.4 opacity value.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– scrubbingPlotIndexForGraphChartView: -

- -
-
- -
- - -
-

Asks the data source which plot the scrubber should snap to in multigraph chart views.

-
- - - -
- (NSInteger)scrubbingPlotIndexForGraphChartView:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view asking for the scrubbing plot index.

-
- - - -
-

Return Value

-

The index of the plot that the scrubber should snap to.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the scrubber snaps over the first plot.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– maximumValueForGraphChartView: -

- -
-
- -
- - -
-

Asks the data source for the upper limit of the y-axis drawn by the graph chart view.

-
- - - -
- (double)maximumValueForGraphChartView:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view asking for the maximum value.

-
- - - -
-

Return Value

-

The maximum value of the y-axis drawn by graphChartView.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the greatest maximumValue of all ORKValueRange instances -returned in graphChartView:plot:valueForPointAtIndex: is used.

- -

See also: graphChartView:plot:valueForPointAtIndex:.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– minimumValueForGraphChartView: -

- -
-
- -
- - -
-

Asks the data source for the lower limit of the y-axis drawn by the graph chart view.

-
- - - -
- (double)minimumValueForGraphChartView:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view asking for the minimum value.

-
- - - -
-

Return Value

-

The minimum value of the y-axis drawn by graphChartView.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the smallest minimumValue of all ORKValueRange instances -returned in graphChartView:plot:valueForPointAtIndex: is used.

- -

See also: graphChartView:plot:valueForPointAtIndex:.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– numberOfDivisionsInXAxisForGraphChartView: -

- -
-
- -
- - -
-

Asks the data source for the number of divisions in the x-axis. The value is ignored if it is lower -than the number of data points. A title appearing adjacent to each -division may optionally be returned by the graphChartView:titleForXAxisAtPointIndex: method.

-
- - - -
- (NSInteger)numberOfDivisionsInXAxisForGraphChartView:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view asking for the number of divisions in its x-axis.

-
- - - -
-

Return Value

-

The number of divisions in the x-axis for graphChartView.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:titleForXAxisAtPointIndex: -

- -
-
- -
- - -
-

Asks the data source for the title to be displayed adjacent to each division in the x-axis (the -number returned by numberOfDivisionsInXAxisForGraphChartView:). You can return nil from this -method if you don’t want to display a title for the specified point index.

-
- - - -
- (nullable NSString *)graphChartView:(ORKGraphChartView *)graphChartView titleForXAxisAtPointIndex:(NSInteger)pointIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph chart view asking for the title.

pointIndex

The index of the specified x-axis division.

-
- - - -
-

Return Value

-

The title string to be displayed adjacent to each division of the x-axis of the graph chart -view.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the x-axis has no titles.

- -

See also: numberOfDivisionsInXAxisForGraphChartView:.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:drawsVerticalReferenceLineAtPointIndex: -

- -
-
- -
- - -
-

Asks the data source if the vertical reference line at the specified point index should be drawn..

-
- - - -
- (BOOL)graphChartView:(ORKGraphChartView *)graphChartView drawsVerticalReferenceLineAtPointIndex:(NSInteger)pointIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph view asking for the tile.

pointIndex

The index corresponding to the number returned by - numberOfDivisionsInXAxisForGraphChartView:.

-
- - - -
-

Return Value

-

Whether the graph chart view should draw the vertical reference line.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the graph chart view will draw all vertical reference lines.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:drawsPointIndicatorsForPlotIndex: -

- -
-
- -
- - -
-

Asks the data source if the plot at specified index should display circular indicators on its data points.

-
- - - -
- (BOOL)graphChartView:(ORKGraphChartView *)graphChartView drawsPointIndicatorsForPlotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph view asking whether point indicators should be drawn.

plotIndex

An index number identifying the plot in the graph chart view. This index -is always 0 in single-plot graph chart views.

-
- - - -
-

Return Value

-

Whether the graph chart view should draw point indicators for its points.

-
- - - - - -
-

Discussion

-

This only applys to ORKLineGrapthChartView. -If this method is not implemented, point indicators will be drawn for all plots.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:accessibilityUnitLabelForPlotIndex: -

- -
-
- -
- - -
-

Asks the data source for the unit label for the given plot index so VoiceOver’s description of the graph can be read with units.

-
- - - -
- (NSString *)graphChartView:(ORKGraphChartView *)graphChartView accessibilityUnitLabelForPlotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph view asking for its unit label

plotIndex

An index number identifying the plot in the graph chart view. This index -is always 0 in single-plot graph chart views.

-
- - - -
-

Return Value

-

An appropriate unit label for the given plot.

-
- - - - - -
-

Discussion

-

If this method is not implemented, VoiceOver will speak the graph value without units.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:accessibilityLabelForXAxisAtPointIndex: -

- -
-
- -
- - -
-

Asks the data source for the accessibilityLabel at a given point on the x-axis

-
- - - -
- (NSString *)graphChartView:(ORKGraphChartView *)graphChartView accessibilityLabelForXAxisAtPointIndex:(NSInteger)pointIndex
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph view asking for its unit label

pointIndex

The index corresponding to the number returned by numberOfDivisionsInXAxisForGraphChartView:.

-
- - - -
-

Return Value

-

An appropriate accessibility label for the given index of the graph.

-
- - - - - -
-

Discussion

-

This is used in cases where the UI may be displaying a shortened form (e.g. M, T, W, etc. for days of the week), but VoiceOver should be speaking the longer form. If this method isn’t implemented, VoiceOver will speak the label displayed in the UI for the given index.

-
- - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKGraphChartViewDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKGraphChartViewDelegate.html deleted file mode 100644 index de3926ca96..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKGraphChartViewDelegate.html +++ /dev/null @@ -1,314 +0,0 @@ - - - - - - ORKGraphChartViewDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKGraphChartViewDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKGraphChartView.h
- - - - -
- -

Overview

-

The graph chart view delegate protocol forwards pan gesture events occuring -within the bounds of an ORKGraphChartView object.

-
- - - - - -
- - - - - - -
-
- -

– graphChartViewTouchesBegan: -

- -
-
- -
- - -
-

Notifies the delegate that a pan gesture has begun within the bounds of an ORKGraphChartView -object.

-
- - - -
- (void)graphChartViewTouchesBegan:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view in which the gesture occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartView:touchesMovedToXPosition: -

- -
-
- -
- - -
-

Notifies the delegate of updates in the x-coordinate of an ongoing pan gesture within the bounds -of an ORKGraphChartView object.

-
- - - -
- (void)graphChartView:(ORKGraphChartView *)graphChartView touchesMovedToXPosition:(CGFloat)xPosition
- - - -
-

Parameters

- - - - - - - - - - - - -
graphChartView

The graph chart view object in which the gesture occurred.

xPosition

The updated x-coordinate of the ongoing pan gesture.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
- -

– graphChartViewTouchesEnded: -

- -
-
- -
- - -
-

Notifies the delegate that a pan gesture that began within the bounds of an ORKGraphChartView -object has ended.

-
- - - -
- (void)graphChartViewTouchesEnded:(ORKGraphChartView *)graphChartView
- - - -
-

Parameters

- - - - - - - -
graphChartView

The graph chart view object in which the gesture occurred.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKPasscodeDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKPasscodeDelegate.html deleted file mode 100644 index 3ebed0338f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKPasscodeDelegate.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - ORKPasscodeDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPasscodeDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKPasscodeViewController.h
- - - - -
- -

Overview

-

The passcode delegate protocol declares methods which forward the success or failure of passcode modification -or authentication.

-
- - - - - -
- - - - - - -
-
- -

– passcodeViewControllerDidFinishWithSuccess: -required method

- -
-
- -
- - -
-

Notifies the delegate that the user has finished authenticating or editing the passcode.

-
- - - -
- (void)passcodeViewControllerDidFinishWithSuccess:(UIViewController *)viewController
- - - -
-

Parameters

- - - - - - - -
viewController

The ORKPasscodeStepViewController object in which the passcode input is entered.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

– passcodeViewControllerDidFailAuthentication: -required method

- -
-
- -
- - -
-

Notifies the delegate that the user failed authentication.

-
- - - -
- (void)passcodeViewControllerDidFailAuthentication:(UIViewController *)viewController
- - - -
-

Parameters

- - - - - - - -
viewController

The ORKPasscodeStepViewController object in which the passcode input is entered.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

– passcodeViewControllerDidCancel: -

- -
-
- -
- - -
-

Notifies the delegate that the user hit the cancel button item. The cancel button is only visible if this method -is implemented.

-
- - - -
- (void)passcodeViewControllerDidCancel:(UIViewController *)viewController
- - - -
-

Parameters

- - - - - - - -
viewController

The ORKPasscodeStepViewController object in which the passcode input is entered.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

– passcodeViewControllerTextForForgotPasscode: -

- -
-
- -
- - -
-

Defaults to Localized “Forgot Passcode?” text

-
- - - -
- (NSString *)passcodeViewControllerTextForForgotPasscode:(UIViewController *)viewController
- - - -
-

Parameters

- - - - - - - -
viewController

The ORKPasscodeStepViewController object in which the passcode input is entered.

-
- - - -
-

Return Value

-

Text to display for the forgot passcode button

-
- - - - - - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
- -

– passcodeViewControllerForgotPasscodeTapped: -

- -
-
- -
- - -
-

Notifies the delegate that forgot passcode button has been tapped.

-
- - - -
- (void)passcodeViewControllerForgotPasscodeTapped:(UIViewController *)viewController
- - - -
-

Parameters

- - - - - - - -
viewController

The ORKPasscodeStepViewController object in which the passcode input is entered.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKPasscodeViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKPieChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKPieChartViewDataSource.html deleted file mode 100644 index 30fad4a3f5..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKPieChartViewDataSource.html +++ /dev/null @@ -1,422 +0,0 @@ - - - - - - ORKPieChartViewDataSource Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKPieChartViewDataSource Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKPieChartView.h
- - - - -
- -

Overview

-

An object that adopts the ORKPieChartViewDataSource protocol is responsible for providing the -data required to populate an ORKPieChartView object.

- -

At a minimumm, a data source object must implement the numberOfSegmentsInPieChartView and -pieChartView:valueForSegmentAtIndex: methods. These methods are responsible for returning the -number of segments in a pie chart view and the value for each segment. A data source object may -provide additional information to the pie chart by implementing the optional -ORKPieChartViewDataSource methods.

- -

When configuring an ORKPieChartView object, assign your data source to its dataSource property.

-
- - - - - -
- - - - - - -
-
- -

– numberOfSegmentsInPieChartView: -required method

- -
-
- -
- - -
-

Asks the data source for the number of segments in the pie chart view.

-
- - - -
- (NSInteger)numberOfSegmentsInPieChartView:(ORKPieChartView *)pieChartView
- - - -
-

Parameters

- - - - - - - -
pieChartView

The pie chart view asking for the number of segments.

-
- - - -
-

Return Value

-

The number of segments in the pie chart view.

-
- - - - - - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– pieChartView:valueForSegmentAtIndex: -required method

- -
-
- -
- - -
-

Asks the data source for the value of a segment in the pie chart view.

-
- - - -
- (CGFloat)pieChartView:(ORKPieChartView *)pieChartView valueForSegmentAtIndex:(NSInteger)index
- - - -
-

Parameters

- - - - - - - - - - - - -
pieChartView

The pie chart view asking for the value of the segment.

index

An index number specifying the segment in the pie chart view.

-
- - - -
-

Return Value

-

The value of the segment at the specified index in the pie chart view.

-
- - - - - -
-

Discussion

-

The value can be any arbitrary integer: the pie chart view normalizes them by the sum of all -returned values.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– pieChartView:colorForSegmentAtIndex: -

- -
-
- -
- - -
-

Asks the data source for the color of a segment in the pie chart view.

-
- - - -
- (UIColor *)pieChartView:(ORKPieChartView *)pieChartView colorForSegmentAtIndex:(NSInteger)index
- - - -
-

Parameters

- - - - - - - - - - - - -
pieChartView

The pie chart view asking for the color of the segment.

index

An index number specifying the segment in the pie chart view.

-
- - - -
-

Return Value

-

The color of the segment at the specified index in the pie chart view.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the pie chart view uses a unique shade of the current -tint color for each segment.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
- -

– pieChartView:titleForSegmentAtIndex: -

- -
-
- -
- - -
-

Asks the data source for the title to appear in the legend for a segment in the pie chart view.

-
- - - -
- (NSString *)pieChartView:(ORKPieChartView *)pieChartView titleForSegmentAtIndex:(NSInteger)index
- - - -
-

Parameters

- - - - - - - - - - - - -
pieChartView

The pie chart view asking for the title.

index

An index number specifying the segment in the pie chart view.

-
- - - -
-

Return Value

-

The title of the segment at the specified index in the pie chat view’s -legend.

-
- - - - - -
-

Discussion

-

If this method is not implemented, the pie chart view does not display the legend.

-
- - - - - - - -
-

Declared In

-

ORKPieChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKQuestionStepCustomViewDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKQuestionStepCustomViewDelegate.html deleted file mode 100644 index 4679f96665..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKQuestionStepCustomViewDelegate.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - ORKQuestionStepCustomViewDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKQuestionStepCustomViewDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKCustomStepView.h
- - - - -
- -

Overview

-

The ORKQuestionStepCustomViewDelegate protocol defines the methods that a question step custom view should implement.

- -

Typically, a question step view controller (ORKQuestionStepViewController) is the delegate of a -custom question step view.

-
- - - - - - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKRecorderDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKRecorderDelegate.html deleted file mode 100644 index 45e6c5874f..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKRecorderDelegate.html +++ /dev/null @@ -1,274 +0,0 @@ - - - - - - ORKRecorderDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKRecorderDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKRecorder.h
- - - - -
- -

Overview

-

The ORKRecorderDelegate protocol defines methods that the delegate of an ORKRecorder object should use to handle errors and log the -completed results.

- -

This protocol is implemented by ORKActiveStepViewController; your app should not -need to implement it.

-
- - - - - -
- - - - - - -
-
- -

– recorder:didCompleteWithResult: -required method

- -
-
- -
- - -
-

Tells the delegate that the recorder has completed with the specified result.

-
- - - -
- (void)recorder:(ORKRecorder *)recorder didCompleteWithResult:(nullable ORKResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
recorder

The generating recorder object.

result

The generated result.

-
- - - - - - - -
-

Discussion

-

Typically, this method is called once when recording is stopped.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
- -

– recorder:didFailWithError: -required method

- -
-
- -
- - -
-

Tells the delegate that recording failed.

-
- - - -
- (void)recorder:(ORKRecorder *)recorder didFailWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
recorder

The generating recorder object.

error

The error that occurred.

-
- - - - - - - -
-

Discussion

-

Typically, this method is called once when the error occurred.

-
- - - - - - - -
-

Declared In

-

ORKRecorder.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKSpeechRecognitionDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKSpeechRecognitionDelegate.html deleted file mode 100644 index 3101acd873..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKSpeechRecognitionDelegate.html +++ /dev/null @@ -1,256 +0,0 @@ - - - - - - ORKSpeechRecognitionDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKSpeechRecognitionDelegate Protocol Reference

- - -
- - - - -
Declared inORKSpeechRecognizer.h
- - - - - - -
- - - - - - -
-
- -

– didFinishRecognitionWithError: -

- -
-
- -
- - -
-

Tells the delegate when the recognition of requested utterance is finished.

-
- - - -
- (void)didFinishRecognitionWithError:(NSError *)error
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognizer.h

-
- - -
-
-
- -

– didHypothesizeTranscription: -

- -
-
- -
- - -
-

Tells the delegate that a hypothesized transcription is available.

-
- - - -
- (void)didHypothesizeTranscription:(SFTranscription *)transcription
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognizer.h

-
- - -
-
-
- -

– availabilityDidChange: -

- -
-
- -
- - -
-

Tells the delegate when the availability of the speech recognizer has changed

-
- - - -
- (void)availabilityDidChange:(BOOL)available
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKSpeechRecognizer.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKStepViewControllerDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKStepViewControllerDelegate.html deleted file mode 100644 index c0167cc1f2..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKStepViewControllerDelegate.html +++ /dev/null @@ -1,606 +0,0 @@ - - - - - - ORKStepViewControllerDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKStepViewControllerDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKStepViewController.h
- - - - -
- -

Overview

-

The primary implementer of the ORKStepViewControllerDelegate protocol is the -task view controller (ORKTaskViewController). The task view controller observes the messages -of the protocol to correctly update its result property, and to control navigation -through the task.

- -

If you present step view controllers outside of a task view controller, it -can be helpful to implement this protocol to facilitate navigation and -results collection.

-
- - - - - -
- - - - - - -
-
- -

– stepViewController:didFinishWithNavigationDirection: -required method

- -
-
- -
- - -
-

Tells the delegate when the user has done something that requires navigation, such as -tap the Back or a Next button, or enter a response to a nonoptional -survey question.

-
- - - -
- (void)stepViewController:(ORKStepViewController *)stepViewController didFinishWithNavigationDirection:(ORKStepViewControllerNavigationDirection)direction
- - - -
-

Parameters

- - - - - - - - - - - - -
stepViewController

The step view controller providing the callback.

direction

Direction of navigation requested.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerResultDidChange: -required method

- -
-
- -
- - -
-

Tells the delegate when a substantial change has occurred to the result.

-
- - - -
- (void)stepViewControllerResultDidChange:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - - - - - -
-

Discussion

-

The result is always available in the step view controller. Although the result is continuously changing -while the step view controller is active (because the time stamp in the result property is different each time it’s called), this method is called only when a substantive change -to the result occurs, such as when the user enters a survey answer or completes -an active step.

- -

In your implementation of this delegate method, you can collect the value of result from the step view controller.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerDidFail:withError: -required method

- -
-
- -
- - -
-

Tells the delegate when a step fails due to an error.

-
- - - -
- (void)stepViewControllerDidFail:(ORKStepViewController *)stepViewController withError:(nullable NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - -
stepViewController

The step view controller providing the callback.

error

The error detected.

-
- - - - - - - -
-

Discussion

-

A step view controller can use this method to report its failure to the task view controller. -The task view controller sends the error to its delegate indicating that the task has failed (using ORKTaskViewControllerFinishReasonFailed). -Note that recorder errors are reported by calling the ORKStepViewControllerDelegate method stepViewController:recorder:didFailWithError:.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewController:recorder:didFailWithError: -required method

- -
-
- -
- - -
-

Tells the delegate when a recorder error has been detected during the step.

-
- - - -
- (void)stepViewController:(ORKStepViewController *)stepViewController recorder:(ORKRecorder *)recorder didFailWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
stepViewController

The step view controller providing the callback.

recorder

The recorder that detected the error.

error

The error detected.

-
- - - - - - - -
-

Discussion

-

Recorder errors can occur during active steps, usually due to the -unavailability of sensor data or disk space in which to record results.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerWillAppear: -

- -
-
- -
- - -
-

Tells the delegate that the step view controller’s view is about to appear.

-
- - - -
- (void)stepViewControllerWillAppear:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - - - - - -
-

Discussion

-

This method is called from the step view controller’s viewWillAppear: method. -You can use this method to customize the appearance of the step view -controller without subclassing it.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerHasPreviousStep: -

- -
-
- -
- - -
-

Asks the delegate whether there is a previous step.

-
- - - -
- (BOOL)stepViewControllerHasPreviousStep:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - -
-

Return Value

-

YES if a Back button should be visible; otherwise, NO.

-
- - - - - -
-

Discussion

-

If there is a previous step, the step view controller adds a Back button to its -navigation item; if not, no Back button is added to the navigation item.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
- -

– stepViewControllerHasNextStep: -

- -
-
- -
- - -
-

Asks the delegate whether there is a next step.

-
- - - -
- (BOOL)stepViewControllerHasNextStep:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - -
stepViewController

The step view controller providing the callback.

-
- - - -
-

Return Value

-

YES if there is a step following the current one; otherwise, NO.

-
- - - - - -
-

Discussion

-

Depending on the result of the step, the step view controller can adjust the language for the -Next button.

-
- - - - - - - -
-

Declared In

-

ORKStepViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTableStepSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTableStepSource.html deleted file mode 100644 index 4475ec9e08..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTableStepSource.html +++ /dev/null @@ -1,561 +0,0 @@ - - - - - - ORKTableStepSource Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTableStepSource Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKTableStep.h
- - - - -
- -

Overview

-

The ORKTableStepSource is a protocol that can be used for presenting a list of model -objects in a UITableView. Any ORKStep subclass that implements this protocol can be used with -an ORKTableStepViewController to display the list of items.

-
- - - - - -
- - - - - - -
-
- -

– numberOfRowsInSection: -required method

- -
-
- -
- - -
-

Returns the number of rows in the section.

-
- - - -
- (NSInteger)numberOfRowsInSection:(NSInteger)section
- - - -
-

Parameters

- - - - - - - -
section

The section of the table

-
- - - -
-

Return Value

-

The number of rows in the tableview section

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– configureCell:indexPath:tableView: -required method

- -
-
- -
- - -
-

Method for configuring a cell.

-
- - - -
- (void)configureCell:(UITableViewCell *)cell indexPath:(NSIndexPath *)indexPath tableView:(UITableView *)tableView
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
cell

The UITableViewCell to configure.

indexPath

The indexpath for the cell.

tableView

The table view for this cell.

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– numberOfSections -

- -
-
- -
- - -
-

Returns the number of sections in the tableview used to display this step. Default = 1.

-
- - - -
- (NSInteger)numberOfSections
- - - - - -
-

Return Value

-

The number of sections in the tableview.

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– reuseIdentifierForRowAtIndexPath: -

- -
-
- -
- - -
-

Returns the reuseIdentifier for the object at this index path. Default = ORKBasicCellReuseIdentifier

-
- - - -
- (NSString *)reuseIdentifierForRowAtIndexPath:(NSIndexPath *)indexPath
- - - -
-

Parameters

- - - - - - - -
indexPath

The indexpath of the section/row for the cell

-
- - - -
-

Return Value

-

The model object for this section/row

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– registerCellsForTableView: -

- -
-
- -
- - -
-

Optional override for registering UITableViewCell instances. The default registers a UITableViewCell -for ORKBasicCellReuseIdentifier.

-
- - - -
- (void)registerCellsForTableView:(UITableView *)tableView
- - - -
-

Parameters

- - - - - - - -
tableView

The table view to register cells

-
- - - - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– titleForHeaderInSection:tableView: -

- -
-
- -
- - -
-

Optional override to return custom header title for section. The default returns nil.

-
- - - -
- (nullable NSString *)titleForHeaderInSection:(NSInteger)section tableView:(UITableView *)tableView
- - - -
-

Parameters

- - - - - - - - - - - - -
section

The section for this custom header title

tableView

The table view for custom section header title

-
- - - -
-

Return Value

-

The custom header title for this section

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
- -

– viewForHeaderInSection:tableView: -

- -
-
- -
- - -
-

Optional override to return custom header view for section. The default returns nil.

-
- - - -
- (nullable UIView *)viewForHeaderInSection:(NSInteger)section tableView:(UITableView *)tableView
- - - -
-

Parameters

- - - - - - - - - - - - -
section

The section for this custom header view

tableView

The table view for custom section header view

-
- - - -
-

Return Value

-

The custom header view for this section

-
- - - - - - - - - - - -
-

Declared In

-

ORKTableStep.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTask.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTask.html deleted file mode 100644 index ce7babee66..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTask.html +++ /dev/null @@ -1,668 +0,0 @@ - - - - - - ORKTask Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTask Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKTask.h
- - - - -
- -

Overview

-

The ORKTask protocol defines a task to be carried out by a participant -in a research study. To present the ResearchKit framework UI in your app, instantiate an -object that implements the ORKTask protocol (such as ORKOrderedTask) and -provide it to an ORKTaskViewController object.

- -

Implement this protocol to enable dynamic selection of the steps for a given task. -By default, ORKOrderedTask implements this protocol for simple sequential tasks.

- -

Each step (ORKStep) in a task roughly corresponds to one screen, and represents the -primary unit of work in any task presented by a task view controller. For example, -an ORKQuestionStep object corresponds to a single question presented on screen, -together with controls the participant uses to answer the question. Another example is ORKFormStep, which corresponds to a single -screen that displays multiple questions or items for which participants provide information, such as first name, last name, and birth date.

- -

Each step corresponds to one -ORKStepViewController object, which may manage child view controllers in a particular -sequence. The correspondence of step to view controller holds even though some steps, such as ORKVisualConsentStep and -ORKConsentReviewStep, can produce multiple screens.

-
- - - - - -
- - - - - - -
-
- -

  identifier -required method

- -
-
- -
- - -
-

The unique identifier for this task.

-
- - - -
@property (nonatomic, copy, readonly) NSString *identifier
- - - - - - - - - -
-

Discussion

-

The identifier should be a short string that identifies the task. The identifier is copied -into the ORKTaskResult objects generated by the task view controller for this -task. You can use a human-readable string for the task identifier -or a UUID; the exact string you use depends on your app.

- -

In the case of apps whose tasks come from a server, the unique -identifier for the task may be in an external database.

- -

The task view controller uses the identifier when constructing the task result. -The identifier can also be used during UI state restoration to identify the -task that needs to be restored.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepAfterStep:withResult: -required method

- -
-
- -
- - - - -
- (nullable ORKStep *)stepAfterStep:(nullable ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepBeforeStep:withResult: -required method

- -
-
- -
- - - - -
- (nullable ORKStep *)stepBeforeStep:(nullable ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– stepWithIdentifier: -

- -
-
- -
- - -
-

Returns the step that matches the specified identifier.

-
- - - -
- (nullable ORKStep *)stepWithIdentifier:(NSString *)identifier
- - - -
-

Parameters

- - - - - - - -
identifier

The identifier of the step to restore.

-
- - - -
-

Return Value

-

The step that matches the specified identifier.

-
- - - - - -
-

Discussion

-

Implementing this method allows state restoration of a task -to a particular step. If you don’t implement this method, ORKTaskViewController restores the state -to the first step of the task.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– progressOfCurrentStep:withResult: -

- -
-
- -
- - - - -
- (ORKTaskProgress)progressOfCurrentStep:(ORKStep *)step withResult:(ORKTaskResult *)result
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

– validateParameters -

- -
-
- -
- - -
-

Validates the task parameters.

-
- - - -
- (void)validateParameters
- - - - - - - - - -
-

Discussion

-

The implementation of this method should check that all the task parameters are correct. An invalid task -is considered an unrecoverable error: the implementation should throw an exception on parameter validation failure. -For example, the ORKOrderedTask implementation makes sure that all its step identifiers are unique, throwing an -exception otherwise.

- -

This method is usually called by a task view controller when its task is set.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

  requestedHealthKitTypesForReading -

- -
-
- -
- - -
-

The set of HealthKit types that steps in the task need to be able to -read. (read-only)

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSSet<HKObjectType*> *requestedHealthKitTypesForReading
- - - - - - - - - -
-

Discussion

-

The value of this property is a set of HKObjectType values to request for reading from HealthKit during this task. After the last of the initial instruction steps, the task view controller -requests access to these HealthKit types.

- -

To set this property, you can scan the steps in the task -and collate the HealthKit types that are requested by each active step, question, or -form step that has a Health answer format, and then include any additional types known -to be required. (Note that ORKOrderedTask does something similar for this property.)

- -

See also: requestedHealthKitTypesForWriting.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

  requestedHealthKitTypesForWriting -

- -
-
- -
- - -
-

The set of HealthKit types for which the task needs to request write access.

-
- - - -
@property (nonatomic, copy, readonly, nullable) NSSet<HKObjectType*> *requestedHealthKitTypesForWriting
- - - - - - - - - -
-

Discussion

-

The requested HKObjectType values for writing can be returned by an extended task, -to request write access to these HealthKit types together with the read access -requested by the task view controller by calling requestedHealthKitTypesForReading.

- -

See also: requestedHealthKitTypesForReading.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

  requestedPermissions -

- -
-
- -
- - -
-

The set of permissions requested by the task.

-
- - - -
@property (nonatomic, readonly) ORKPermissionMask requestedPermissions
- - - - - - - - - -
-

Discussion

-

By default in ORKOrderedTask object, these permissions are collected from the -recorder configurations associated with the active steps in the task.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
- -

  providesBackgroundAudioPrompts -

- -
-
- -
- - -
-

A Boolean value indicating whether this task involves spoken audio prompts. (read-only)

-
- - - -
@property (nonatomic, readonly) BOOL providesBackgroundAudioPrompts
- - - - - - - - - -
-

Discussion

-

If the value of this property is YES, the shared AVAudioSession is configured for playback in the background. -The audio UIBackgroundMode value must be set in the application’s Info.plist file -for this to be effective.

- -

By default, this property looks for active steps that have -audio prompts or count down enabled, and returns YES if such steps exist in -the task.

-
- - - - - - - -
-

Declared In

-

ORKTask.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTaskResultSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTaskResultSource.html deleted file mode 100644 index 48226fa81b..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTaskResultSource.html +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - ORKTaskResultSource Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTaskResultSource Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKCollectionResult.h
- - - - -
- -

Overview

-

ORKTaskResultSource is the protocol for [ORKTaskViewController defaultResultSource].

-
- - - - - -
- - - - - - -
-
- -

– stepResultForStepIdentifier: -required method

- -
-
- -
- - -
-

Returns a step result for the specified step identifier, if one exists.

-
- - - -
- (nullable ORKStepResult *)stepResultForStepIdentifier:(NSString *)stepIdentifier
- - - -
-

Parameters

- - - - - - - -
stepIdentifier

The identifier for which to search.

-
- - - -
-

Return Value

-

The result for the specified step, or nil for none.

-
- - - - - -
-

Discussion

-

When it’s about to present a step, the task view controller needs to look up a -suitable default answer. The answer can be used to prepopulate a survey with -the results obtained on a previous run of the same task, by passing an -ORKTaskResult object (which itself implements this protocol).

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
- -

– alwaysCheckForDefaultResult -

- -
-
- -
- - -
-

Should the default result store be used even if there is a previous result? (due to -reverse navigation or looping)

-
- - - -
- (BOOL)alwaysCheckForDefaultResult
- - - - - -
-

Return Value

-

YES if the default result should be given priority over the previous result.

-
- - - - - -
-

Discussion

-

By default, the [ORKTaskViewController defaultResultSource] is only queried for a -result if the previous result is nil. This allows the result source to override that -default behavior.

-
- - - - - - - -
-

Declared In

-

ORKCollectionResult.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTaskViewControllerDelegate.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTaskViewControllerDelegate.html deleted file mode 100644 index a1ba48c3a5..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKTaskViewControllerDelegate.html +++ /dev/null @@ -1,945 +0,0 @@ - - - - - - ORKTaskViewControllerDelegate Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKTaskViewControllerDelegate Protocol Reference

- - -
- - - - - - - -
Conforms toNSObject
Declared inORKTaskViewController.h
- - - - -
- -

Overview

-

The task view controller delegate is responsible for processing the results -of the task, exerting some control over how the controller behaves, and providing -auxiliary content as needed.

-
- - - - - -
- - - - - - -
-
- -

– taskViewController:didFinishWithReason:error: -required method

- -
-
- -
- - -
-

Tells the delegate that the task has finished.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController didFinishWithReason:(ORKTaskViewControllerFinishReason)reason error:(nullable NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
taskViewController

The ORKTaskViewControllerinstance that is returning the result.

reason

An ORKTaskViewControllerFinishReason value indicating how the user chose to complete the task.

error

If failure occurred, an NSError object indicating the reason for the failure. The value of this parameter is nil if result does not indicate failure.

-
- - - - - - - -
-

Discussion

-

The task view controller calls this method when an unrecoverable error occurs, -when the user has canceled the task (with or without saving), or when the user -completes the last step in the task.

- -

In most circumstances, the receiver should dismiss the task view controller -in response to this method, and may also need to collect and process the results -of the task.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:recorder:didFailWithError: -

- -
-
- -
- - -
-

Signals that an error has been detected by a recorder.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController recorder:(ORKRecorder *)recorder didFailWithError:(NSError *)error
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

recorder

The recorder that detected the error. ORKStep and ORKRecorderConfiguration objects can be found in the recorder instance.

error

The error that was detected.

-
- - - - - - - -
-

Discussion

-

Recorder errors can occur during active steps, typically because sensor data is unavailable or there isn’t enough disk space to record the results. -You can use this method as an opportunity to respond to the error by, for example, logging and ignoring it.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewControllerSupportsSaveAndRestore: -

- -
-
- -
- - -
-

Asks the delegate if the state of the current uncompleted task should be saved.

-
- - - -
- (BOOL)taskViewControllerSupportsSaveAndRestore:(ORKTaskViewController *)taskViewController
- - - -
-

Parameters

- - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

-
- - - -
-

Return Value

-

YES if save and restore should be supported; otherwise, NO.

-
- - - - - -
-

Discussion

-

The task view controller calls this method to determine whether to offer -a save option when the user attempts to cancel a task that is in progress.

- -

If this method is not implemented, the task view controller assumes that save and restore are not supported. -If this method returns YES, it’s recommended that you copy the value of the restorationData property of the -task view controller and pass that data to initWithTask:restorationData: when it is time -to create a new task view controller to continue from the point at which the user stopped.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewControllerShouldConfirmCancel: -

- -
-
- -
- - -
-

Asks the delegate if the cancel action should be confirmed

-
- - - -
- (BOOL)taskViewControllerShouldConfirmCancel:(ORKTaskViewController *)taskViewController
- - - -
-

Parameters

- - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

-
- - - -
-

Return Value

-

YES to confirm cancel action; NO to immediately discard the results.

-
- - - - - -
-

Discussion

-

The task view controller calls this method to determine whether or not to confirm -result save or discard when user attempts to cancel a task that is in progress.

- -

If this method is not implemented, the task view controller assumes that cancel should be confirmed. -If this method returns YES, then cancel action will be confirmed. -If this method returns NO, then the results will immediately be discarded.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:hasLearnMoreForStep: -

- -
-
- -
- - -
-

Asks the delegate if there is Learn More content for this step.

-
- - - -
- (BOOL)taskViewController:(ORKTaskViewController *)taskViewController hasLearnMoreForStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

step

The step for which the task view controller needs to know if there is Learn More content.

-
- - - -
-

Return Value

-

NO if there is no Learn More content to display.

-
- - - - - -
-

Discussion

-

The task view controller calls this method to determine whether a -Learn More button should be displayed for the step.

- -

The standard templates in ResearchKit for all types of steps include a button -labeled Learn More (or a variant). In consent steps, this is internal to -the implementations of the step and step view controller, but in all other steps, -the task view controller asks its delegate to determine if Learn More content is available, -and to request that it be displayed.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:learnMoreForStep: -

- -
-
- -
- - -
-

Tells the delegate that the user has tapped the Learn More button in the step.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController learnMoreForStep:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

stepViewController

The ORKStepViewController that reported the Learn More event to the task view controller.

-
- - - - - - - -
-

Discussion

-

The standard templates in ResearchKit for all types of steps include a button -labeled Learn More (or a variant). In consent steps this is internal to -the implementations of the step and step view controller, but in all other steps, -the task view controller asks its delegate to determine if Learn More content is available.

- -

This method is called only if the delegate returns YES to -taskViewController:hasLearnMoreForStep: for the current step, and the user -subsequently taps on the Learn More button.

- -

When this method is called, the app should respond to the Learn More action by -presenting a dialog or other view (possibly modal) that contains the Learn More content.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:viewControllerForStep: -

- -
-
- -
- - -
-

Asks the delegate for a custom view controller for the specified step.

-
- - - -
- (nullable ORKStepViewController *)taskViewController:(ORKTaskViewController *)taskViewController viewControllerForStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

step

The step for which a view controller is requested.

-
- - - -
-

Return Value

-

A custom view controller, or nil to request the default step controller for this step.

-
- - - - - -
-

Discussion

-

If this method is implemented, the task view controller calls it to obtain a -step view controller for the step.

- -

In most circumstances, the task view controller -can determine which view controller to instantiate for a step. However, if -you want to provide a specific view controller instance, you can call this method to do so.

- -

The delegate should provide a step view controller implementation for any custom step.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:shouldPresentStep: -

- -
-
- -
- - -
-

Asks the delegate if the task view controller should proceed to the specified step.

-
- - - -
- (BOOL)taskViewController:(ORKTaskViewController *)taskViewController shouldPresentStep:(ORKStep *)step
- - - -
-

Parameters

- - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

step

The step for which presentation is requested.

-
- - - -
-

Return Value

-

YES if navigation should proceed to the specified step; NO if navigation should not proceed.

-
- - - - - -
-

Discussion

-

The task view controller calls this method before creating a step view -controller for the next or previous step.

- -

Generally, when a step is available, the task view controller presents it when -the user taps a forward or backward navigation button, but the results entered or other circumstances can make this action inappropriate. In these -circumstances, you can implement this delegate method and return NO.

- -

If you return NO, it’s often appropriate to present a dialog or take -some other UI action to explain why navigation was denied.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:stepViewControllerWillAppear: -

- -
-
- -
- - -
-

Tells the delegate that a step view controller is about to be displayed.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillAppear:(ORKStepViewController *)stepViewController
- - - -
-

Parameters

- - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

stepViewController

The ORKStepViewController that is about to be displayed.

-
- - - - - - - -
-

Discussion

-

The task view controller calls this method before presenting the step -view controller.

- -

This method gives you an opportunity to modify the step view controller before presentation. -For example, you might want to modify the learnMoreButtonTitle or continueButtonTitle -properties, or modify other button state. Another possible use case is when a particular -step view controller requires additional setup before presentation.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:stepViewControllerWillDisappear:navigationDirection: -

- -
-
- -
- - -
-

Tells the delegate that a step will disappear.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController stepViewControllerWillDisappear:(ORKStepViewController *)stepViewController navigationDirection:(ORKStepViewControllerNavigationDirection)direction
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

stepViewController

The ORKStepViewController that has just finished.

direction

The ORKStepViewControllerNavigationDirection of navigation.

-
- - - - - - - -
-

Discussion

-

This is called in the ORKStepViewControllerDelegate method for stepViewController:didFinishWithNavigationDirection: -after saving the result of the step to the task view controller and before navigating to the next/previous step.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
- -

– taskViewController:didChangeResult: -

- -
-
- -
- - -
-

Tells the delegate that the result has substantively changed.

-
- - - -
- (void)taskViewController:(ORKTaskViewController *)taskViewController didChangeResult:(ORKTaskResult *)result
- - - -
-

Parameters

- - - - - - - - - - - - -
taskViewController

The calling ORKTaskViewController instance.

result

The current value of the result.

-
- - - - - - - -
-

Discussion

-

The task view controller calls this method when steps start or finish, or if an answer has -changed in the current step due to editing or other user interaction.

-
- - - - - - - -
-

Declared In

-

ORKTaskViewController.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueCollectionType.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueCollectionType.html deleted file mode 100644 index 3489636780..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueCollectionType.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - ORKValueCollectionType Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKValueCollectionType Protocol Reference

- - -
- - - - -
Declared inORKChartTypes.h
- - - - -
- -

Overview

-

Defines the common attributes of chart values.

-
- - - - - -
- - - - - - -
-
- -

  isUnset -required method

- -
-
- -
- - -
-

A Boolean value indicating that the value is unset. (read-only)

-
- - - -
@property (nonatomic, readonly) BOOL isUnset
- - - - - - - - - - - - - - - -
-

Declared In

-

ORKChartTypes.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueRangeGraphChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueRangeGraphChartViewDataSource.html deleted file mode 100644 index b6fe6e1852..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueRangeGraphChartViewDataSource.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - ORKValueRangeGraphChartViewDataSource Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKValueRangeGraphChartViewDataSource Protocol Reference

- - -
- - - - - - - -
Conforms toORKGraphChartViewDataSource
Declared inORKGraphChartView.h
- - - - -
- -

Overview

-

An object that adopts the ORKValueRangeGraphChartViewDataSource protocol is responsible for -providing data in the form of ORKValueRange values required to populate an -ORKValueRangeGraphChartView concrete subclass, such as ORKLineGraphChartView and -ORKDiscreteGraphChartView.

-
- - - - - -
- - - - - - -
-
- -

– graphChartView:dataPointForPointIndex:plotIndex: -required method

- -
-
- -
- - -
-

Asks the data source for the value range to be plotted at the specified point index for the -specified plot.

-
- - - -
- (ORKValueRange *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
graphChartView

The graph chart view that is asking for the value range.

pointIndex

An index number identifying the value range in the graph chart view.

plotIndex

An index number identifying the plot in the graph chart view. This index - is 0 in a single-plot graph chart view.

-
- - - -
-

Return Value

-

The value range specified by pointIndex in the plot specified by plotIndex for the -specified graph chart view`.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueStackGraphChartViewDataSource.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueStackGraphChartViewDataSource.html deleted file mode 100644 index 2ed202f5ac..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/Protocols/ORKValueStackGraphChartViewDataSource.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - ORKValueStackGraphChartViewDataSource Protocol Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ORKValueStackGraphChartViewDataSource Protocol Reference

- - -
- - - - - - - -
Conforms toORKGraphChartViewDataSource
Declared inORKGraphChartView.h
- - - - -
- -

Overview

-

An object that adopts the ORKValueStackGraphChartViewDataSource protocol is responsible for -providing data in the form of ORKValueStack values required to populate an ORKBarGraphChartView -object.

-
- - - - - -
- - - - - - -
-
- -

– graphChartView:dataPointForPointIndex:plotIndex: -required method

- -
-
- -
- - -
-

Asks the data source for the value stack to be plotted at the specified point index for the -specified plot.

-
- - - -
- (ORKValueStack *)graphChartView:(ORKGraphChartView *)graphChartView dataPointForPointIndex:(NSInteger)pointIndex plotIndex:(NSInteger)plotIndex
- - - -
-

Parameters

- - - - - - - - - - - - - - - - - -
graphChartView

The graph chart view that is asking for the value stack.

pointIndex

An index number identifying the value stack in the graph chart view.

plotIndex

An index number identifying the plot in the graph chart view. This index -is 0 in a single-plot graph chart view.

-
- - - -
-

Return Value

-

The value stack specified by pointIndex in the plot specified by plotIndex for the -specified graph chart view`.

-
- - - - - - - - - - - -
-

Declared In

-

ORKGraphChartView.h

-
- - -
-
-
-
- -
- - - - - - -
- - -
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_index.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_index.scss deleted file mode 100644 index 6a57ec5dc3..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_index.scss +++ /dev/null @@ -1,17 +0,0 @@ -.index-container { - -webkit-flex-direction: column; - flex-direction: column; - - @media (min-width: $desktop-min-width) { - display: flex; - -webkit-flex-direction: row; - flex-direction: row; - -webkit-flex-wrap: wrap; - flex-wrap: wrap; - } - - .index-column { - -webkit-flex: 1 1 33%; - flex: 1 1 33%; - } -} diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_layout.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_layout.scss deleted file mode 100644 index da46aef079..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_layout.scss +++ /dev/null @@ -1,302 +0,0 @@ -* { - box-sizing: border-box; -} - -.clear { - clear: both; -} - -.clearfix { - &:before, &:after { - clear: both; - display: table; - content: ""; - } -} - -.xcode .hide-in-xcode { - display: none; -} - -body { - font: 62.5% $body-font; - background: $body-background; - - @media (max-width: $mobile-max-width) { - background-color: $content-background; - } -} - -h1, h2, h3 { - font-weight: 300; - color: #808080; -} - -h1 { - font-size: 2em; - color: #000; -} - -h4 { - font-size: 13px; - line-height: 1.5; - margin: 21px 0 0 0; -} - -a { - color: $tint-color; - text-decoration: none; -} - -pre, code { - font-family: $code-font; - word-wrap: break-word; -} - -pre > code, .method-declaration code { - display: inline-block; - font-size: .85em; - padding: 4px 0 4px 10px; - border-left: 5px solid rgba(0, 155, 51, .2); - - &:before { - content: "Objective-C"; - display: block; - - font: 9px/1 $body-font; - color: #009b33; - text-transform: uppercase; - letter-spacing: 2px; - padding-bottom: 6px; - } -} - -pre > code { - font-size: inherit; -} - -table, th, td { - border: 1px solid #e9e9e9; -} - -table { - width: 100%; -} - -th, td { - padding: 7px; - - > :first-child { - margin-top: 0; - } - - > :last-child { - margin-bottom: 0; - } -} - -.container { - @extend .clearfix; - - max-width: 980px; - padding: 0 10px; - margin: 0 auto; - - @media (max-width: $mobile-max-width) { - padding: 0; - } -} - -header { - position: fixed; - top: 0; - left: 0; - width: 100%; - z-index: 2; - - background: #414141; - color: #fff; - font-size: 1.1em; - line-height: 25px; - letter-spacing: .05em; - - #library-title { - float: left; - } - - #developer-home { - float: right; - } - - h1 { - font-size: inherit; - font-weight: inherit; - margin: 0; - } - - p { - margin: 0; - } - - h1, a { - color: inherit; - } - - @media (max-width: $mobile-max-width) { - .container { - padding: 0 10px; - } - } -} - -aside { - position: fixed; - top: 25px; - left: 0; - width: 100%; - height: 25px; - z-index: 2; - - font-size: 1.1em; - - #header-buttons { - background: rgba(255, 255, 255, .8); - margin: 0 1px; - padding: 0; - list-style: none; - text-align: right; - line-height: 32px; - - li { - display: inline-block; - cursor: pointer; - padding: 0 10px; - } - - label, select { - cursor: inherit; - } - - #on-this-page { - position: relative; - - .chevron { - display: inline-block; - width: 14px; - height: 4px; - position: relative; - - .chevy { - background: #878787; - height: 2px; - position: absolute; - width: 10px; - - &.chevron-left { - left: 0; - transform: rotateZ(45deg) scale(0.6); - } - - &.chevron-right { - right: 0; - transform: rotateZ(-45deg) scale(0.6); - } - } - } - - #jump-to { - opacity: 0; - font-size: 16px; - - position: absolute; - top: 5px; - left: 0; - width: 100%; - height: 100%; - } - } - } -} - -article { - margin-top: 25px; - - #content { - @extend .clearfix; - - background: $content-background; - border: 1px solid $content-border; - padding: 15px 25px 30px 25px; - - font-size: 1.4em; - line-height: 1.45; - - position: relative; - - @media (max-width: $mobile-max-width) { - padding: 15px 10px 20px 10px; - border: none; - } - - .navigation-top { - position: absolute; - top: 15px; - right: 25px; - } - - .title { - margin: 21px 0 0 0; - padding: 15px 0; - } - - p { - color: #414141; - margin: 0 0 15px 0; - } - - th, td { - p:last-child { - margin-bottom: 0; - } - } - - main { - ul { - list-style: none; - margin-left: 24px; - margin-bottom: 12px; - padding: 0; - - li { - position: relative; - padding-left: 1.3em; - - &:before { - content: "\02022"; - - color: #414141; - font-size: 1.08em; - line-height: 1; - - position: absolute; - left: 0; - padding-top: 2px; - } - } - } - } - - footer { - @extend .clearfix; - - .footer-copyright { - margin: 70px 25px 10px 0; - } - - p { - font-size: .71em; - color: #a0a0a0; - } - } - } -} diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_normalize.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_normalize.scss deleted file mode 100644 index 9b8848a5cf..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_normalize.scss +++ /dev/null @@ -1,581 +0,0 @@ -/* ========================================================================== - Normalize.scss settings - ========================================================================== */ -/** - * Includes legacy browser support IE6/7 - * - * Set to false if you want to drop support for IE6 and IE7 - */ - -$legacy_browser_support: false !default; - -/* Base - ========================================================================== */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - * 3. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using - * `em` units. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ - @if $legacy_browser_support { - *font-size: 100%; /* 3 */ - } -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ - @if $legacy_browser_support { - *display: inline; - *zoom: 1; - } -} - -/** - * Prevents modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ - -a { - &:active, &:hover { - outline: 0; - }; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -@if $legacy_browser_support { - blockquote { - margin: 1em 40px; - } -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -@if $legacy_browser_support { - h2 { - font-size: 1.5em; - margin: 0.83em 0; - } - - h3 { - font-size: 1.17em; - margin: 1em 0; - } - - h4 { - font-size: 1em; - margin: 1.33em 0; - } - - h5 { - font-size: 0.83em; - margin: 1.67em 0; - } - - h6 { - font-size: 0.67em; - margin: 2.33em 0; - } -} - -/** - * Addresses styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -@if $legacy_browser_support { - - /** - * Addresses margins set differently in IE 6/7. - */ - - p, - pre { - *margin: 1em 0; - } - - /* - * Addresses CSS quotes not supported in IE 6/7. - */ - - q { - *quotes: none; - } - - /* - * Addresses `quotes` property not supported in Safari 4. - */ - - q:before, - q:after { - content: ''; - content: none; - } -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -@if $legacy_browser_support { - - /* ========================================================================== - Lists - ========================================================================== */ - - /* - * Addresses margins set differently in IE 6/7. - */ - - dl, - menu, - ol, - ul { - *margin: 1em 0; - } - - dd { - *margin: 0 0 0 40px; - } - - /* - * Addresses paddings set differently in IE 6/7. - */ - - menu, - ol, - ul { - *padding: 0 0 0 40px; - } - - /* - * Corrects list images handled incorrectly in IE 7. - */ - - nav ul, - nav ol { - *list-style: none; - *list-style-image: none; - } - -} - -/* Embedded content - ========================================================================== */ - -/** - * 1. Remove border when inside `a` element in IE 8/9/10. - * 2. Improves image quality when scaled in IE 7. - */ - -img { - border: 0; - @if $legacy_browser_support { - *-ms-interpolation-mode: bicubic; /* 2 */ - } -} - -/** - * Correct overflow not hidden in IE 9/10/11. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Grouping content - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - @if $legacy_browser_support { - _font-family: 'courier new', monospace; - } - font-size: 1em; -} - -/* Forms - ========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - * 4. Improves appearance and consistency in all browsers. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ - @if $legacy_browser_support { - vertical-align: baseline; /* 3 */ - *vertical-align: middle; /* 3 */ - } -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - * 4. Removes inner spacing in IE 7 without affecting normal text inputs. - * Known issue: inner spacing remains in IE 6. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ - @if $legacy_browser_support { - *overflow: visible; /* 4 */ - } -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - * Known issue: excess padding remains in IE 6. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ - @if $legacy_browser_support { - *height: 13px; /* 3 */ - *width: 13px; /* 3 */ - } -} - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; -} - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - * 3. Corrects text not wrapping in Firefox 3. - * 4. Corrects alignment displayed oddly in IE 6/7. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ - @if $legacy_browser_support { - white-space: normal; /* 3 */ - *margin-left: -7px; /* 4 */ - } -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_object.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_object.scss deleted file mode 100644 index 22eebd87d0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_object.scss +++ /dev/null @@ -1,89 +0,0 @@ -.section-specification { - table { - width: auto; - - th { - text-align: left; - } - } -} - -.method-title { - margin-left: -15px; - margin-bottom: 8px; - transition: margin-left .3s ease-out; - - .section-method.hide & { - margin-left: 0; - } - - code { - font-weight: 400; - font-size: .85em; - } -} - -.method-info { - background: $object-background; - border-bottom: 1px solid $object-border; - margin: 0 -25px; - padding: 20px 25px 0 25px; - transition: height .3s ease-out; - - position: relative; - - .pointy-thing { - background: $content-background; - height: 10px; - border-bottom: 1px solid $object-border; - margin: -20px -25px 16px -25px; - - &:before { - display: inline-block; - content: ""; - - background: $object-background; - border: 1px solid $object-border; - border-bottom: 0; - border-right: 0; - - position: absolute; - left: 21px; - top: 3px; - width: 12px; - height: 12px; - transform: rotate(45deg); - } - } - - .method-subsection { - margin-bottom: 15px; - - .argument-name { - width: 1px; - text-align: right; - - code { - color: #808080; - font-style: italic; - font-weight: 400; - } - } - } -} - -.section-method { - &.hide .method-info { - height: 0 !important; - overflow: hidden; - display: none; - } - - &.hide.animating .method-info { - display: block; - } - - &.animating .method-info { - overflow: hidden; - } -} diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_print.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_print.scss deleted file mode 100644 index 61bdf99f86..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_print.scss +++ /dev/null @@ -1,42 +0,0 @@ -@media print { - body { - background: #fff; - padding: 8px; - } - - header { - position: static; - background: #fff; - color: #000; - } - - aside { - display: none; - } - - .container { - max-width: none; - padding: 0; - } - - article { - margin-top: 0; - - #content { - border: 0; - background: #fff; - padding: 15px 0 0 0; - - .title { - margin-top: 0; - padding-top: 0; - } - } - } - - .method-info { - &, & .pointy-thing { - background: #fff; - } - } -} diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_variables.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_variables.scss deleted file mode 100644 index 38e072d310..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_variables.scss +++ /dev/null @@ -1,12 +0,0 @@ -$body-font: -apple-system-font, "Helvetica Neue", Helvetica, sans-serif; -$code-font: "Source Code Pro", Monaco, Menlo, Consolas, monospace; - -$body-background: #f2f2f2; -$content-background: #fff; -$content-border: #e9e9e9; -$tint-color: #08c; -$object-background: #f9f9f9; -$object-border: #e9e9e9; - -$mobile-max-width: 650px; -$desktop-min-width: 768px; \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_xcode.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_xcode.scss deleted file mode 100644 index 340b1f6b80..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/_xcode.scss +++ /dev/null @@ -1,29 +0,0 @@ -.xcode { - header, aside { - display: none; - } - - .container { - padding: 0; - } - - article { - margin-top: 0; - - #content { - border: 0; - margin: 0; - } - } - - .method-info { - &, .section-method.hide & { - max-height: auto; - overflow: visible; - - &.hiding { - display: block; - } - } - } -} diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/style.scss b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/style.scss deleted file mode 100644 index 648a6086ba..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/scss/style.scss +++ /dev/null @@ -1 +0,0 @@ -@import "variables", "normalize", "layout", "index", "object", "print", "xcode"; diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/style.css b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/style.css deleted file mode 100644 index d9d59dd080..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/css/style.css +++ /dev/null @@ -1,2 +0,0 @@ -html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{box-sizing:border-box}.clear{clear:both}.clearfix:before,.container:before,article #content:before,article #content footer:before,.clearfix:after,.container:after,article #content:after,article #content footer:after{clear:both;display:table;content:""}.xcode .hide-in-xcode{display:none}body{font:62.5% -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;background:#f2f2f2}@media (max-width: 650px){body{background-color:#fff}}h1,h2,h3{font-weight:300;color:#808080}h1{font-size:2em;color:#000}h4{font-size:13px;line-height:1.5;margin:21px 0 0 0}a{color:#08c;text-decoration:none}pre,code{font-family:"Source Code Pro",Monaco,Menlo,Consolas,monospace;word-wrap:break-word}pre>code,.method-declaration code{display:inline-block;font-size:.85em;padding:4px 0 4px 10px;border-left:5px solid rgba(0,155,51,0.2)}pre>code:before,.method-declaration code:before{content:"Objective-C";display:block;font:9px/1 -apple-system-font,"Helvetica Neue",Helvetica,sans-serif;color:#009b33;text-transform:uppercase;letter-spacing:2px;padding-bottom:6px}pre>code{font-size:inherit}table,th,td{border:1px solid #e9e9e9}table{width:100%}th,td{padding:7px}th>:first-child,td>:first-child{margin-top:0}th>:last-child,td>:last-child{margin-bottom:0}.container{max-width:980px;padding:0 10px;margin:0 auto}@media (max-width: 650px){.container{padding:0}}header{position:fixed;top:0;left:0;width:100%;z-index:2;background:#414141;color:#fff;font-size:1.1em;line-height:25px;letter-spacing:.05em}header #library-title{float:left}header #developer-home{float:right}header h1{font-size:inherit;font-weight:inherit;margin:0}header p{margin:0}header h1,header a{color:inherit}@media (max-width: 650px){header .container{padding:0 10px}}aside{position:fixed;top:25px;left:0;width:100%;height:25px;z-index:2;font-size:1.1em}aside #header-buttons{background:rgba(255,255,255,0.8);margin:0 1px;padding:0;list-style:none;text-align:right;line-height:32px}aside #header-buttons li{display:inline-block;cursor:pointer;padding:0 10px}aside #header-buttons label,aside #header-buttons select{cursor:inherit}aside #header-buttons #on-this-page{position:relative}aside #header-buttons #on-this-page .chevron{display:inline-block;width:14px;height:4px;position:relative}aside #header-buttons #on-this-page .chevron .chevy{background:#878787;height:2px;position:absolute;width:10px}aside #header-buttons #on-this-page .chevron .chevy.chevron-left{left:0;transform:rotateZ(45deg) scale(0.6)}aside #header-buttons #on-this-page .chevron .chevy.chevron-right{right:0;transform:rotateZ(-45deg) scale(0.6)}aside #header-buttons #on-this-page #jump-to{opacity:0;font-size:16px;position:absolute;top:5px;left:0;width:100%;height:100%}article{margin-top:25px}article #content{background:#fff;border:1px solid #e9e9e9;padding:15px 25px 30px 25px;font-size:1.4em;line-height:1.45;position:relative}@media (max-width: 650px){article #content{padding:15px 10px 20px 10px;border:none}}article #content .navigation-top{position:absolute;top:15px;right:25px}article #content .title{margin:21px 0 0 0;padding:15px 0}article #content p{color:#414141;margin:0 0 15px 0}article #content th p:last-child,article #content td p:last-child{margin-bottom:0}article #content main ul{list-style:none;margin-left:24px;margin-bottom:12px;padding:0}article #content main ul li{position:relative;padding-left:1.3em}article #content main ul li:before{content:"\02022";color:#414141;font-size:1.08em;line-height:1;position:absolute;left:0;padding-top:2px}article #content footer .footer-copyright{margin:70px 25px 10px 0}article #content footer p{font-size:.71em;color:#a0a0a0}.index-container{-webkit-flex-direction:column;flex-direction:column}@media (min-width: 768px){.index-container{display:flex;-webkit-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;flex-wrap:wrap}}.index-container .index-column{-webkit-flex:1 1 33%;flex:1 1 33%}.section-specification table{width:auto}.section-specification table th{text-align:left}.method-title{margin-left:-15px;margin-bottom:8px;transition:margin-left .3s ease-out}.section-method.hide .method-title{margin-left:0}.method-title code{font-weight:400;font-size:.85em}.method-info{background:#f9f9f9;border-bottom:1px solid #e9e9e9;margin:0 -25px;padding:20px 25px 0 25px;transition:height .3s ease-out;position:relative}.method-info .pointy-thing{background:#fff;height:10px;border-bottom:1px solid #e9e9e9;margin:-20px -25px 16px -25px}.method-info .pointy-thing:before{display:inline-block;content:"";background:#f9f9f9;border:1px solid #e9e9e9;border-bottom:0;border-right:0;position:absolute;left:21px;top:3px;width:12px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg) }.method-info .method-subsection{margin-bottom:15px}.method-info .method-subsection .argument-name{width:1px;text-align:right}.method-info .method-subsection .argument-name code{color:#808080;font-style:italic;font-weight:400}.section-method.hide .method-info{height:0 !important;overflow:hidden;display:none}.section-method.hide.animating .method-info{display:block}.section-method.animating .method-info{overflow:hidden}@media print{body{background:#fff;padding:8px}header{position:static;background:#fff;color:#000}aside{display:none}.container{max-width:none;padding:0}article{margin-top:0}article #content{border:0;background:#fff;padding:15px 0 0 0}article #content .title{margin-top:0;padding-top:0}.method-info,.method-info .pointy-thing{background:#fff}}.xcode header,.xcode aside{display:none}.xcode .container{padding:0}.xcode article{margin-top:0}.xcode article #content{border:0;margin:0}.xcode .method-info,.section-method.hide .xcode .method-info{max-height:auto;overflow:visible}.xcode .method-info.hiding,.section-method.hide .xcode .method-info.hiding{display:block} - diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/hierarchy.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/hierarchy.html deleted file mode 100644 index 419259dad0..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/hierarchy.html +++ /dev/null @@ -1,974 +0,0 @@ - - - - - - ResearchKit Hierarchy - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ResearchKit Hierarchy

- - -
-

Class Hierarchy

- - - -
- - - -
- -

Protocol References

- - - -

Constant References

- - - -

Category References

- - -
- - - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/button_bar_background.png b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/button_bar_background.png deleted file mode 100644 index 71d1019bc0..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/button_bar_background.png and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/disclosure.png b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/disclosure.png deleted file mode 100644 index 4c5cbf4456..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/disclosure.png and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/disclosure_open.png b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/disclosure_open.png deleted file mode 100644 index 82396fed29..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/disclosure_open.png and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/library_background.png b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/library_background.png deleted file mode 100644 index 3006248afe..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/library_background.png and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/title_background.png b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/title_background.png deleted file mode 100644 index 846e4968d0..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/img/title_background.png and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/index.html b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/index.html deleted file mode 100644 index 18b7711284..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/index.html +++ /dev/null @@ -1,811 +0,0 @@ - - - - - - ResearchKit Reference - - - - - - -
-
- -

- ResearchKit -

- -

- ResearchKit -

- -
-
- - - -
-
-
-
-

ResearchKit Reference

- - -
- - -

The ResearchKit™ framework is an open source framework that developers and researchers can use to create apps that let iOS users participate in medical research.

- -

This is the API documentation for the ResearchKit framework. For an overview of framework and a more general guide to using and extending the framework, see the Programming Guide.

- -

Constructing Tasks

- -

ResearchKit tasks are actions to be performed by participants in a research study. Tasks are the building blocks for ResearchKit modules, which address the most common components of medical studies: surveys, consent documents, and active tasks.

- -

Tasks are constructed using a hierarchy of model objects. -At the root of the hierarchy is an ORKOrderedTask object (or another object that implements the ORKTask protocol). The task defines the order in which steps are presented, and how progress through the task is represented.

- -

A task consists of steps, which are subclasses of ORKStep. Most steps are designed for data presentation or data entry, but the ORKActiveStep subclasses can also enable data collection. -The ORKQuestionStep and ORKFormStep survey step classes describe a question to be asked. The format of the answer is modeled with subclasses of ORKAnswerFormat.

- -

Presenting Tasks

- -

To present a task, you create an ORKTaskViewController object and give it the task. The task view controller manages the task and returns the result through delegate methods.

- -

For each step, ORKTaskViewController instantiates an appropriate subclass of ORKStepViewController to display the step.

- -

Getting Results

- -

The result property of ORKTaskViewController provides the results of the task, both while the task is in progress, and upon completion of the task.

- -

Results are constructed with a hierarchy that’s similar to the task model hierarchy. In the hierarchy for a result, ORKTaskResult is the root and ORKStepResult objects form the immediate children.

- -

For survey question steps, the answers collected are reported as ORKQuestionResult objects, which are children of ORKStepResult. Active steps may include additional result objects as children, depending on the types of data that are recorded. To help you get data from various device features, such as the accelerometer or HealthKit, the ResearchKit framework provides the ORKRecorder and ORKRecorderConfiguration classes, which work together to collect and configure data into a serialized format during the duration of an active step.

- -

Predefined Active Tasks

- -

An active task invites users to perform activities under semi-controlled conditions, while iPhone sensors actively collect data. A category on ORKOrderedTask provides factory methods for generating ORKOrderedTask instances that correspond to ResearchKit’s predefined active tasks, such as the short walk or fitness task.

- -

Consent

- -

The consent features in the ResearchKit framework are implemented using three special steps that can be added to tasks:

- -
    -
  • ORKVisualConsentStep. The visual consent step presents a series of simple graphics to help participants understand the content of an consent document. The default graphics have animated transitions.

  • -
  • ORKConsentSharingStep. The consent sharing step has predefined transitions that can be used to establish user preferences regarding how widely personal data can be shared.

  • -
  • ORKConsentReviewStep. The consent review step makes the consent document available for review, and provides facilities for collecting the user’s name and signature.

  • -
- - -

Creating the visual consent step and the consent review step requires a consent document model (that is, an ORKConsentDocument object).

- - -
- - -
- - - -
-

Class References

- -
- - - -
- -

Protocol References

- - - - -

Constant References

- - - - -

Category References

- - -
- -
- - -
-
-
-
- - - - \ No newline at end of file diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/js/script.js b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/js/script.js deleted file mode 100644 index 4074361c44..0000000000 --- a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/Documents/js/script.js +++ /dev/null @@ -1,59 +0,0 @@ -function $() { - return document.querySelector.apply(document, arguments); -} - -if (navigator.userAgent.indexOf("Xcode") != -1) { - document.documentElement.classList.add("xcode"); -} - -var jumpTo = $("#jump-to"); - -if (jumpTo) { - jumpTo.addEventListener("change", function(e) { - location.hash = this.options[this.selectedIndex].value; - }); -} - -function hashChanged() { - if (/^#\/\/api\//.test(location.hash)) { - var element = document.querySelector("a[name='" + location.hash.substring(1) + "']"); - - if (!element) { - return; - } - - element = element.parentNode; - - element.classList.remove("hide"); - fixScrollPosition(element); - } -} - -function fixScrollPosition(element) { - var scrollTop = element.offsetTop - 150; - document.documentElement.scrollTop = scrollTop; - document.body.scrollTop = scrollTop; -} - -[].forEach.call(document.querySelectorAll(".section-method"), function(element) { - element.classList.add("hide"); - - element.querySelector(".method-title a").addEventListener("click", function(e) { - var info = element.querySelector(".method-info"), - infoContainer = element.querySelector(".method-info-container"); - - element.classList.add("animating"); - info.style.height = (infoContainer.clientHeight + 40) + "px"; - fixScrollPosition(element); - element.classList.toggle("hide"); - if (element.classList.contains("hide")) { - e.preventDefault(); - } - setTimeout(function() { - element.classList.remove("animating"); - }, 300); - }); -}); - -window.addEventListener("hashchange", hashChanged); -hashChanged(); diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx deleted file mode 100644 index cb9880b906..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx-shm b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx-shm deleted file mode 100644 index c9397da8d8..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx-shm and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx-wal b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx-wal deleted file mode 100644 index cc9ac32153..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.dsidx-wal and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.mom b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.mom deleted file mode 100644 index 762bdf001a..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.mom and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.skidx b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.skidx deleted file mode 100644 index 95bd5529da..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.skidx and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.toc b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.toc deleted file mode 100644 index 312c1d005a..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.toc and /dev/null differ diff --git a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.tokencache b/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.tokencache deleted file mode 100644 index 4e31554362..0000000000 Binary files a/docs/org.researchkit.ResearchKit.docset/Contents/Resources/docSet.tokencache and /dev/null differ diff --git a/docs/templates/docset/Contents/Resources/Documents/documents-template b/docs/templates/docset/Contents/Resources/Documents/documents-template deleted file mode 100644 index 078aab97fb..0000000000 --- a/docs/templates/docset/Contents/Resources/Documents/documents-template +++ /dev/null @@ -1 +0,0 @@ -This is used only as placeholder for location of Documents directory! \ No newline at end of file diff --git a/docs/templates/docset/Contents/Resources/nodes-template.xml b/docs/templates/docset/Contents/Resources/nodes-template.xml deleted file mode 100644 index 2db5e406c0..0000000000 --- a/docs/templates/docset/Contents/Resources/nodes-template.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - {{projectName}} - {{indexFilename}} - - {{#hasDocs}} - - {{strings.docset.docsTitle}} - {{indexFilename}} - - {{#docs}}{{>NodeRef}} - {{/docs}} - - - {{/hasDocs}} - {{#hasClasses}} - - {{strings.docset.classesTitle}} - {{indexFilename}} - - {{#classes}}{{>NodeRef}} - {{/classes}} - - - {{/hasClasses}} - {{#hasCategories}} - - {{strings.docset.categoriesTitle}} - {{indexFilename}} - - {{#categories}}{{>NodeRef}} - {{/categories}} - - - {{/hasCategories}} - {{#hasProtocols}} - - {{strings.docset.protocolsTitle}} - {{indexFilename}} - - {{#protocols}}{{>NodeRef}} - {{/protocols}} - - - {{/hasProtocols}} - {{#hasConstants}} - - {{strings.docset.constantsTitle}} - {{indexFilename}} - - {{#constants}}{{>NodeRef}} - {{/constants}} - - - {{/hasConstants}} - {{#hasBlocks}} - - {{strings.docset.blocksTitle}} - {{indexFilename}} - - {{#blocks}}{{>NodeRef}} - {{/blocks}} - - - {{/hasBlocks}} - - - - - {{#docs}}{{>Node}} - {{/docs}} - {{#classes}}{{>Node}} - {{/classes}} - {{#categories}}{{>Node}} - {{/categories}} - {{#protocols}}{{>Node}} - {{/protocols}} - {{#constants}}{{>Node}} - {{/constants}} - {{#blocks}}{{>Node}} - {{/blocks}} - - - -Section Node - - {{name}} - {{path}} - {{#hasSubNodes}} - - - {{path}} - Overview - overview - - - {{path}} - Tasks - tasks - - {{#hasProperties}} - - {{path}} - Properties - properties - - {{/hasProperties}} - {{#hasClassMethods}} - - {{path}} - Class Methods - class_methods - - {{/hasClassMethods}} - {{#hasInstanceMethods}} - - {{path}} - Instance Methods - instance_methods - - {{/hasInstanceMethods}} - - {{/hasSubNodes}} - -EndSection - -Section NodeRef - -EndSection diff --git a/docs/templates/docset/Contents/Resources/tokens-template.xml b/docs/templates/docset/Contents/Resources/tokens-template.xml deleted file mode 100755 index 5ac05c2a87..0000000000 --- a/docs/templates/docset/Contents/Resources/tokens-template.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - {{#object}} - - {{>TokenIdentifier}} - {{>Abstract}} - {{>DeclaredIn}} - {{>Availability}} - {{>RelatedTokens}} - {{#refid}}{{/refid}} - - {{/object}} - {{#members}} - - {{>TokenIdentifier}} - {{>Abstract}} - {{>DeclaredIn}} - {{>RelatedTokens}} - {{>MethodDeclaration}} - {{#hasParameters}} - {{#parameters}} - {{name}} - {{>Abstract}} - {{/parameters}} - {{/hasParameters}} - {{#returnValue}}{{>Abstract}}{{/returnValue}} - {{#anchor}}{{anchor}}{{/anchor}} - {{#refid}}{{/refid}} - - {{/members}} - {{#constants}} - - {{>TokenIdentifier}} - {{>Abstract}} - {{declaration}} - {{>Availability}} - {{>DeclaredIn}} - {{>RelatedTokens}} - {{>Reference}} - - {{/constants}} - {{#blocks}} - - {{>TokenIdentifier}} - {{>Abstract}} - {{declaration}} - {{>Availability}} - {{>DeclaredIn}} - {{>RelatedTokens}} - {{>Reference}} - - {{/blocks}} - - - -Section TokenIdentifier - {{identifier}} -EndSection - -Section DeclaredIn - {{declaredin}} -EndSection - -Section RelatedTokens - {{#hasRelatedTokens}} - - {{#relatedTokens}}{{.}} - {{/relatedTokens}} - - {{/hasRelatedTokens}} -EndSection - -Section Abstract -{{#abstract}}{{>GBCommentComponentsList}}{{/abstract}} -EndSection - -Section Availability -{{#availability}}{{>GBCommentComponentsList}}{{/availability}} -EndSection - -Section Reference -{{#refid}}{{/refid}} -EndSection - -Section MethodDeclaration -{{#formattedComponents}}{{value}}{{/formattedComponents}} -EndSection - -Section GBCommentComponentsList -{{#components}}{{textValue}}{{/components}} -EndSection - diff --git a/docs/templates/docset/Contents/info-template.plist b/docs/templates/docset/Contents/info-template.plist deleted file mode 100644 index 26de4711d5..0000000000 --- a/docs/templates/docset/Contents/info-template.plist +++ /dev/null @@ -1,40 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - {{#bundleIdentifier}}CFBundleIdentifier - {{bundleIdentifier}}{{/bundleIdentifier}} - {{#bundleName}}CFBundleName - {{bundleName}}{{/bundleName}} - {{#bundleVersion}}CFBundleShortVersionString - {{bundleVersion}} - CFBundleVersion - {{bundleVersion}}{{/bundleVersion}} - {{#certificateIssuer}}DocSetCertificateIssuer - {{certificateIssuer}}{{/certificateIssuer}} - {{#certificateSigner}}DocSetCertificateSigner - {{certificateSigner}}{{/certificateSigner}} - {{#description}}DocSetDescription - {{description}}{{/description}} - {{#fallbackURL}}DocSetFallbackURL - {{fallbackURL}}{{/fallbackURL}} - {{#feedName}}DocSetFeedName - {{feedName}}{{/feedName}} - {{#feedURL}}DocSetFeedURL - {{feedURL}}{{/feedURL}} - {{#minimumXcodeVersion}}DocSetMinimumXcodeVersion - {{minimumXcodeVersion}}{{/minimumXcodeVersion}} - {{#platformFamily}}DocSetPlatformFamily - {{platformFamily}}{{/platformFamily}} - {{#dashPlatformFamily}}DashDocSetFamily - {{dashPlatformFamily}}{{/dashPlatformFamily}} - {{#publisherIdentifier}}DocSetPublisherIdentifier - {{publisherIdentifier}}{{/publisherIdentifier}} - {{#publisherName}}DocSetPublisherName - {{publisherName}}{{/publisherName}} - {{#copyrightMessage}}NSHumanReadableCopyright - {{copyrightMessage}}{{/copyrightMessage}} - - diff --git a/docs/templates/html/css/scss/_index.scss b/docs/templates/html/css/scss/_index.scss deleted file mode 100644 index 7e98029dde..0000000000 --- a/docs/templates/html/css/scss/_index.scss +++ /dev/null @@ -1,13 +0,0 @@ -.index-container { - display: flex; - flex-direction: row; - flex-wrap: wrap; - - @media (max-width: $mobile-max-width) { - flex-direction: column; - } - - .index-column { - flex: 1 1 33%; - } -} diff --git a/docs/templates/html/css/scss/_layout.scss b/docs/templates/html/css/scss/_layout.scss deleted file mode 100644 index b69d19914e..0000000000 --- a/docs/templates/html/css/scss/_layout.scss +++ /dev/null @@ -1,303 +0,0 @@ -* { - box-sizing: border-box; -} - -.clear { - clear: both; -} - -.clearfix { - &:before, &:after { - clear: both; - display: table; - content: ""; - } -} - -.xcode .hide-in-xcode { - display: none; -} - -body { - font: 62.5% $body-font; - background: $body-background; -} - -h1, h2, h3 { - font-weight: 300; - color: #808080; -} - -h1 { - font-size: 2em; - color: #000; -} - -h4 { - font-size: 13px; - line-height: 1.5; - margin: 21px 0 0 0; -} - -a { - color: $tint-color; - text-decoration: none; -} - -pre, code { - font-family: $code-font; - word-wrap: break-word; -} - -pre > code, .method-declaration code { - display: inline-block; - font-size: .85em; - padding: 4px 0 4px 10px; - border-left: 5px solid rgba(0, 155, 51, .2); - - &:before { - content: "Objective-C"; - display: block; - - font: 9px/1 $body-font; - color: #009b33; - text-transform: uppercase; - letter-spacing: 2px; - padding-bottom: 6px; - } -} - -pre > code { - font-size: inherit; -} - -table, th, td { - border: 1px solid #e9e9e9; -} - -table { - width: 100%; -} - -th, td { - padding: 7px; - - > :first-child { - margin-top: 0; - } - - > :last-child { - margin-bottom: 0; - } -} - -.container { - @extend .clearfix; - - max-width: 980px; - padding: 0 10px; - margin: 0 auto; - - @media (max-width: $mobile-max-width) { - padding: 0; - } -} - -header { - position: fixed; - top: 0; - left: 0; - width: 100%; - z-index: 2; - - background: #414141; - color: #fff; - font-size: 1.1em; - line-height: 25px; - letter-spacing: .05em; - - #library-title { - float: left; - } - - #developer-home { - float: right; - } - - h1 { - font-size: inherit; - font-weight: inherit; - margin: 0; - } - - p { - margin: 0; - } - - h1, a { - color: inherit; - } - - @media (max-width: $mobile-max-width) { - position: absolute; - - .container { - padding: 0 10px; - } - } -} - -aside { - position: fixed; - top: 25px; - left: 0; - width: 100%; - height: 25px; - z-index: 2; - - font-size: 1.1em; - - @media (max-width: $mobile-max-width) { - position: absolute; - } - - #header-buttons { - background: rgba(255, 255, 255, .9); - margin: 0 1px; - padding: 0; - list-style: none; - text-align: right; - line-height: 32px; - - li { - display: inline-block; - cursor: default; - padding: 0 10px; - } - - label, select { - cursor: auto; - } - - #on-this-page { - position: relative; - - .chevron { - display: inline-block; - width: 14px; - height: 4px; - position: relative; - - .chevy { - background: #878787; - height: 2px; - position: absolute; - width: 10px; - - &.chevron-left { - left: 0; - transform: rotateZ(45deg) scale(0.6); - } - - &.chevron-right { - right: 0; - transform: rotateZ(-45deg) scale(0.6); - } - } - } - - #jump-to { - opacity: 0; - font-size: 16px; - - position: absolute; - top: 5px; - left: 0; - width: 100%; - height: 100%; - } - } - } -} - -article { - margin-top: 25px; - - #content { - @extend .clearfix; - - background: $content-background; - border: 1px solid $content-border; - padding: 15px 25px 30px 25px; - - font-size: 1.4em; - line-height: 1.45; - - position: relative; - - @media (max-width: $mobile-max-width) { - padding: 15px 10px 20px 10px; - } - - .navigation-top { - position: absolute; - top: 15px; - right: 25px; - } - - .title { - margin: 21px 0 0 0; - padding: 15px 0; - } - - p { - color: #414141; - margin: 0 0 15px 0; - } - - th, td { - p:last-child { - margin-bottom: 0; - } - } - - main { - ul { - list-style: none; - margin-left: 24px; - margin-bottom: 12px; - padding: 0; - - li { - position: relative; - padding-left: 1.3em; - - &:before { - content: "\02022"; - - color: #414141; - font-size: 1.08em; - line-height: 1; - - position: absolute; - left: 0; - padding-top: 2px; - } - } - } - } - - footer { - @extend .clearfix; - - .footer-copyright { - margin: 70px 25px 10px 0; - } - - p { - font-size: .71em; - color: #a0a0a0; - } - } - } -} diff --git a/docs/templates/html/css/scss/_normalize.scss b/docs/templates/html/css/scss/_normalize.scss deleted file mode 100644 index 9b8848a5cf..0000000000 --- a/docs/templates/html/css/scss/_normalize.scss +++ /dev/null @@ -1,581 +0,0 @@ -/* ========================================================================== - Normalize.scss settings - ========================================================================== */ -/** - * Includes legacy browser support IE6/7 - * - * Set to false if you want to drop support for IE6 and IE7 - */ - -$legacy_browser_support: false !default; - -/* Base - ========================================================================== */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - * 3. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using - * `em` units. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ - @if $legacy_browser_support { - *font-size: 100%; /* 3 */ - } -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ - @if $legacy_browser_support { - *display: inline; - *zoom: 1; - } -} - -/** - * Prevents modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ - -a { - &:active, &:hover { - outline: 0; - }; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -@if $legacy_browser_support { - blockquote { - margin: 1em 40px; - } -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -@if $legacy_browser_support { - h2 { - font-size: 1.5em; - margin: 0.83em 0; - } - - h3 { - font-size: 1.17em; - margin: 1em 0; - } - - h4 { - font-size: 1em; - margin: 1.33em 0; - } - - h5 { - font-size: 0.83em; - margin: 1.67em 0; - } - - h6 { - font-size: 0.67em; - margin: 2.33em 0; - } -} - -/** - * Addresses styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -@if $legacy_browser_support { - - /** - * Addresses margins set differently in IE 6/7. - */ - - p, - pre { - *margin: 1em 0; - } - - /* - * Addresses CSS quotes not supported in IE 6/7. - */ - - q { - *quotes: none; - } - - /* - * Addresses `quotes` property not supported in Safari 4. - */ - - q:before, - q:after { - content: ''; - content: none; - } -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -@if $legacy_browser_support { - - /* ========================================================================== - Lists - ========================================================================== */ - - /* - * Addresses margins set differently in IE 6/7. - */ - - dl, - menu, - ol, - ul { - *margin: 1em 0; - } - - dd { - *margin: 0 0 0 40px; - } - - /* - * Addresses paddings set differently in IE 6/7. - */ - - menu, - ol, - ul { - *padding: 0 0 0 40px; - } - - /* - * Corrects list images handled incorrectly in IE 7. - */ - - nav ul, - nav ol { - *list-style: none; - *list-style-image: none; - } - -} - -/* Embedded content - ========================================================================== */ - -/** - * 1. Remove border when inside `a` element in IE 8/9/10. - * 2. Improves image quality when scaled in IE 7. - */ - -img { - border: 0; - @if $legacy_browser_support { - *-ms-interpolation-mode: bicubic; /* 2 */ - } -} - -/** - * Correct overflow not hidden in IE 9/10/11. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Grouping content - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - @if $legacy_browser_support { - _font-family: 'courier new', monospace; - } - font-size: 1em; -} - -/* Forms - ========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - * 4. Improves appearance and consistency in all browsers. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ - @if $legacy_browser_support { - vertical-align: baseline; /* 3 */ - *vertical-align: middle; /* 3 */ - } -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - * 4. Removes inner spacing in IE 7 without affecting normal text inputs. - * Known issue: inner spacing remains in IE 6. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ - @if $legacy_browser_support { - *overflow: visible; /* 4 */ - } -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - * Known issue: excess padding remains in IE 6. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ - @if $legacy_browser_support { - *height: 13px; /* 3 */ - *width: 13px; /* 3 */ - } -} - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; -} - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - * 3. Corrects text not wrapping in Firefox 3. - * 4. Corrects alignment displayed oddly in IE 6/7. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ - @if $legacy_browser_support { - white-space: normal; /* 3 */ - *margin-left: -7px; /* 4 */ - } -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} diff --git a/docs/templates/html/css/scss/_object.scss b/docs/templates/html/css/scss/_object.scss deleted file mode 100644 index 22eebd87d0..0000000000 --- a/docs/templates/html/css/scss/_object.scss +++ /dev/null @@ -1,89 +0,0 @@ -.section-specification { - table { - width: auto; - - th { - text-align: left; - } - } -} - -.method-title { - margin-left: -15px; - margin-bottom: 8px; - transition: margin-left .3s ease-out; - - .section-method.hide & { - margin-left: 0; - } - - code { - font-weight: 400; - font-size: .85em; - } -} - -.method-info { - background: $object-background; - border-bottom: 1px solid $object-border; - margin: 0 -25px; - padding: 20px 25px 0 25px; - transition: height .3s ease-out; - - position: relative; - - .pointy-thing { - background: $content-background; - height: 10px; - border-bottom: 1px solid $object-border; - margin: -20px -25px 16px -25px; - - &:before { - display: inline-block; - content: ""; - - background: $object-background; - border: 1px solid $object-border; - border-bottom: 0; - border-right: 0; - - position: absolute; - left: 21px; - top: 3px; - width: 12px; - height: 12px; - transform: rotate(45deg); - } - } - - .method-subsection { - margin-bottom: 15px; - - .argument-name { - width: 1px; - text-align: right; - - code { - color: #808080; - font-style: italic; - font-weight: 400; - } - } - } -} - -.section-method { - &.hide .method-info { - height: 0 !important; - overflow: hidden; - display: none; - } - - &.hide.animating .method-info { - display: block; - } - - &.animating .method-info { - overflow: hidden; - } -} diff --git a/docs/templates/html/css/scss/_print.scss b/docs/templates/html/css/scss/_print.scss deleted file mode 100644 index 61bdf99f86..0000000000 --- a/docs/templates/html/css/scss/_print.scss +++ /dev/null @@ -1,42 +0,0 @@ -@media print { - body { - background: #fff; - padding: 8px; - } - - header { - position: static; - background: #fff; - color: #000; - } - - aside { - display: none; - } - - .container { - max-width: none; - padding: 0; - } - - article { - margin-top: 0; - - #content { - border: 0; - background: #fff; - padding: 15px 0 0 0; - - .title { - margin-top: 0; - padding-top: 0; - } - } - } - - .method-info { - &, & .pointy-thing { - background: #fff; - } - } -} diff --git a/docs/templates/html/css/scss/_variables.scss b/docs/templates/html/css/scss/_variables.scss deleted file mode 100644 index cbaff3cf5c..0000000000 --- a/docs/templates/html/css/scss/_variables.scss +++ /dev/null @@ -1,11 +0,0 @@ -$body-font: -apple-system-font, "Helvetica Neue", Helvetica, sans-serif; -$code-font: "Source Code Pro", Monaco, Menlo, Consolas, monospace; - -$body-background: #f2f2f2; -$content-background: #fff; -$content-border: #e9e9e9; -$tint-color: #08c; -$object-background: #f9f9f9; -$object-border: #e9e9e9; - -$mobile-max-width: 650px; diff --git a/docs/templates/html/css/scss/_xcode.scss b/docs/templates/html/css/scss/_xcode.scss deleted file mode 100644 index 340b1f6b80..0000000000 --- a/docs/templates/html/css/scss/_xcode.scss +++ /dev/null @@ -1,29 +0,0 @@ -.xcode { - header, aside { - display: none; - } - - .container { - padding: 0; - } - - article { - margin-top: 0; - - #content { - border: 0; - margin: 0; - } - } - - .method-info { - &, .section-method.hide & { - max-height: auto; - overflow: visible; - - &.hiding { - display: block; - } - } - } -} diff --git a/docs/templates/html/css/scss/style.scss b/docs/templates/html/css/scss/style.scss deleted file mode 100644 index 648a6086ba..0000000000 --- a/docs/templates/html/css/scss/style.scss +++ /dev/null @@ -1 +0,0 @@ -@import "variables", "normalize", "layout", "index", "object", "print", "xcode"; diff --git a/docs/templates/html/css/style.css b/docs/templates/html/css/style.css deleted file mode 100644 index 88a1594657..0000000000 --- a/docs/templates/html/css/style.css +++ /dev/null @@ -1,690 +0,0 @@ -/* ========================================================================== - Normalize.scss settings - ========================================================================== */ -/** - * Includes legacy browser support IE6/7 - * - * Set to false if you want to drop support for IE6 and IE7 - */ -/* Base - ========================================================================== */ -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS text size adjust after orientation change, without disabling - * user zoom. - * 3. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using - * `em` units. - */ -html { - font-family: sans-serif; - /* 1 */ - -ms-text-size-adjust: 100%; - /* 2 */ - -webkit-text-size-adjust: 100%; - /* 2 */ } - -/** - * Remove default margin. - */ -body { - margin: 0; } - -/* HTML5 display definitions - ========================================================================== */ -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; } - -/** - * 1. Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ -audio, -canvas, -progress, -video { - display: inline-block; - /* 1 */ - vertical-align: baseline; - /* 2 */ } - -/** - * Prevents modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ -audio:not([controls]) { - display: none; - height: 0; } - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. - */ -[hidden], -template { - display: none; } - -/* Links - ========================================================================== */ -/** - * Remove the gray background color from active links in IE 10. - */ -a { - background-color: transparent; } - -/** - * Improve readability when focused and also mouse hovered in all browsers. - */ -a:active, a:hover { - outline: 0; } - -/* Text-level semantics - ========================================================================== */ -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ -abbr[title] { - border-bottom: 1px dotted; } - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ -b, -strong { - font-weight: bold; } - -/** - * Address styling not present in Safari and Chrome. - */ -dfn { - font-style: italic; } - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ -h1 { - font-size: 2em; - margin: 0.67em 0; } - -/** - * Addresses styling not present in IE 8/9. - */ -mark { - background: #ff0; - color: #000; } - -/** - * Address inconsistent and variable font size in all browsers. - */ -small { - font-size: 80%; } - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; } - -sup { - top: -0.5em; } - -sub { - bottom: -0.25em; } - -/* Embedded content - ========================================================================== */ -/** - * 1. Remove border when inside `a` element in IE 8/9/10. - * 2. Improves image quality when scaled in IE 7. - */ -img { - border: 0; } - -/** - * Correct overflow not hidden in IE 9/10/11. - */ -svg:not(:root) { - overflow: hidden; } - -/* Grouping content - ========================================================================== */ -/** - * Address margin not present in IE 8/9 and Safari. - */ -figure { - margin: 1em 40px; } - -/** - * Address differences between Firefox and other browsers. - */ -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; } - -/** - * Contain overflow in all browsers. - */ -pre { - overflow: auto; } - -/** - * Address odd `em`-unit font size rendering in all browsers. - * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. - */ -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; } - -/* Forms - ========================================================================== */ -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - * 4. Improves appearance and consistency in all browsers. - */ -button, -input, -optgroup, -select, -textarea { - color: inherit; - /* 1 */ - font: inherit; - /* 2 */ - margin: 0; - /* 3 */ } - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ -button { - overflow: visible; } - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ -button, -select { - text-transform: none; } - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - * 4. Removes inner spacing in IE 7 without affecting normal text inputs. - * Known issue: inner spacing remains in IE 6. - */ -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - /* 2 */ - cursor: pointer; - /* 3 */ } - -/** - * Re-set default cursor for disabled elements. - */ -button[disabled], -html input[disabled] { - cursor: default; } - -/** - * Remove inner padding and border in Firefox 4+. - */ -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; } - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ -input { - line-height: normal; } - -/** - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - * Known issue: excess padding remains in IE 6. - */ -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - /* 1 */ - padding: 0; - /* 2 */ } - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; } - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome - * (include `-moz` to future-proof). - */ -input[type="search"] { - -webkit-appearance: textfield; - /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - /* 2 */ - box-sizing: content-box; } - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; } - -/** - * Define consistent border, margin, and padding. - */ -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; } - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - * 3. Corrects text not wrapping in Firefox 3. - * 4. Corrects alignment displayed oddly in IE 6/7. - */ -legend { - border: 0; - /* 1 */ - padding: 0; - /* 2 */ } - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ -textarea { - overflow: auto; } - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ -optgroup { - font-weight: bold; } - -/* Tables - ========================================================================== */ -/** - * Remove most spacing between table cells. - */ -table { - border-collapse: collapse; - border-spacing: 0; } - -td, -th { - padding: 0; } - -* { - box-sizing: border-box; } - -.clear { - clear: both; } - -.clearfix:before, .container:before, article #content:before, article #content footer:before, .clearfix:after, .container:after, article #content:after, article #content footer:after { - clear: both; - display: table; - content: ""; } - -.xcode .hide-in-xcode { - display: none; } - -body { - font: 62.5% -apple-system-font, "Helvetica Neue", Helvetica, sans-serif; - background: #f2f2f2; } - -h1, h2, h3 { - font-weight: 300; - color: #808080; } - -h1 { - font-size: 2em; - color: #000; } - -h4 { - font-size: 13px; - line-height: 1.5; - margin: 21px 0 0 0; } - -a { - color: #08c; - text-decoration: none; } - -pre, code { - font-family: "Source Code Pro", Monaco, Menlo, Consolas, monospace; - word-wrap: break-word; } - -pre > code, .method-declaration code { - display: inline-block; - font-size: .85em; - padding: 4px 0 4px 10px; - border-left: 5px solid rgba(0, 155, 51, 0.2); } - pre > code:before, .method-declaration code:before { - content: "Objective-C"; - display: block; - font: 9px/1 -apple-system-font, "Helvetica Neue", Helvetica, sans-serif; - color: #009b33; - text-transform: uppercase; - letter-spacing: 2px; - padding-bottom: 6px; } - -pre > code { - font-size: inherit; } - -table, th, td { - border: 1px solid #e9e9e9; } - -table { - width: 100%; } - -th, td { - padding: 7px; } - th > :first-child, td > :first-child { - margin-top: 0; } - th > :last-child, td > :last-child { - margin-bottom: 0; } - -.container { - max-width: 980px; - padding: 0 10px; - margin: 0 auto; } - @media (max-width: 650px) { - .container { - padding: 0; } } - -header { - position: fixed; - top: 0; - left: 0; - width: 100%; - z-index: 2; - background: #414141; - color: #fff; - font-size: 1.1em; - line-height: 25px; - letter-spacing: .05em; } - header #library-title { - float: left; } - header #developer-home { - float: right; } - header h1 { - font-size: inherit; - font-weight: inherit; - margin: 0; } - header p { - margin: 0; } - header h1, header a { - color: inherit; } - @media (max-width: 650px) { - header { - position: absolute; } - header .container { - padding: 0 10px; } } - -aside { - position: fixed; - top: 25px; - left: 0; - width: 100%; - height: 25px; - z-index: 2; - font-size: 1.1em; } - @media (max-width: 650px) { - aside { - position: absolute; } } - aside #header-buttons { - background: rgba(255, 255, 255, 0.9); - margin: 0 1px; - padding: 0; - list-style: none; - text-align: right; - line-height: 32px; } - aside #header-buttons li { - display: inline-block; - cursor: default; - padding: 0 10px; } - aside #header-buttons label, aside #header-buttons select { - cursor: auto; } - aside #header-buttons #on-this-page { - position: relative; } - aside #header-buttons #on-this-page .chevron { - display: inline-block; - width: 14px; - height: 4px; - position: relative; } - aside #header-buttons #on-this-page .chevron .chevy { - background: #878787; - height: 2px; - position: absolute; - width: 10px; } - aside #header-buttons #on-this-page .chevron .chevy.chevron-left { - left: 0; - transform: rotateZ(45deg) scale(0.6); } - aside #header-buttons #on-this-page .chevron .chevy.chevron-right { - right: 0; - transform: rotateZ(-45deg) scale(0.6); } - aside #header-buttons #on-this-page #jump-to { - opacity: 0; - font-size: 16px; - position: absolute; - top: 5px; - left: 0; - width: 100%; - height: 100%; } - -article { - margin-top: 25px; } - article #content { - background: #fff; - border: 1px solid #e9e9e9; - padding: 15px 25px 30px 25px; - font-size: 1.4em; - line-height: 1.45; - position: relative; } - @media (max-width: 650px) { - article #content { - padding: 15px 10px 20px 10px; } } - article #content .navigation-top { - position: absolute; - top: 15px; - right: 25px; } - article #content .title { - margin: 21px 0 0 0; - padding: 15px 0; } - article #content p { - color: #414141; - margin: 0 0 15px 0; } - article #content th p:last-child, article #content td p:last-child { - margin-bottom: 0; } - article #content main ul { - list-style: none; - margin-left: 24px; - margin-bottom: 12px; - padding: 0; } - article #content main ul li { - position: relative; - padding-left: 1.3em; } - article #content main ul li:before { - content: "\02022"; - color: #414141; - font-size: 1.08em; - line-height: 1; - position: absolute; - left: 0; - padding-top: 2px; } - article #content footer .footer-copyright { - margin: 70px 25px 10px 0; } - article #content footer p { - font-size: .71em; - color: #a0a0a0; } - -.index-container { - display: flex; - flex-direction: row; - flex-wrap: wrap; } - @media (max-width: 650px) { - .index-container { - flex-direction: column; } } - .index-container .index-column { - flex: 1 1 33%; } - -.section-specification table { - width: auto; } - .section-specification table th { - text-align: left; } - -.method-title { - margin-left: -15px; - margin-bottom: 8px; - transition: margin-left .3s ease-out; } - .section-method.hide .method-title { - margin-left: 0; } - .method-title code { - font-weight: 400; - font-size: .85em; } - -.method-info { - background: #f9f9f9; - border-bottom: 1px solid #e9e9e9; - margin: 0 -25px; - padding: 20px 25px 0 25px; - transition: height .3s ease-out; - position: relative; } - .method-info .pointy-thing { - background: #fff; - height: 10px; - border-bottom: 1px solid #e9e9e9; - margin: -20px -25px 16px -25px; } - .method-info .pointy-thing:before { - display: inline-block; - content: ""; - background: #f9f9f9; - border: 1px solid #e9e9e9; - border-bottom: 0; - border-right: 0; - position: absolute; - left: 21px; - top: 3px; - width: 12px; - height: 12px; - transform: rotate(45deg); } - .method-info .method-subsection { - margin-bottom: 15px; } - .method-info .method-subsection .argument-name { - width: 1px; - text-align: right; } - .method-info .method-subsection .argument-name code { - color: #808080; - font-style: italic; - font-weight: 400; } - -.section-method.hide .method-info { - height: 0 !important; - overflow: hidden; - display: none; } -.section-method.hide.animating .method-info { - display: block; } -.section-method.animating .method-info { - overflow: hidden; } - -@media print { - body { - background: #fff; - padding: 8px; } - - header { - position: static; - background: #fff; - color: #000; } - - aside { - display: none; } - - .container { - max-width: none; - padding: 0; } - - article { - margin-top: 0; } - article #content { - border: 0; - background: #fff; - padding: 15px 0 0 0; } - article #content .title { - margin-top: 0; - padding-top: 0; } - - .method-info, .method-info .pointy-thing { - background: #fff; } } -.xcode header, .xcode aside { - display: none; } -.xcode .container { - padding: 0; } -.xcode article { - margin-top: 0; } - .xcode article #content { - border: 0; - margin: 0; } -.xcode .method-info, .section-method.hide .xcode .method-info { - max-height: auto; - overflow: visible; } - .xcode .method-info.hiding, .section-method.hide .xcode .method-info.hiding { - display: block; } - -/*# sourceMappingURL=style.css.map */ diff --git a/docs/templates/html/document-template.html b/docs/templates/html/document-template.html deleted file mode 100755 index adc90901b5..0000000000 --- a/docs/templates/html/document-template.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - {{page.title}} - - - - {{#strings.appledocData}}{{/strings.appledocData}} - - -
- -
- - - -
-
-
-
- - - {{#object.comment}}{{#longDescription}}{{>GBCommentComponentsList}}{{/longDescription}}{{/object.comment}} - -
- -
-
-
-
-
- - - - - - -Section GBCommentComponentsList -{{#components}}{{>GBCommentComponent}}{{/components}} -EndSection - -Section GBCommentComponent -{{&htmlValue}} -EndSection - -Section Navigation -
  • Home
  • -EndSection diff --git a/docs/templates/html/hierarchy-template.html b/docs/templates/html/hierarchy-template.html deleted file mode 100755 index 8f6753fbb0..0000000000 --- a/docs/templates/html/hierarchy-template.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - {{page.title}} - - - - {{#strings.appledocData}}{{/strings.appledocData}} - - -
    - -
    - - - -
    -
    -
    -
    -

    {{page.title}}

    - - {{#hasClasses}} -
    -

    {{strings.hierarchyPage.classesTitle}}

    - {{>Classes}} -
    - {{/hasClasses}} - - {{#hasProtocolsOrCategories}} -
    - {{#hasProtocols}} -

    {{strings.hierarchyPage.protocolsTitle}}

    -
      - {{#protocols}} -
    • {{title}}
    • - {{/protocols}} -
    - {{/hasProtocols}} - {{#hasConstants}} -

    {{strings.hierarchyPage.constantsTitle}}

    -
      - {{#constants}} -
    • {{title}}
    • - {{/constants}} -
    - {{/hasConstants}} - {{#hasCategories}} -

    {{strings.hierarchyPage.categoriesTitle}}

    -
      - {{#categories}} -
    • {{title}}
    • - {{/categories}} -
    - {{/hasCategories}} -
    - {{/hasProtocolsOrCategories}} - -
    - -
    -
    -
    -
    -
    - - - - - -Section Classes -{{#hasClasses}} - -{{/hasClasses}} -EndSection - -Section Navigation -
  • Home
  • -EndSection diff --git a/docs/templates/html/img/button_bar_background.png b/docs/templates/html/img/button_bar_background.png deleted file mode 100644 index 71d1019bc0..0000000000 Binary files a/docs/templates/html/img/button_bar_background.png and /dev/null differ diff --git a/docs/templates/html/img/disclosure.png b/docs/templates/html/img/disclosure.png deleted file mode 100644 index 4c5cbf4456..0000000000 Binary files a/docs/templates/html/img/disclosure.png and /dev/null differ diff --git a/docs/templates/html/img/disclosure_open.png b/docs/templates/html/img/disclosure_open.png deleted file mode 100644 index 82396fed29..0000000000 Binary files a/docs/templates/html/img/disclosure_open.png and /dev/null differ diff --git a/docs/templates/html/img/library_background.png b/docs/templates/html/img/library_background.png deleted file mode 100644 index 3006248afe..0000000000 Binary files a/docs/templates/html/img/library_background.png and /dev/null differ diff --git a/docs/templates/html/img/title_background.png b/docs/templates/html/img/title_background.png deleted file mode 100644 index 846e4968d0..0000000000 Binary files a/docs/templates/html/img/title_background.png and /dev/null differ diff --git a/docs/templates/html/index-template.html b/docs/templates/html/index-template.html deleted file mode 100755 index 57b22e17b1..0000000000 --- a/docs/templates/html/index-template.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - {{page.title}} - - - - {{#strings.appledocData}}{{/strings.appledocData}} - - -
    - -
    - - - -
    -
    -
    -
    -

    {{page.title}}

    - - {{#indexDescription}} -
    - {{#comment}} - {{#hasLongDescription}} - {{#longDescription}}{{#components}}{{&htmlValue}}{{/components}}{{/longDescription}} - {{/hasLongDescription}} - {{/comment}} -
    - {{/indexDescription}} - -
    - {{#hasDocs}} -
    -

    {{strings.indexPage.docsTitle}}

    - -
    - {{/hasDocs}} - - {{#hasClasses}} -
    -

    {{strings.indexPage.classesTitle}}

    -
      - {{#classes}} -
    • {{title}}
    • - {{/classes}} -
    -
    - {{/hasClasses}} - - {{#hasProtocolsOrCategories}} -
    - {{#hasProtocols}} -

    {{strings.indexPage.protocolsTitle}}

    -
      - {{#protocols}} -
    • {{title}}
    • - {{/protocols}} -
    - {{/hasProtocols}} - - {{#hasConstants}} -

    {{strings.indexPage.constantsTitle}}

    -
      - {{#constants}} -
    • {{title}}
    • - {{/constants}} -
    - {{/hasConstants}} - - {{#hasCategories}} -

    {{strings.indexPage.categoriesTitle}}

    -
      - {{#categories}} -
    • {{title}}
    • - {{/categories}} -
    - {{/hasCategories}} -
    - {{/hasProtocolsOrCategories}} -
    - -
    - -
    -
    -
    -
    -
    - - - - - -Section Navigation -
  • Hierarchy
  • -EndSection diff --git a/docs/templates/html/js/script.js b/docs/templates/html/js/script.js deleted file mode 100644 index 4074361c44..0000000000 --- a/docs/templates/html/js/script.js +++ /dev/null @@ -1,59 +0,0 @@ -function $() { - return document.querySelector.apply(document, arguments); -} - -if (navigator.userAgent.indexOf("Xcode") != -1) { - document.documentElement.classList.add("xcode"); -} - -var jumpTo = $("#jump-to"); - -if (jumpTo) { - jumpTo.addEventListener("change", function(e) { - location.hash = this.options[this.selectedIndex].value; - }); -} - -function hashChanged() { - if (/^#\/\/api\//.test(location.hash)) { - var element = document.querySelector("a[name='" + location.hash.substring(1) + "']"); - - if (!element) { - return; - } - - element = element.parentNode; - - element.classList.remove("hide"); - fixScrollPosition(element); - } -} - -function fixScrollPosition(element) { - var scrollTop = element.offsetTop - 150; - document.documentElement.scrollTop = scrollTop; - document.body.scrollTop = scrollTop; -} - -[].forEach.call(document.querySelectorAll(".section-method"), function(element) { - element.classList.add("hide"); - - element.querySelector(".method-title a").addEventListener("click", function(e) { - var info = element.querySelector(".method-info"), - infoContainer = element.querySelector(".method-info-container"); - - element.classList.add("animating"); - info.style.height = (infoContainer.clientHeight + 40) + "px"; - fixScrollPosition(element); - element.classList.toggle("hide"); - if (element.classList.contains("hide")) { - e.preventDefault(); - } - setTimeout(function() { - element.classList.remove("animating"); - }, 300); - }); -}); - -window.addEventListener("hashchange", hashChanged); -hashChanged(); diff --git a/docs/templates/html/object-template.html b/docs/templates/html/object-template.html deleted file mode 100644 index 10e85db8f0..0000000000 --- a/docs/templates/html/object-template.html +++ /dev/null @@ -1,412 +0,0 @@ - - - - - - {{page.title}} - - - - {{#strings.appledocData}}{{/strings.appledocData}} - - -
    - -
    - - - -
    -
    -
    -
    -

    {{page.title}}

    - - {{#page.specifications}} - {{#used}}
    {{/used}} - {{#values}}{{>ObjectSpecification}}{{/values}} - {{#used}}
    {{/used}} - {{/page.specifications}} - - {{#object.comment}} - {{#hasLongDescription}} -
    - - -

    - {{#longDescription}}{{>GBCommentComponentsList}}{{/longDescription}} -
    - {{/hasLongDescription}} - {{/object.comment}} - - {{#object.methods}} - {{#hasSections}} -
    - - {{#sections}} - - {{#sectionName}}{{/sectionName}} - {{>TaskTitle}} -
    - {{#methods}}{{>Method}}{{/methods}} -
    - {{/sections}} -
    - {{/hasSections}} - {{/object.methods}} - - {{#typedefEnum}} -

    {{nameOfEnum}}

    - {{#comment}} - {{#hasLongDescription}} -
    - {{#longDescription}}{{>GBCommentComponentsList}}{{/longDescription}} -
    - {{/hasLongDescription}} - {{/comment}} -
    - - {{#constants}} -

    Definition

    - typedef {{enumStyle}}({{enumPrimitive}}, {{nameOfEnum}} ) {
    - {{#constants}} -    {{name}}{{#hasAssignedValue}} = {{assignedValue}}{{/hasAssignedValue}},
    - {{/constants}} - };
    - {{/constants}} -
    - {{#constants}} -
    -

    Constants

    -
    - {{#constants}} - {{>Constant}} - {{/constants}} -
    -
    - {{/constants}} - - {{#comment}} - {{#hasAvailability}} -
    -

    {{strings.objectMethods.availability}}

    - {{#availability}}{{>GBCommentComponentsList}}{{/availability}} -
    - {{/hasAvailability}} - - {{#hasRelatedItems}} -
    -

    {{strings.objectMethods.seeAlsoTitle}}

    -
      - {{#relatedItems.components}} -
    • {{>GBCommentComponent}}
    • - {{/relatedItems.components}} -
    -
    - {{/hasRelatedItems}} - - {{#prefferedSourceInfo}} -
    -

    {{strings.objectMethods.declaredInTitle}}

    -

    {{filename}}

    -
    - {{/prefferedSourceInfo}} - {{/comment}} - {{/typedefEnum}} -
    - -
    - -
    -
    -
    -
    - - - - - - -Section Method -
    - -

    {{>TaskMethod}}

    - -
    -
    - -
    - {{#comment}} - {{#hasShortDescription}} -
    - {{#shortDescription}}{{>GBCommentComponent}}{{/shortDescription}} -
    - {{/hasShortDescription}} - {{/comment}} - -
    {{>MethodDeclaration}}
    - - {{#comment}} - {{#hasMethodParameters}} -
    -

    {{strings.objectMethods.parametersTitle}}

    - - {{#methodParameters}} - - - - - {{/methodParameters}} -
    {{argumentName}}{{#argumentDescription}}{{>GBCommentComponentsList}}{{/argumentDescription}}
    -
    - {{/hasMethodParameters}} - - {{#hasMethodResult}} -
    -

    {{strings.objectMethods.resultTitle}}

    - {{#methodResult}}{{>GBCommentComponentsList}}{{/methodResult}} -
    - {{/hasMethodResult}} - - {{#hasAvailability}} -
    -

    {{strings.objectMethods.availability}}

    - {{#availability}}{{>GBCommentComponentsList}}{{/availability}} -
    - {{/hasAvailability}} - - {{#hasLongDescription}} -
    -

    {{strings.objectMethods.discussionTitle}}

    - {{#longDescription}}{{>GBCommentComponentsList}}{{/longDescription}} -
    - {{/hasLongDescription}} - - {{#hasMethodExceptions}} -
    -

    {{strings.objectMethods.exceptionsTitle}}

    - - {{#methodExceptions}} - - - - - {{/methodExceptions}} -
    {{argumentName}}{{#argumentDescription}}{{>GBCommentComponentsList}}{{/argumentDescription}}
    -
    - {{/hasMethodExceptions}} - - {{#hasRelatedItems}} -
    -

    {{strings.objectMethods.seeAlsoTitle}}

    -
      - {{#relatedItems.components}} -
    • {{>GBCommentComponent}}
    • - {{/relatedItems.components}} -
    -
    - {{/hasRelatedItems}} - - {{#prefferedSourceInfo}} -
    -

    {{strings.objectMethods.declaredInTitle}}

    -

    {{filename}}

    -
    - {{/prefferedSourceInfo}} - {{/comment}} -
    -
    -
    -EndSection - -Section MethodDeclaration -{{#formattedComponents}}{{#emphasized}}{{/emphasized}}{{#href}}{{/href}}{{value}}{{#href}}{{/href}}{{#emphasized}}{{/emphasized}}{{/formattedComponents}} -EndSection - - -Section TaskTitle -{{#hasMultipleSections}}

    {{#sectionName}}{{.}}{{/sectionName}}{{^sectionName}}{{strings.objectTasks.otherMethodsSectionName}}{{/sectionName}}

    {{/hasMultipleSections}} -{{^hasMultipleSections}}{{#sectionName}}

    {{.}}

    {{/sectionName}}{{/hasMultipleSections}} -EndSection - -Section TaskMethod -{{>TaskSelector}} -{{#isRequired}}{{strings.objectTasks.requiredMethod}}{{/isRequired}} -EndSection - -Section TaskSelector -{{#isInstanceMethod}}–{{/isInstanceMethod}}{{#isClassMethod}}+{{/isClassMethod}}{{#isProperty}} {{/isProperty}} {{methodSelector}} -EndSection - - -Section GBCommentComponentsList -{{#components}}{{>GBCommentComponent}}{{/components}} -EndSection - -Section Constant -
    {{name}}
    -
    -{{#comment}} -{{#hasShortDescription}} -{{#shortDescription}}{{>GBCommentComponent}}{{/shortDescription}} -{{/hasShortDescription}} - -{{#hasAvailability}} -

    Available in {{#availability}}{{#components}}{{stringValue}}{{/components}}{{/availability}}

    -{{/hasAvailability}} - -{{/comment}} - {{#prefferedSourceInfo}} -

    - {{strings.objectMethods.declaredInTitle}} {{filename}}. -

    - {{/prefferedSourceInfo}} -
    -EndSection - -Section GBCommentComponent -{{&htmlValue}} -EndSection - -Section ObjectSpecification - - {{title}} - {{#values}}{{#href}}{{/href}}{{string}}{{#href}}{{/href}}{{&delimiter}}{{/values}} - -EndSection - - -Section Navigation -
  • Index
  • -
  • Hierarchy
  • -EndSection - -Section JumpTo - -EndSection - -Section TableOfContents -{{#object.comment}} -
  • {{strings.objectOverview.title}}
  • -{{/object.comment}} - -{{#object.methods}} -{{#hasSections}} -
  • {{strings.objectTasks.title}}
  • -{{/hasSections}} -{{/object.methods}} - -{{#object.methods}} -{{#hasProperties}} -
  • {{strings.objectMethods.propertiesTitle}}
  • -{{/hasProperties}} - -{{#hasClassMethods}} -
  • {{strings.objectMethods.classMethodsTitle}}
  • -{{/hasClassMethods}} - -{{#hasInstanceMethods}} -
  • {{strings.objectMethods.instanceMethodsTitle}}
  • -{{/hasInstanceMethods}} -{{/object.methods}} -EndSection diff --git a/docs/templates/publish/xml-template.xml b/docs/templates/publish/xml-template.xml deleted file mode 100644 index cd79c3e05f..0000000000 --- a/docs/templates/publish/xml-template.xml +++ /dev/null @@ -1,4 +0,0 @@ - - ${DOCSET_FEED_VERSION} - ${DOCSET_PACKAGE_URL} - \ No newline at end of file diff --git a/samples/ORKCatalog/ORKCatalog.xcodeproj/project.pbxproj b/samples/ORKCatalog/ORKCatalog.xcodeproj/project.pbxproj index defe55fcd9..a166222472 100644 --- a/samples/ORKCatalog/ORKCatalog.xcodeproj/project.pbxproj +++ b/samples/ORKCatalog/ORKCatalog.xcodeproj/project.pbxproj @@ -3,24 +3,22 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 03F7FD9F23959DD500432EF6 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03F7FD9E23959DD500432EF6 /* SceneDelegate.swift */; }; 0B6CB32728B577640092E993 /* Bundle+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B6CB32628B577640092E993 /* Bundle+Extensions.swift */; }; - 3C39E45E2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3C39E45D2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig */; }; 3E39B9FB1ABF682D00C2ABE5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E39B9F91ABF682D00C2ABE5 /* Main.storyboard */; }; 3E39B9FE1ABF683700C2ABE5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3E39B9FC1ABF683700C2ABE5 /* LaunchScreen.xib */; }; 3E39BA001ABF683F00C2ABE5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3E39B9FF1ABF683F00C2ABE5 /* Images.xcassets */; }; 3ED967B81AC13D37007E2D83 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3ED967BA1AC13D37007E2D83 /* Localizable.strings */; }; + 51AF19862B59F3A900D3B399 /* ORKKeychainWrapperTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51AF19852B59F3A900D3B399 /* ORKKeychainWrapperTests.m */; }; + 51C173282BA4B4E1006604FB /* sphere_model.usdz in Resources */ = {isa = PBXBuildFile; fileRef = 51C173272BA4B4E1006604FB /* sphere_model.usdz */; }; + 51F210EF2B4634FC0072B536 /* TaskListRowSteps.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F210EE2B4634FC0072B536 /* TaskListRowSteps.swift */; }; + 51F210FE2B49D04F0072B536 /* TaskListRowConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51F210FD2B49D04F0072B536 /* TaskListRowConstants.swift */; }; 863CCD821ACF545E009FD3B4 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 863CCD811ACF545E009FD3B4 /* HealthKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 86B89AA51AB2C0A5001626A4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B89A9C1AB2C0A5001626A4 /* AppDelegate.swift */; }; - 9622283924F04DBF0056E74D /* TaskScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9622283824F04DBF0056E74D /* TaskScreen.swift */; }; - 9622283B24F04DFE0056E74D /* CommonElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9622283A24F04DFE0056E74D /* CommonElements.swift */; }; - 9622283D24F04E6F0056E74D /* AllowScreens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9622283C24F04E6F0056E74D /* AllowScreens.swift */; }; - 9622283F24F04EBA0056E74D /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9622283E24F04EBA0056E74D /* Helpers.swift */; }; - 9622284124F04EEF0056E74D /* PreSubmissionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9622284024F04EEF0056E74D /* PreSubmissionTests.swift */; }; B125E3D41B1BA47600FF8759 /* tap.aif in Resources */ = {isa = PBXBuildFile; fileRef = B125E3D31B1BA47600FF8759 /* tap.aif */; }; BAAC3FD620C4EF1C0065B9E1 /* ResearchKit.pdf in Resources */ = {isa = PBXBuildFile; fileRef = BAAC3FD520C4EF1C0065B9E1 /* ResearchKit.pdf */; }; BC2A3CD91C58F1CA00DA64B7 /* ResearchKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC2A3CD81C58F1CA00DA64B7 /* ResearchKit.framework */; }; @@ -31,10 +29,14 @@ BC9A273D1B82741900BDA84D /* ResultTableViewProviders.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC9A27391B82741900BDA84D /* ResultTableViewProviders.swift */; }; BC9A273E1B82741900BDA84D /* ResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC9A273A1B82741900BDA84D /* ResultViewController.swift */; }; BC9A273F1B82741900BDA84D /* TextImageTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC9A273B1B82741900BDA84D /* TextImageTableViewCell.swift */; }; + CA6A0D8F288F04260048C1EF /* ResearchKitUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA6A0D8E288F04260048C1EF /* ResearchKitUI.framework */; }; + CA6A0D90288F04260048C1EF /* ResearchKitUI.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CA6A0D8E288F04260048C1EF /* ResearchKitUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + CA9B6DF828A2BF51000A7603 /* ResearchKitActiveTask.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA9B6DF728A2BF51000A7603 /* ResearchKitActiveTask.framework */; }; + CA9B6DF928A2BF64000A7603 /* ResearchKitActiveTask.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CA9B6DF728A2BF51000A7603 /* ResearchKitActiveTask.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 9622282F24F04D780056E74D /* PBXContainerItemProxy */ = { + 51AF197B2B59F1E500D3B399 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 869230B61AAA890A00BFE11B /* Project object */; proxyType = 1; @@ -50,6 +52,8 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( + CA9B6DF928A2BF64000A7603 /* ResearchKitActiveTask.framework in Embed Frameworks */, + CA6A0D90288F04260048C1EF /* ResearchKitUI.framework in Embed Frameworks */, BC2A3CDA1C58F1CA00DA64B7 /* ResearchKit.framework in Embed Frameworks */, ); name = "Embed Frameworks"; @@ -98,25 +102,22 @@ 246DFA261BEAE26200591E9A /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = en_GB.lproj/Localizable.strings; sourceTree = ""; }; 246DFA271BEAE27000591E9A /* en-AU */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-AU"; path = en_AU.lproj/Localizable.strings; sourceTree = ""; }; 246DFA281BEAE2A800591E9A /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = zh_HK.lproj/Localizable.strings; sourceTree = ""; }; - 3C39E45D2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "ORKCatalog-Shared.xcconfig"; path = "ORKCatalog/Configuration/ORKCatalog-Shared.xcconfig"; sourceTree = SOURCE_ROOT; }; 3E39B9E81ABF675000C2ABE5 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 3E39B9FA1ABF682D00C2ABE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 3E39B9FD1ABF683700C2ABE5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 3E39B9FF1ABF683F00C2ABE5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 3ED967B91AC13D37007E2D83 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; + 5116D0BF2677FB780010FAB1 /* ResearchKit-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ResearchKit-Shared.xcconfig"; sourceTree = ""; }; + 51AF19772B59F1E400D3B399 /* ORKCatalogTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ORKCatalogTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 51AF19852B59F3A900D3B399 /* ORKKeychainWrapperTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ORKKeychainWrapperTests.m; sourceTree = ""; }; + 51C173272BA4B4E1006604FB /* sphere_model.usdz */ = {isa = PBXFileReference; lastKnownFileType = file.usdz; path = sphere_model.usdz; sourceTree = ""; }; + 51F210EE2B4634FC0072B536 /* TaskListRowSteps.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskListRowSteps.swift; sourceTree = ""; }; + 51F210FD2B49D04F0072B536 /* TaskListRowConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskListRowConstants.swift; sourceTree = ""; }; 863CCD811ACF545E009FD3B4 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 863CCD831ACF545E009FD3B4 /* ORKCatalog.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = ORKCatalog.entitlements; sourceTree = ""; }; 869230BE1AAA890A00BFE11B /* ORKCatalog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ORKCatalog.app; sourceTree = BUILT_PRODUCTS_DIR; }; 86B89A981AB2C0A5001626A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 86B89A9C1AB2C0A5001626A4 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = ORKCatalog/AppDelegate.swift; sourceTree = SOURCE_ROOT; }; - 9622282A24F04D780056E74D /* ORKCatalogUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ORKCatalogUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 9622282E24F04D780056E74D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9622283824F04DBF0056E74D /* TaskScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TaskScreen.swift; sourceTree = ""; }; - 9622283A24F04DFE0056E74D /* CommonElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonElements.swift; sourceTree = ""; }; - 9622283C24F04E6F0056E74D /* AllowScreens.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AllowScreens.swift; sourceTree = ""; }; - 9622283E24F04EBA0056E74D /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; }; - 9622284024F04EEF0056E74D /* PreSubmissionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreSubmissionTests.swift; sourceTree = ""; }; - 9632B5D524F093070010818C /* ORKCatalogUI.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = ORKCatalogUI.xctestplan; sourceTree = ""; }; B125E3D31B1BA47600FF8759 /* tap.aif */ = {isa = PBXFileReference; lastKnownFileType = file; path = tap.aif; sourceTree = ""; }; BAAC3FD520C4EF1C0065B9E1 /* ResearchKit.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = ResearchKit.pdf; sourceTree = ""; }; BAFAD7AA1EFB2907004DEC45 /* fr-CA */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "fr-CA"; path = fr_CA.lproj/Localizable.strings; sourceTree = ""; }; @@ -127,22 +128,26 @@ BC9A27391B82741900BDA84D /* ResultTableViewProviders.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ResultTableViewProviders.swift; path = Results/ResultTableViewProviders.swift; sourceTree = ""; }; BC9A273A1B82741900BDA84D /* ResultViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ResultViewController.swift; path = Results/ResultViewController.swift; sourceTree = ""; }; BC9A273B1B82741900BDA84D /* TextImageTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TextImageTableViewCell.swift; path = Results/TextImageTableViewCell.swift; sourceTree = ""; }; + CA6A0D8E288F04260048C1EF /* ResearchKitUI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ResearchKitUI.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CA9B6DF728A2BF51000A7603 /* ResearchKitActiveTask.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = ResearchKitActiveTask.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 869230BB1AAA890A00BFE11B /* Frameworks */ = { + 51AF19742B59F1E400D3B399 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - BC2A3CD91C58F1CA00DA64B7 /* ResearchKit.framework in Frameworks */, - 863CCD821ACF545E009FD3B4 /* HealthKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 9622282724F04D780056E74D /* Frameworks */ = { + 869230BB1AAA890A00BFE11B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + CA9B6DF828A2BF51000A7603 /* ResearchKitActiveTask.framework in Frameworks */, + CA6A0D8F288F04260048C1EF /* ResearchKitUI.framework in Frameworks */, + BC2A3CD91C58F1CA00DA64B7 /* ResearchKit.framework in Frameworks */, + 863CCD821ACF545E009FD3B4 /* HealthKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -157,17 +162,10 @@ path = Extensions; sourceTree = ""; }; - 3C39E45F2950F27800BD96F6 /* Configuration */ = { - isa = PBXGroup; - children = ( - 3C39E45D2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig */, - ); - path = Configuration; - sourceTree = ""; - }; 3E838B881ABFD0E5006AE2D4 /* Presenting Tasks */ = { isa = PBXGroup; children = ( + 51F210FC2B49D02C0072B536 /* Task List Row Helpers */, BC9A27321B82740D00BDA84D /* TaskListRow.swift */, BC9A27331B82740D00BDA84D /* TaskListViewController.swift */, ); @@ -185,11 +183,29 @@ name = "Displaying Results"; sourceTree = ""; }; + 51AF19782B59F1E500D3B399 /* ORKCatalogTests */ = { + isa = PBXGroup; + children = ( + 51AF19852B59F3A900D3B399 /* ORKKeychainWrapperTests.m */, + ); + path = ORKCatalogTests; + sourceTree = ""; + }; + 51F210FC2B49D02C0072B536 /* Task List Row Helpers */ = { + isa = PBXGroup; + children = ( + 51F210EE2B4634FC0072B536 /* TaskListRowSteps.swift */, + 51F210FD2B49D04F0072B536 /* TaskListRowConstants.swift */, + ); + name = "Task List Row Helpers"; + sourceTree = ""; + }; 869230B51AAA890A00BFE11B = { isa = PBXGroup; children = ( + 5116D0BF2677FB780010FAB1 /* ResearchKit-Shared.xcconfig */, 3E39B9E81ABF675000C2ABE5 /* README.md */, - 9622282B24F04D780056E74D /* ORKCatalogUITests */, + 51AF19782B59F1E500D3B399 /* ORKCatalogTests */, BC2A3C9E1C58E81500DA64B7 /* Frameworks */, 869230C01AAA890A00BFE11B /* ORKCatalog */, 869230BF1AAA890A00BFE11B /* Products */, @@ -200,7 +216,7 @@ isa = PBXGroup; children = ( 869230BE1AAA890A00BFE11B /* ORKCatalog.app */, - 9622282A24F04D780056E74D /* ORKCatalogUITests.xctest */, + 51AF19772B59F1E400D3B399 /* ORKCatalogTests.xctest */, ); name = Products; sourceTree = ""; @@ -210,7 +226,6 @@ children = ( 86B89A9C1AB2C0A5001626A4 /* AppDelegate.swift */, 03F7FD9E23959DD500432EF6 /* SceneDelegate.swift */, - 3C39E45F2950F27800BD96F6 /* Configuration */, 3E838B891ABFD104006AE2D4 /* Displaying Results */, 0B1A0A8228B6E0D800C16ABA /* Extensions */, 3E838B881ABFD0E5006AE2D4 /* Presenting Tasks */, @@ -229,31 +244,11 @@ path = "Supporting Files"; sourceTree = ""; }; - 9622282B24F04D780056E74D /* ORKCatalogUITests */ = { - isa = PBXGroup; - children = ( - 9622283724F04D850056E74D /* Screens */, - 9622282E24F04D780056E74D /* Info.plist */, - 9622283E24F04EBA0056E74D /* Helpers.swift */, - 9622284024F04EEF0056E74D /* PreSubmissionTests.swift */, - 9632B5D524F093070010818C /* ORKCatalogUI.xctestplan */, - ); - path = ORKCatalogUITests; - sourceTree = ""; - }; - 9622283724F04D850056E74D /* Screens */ = { - isa = PBXGroup; - children = ( - 9622283824F04DBF0056E74D /* TaskScreen.swift */, - 9622283A24F04DFE0056E74D /* CommonElements.swift */, - 9622283C24F04E6F0056E74D /* AllowScreens.swift */, - ); - path = Screens; - sourceTree = ""; - }; BC2A3C9E1C58E81500DA64B7 /* Frameworks */ = { isa = PBXGroup; children = ( + CA9B6DF728A2BF51000A7603 /* ResearchKitActiveTask.framework */, + CA6A0D8E288F04260048C1EF /* ResearchKitUI.framework */, BC2A3CD81C58F1CA00DA64B7 /* ResearchKit.framework */, 863CCD811ACF545E009FD3B4 /* HealthKit.framework */, ); @@ -263,6 +258,7 @@ BC74787A1B990EED0072BFE8 /* Resources */ = { isa = PBXGroup; children = ( + 51C173272BA4B4E1006604FB /* sphere_model.usdz */, BAAC3FD520C4EF1C0065B9E1 /* ResearchKit.pdf */, 3E39B9FF1ABF683F00C2ABE5 /* Images.xcassets */, 3E39B9FC1ABF683700C2ABE5 /* LaunchScreen.xib */, @@ -276,6 +272,24 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 51AF19762B59F1E400D3B399 /* ORKCatalogTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 51AF19822B59F1E600D3B399 /* Build configuration list for PBXNativeTarget "ORKCatalogTests" */; + buildPhases = ( + 51AF19732B59F1E400D3B399 /* Sources */, + 51AF19742B59F1E400D3B399 /* Frameworks */, + 51AF19752B59F1E400D3B399 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 51AF197C2B59F1E500D3B399 /* PBXTargetDependency */, + ); + name = ORKCatalogTests; + productName = ORKCatalogTests; + productReference = 51AF19772B59F1E400D3B399 /* ORKCatalogTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 869230BD1AAA890A00BFE11B /* ORKCatalog */ = { isa = PBXNativeTarget; buildConfigurationList = 869230DF1AAA890A00BFE11B /* Build configuration list for PBXNativeTarget "ORKCatalog" */; @@ -294,49 +308,31 @@ productReference = 869230BE1AAA890A00BFE11B /* ORKCatalog.app */; productType = "com.apple.product-type.application"; }; - 9622282924F04D780056E74D /* ORKCatalogUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9622283624F04D780056E74D /* Build configuration list for PBXNativeTarget "ORKCatalogUITests" */; - buildPhases = ( - 9622282624F04D780056E74D /* Sources */, - 9622282724F04D780056E74D /* Frameworks */, - 9622282824F04D780056E74D /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 9622283024F04D780056E74D /* PBXTargetDependency */, - ); - name = ORKCatalogUITests; - productName = ORKCatalogUITests; - productReference = 9622282A24F04D780056E74D /* ORKCatalogUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 869230B61AAA890A00BFE11B /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1160; - LastUpgradeCheck = 1310; + BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; ORGANIZATIONNAME = researchkit.org; TargetAttributes = { + 51AF19762B59F1E400D3B399 = { + CreatedOnToolsVersion = 15.1; + TestTargetID = 869230BD1AAA890A00BFE11B; + }; 869230BD1AAA890A00BFE11B = { CreatedOnToolsVersion = 6.2; - LastSwiftMigration = 1020; - ProvisioningStyle = Manual; - }; - 9622282924F04D780056E74D = { - CreatedOnToolsVersion = 11.6; - ProvisioningStyle = Manual; - TestTargetID = 869230BD1AAA890A00BFE11B; + LastSwiftMigration = 1530; + ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 869230B91AAA890A00BFE11B /* Build configuration list for PBXProject "ORKCatalog" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; + developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( English, @@ -395,40 +391,49 @@ projectRoot = ""; targets = ( 869230BD1AAA890A00BFE11B /* ORKCatalog */, - 9622282924F04D780056E74D /* ORKCatalogUITests */, + 51AF19762B59F1E400D3B399 /* ORKCatalogTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 51AF19752B59F1E400D3B399 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 869230BC1AAA890A00BFE11B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 51C173282BA4B4E1006604FB /* sphere_model.usdz in Resources */, 3E39BA001ABF683F00C2ABE5 /* Images.xcassets in Resources */, 3E39B9FB1ABF682D00C2ABE5 /* Main.storyboard in Resources */, BAAC3FD620C4EF1C0065B9E1 /* ResearchKit.pdf in Resources */, B125E3D41B1BA47600FF8759 /* tap.aif in Resources */, 3E39B9FE1ABF683700C2ABE5 /* LaunchScreen.xib in Resources */, - 3C39E45E2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig in Resources */, 3ED967B81AC13D37007E2D83 /* Localizable.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 9622282824F04D780056E74D /* Resources */ = { - isa = PBXResourcesBuildPhase; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 51AF19732B59F1E400D3B399 /* Sources */ = { + isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 51AF19862B59F3A900D3B399 /* ORKKeychainWrapperTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ 869230BA1AAA890A00BFE11B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 51F210FE2B49D04F0072B536 /* TaskListRowConstants.swift in Sources */, BC9A273E1B82741900BDA84D /* ResultViewController.swift in Sources */, 0B6CB32728B577640092E993 /* Bundle+Extensions.swift in Sources */, BC9A273D1B82741900BDA84D /* ResultTableViewProviders.swift in Sources */, @@ -438,28 +443,17 @@ BC9A273C1B82741900BDA84D /* ImageTableViewCell.swift in Sources */, BC9A27351B82740D00BDA84D /* TaskListViewController.swift in Sources */, BC9A27341B82740D00BDA84D /* TaskListRow.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9622282624F04D780056E74D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9622283924F04DBF0056E74D /* TaskScreen.swift in Sources */, - 9622283B24F04DFE0056E74D /* CommonElements.swift in Sources */, - 9622284124F04EEF0056E74D /* PreSubmissionTests.swift in Sources */, - 9622283F24F04EBA0056E74D /* Helpers.swift in Sources */, - 9622283D24F04E6F0056E74D /* AllowScreens.swift in Sources */, + 51F210EF2B4634FC0072B536 /* TaskListRowSteps.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 9622283024F04D780056E74D /* PBXTargetDependency */ = { + 51AF197C2B59F1E500D3B399 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 869230BD1AAA890A00BFE11B /* ORKCatalog */; - targetProxy = 9622282F24F04D780056E74D /* PBXContainerItemProxy */; + targetProxy = 51AF197B2B59F1E500D3B399 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -535,7 +529,6 @@ /* Begin XCBuildConfiguration section */ 050B7A0323ECA11400CC1719 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3C39E45D2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; @@ -567,6 +560,7 @@ COPY_PHASE_STRIP = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -585,61 +579,98 @@ }; 050B7A0423ECA11400CC1719 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3C39E45D2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig */; + baseConfigurationReference = 5116D0BF2677FB780010FAB1 /* ResearchKit-Shared.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CODE_SIGN_ENTITLEMENTS = "ORKCatalog/Supporting Files/ORKCatalog.entitlements"; - CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(ORK_CATALOG_BUILD_NUMBER)"; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; - GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(ORK_GCC_PREPROCESSOR_DEFINITIONS)", + "$(inherited)", + ); INFOPLIST_FILE = "$(SRCROOT)/ORKCatalog/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = "$(ORK_CATALOG_VERSION_NUMBER)"; - OTHER_SWIFT_FLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = "$(ORK_CATALOG_BUNDLE_ID)"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.researchkit-samplecode.$(PRODUCT_NAME:rfc1034identifier)-internal"; PRODUCT_NAME = ORKCatalog; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Release; }; - 5128EFC52909ADC500257C1C /* Debug */ = { + 51AF197D2B59F1E600D3B399 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - CODE_SIGN_STYLE = Manual; - COPY_PHASE_STRIP = NO; - DEVELOPMENT_TEAM = ""; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - PRODUCT_NAME = ORKCatalogUITests; - PROVISIONING_PROFILE_SPECIFIER = ""; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.orkcatalog.ORKCatalogTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ORKCatalog.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ORKCatalog"; }; name = Debug; }; - 5128EFC62909ADC500257C1C /* Release */ = { + 51AF19802B59F1E600D3B399 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - CODE_SIGN_STYLE = Manual; - COPY_PHASE_STRIP = YES; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEVELOPMENT_TEAM = ""; - PRODUCT_NAME = ORKCatalogUITests; - PROVISIONING_PROFILE_SPECIFIER = ""; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.2; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.orkcatalog.ORKCatalogTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ORKCatalog.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ORKCatalog"; }; name = Release; }; 869230DD1AAA890A00BFE11B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3C39E45D2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig */; + baseConfigurationReference = 5116D0BF2677FB780010FAB1 /* ResearchKit-Shared.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; @@ -671,6 +702,7 @@ COPY_PHASE_STRIP = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -697,14 +729,14 @@ }; 869230E01AAA890A00BFE11B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3C39E45D2950EFAD00BD96F6 /* ORKCatalog-Shared.xcconfig */; + baseConfigurationReference = 5116D0BF2677FB780010FAB1 /* ResearchKit-Shared.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CODE_SIGN_ENTITLEMENTS = "ORKCatalog/Supporting Files/ORKCatalog.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = "$(ORK_CATALOG_BUILD_NUMBER)"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PREPROCESSOR_DEFINITIONS = ( @@ -713,9 +745,11 @@ ); INFOPLIST_FILE = "$(SRCROOT)/ORKCatalog/Supporting Files/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - MARKETING_VERSION = "$(ORK_CATALOG_VERSION_NUMBER)"; - PRODUCT_BUNDLE_IDENTIFIER = "$(ORK_CATALOG_BUNDLE_ID)"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.example.researchkit-samplecode.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = ORKCatalog; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -727,29 +761,29 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 869230B91AAA890A00BFE11B /* Build configuration list for PBXProject "ORKCatalog" */ = { + 51AF19822B59F1E600D3B399 /* Build configuration list for PBXNativeTarget "ORKCatalogTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - 869230DD1AAA890A00BFE11B /* Debug */, - 050B7A0323ECA11400CC1719 /* Release */, + 51AF197D2B59F1E600D3B399 /* Debug */, + 51AF19802B59F1E600D3B399 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 869230DF1AAA890A00BFE11B /* Build configuration list for PBXNativeTarget "ORKCatalog" */ = { + 869230B91AAA890A00BFE11B /* Build configuration list for PBXProject "ORKCatalog" */ = { isa = XCConfigurationList; buildConfigurations = ( - 869230E01AAA890A00BFE11B /* Debug */, - 050B7A0423ECA11400CC1719 /* Release */, + 869230DD1AAA890A00BFE11B /* Debug */, + 050B7A0323ECA11400CC1719 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - 9622283624F04D780056E74D /* Build configuration list for PBXNativeTarget "ORKCatalogUITests" */ = { + 869230DF1AAA890A00BFE11B /* Build configuration list for PBXNativeTarget "ORKCatalog" */ = { isa = XCConfigurationList; buildConfigurations = ( - 5128EFC52909ADC500257C1C /* Debug */, - 5128EFC62909ADC500257C1C /* Release */, + 869230E01AAA890A00BFE11B /* Debug */, + 050B7A0423ECA11400CC1719 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; diff --git a/samples/ORKCatalog/ORKCatalog.xcodeproj/xcshareddata/xcschemes/ORKCatalog.xcscheme b/samples/ORKCatalog/ORKCatalog.xcodeproj/xcshareddata/xcschemes/ORKCatalog.xcscheme index 7ea3592acd..2213186f8b 100644 --- a/samples/ORKCatalog/ORKCatalog.xcodeproj/xcshareddata/xcschemes/ORKCatalog.xcscheme +++ b/samples/ORKCatalog/ORKCatalog.xcodeproj/xcshareddata/xcschemes/ORKCatalog.xcscheme @@ -1,6 +1,6 @@ - - - - + shouldUseLaunchSchemeArgsEnv = "YES" + shouldAutocreateTestPlan = "YES"> + skipped = "NO" + parallelizable = "YES"> diff --git a/samples/ORKCatalog/ORKCatalog.xcodeproj/xcshareddata/xcschemes/ORKCatalogUI.xcscheme b/samples/ORKCatalog/ORKCatalog.xcodeproj/xcshareddata/xcschemes/ORKCatalogUI.xcscheme deleted file mode 100644 index 8633ef7f92..0000000000 --- a/samples/ORKCatalog/ORKCatalog.xcodeproj/xcshareddata/xcschemes/ORKCatalogUI.xcscheme +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/ORKCatalog/ORKCatalog/AppDelegate.swift b/samples/ORKCatalog/ORKCatalog/AppDelegate.swift index d862e01407..982afb7684 100644 --- a/samples/ORKCatalog/ORKCatalog/AppDelegate.swift +++ b/samples/ORKCatalog/ORKCatalog/AppDelegate.swift @@ -28,13 +28,12 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import ResearchKitActiveTask import UIKit -@UIApplicationMain +@main class AppDelegate: UIResponder, UIApplicationDelegate { - var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { return true } diff --git a/samples/ORKCatalog/ORKCatalog/Charts/ChartDataSources.swift b/samples/ORKCatalog/ORKCatalog/Charts/ChartDataSources.swift deleted file mode 100644 index aa7fba6b1b..0000000000 --- a/samples/ORKCatalog/ORKCatalog/Charts/ChartDataSources.swift +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright (c) 2015, James Cox. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import ResearchKit - -class PieChartDataSource: NSObject, ORKPieChartViewDataSource { - - let colors = [ - UIColor(red: 217 / 225, green: 217 / 255, blue: 217 / 225, alpha: 1), - UIColor(red: 142 / 255, green: 142 / 255, blue: 147 / 255, alpha: 1), - UIColor(red: 244 / 255, green: 190 / 255, blue: 74 / 255, alpha: 1) - ] - let values = [10.0, 25.0, 45.0] - - func numberOfSegments(in pieChartView: ORKPieChartView ) -> Int { - return colors.count - } - - func pieChartView(_ pieChartView: ORKPieChartView, valueForSegmentAt index: Int) -> CGFloat { - return CGFloat(values[index]) - } - - func pieChartView(_ pieChartView: ORKPieChartView, colorForSegmentAt index: Int) -> UIColor { - return colors[index] - } - - func pieChartView(_ pieChartView: ORKPieChartView, titleForSegmentAt index: Int) -> String? { - return "Title \(index + 1)" - } -} - -class LineGraphDataSource: NSObject, ORKValueRangeGraphChartViewDataSource { - - var plotPoints = - [ - [ - ORKValueRange(value: 10), - ORKValueRange(value: 20), - ORKValueRange(value: 25), - ORKValueRange(), - ORKValueRange(value: 30), - ORKValueRange(value: 40) - ], - [ - ORKValueRange(value: 2), - ORKValueRange(value: 4), - ORKValueRange(value: 8), - ORKValueRange(value: 16), - ORKValueRange(value: 32), - ORKValueRange(value: 64) - ] - ] - - func numberOfPlots(in graphChartView: ORKGraphChartView) -> Int { - return plotPoints.count - } - - func graphChartView(_ graphChartView: ORKGraphChartView, dataPointForPointIndex pointIndex: Int, plotIndex: Int) -> ORKValueRange { - return plotPoints[plotIndex][pointIndex] - } - - func graphChartView(_ graphChartView: ORKGraphChartView, numberOfDataPointsForPlotIndex plotIndex: Int) -> Int { - return plotPoints[plotIndex].count - } - - func maximumValue(for graphChartView: ORKGraphChartView) -> Double { - return 70 - } - - func minimumValue(for graphChartView: ORKGraphChartView) -> Double { - return 0 - } - - func graphChartView(_ graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String? { - return "\(pointIndex + 1)" - } - - func graphChartView(_ graphChartView: ORKGraphChartView, drawsPointIndicatorsForPlotIndex plotIndex: Int) -> Bool { - if plotIndex == 1 { - return false - } - return true - } -} - -class DiscreteGraphDataSource: NSObject, ORKValueRangeGraphChartViewDataSource { - - var plotPoints = - [ - [ - ORKValueRange(minimumValue: 0, maximumValue: 2), - ORKValueRange(minimumValue: 1, maximumValue: 4), - ORKValueRange(minimumValue: 2, maximumValue: 6), - ORKValueRange(minimumValue: 3, maximumValue: 8), - ORKValueRange(minimumValue: 5, maximumValue: 10), - ORKValueRange(minimumValue: 8, maximumValue: 13) - ], - [ - ORKValueRange(value: 1), - ORKValueRange(minimumValue: 2, maximumValue: 6), - ORKValueRange(minimumValue: 3, maximumValue: 10), - ORKValueRange(minimumValue: 5, maximumValue: 11), - ORKValueRange(minimumValue: 7, maximumValue: 13), - ORKValueRange(minimumValue: 10, maximumValue: 13) - ] - ] - - func numberOfPlots(in graphChartView: ORKGraphChartView) -> Int { - return plotPoints.count - } - - func graphChartView(_ graphChartView: ORKGraphChartView, dataPointForPointIndex pointIndex: Int, plotIndex: Int) -> ORKValueRange { - return plotPoints[plotIndex][pointIndex] - } - - func graphChartView(_ graphChartView: ORKGraphChartView, numberOfDataPointsForPlotIndex plotIndex: Int) -> Int { - return plotPoints[plotIndex].count - } - - func graphChartView(_ graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String? { - return "\(pointIndex + 1)" - } - -} - -class BarGraphDataSource: NSObject, ORKValueStackGraphChartViewDataSource { - - var plotPoints = - [ - [ - ORKValueStack(stackedValues: [4, 6]), - ORKValueStack(stackedValues: [2, 4, 4]), - ORKValueStack(stackedValues: [2, 6, 3, 6]), - ORKValueStack(stackedValues: [3, 8, 10, 12]), - ORKValueStack(stackedValues: [5, 10, 12, 8]), - ORKValueStack(stackedValues: [8, 13, 18]) - ], - [ - ORKValueStack(stackedValues: [14]), - ORKValueStack(stackedValues: [6, 6]), - ORKValueStack(stackedValues: [3, 10, 12]), - ORKValueStack(stackedValues: [5, 11, 14]), - ORKValueStack(stackedValues: [7, 13, 20]), - ORKValueStack(stackedValues: [10, 13, 25]) - ] - ] - - public func numberOfPlots(in graphChartView: ORKGraphChartView) -> Int { - return plotPoints.count - } - - func graphChartView(_ graphChartView: ORKGraphChartView, dataPointForPointIndex pointIndex: Int, plotIndex: Int) -> ORKValueStack { - return plotPoints[plotIndex][pointIndex] - } - - func graphChartView(_ graphChartView: ORKGraphChartView, numberOfDataPointsForPlotIndex plotIndex: Int) -> Int { - return plotPoints[plotIndex].count - } - - func graphChartView(_ graphChartView: ORKGraphChartView, titleForXAxisAtPointIndex pointIndex: Int) -> String? { - return "\(pointIndex + 1)" - } - -} diff --git a/samples/ORKCatalog/ORKCatalog/Charts/ChartListViewController.swift b/samples/ORKCatalog/ORKCatalog/Charts/ChartListViewController.swift deleted file mode 100644 index 5a5675f3b7..0000000000 --- a/samples/ORKCatalog/ORKCatalog/Charts/ChartListViewController.swift +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright (c) 2015, James Cox. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import UIKit -import ResearchKit - -class ChartListViewController: UITableViewController { - - let pieChartDataSource = PieChartDataSource() - let lineGraphChartDataSource = LineGraphDataSource() - let discreteGraphChartDataSource = DiscreteGraphDataSource() - let barGraphChartDataSource = BarGraphDataSource() - - let pieChartIdentifier = "PieChartCell" - let lineGraphChartIdentifier = "LineGraphChartCell" - let discreteGraphChartIdentifier = "DiscreteGraphChartCell" - let barGraphChartIdentifier = "BarGraphChartCell" - - var pieChartTableViewCell: PieChartTableViewCell! - var lineGraphChartTableViewCell: LineGraphChartTableViewCell! - var discreteGraphChartTableViewCell: DiscreteGraphChartTableViewCell! - var barGraphChartTableViewCell: BarGraphChartTableViewCell! - var chartTableViewCells: [UITableViewCell]! - - override func viewDidLoad() { - super.viewDidLoad() - - if #available(iOS 13.0, *) { - self.tableView.backgroundColor = UIColor.systemBackground - } - - // ORKPieChartView - pieChartTableViewCell = (tableView.dequeueReusableCell(withIdentifier: pieChartIdentifier) as! PieChartTableViewCell) - let pieChartView = pieChartTableViewCell.pieChartView - pieChartView?.dataSource = pieChartDataSource - // Optional custom configuration - - pieChartView?.title = "TITLE" - pieChartView?.text = "TEXT" - pieChartView?.lineWidth = 14 - pieChartView?.radiusScaleFactor = 0.6 - - // ORKLineGraphChartView - lineGraphChartTableViewCell = (tableView.dequeueReusableCell(withIdentifier: lineGraphChartIdentifier) as! LineGraphChartTableViewCell) - let lineGraphChartView = lineGraphChartTableViewCell.graphView as! ORKLineGraphChartView - lineGraphChartView.dataSource = lineGraphChartDataSource - lineGraphChartView.tintColor = UIColor(red: 244 / 255, green: 190 / 255, blue: 74 / 255, alpha: 1) - // Optional custom configuration - lineGraphChartView.showsHorizontalReferenceLines = true - lineGraphChartView.showsVerticalReferenceLines = true - - // ORKDiscreteGraphChartView - discreteGraphChartTableViewCell = (tableView.dequeueReusableCell(withIdentifier: discreteGraphChartIdentifier) as! DiscreteGraphChartTableViewCell) - let discreteGraphChartView = discreteGraphChartTableViewCell.graphView as! ORKDiscreteGraphChartView - discreteGraphChartView.dataSource = discreteGraphChartDataSource - discreteGraphChartView.tintColor = UIColor(red: 244 / 255, green: 190 / 255, blue: 74 / 255, alpha: 1) - // Optional custom configuration - discreteGraphChartView.showsHorizontalReferenceLines = true - discreteGraphChartView.showsVerticalReferenceLines = true - - // ORKBarGraphChartView - barGraphChartTableViewCell = (tableView.dequeueReusableCell(withIdentifier: barGraphChartIdentifier) as! BarGraphChartTableViewCell) - let barGraphChartView = barGraphChartTableViewCell.graphView as! ORKBarGraphChartView - barGraphChartView.dataSource = barGraphChartDataSource - barGraphChartView.tintColor = UIColor(red: 244 / 255, green: 190 / 255, blue: 74 / 255, alpha: 1) - // Optional custom configuration - barGraphChartView.showsHorizontalReferenceLines = true - barGraphChartView.showsVerticalReferenceLines = true - - chartTableViewCells = [pieChartTableViewCell, lineGraphChartTableViewCell, discreteGraphChartTableViewCell, barGraphChartTableViewCell] - - if #available(iOS 13.0, *) { - pieChartView?.backgroundColor = UIColor.secondarySystemBackground - lineGraphChartView.backgroundColor = UIColor.secondarySystemBackground - discreteGraphChartView.backgroundColor = UIColor.secondarySystemBackground - barGraphChartView.backgroundColor = UIColor.secondarySystemBackground - } - - tableView.tableFooterView = UIView(frame: CGRect.zero) - } - - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - return chartTableViewCells.count - } - - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - let cell = chartTableViewCells[(indexPath as NSIndexPath).row] - - if #available(iOS 13.0, *) { - cell.contentView.backgroundColor = UIColor.systemBackground - } - - return cell - } - - override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - pieChartTableViewCell.pieChartView.animate(withDuration: 0.5) - lineGraphChartTableViewCell.graphView.animate(withDuration: 0.5) - discreteGraphChartTableViewCell.graphView.animate(withDuration: 0.5) - barGraphChartTableViewCell.graphView.animate(withDuration: 0.5) - } - -} diff --git a/samples/ORKCatalog/ORKCatalog/Configuration/ORKCatalog-Shared.xcconfig b/samples/ORKCatalog/ORKCatalog/Configuration/ORKCatalog-Shared.xcconfig deleted file mode 100644 index c833c5042c..0000000000 --- a/samples/ORKCatalog/ORKCatalog/Configuration/ORKCatalog-Shared.xcconfig +++ /dev/null @@ -1,17 +0,0 @@ -// -// ORKCatalog-Shared.xcconfig -// - -ORK_CATALOG_VERSION_NUMBER = 2.2.9 - -ORK_CATALOG_BUILD_NUMBER = $(ORK_CATALOG_BUILD_NUMBER_CI_$(CI)) // ORK_CATALOG_BUILD_NUMBER_CI_TRUE or ORK_CATALOG_BUILD_NUMBER_CI_ -ORK_CATALOG_BUILD_NUMBER_CI_TRUE = $(CI_BUILD_NUMBER) // if CI_BUILD_NUMBER is defined (presumably by CI) just use it -ORK_CATALOG_BUILD_NUMBER_CI_FALSE = $(ORK_CATALOG_VERSION_NUMBER) // when not in CI, assume the build number is our version number -ORK_CATALOG_BUILD_NUMBER_CI_ = $(ORK_CATALOG_BUILD_NUMBER_CI_FALSE) - -ORK_CATALOG_BUNDLE_ID_BASE = com.example.researchkit-samplecode.$(PRODUCT_NAME:rfc1034identifier) - -ORK_CATALOG_BUNDLE_ID = $(ORK_CATALOG_BUNDLE_ID_CI_$(CI)) // ORK_CATALOG_BUNDLE_ID_CI_TRUE or ORK_CATALOG_BUNDLE_ID_CI_ -ORK_CATALOG_BUNDLE_ID_CI_TRUE = $(CI_BUNDLE_ID)$(ORK_CATALOG_CI_BUNDLE_ID_SUFFIX) // if CI_BUNDLE_ID is defined (presumably by CI) just use it, allow appending an optional suffix -ORK_CATALOG_BUNDLE_ID_CI_FALSE = $(ORK_CATALOG_BUNDLE_ID_BASE) // when not in CI, use the Base bundle ID -ORK_CATALOG_BUNDLE_ID_CI_ = $(ORK_CATALOG_BUNDLE_ID_CI_FALSE) diff --git a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/AppIcon.appiconset/Contents.json b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/AppIcon.appiconset/Contents.json index 536bc9d185..cac48b06e8 100644 --- a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/AppIcon.appiconset/Contents.json @@ -2,105 +2,106 @@ "images" : [ { "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { - "size" : "40x40", - "idiom" : "iphone", "filename" : "Icon-Small-40@2x.png", - "scale" : "2x" + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" }, { - "size" : "40x40", - "idiom" : "iphone", "filename" : "Icon-Small-40@3x.png", - "scale" : "3x" + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" }, { - "size" : "60x60", - "idiom" : "iphone", "filename" : "Icon-60@2x.png", - "scale" : "2x" + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" }, { - "size" : "60x60", - "idiom" : "iphone", "filename" : "Icon-60@3x.png", - "scale" : "3x" + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" }, { "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" + "scale" : "1x", + "size" : "20x20" }, { "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" + "scale" : "1x", + "size" : "29x29" }, { "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { - "size" : "40x40", - "idiom" : "ipad", "filename" : "Icon-Small-40.png", - "scale" : "1x" + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" }, { "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { - "size" : "76x76", - "idiom" : "ipad", "filename" : "Icon-76.png", - "scale" : "1x" + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" }, { - "size" : "76x76", - "idiom" : "ipad", "filename" : "Icon-76@2x.png", - "scale" : "2x" + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" }, { - "size" : "83.5x83.5", - "idiom" : "ipad", "filename" : "Icon-83.5@2x.png", - "scale" : "2x" + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" }, { + "filename" : "ResearchKit logo 1024x1024.png", "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/AppIcon.appiconset/ResearchKit logo 1024x1024.png b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/AppIcon.appiconset/ResearchKit logo 1024x1024.png new file mode 100644 index 0000000000..f63472f177 Binary files /dev/null and b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/AppIcon.appiconset/ResearchKit logo 1024x1024.png differ diff --git a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/Contents.json b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/Contents.json index 2d92bd53fd..73c00596a7 100644 --- a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/Contents.json +++ b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } } diff --git a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Contents.json b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Contents.json deleted file mode 100644 index c917b4fef1..0000000000 --- a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "Stroop@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "Stroop@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Stroop@2x.png b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Stroop@2x.png deleted file mode 100644 index f6c31eb524..0000000000 Binary files a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Stroop@2x.png and /dev/null differ diff --git a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Stroop@3x.png b/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Stroop@3x.png deleted file mode 100644 index 4f00c85ebb..0000000000 Binary files a/samples/ORKCatalog/ORKCatalog/Resources/Images.xcassets/stroop.imageset/Stroop@3x.png and /dev/null differ diff --git a/samples/ORKCatalog/ORKCatalog/Resources/sphere_model.usdz b/samples/ORKCatalog/ORKCatalog/Resources/sphere_model.usdz new file mode 100644 index 0000000000..7c8e4db04d Binary files /dev/null and b/samples/ORKCatalog/ORKCatalog/Resources/sphere_model.usdz differ diff --git a/samples/ORKCatalog/ORKCatalog/Results/ResultTableViewProviders.swift b/samples/ORKCatalog/ORKCatalog/Results/ResultTableViewProviders.swift index c4c3e220ea..ffe44a23e5 100644 --- a/samples/ORKCatalog/ORKCatalog/Results/ResultTableViewProviders.swift +++ b/samples/ORKCatalog/ORKCatalog/Results/ResultTableViewProviders.swift @@ -30,6 +30,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import UIKit import ResearchKit +import ResearchKitActiveTask +import ResearchKitActiveTask_Private import MapKit import Speech @@ -85,15 +87,19 @@ func resultTableViewProviderForResult(_ result: ORKResult?, delegate: ResultProv case is ORKDateQuestionResult: providerType = DateQuestionResultTableViewProvider.self +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION case is ORKLocationQuestionResult: providerType = LocationQuestionResultTableViewProvider.self - +#endif case is ORKNumericQuestionResult: providerType = NumericQuestionResultTableViewProvider.self case is ORKScaleQuestionResult: providerType = ScaleQuestionResultTableViewProvider.self + case is ORKSESQuestionResult: + providerType = SESQuestionResultTableViewProvider.self + case is ORKTextQuestionResult: providerType = TextQuestionResultTableViewProvider.self @@ -102,10 +108,6 @@ func resultTableViewProviderForResult(_ result: ORKResult?, delegate: ResultProv case is ORKTimeOfDayQuestionResult: providerType = TimeOfDayQuestionResultTableViewProvider.self - - // Consent - case is ORKConsentSignatureResult: - providerType = ConsentSignatureResultTableViewProvider.self // Active Tasks case is ORKAmslerGridResult: @@ -126,9 +128,6 @@ func resultTableViewProviderForResult(_ result: ORKResult?, delegate: ResultProv case is ORKStroopResult: providerType = StroopResultTableViewProvider.self - case is ORKSwiftStroopResult: - providerType = SwiftStroopResultTableViewProvider.self - case is ORKTappingIntervalResult: providerType = TappingIntervalResultTableViewProvider.self @@ -166,6 +165,7 @@ func resultTableViewProviderForResult(_ result: ORKResult?, delegate: ResultProv */ case is ORKCollectionResult where !(result is ORKTaskResult): providerType = CollectionResultTableViewProvider.self + case is ORKVideoInstructionStepResult: providerType = VideoInstructionStepResultTableViewProvider.self @@ -173,14 +173,14 @@ func resultTableViewProviderForResult(_ result: ORKResult?, delegate: ResultProv case is ORKWebViewStepResult: providerType = WebViewStepResultTableViewProvider.self - case is ORKLandoltCResult: - providerType = LandoltCStepResultProvider.self - case is ORKEnvironmentSPLMeterResult: providerType = SPLMeterStepResultTableViewProvider.self case is ORKdBHLToneAudiometryResult: providerType = dBHLToneAudiometryResultTableViewProvider.self + + case is ORKSignatureResult: + providerType = SignatureResultTableViewProvider.self default: fatalError("No ResultTableViewProvider defined for \(type(of: result)).") @@ -296,11 +296,7 @@ class ResultTableViewProvider: NSObject, UITableViewDataSource, UITableViewDeleg // Show an empty row if there isn't any metadata in the rows for this section. if resultRows.isEmpty { let noChildResultsCell: UITableViewCell = tableView.dequeueReusableCell(withIdentifier: ResultRow.TableViewCellIdentifier.noChildResults.rawValue, for: indexPath) - - if #available(iOS 13.0, *) { - noChildResultsCell.textLabel?.textColor = UIColor.label - } - + noChildResultsCell.textLabel?.textColor = UIColor.label return noChildResultsCell } @@ -314,10 +310,8 @@ class ResultTableViewProvider: NSObject, UITableViewDataSource, UITableViewDeleg cell.textLabel!.text = text cell.detailTextLabel!.text = detailText - if #available(iOS 13.0, *) { - cell.textLabel?.textColor = UIColor.label - cell.detailTextLabel?.textColor = UIColor.secondaryLabel - } + cell.textLabel?.textColor = UIColor.label + cell.detailTextLabel?.textColor = UIColor.secondaryLabel /* In this sample, the accessory type should be a disclosure @@ -333,10 +327,7 @@ class ResultTableViewProvider: NSObject, UITableViewDataSource, UITableViewDeleg cell.leftTextLabel.text = text cell.rightImageView.image = image - - if #available(iOS 13.0, *) { - cell.leftTextLabel.textColor = UIColor.label - } + cell.leftTextLabel.textColor = UIColor.label return cell @@ -428,7 +419,7 @@ class ChoiceQuestionResultTableViewProvider: ResultTableViewProvider { let choiceResult = result as! ORKChoiceQuestionResult return super.resultRowsForSection(section) + [ - ResultRow(text: "choices", detail: choiceResult.choiceAnswers) + ResultRow(text: "choices", detail: choiceResult.choiceAnswers?.description) ] } } @@ -454,6 +445,7 @@ class DateQuestionResultTableViewProvider: ResultTableViewProvider { } } +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION /// Table view provider specific to an `ORKLocationQuestionResult` instance. class LocationQuestionResultTableViewProvider: ResultTableViewProvider { // MARK: ResultTableViewProvider @@ -472,7 +464,7 @@ class LocationQuestionResultTableViewProvider: ResultTableViewProvider { return rows } } - +#endif /// Table view provider specific to an `ORKNumericQuestionResult` instance. class NumericQuestionResultTableViewProvider: ResultTableViewProvider { // MARK: ResultTableViewProvider @@ -493,6 +485,20 @@ class NumericQuestionResultTableViewProvider: ResultTableViewProvider { } } +/// Table view provider specific to an `ORKSESQuestionResult` instance. +class SESQuestionResultTableViewProvider: ResultTableViewProvider { + // MARK: ResultTableViewProvider + + override func resultRowsForSection(_ section: Int) -> [ResultRow] { + let rungQuestionResult = result as! ORKSESQuestionResult + + return super.resultRowsForSection(section) + [ + // The value returned from the socieoeconomic rung selected. + ResultRow(text: "rungPicked", detail: rungQuestionResult.rungPicked) + ] + } +} + /// Table view provider specific to an `ORKScaleQuestionResult` instance. class ScaleQuestionResultTableViewProvider: ResultTableViewProvider { // MARK: ResultTableViewProvider @@ -544,6 +550,7 @@ class TimeOfDayQuestionResultTableViewProvider: ResultTableViewProvider { // Format the date components received in the result. let dateComponentsFormatter = DateComponentsFormatter() + dateComponentsFormatter.unitsStyle = .full let dateComponentsAnswerText = dateComponentsFormatter.string(from: questionResult.dateComponentsAnswer!) return super.resultRowsForSection(section) + [ @@ -553,52 +560,6 @@ class TimeOfDayQuestionResultTableViewProvider: ResultTableViewProvider { } } -/// Table view provider specific to an `ORKConsentSignatureResult` instance. -class ConsentSignatureResultTableViewProvider: ResultTableViewProvider { - // MARK: ResultTableViewProvider - - override func resultRowsForSection(_ section: Int) -> [ResultRow] { - let signatureResult = result as! ORKConsentSignatureResult - let signature = signatureResult.signature! - - return super.resultRowsForSection(section) + [ - /* - The identifier for the signature, identifying which one it is in - the document. - */ - ResultRow(text: "identifier", detail: signature.identifier), - - /* - The title of the signatory, displayed under the line. For - example, "Participant". - */ - ResultRow(text: "title", detail: signature.title), - - // The given name of the signatory. - ResultRow(text: "givenName", detail: signature.givenName), - - // The family name of the signatory. - ResultRow(text: "familyName", detail: signature.familyName), - - // The date the signature was obtained. - ResultRow(text: "date", detail: signature.signatureDate), - - // The captured image. - .textImage("signature", image: signature.signatureImage) - ] - } - - func tableView(_ tableView: UITableView, heightForRowAtIndexPath indexPath: IndexPath) -> CGFloat { - let lastRow = self.tableView(tableView, numberOfRowsInSection: (indexPath as NSIndexPath).section) - 1 - - if (indexPath as NSIndexPath).row == lastRow { - return 200 - } - - return UITableView.automaticDimension - } -} - /// Table view provider specific to an `ORKAmslerGridResult` instance. class AmslerGridResultTableViewProvider: ResultTableViewProvider { // MARK: ResultTableViewProvider @@ -819,40 +780,6 @@ class StroopResultTableViewProvider: ResultTableViewProvider { } } -/// Table view provider specific to an `ResearchKit.ORKSStroopResult` instance. -class SwiftStroopResultTableViewProvider: ResultTableViewProvider { - // MARK: UITableViewDataSource - - override func numberOfSections(in tableView: UITableView) -> Int { - return 2 - } - - override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - if section == 0 { - return super.tableView(tableView, titleForHeaderInSection: 0) - } - - return "Samples" - } - - // MARK: ResultTableViewProvider - - override func resultRowsForSection(_ section: Int) -> [ResultRow] { - let stroopResult = result as! ResearchKit.ORKSwiftStroopResult - - let rows = super.resultRowsForSection(section) - - if section == 0 { - return rows - } - return [ - ResultRow(text: "Color", detail: stroopResult.color), - ResultRow(text: "Text", detail: stroopResult.text), - ResultRow(text: "Color Selected", detail: stroopResult.colorSelected) - ] - } -} - /// Table view provider specific to an `ORKTappingIntervalResult` instance. class TappingIntervalResultTableViewProvider: ResultTableViewProvider { // MARK: UITableViewDataSource @@ -932,8 +859,12 @@ class ToneAudiometryResultTableViewProvider: ResultTableViewProvider { ] } + guard let samples = toneAudiometryResult.samples else { + return rows + } + // Add a `ResultRow` for each sample. - return rows + toneAudiometryResult.samples!.map { toneSample in + return rows + samples.map { toneSample in let text: String let detail: String @@ -1324,6 +1255,7 @@ class CollectionResultTableViewProvider: ResultTableViewProvider { } } + /// Table view provider specific to an `ORKVideoInstructionStepResult` instance. class VideoInstructionStepResultTableViewProvider: ResultTableViewProvider { // MARK: ResultTableViewProvider @@ -1367,27 +1299,6 @@ class WebViewStepResultTableViewProvider: ResultTableViewProvider { } } -class LandoltCStepResultProvider: ResultTableViewProvider { - // MARK: ResultTableViewProvider - - override func resultRowsForSection(_ section: Int) -> [ResultRow] { - let landoltCResult = result as! ORKLandoltCResult - - let rows = super.resultRowsForSection(section) - - if section == 0 { - return rows + [ - ResultRow(text: "outcome", detail: landoltCResult.outcome), - ResultRow(text: "letterAngle", detail: landoltCResult.letterAngle), - ResultRow(text: "sliderAngle", detail: landoltCResult.sliderAngle), - ResultRow(text: "score", detail: landoltCResult.score) - ] - } - - return rows - } -} - /// Table view provider specific to an `ORKdBHLToneAudiometryResult` instance. class dBHLToneAudiometryResultTableViewProvider: ResultTableViewProvider { override func numberOfSections(in tableView: UITableView) -> Int { @@ -1446,3 +1357,38 @@ class SPLMeterStepResultTableViewProvider: ResultTableViewProvider { return rows } } + +class SignatureResultTableViewProvider: ResultTableViewProvider { + override func resultRowsForSection(_ section: Int) -> [ResultRow] { + let signatureResult = result as! ORKSignatureResult + + let rows = super.resultRowsForSection(section) + + if let image = signatureResult.signatureImage { + return rows + [.image(image)] + } + + return rows + } + + func tableView(_ tableView: UITableView, heightForRowAtIndexPath indexPath: IndexPath) -> CGFloat { + let resultRows = resultRowsForSection((indexPath as NSIndexPath).section) + + if !resultRows.isEmpty { + switch resultRows[(indexPath as NSIndexPath).row] { + case .image(.some(let image)): + // Keep the aspect ratio the same. + let imageAspectRatio = image.size.width / image.size.height + + return tableView.frame.size.width / imageAspectRatio + + default: + break + } + } + + return UITableView.automaticDimension + } +} + + diff --git a/samples/ORKCatalog/ORKCatalog/Results/ResultViewController.swift b/samples/ORKCatalog/ORKCatalog/Results/ResultViewController.swift index fdf68405b9..1edb675e47 100644 --- a/samples/ORKCatalog/ORKCatalog/Results/ResultViewController.swift +++ b/samples/ORKCatalog/ORKCatalog/Results/ResultViewController.swift @@ -31,6 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import UIKit import ResearchKit + /** The purpose of this view controller is to show you the kinds of data you can fetch from a specific `ORKResult`. The intention is for this view @@ -48,7 +49,6 @@ class ResultViewController: UITableViewController { // MARK: Properties var result: ORKResult? - var currentResult: ORKResult? var resultTableViewProvider: UITableViewDataSource & UITableViewDelegate = resultTableViewProviderForResult(nil, delegate: nil) @@ -58,9 +58,7 @@ class ResultViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() - if #available(iOS 13.0, *) { - self.tableView.backgroundColor = UIColor.systemGroupedBackground - } + self.tableView.backgroundColor = UIColor.systemGroupedBackground } override func viewWillAppear(_ animated: Bool) { @@ -71,7 +69,7 @@ class ResultViewController: UITableViewController { displayed result, and the result that has been most recently set on the `ResultViewController`. */ -// guard result != currentResult || currentResult == nil else { return } + guard result != currentResult || currentResult == nil else { return } // Update the currently displayed result. currentResult = result @@ -99,13 +97,12 @@ class ResultViewController: UITableViewController { let segueIdentifier = SegueIdentifier(rawValue: identifier), segueIdentifier == .showTaskResult { let cell = sender as! UITableViewCell - + let indexPath = tableView.indexPath(for: cell)! let destinationViewController = segue.destination as! ResultViewController let collectionResult = result as! ORKCollectionResult - destinationViewController.result = collectionResult.results![(indexPath as NSIndexPath).row] } } @@ -130,3 +127,4 @@ extension ResultViewController: ResultProviderDelegate { } } + diff --git a/samples/ORKCatalog/ORKCatalog/Supporting Files/Info.plist b/samples/ORKCatalog/ORKCatalog/Supporting Files/Info.plist index 904b6eedb9..d4c3c6d952 100644 --- a/samples/ORKCatalog/ORKCatalog/Supporting Files/Info.plist +++ b/samples/ORKCatalog/ORKCatalog/Supporting Files/Info.plist @@ -5,7 +5,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) + com.example.researchkit-samplecode.$(PRODUCT_NAME:rfc1034identifier) CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -13,11 +13,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - $(MARKETING_VERSION) + $(ORK_CATALOG_VERSION_NUMBER) CFBundleSignature ???? CFBundleVersion - $(CURRENT_PROJECT_VERSION) + $(ORK_CATALOG_BUILD_NUMBER) LSRequiresIPhoneOS NSBluetoothAlwaysUsageDescription diff --git a/samples/ORKCatalog/ORKCatalog/TaskListRowConstants.swift b/samples/ORKCatalog/ORKCatalog/TaskListRowConstants.swift new file mode 100644 index 0000000000..0a773d90bb --- /dev/null +++ b/samples/ORKCatalog/ORKCatalog/TaskListRowConstants.swift @@ -0,0 +1,372 @@ +/* + Copyright (c) 20202415, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +import Foundation + +/** + Every step and task in the ResearchKit framework has to have an identifier. + Within a task, the step identifiers should be unique. + + Here we use an enum to ensure that the identifiers are kept unique. Since + the enum has a raw underlying type of a `String`, the compiler can determine + the uniqueness of the case values at compile time. + + In a real application, the identifiers for your tasks and steps might + come from a database, or in a smaller application, might have some + human-readable meaning. +*/ +enum Identifier { + // Task with a form, where multiple items appear on one page. + case formTask + case groupedFormTask + case formStep + case formStep02 + case groupedFormStep + case formStepWithMultipleSelection + case formStepWithSingleSelection + case formItem01 + case formItem02 + case formItem03 + case formItem04 + case formItem05 + case formItem06 + + // Task with a form, with multiple don't know button + case dontknowSurveyTask + + case textChoiceFormItem + case textChoiceFormStep + case appleFormItemIdentifier + case imageChoiceItemSection + case imageChoiceItem + case freeTextSectionIdentifier + case freeTextItemIdentifier + case completionStep + + // Survey task specific identifiers. + case surveyTask + case introStep + case surveyTaskWithMultipleSelection + case questionStep + case questionStepWithOtherItems + case birthdayQuestion + case birthdayQuestionFormItem + case summaryStep + case consentTask + case consentDoc + + // Task with a Boolean question. + case booleanQuestionTask + case booleanQuestionStep + case booleanFormStep + case booleanFormItem + + // Task with an example of date entry. + case dateQuestionTask + case dateQuestionStep + case dateQuestionFormItem + case date3DayLimitQuestionTask + + // Task with an example of date and time entry. + case dateTimeQuestionTask + case dateTimeQuestionFormStep + case dateTimeQuestionFormItem + + // Task with an example of height entry. + case heightQuestionFormItem1 + case heightQuestionFormStep1 + case heightQuestionFormStep2 + case heightQuestionFormStep3 + case heightQuestionFormStep4 + case heightQuestionTask + + // Task with an example of weight entry. + case weightQuestionTask + case weightQuestionFormStep1 + case weightQuestionFormStep2 + case weightQuestionFormStep3 + case weightQuestionFormStep4 + case weightQuestionFormStep5 + case weightQuestionFormStep6 + case weightQuestionFormStep7 + + // Task with an example of age entry. + case ageQuestionTask + case ageQuestionFormStep + case ageQuestionFormStep2 + case ageQuestionFormStep3 + case ageQuestionFormStep4 + case ageQuestionFormItem + case ageQuestionFormItem2 + case ageQuestionFormItem3 + case ageQuestionFormItem4 + + // Task with an ORKHealthQuantity questions + case healthQuantityFormItem + case healthQuantityFormStep1 + case healthQuantityFormStep2 + case healthQuantityTask + + // Task with an image choice question. + case imageChoiceFormItem + case imageChoiceFormStep1 + case imageChoiceFormStep2 + case imageChoiceQuestionTask + + // Task with a location entry + case locationQuestionFormItem + case locationQuestionFormStep + case locationQuestionTask + + // Task with examples of numeric questions. + case numericDisplayUnitQuestionFormStep + case numericFormItem + case numericNoUnitQuestionFormStep + case numericQuestionFormStep + case numericQuestionTask + + // Task with examples of review Steps. + case reviewTask + case embeddedReviewStep + case standAloneReviewStep + + // Task with examples of questions with sliding scales. + case scaleQuestionTask + case scaleFormItem + case discreteScaleFormStep + case continuousScaleFormStep + case discreteVerticalScaleFormStep + case continuousVerticalScaleFormStep + case textScaleFormStep + case textVerticalScaleFormStep + + // Task with an example of free text entry. + case textQuestionFormItem + case textQuestionFormStep + case textQuestionStep + case textQuestionTask + + // Task with an example of a multiple choice question. + case textChoiceQuestionTask + case textChoiceQuestionStep + case textChoiceQuestionWithImageStep + case textChoiceQuestionWithImageTask + + // Task with an example of time of day entry. + case timeOfDayFormItem + case timeOfDayQuestionFormStep + case timeOfDayQuestionTask + + // Task with an example of time interval entry. + case timeIntervalFormItem + case timeIntervalFormStep + case timeIntervalQuestionTask + + // Task with a value picker. + case valuePickerChoiceFormItem + case valuePickerChoiceFormStep + case valuePickerChoiceQuestionTask + + // Task with an example of validated text entry. + case validatedTextFormItem + case validatedTextFormStepDomain + case validatedTextFormStepEmail + case validatedTextQuestionTask + + // Image capture task specific identifiers. + case imageCaptureTask + case imageCaptureStep + + // Video capture task specific identifiers. + case videoCaptureTask + case videoCaptureStep + + case frontFacingCameraStep + + // Task with an example of waiting. + case waitTask + case waitStepDeterminate + case waitStepIndeterminate + + case pdfViewerStep + case pdfViewerTask + + case requestPermissionsStep + + // Eligibility task specific indentifiers. + case eligibilityTask + case eligibilityIntroStep + case eligibilityFormStep + case eligibilityFormItem01 + case eligibilityFormItem02 + case eligibilityFormItem03 + case eligibilityIneligibleStep + case eligibilityEligibleStep + + // Consent task specific identifiers + case consentWelcomeInstructionStep + case informedConsentInstructionStep + + // Account creation task specific identifiers. + case accountCreationTask + case registrationStep + case waitStep + case verificationStep + + // Login task specific identifiers. + case loginTask + case loginStep + case loginWaitStep + + // Passcode task specific identifiers. + case passcodeTask + case passcodeStep + case biometricPasscodeTask + case biometricPasscodeStep + + // Active tasks. + case audioTask + case amslerGridTask + case tecumsehCubeTestTask + case sixMinuteWalkTask + case fitnessTask + case holePegTestTask + case psatTask + case reactionTime + case normalizedReactionTime + case shortWalkTask + case spatialSpanMemoryTask + case speechRecognitionTask + case speechInNoiseTask + case stroopTask + + case timedWalkWithTurnAroundTask + case toneAudiometryTask + case dBHLToneAudiometryTask + case splMeterTask + case splMeterStep + case towerOfHanoi + case tremorTestTask + case twoFingerTappingIntervalTask + case walkBackAndForthTask + case kneeRangeOfMotion + case shoulderRangeOfMotion + case trailMaking + + // Video instruction tasks. + case videoInstructionTask + case videoInstructionStep + + // Web view tasks. + case webViewTask + case webViewStep + + // 3DModelStep tasks. + case usdzModelStep + case usdzModelTask + + // ORKColorChoice tasks. + case colorChoiceQuestionTask + case colorChoiceQuestionStep + case colorChoiceQuestionStepSwatchOnly + case colorChoiceQuestionFormItem + + // Family History tasks. + case familyHistoryStep + case familyHistoryTask + +} + + +// `ORKTask` Reused Text Convenience + +enum TaskListRowStrings { + static var exampleDescription: String { + return NSLocalizedString("Your description goes here.", comment: "") + } + + static var exampleSpeechInstruction: String { + return NSLocalizedString("Your more specific voice instruction goes here. For example, say 'Aaaah'.", comment: "") + } + + static var exampleQuestionText: String { + return NSLocalizedString("Your question goes here.", comment: "") + } + + static var exampleHighValueText: String { + return NSLocalizedString("High Value", comment: "") + } + + static var exampleLowValueText: String { + return NSLocalizedString("Low Value", comment: "") + } + + static var exampleDetailText: String { + return NSLocalizedString("Additional text can go here.", comment: "") + } + + static var exampleEmailText: String { + return NSLocalizedString("jappleseed@example.com", comment: "") + } + + static var exampleTapHereText: String { + return NSLocalizedString("Tap here", comment: "") + } + + static var exampleDate3DayLimitQuestionTask: String { + return NSLocalizedString("This date picker is restricted to 3 days before or after the current date.", comment: "") + } + + static var exampleHeartRateQuestion: String { + return NSLocalizedString("What is your Heart Rate?", comment: "") + } + + static var exampleBloodTypeQuestion: String { + return NSLocalizedString("What is your Blood Type?", comment: "") + } + + static var loremIpsumText: String { + return "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + } + + static var loremIpsumShortText: String { + return "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + } + + static var loremIpsumMediumText: String { + return "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo?" + } + + static var loremIpsumLongText: String { + return "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo? An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo?" + } + + +} diff --git a/samples/ORKCatalog/ORKCatalog/TaskListRowSteps.swift b/samples/ORKCatalog/ORKCatalog/TaskListRowSteps.swift new file mode 100644 index 0000000000..70523dba95 --- /dev/null +++ b/samples/ORKCatalog/ORKCatalog/TaskListRowSteps.swift @@ -0,0 +1,1044 @@ +/* + Copyright (c) 20202415, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. No license is granted to the trademarks of + the copyright holders even if such marks are included in this software. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +import ResearchKitActiveTask + + +enum TaskListRowSteps { + + // MARK: - ORKFormStep Examples + + static var birthdayExample: ORKFormStep { + let birthDayQuestionAnswerFormat = ORKAnswerFormat.dateAnswerFormat(withDefaultDate: nil, minimumDate: nil, maximumDate: Date(), calendar: nil) + let birthdayQuestion = NSLocalizedString("When is your birthday?", comment: "") + + let birthDayQuestionSectionHeader = ORKFormItem(sectionTitle: birthdayQuestion) + let birthdayQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.birthdayQuestionFormItem), text: nil, answerFormat: birthDayQuestionAnswerFormat) + birthdayQuestionFormItem.placeholder = "Select Date" + let birthdayQuestionFormStep = ORKFormStep(identifier: String(describing: Identifier.birthdayQuestion), title: "Questionnaire", text: TaskListRowStrings.exampleDetailText) + birthdayQuestionFormStep.formItems = [birthDayQuestionSectionHeader, birthdayQuestionFormItem] + + return birthdayQuestionFormStep + } + + static var booleanExample: ORKFormStep { + let booleanQuestionAnswerFormat = ORKBooleanAnswerFormat() + let question1 = NSLocalizedString("Would you like to subscribe to our newsletter?", comment: "") + + let booleanQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.booleanFormItem), text: question1, answerFormat: booleanQuestionAnswerFormat) + booleanQuestionFormItem.learnMoreItem = self.learnMoreItemExample + + let booleanQuestionFormStep = ORKFormStep(identifier: String(describing: Identifier.booleanFormStep), title: "Questionnaire", text: TaskListRowStrings.exampleDetailText) + booleanQuestionFormStep.formItems = [booleanQuestionFormItem] + + return booleanQuestionFormStep + } + + static var booleanGenericExample: ORKFormStep { + let booleanQuestionAnswerFormat = ORKBooleanAnswerFormat() + + let booleanQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.booleanFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: booleanQuestionAnswerFormat) + booleanQuestionFormItem.learnMoreItem = self.learnMoreItemExample + + let booleanQuestionFormStep = ORKFormStep(identifier: String(describing: Identifier.booleanFormStep), title: NSLocalizedString("Boolean", comment: ""), text: TaskListRowStrings.exampleDetailText) + booleanQuestionFormStep.formItems = [booleanQuestionFormItem] + + return booleanQuestionFormStep + } + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + static var bloodTypeExample: ORKFormStep { + let bloodType = HKCharacteristicType.characteristicType(forIdentifier: HKCharacteristicTypeIdentifier.bloodType)! + let bloodTypeAnswerFormat = ORKHealthKitCharacteristicTypeAnswerFormat(characteristicType: bloodType) + + let formItemSectionHeader = ORKFormItem(sectionTitle: String(describing: TaskListRowStrings.exampleBloodTypeQuestion)) + let bloodTypeFormItem = ORKFormItem(identifier: String(describing: Identifier.healthQuantityFormItem), + text: nil, + answerFormat: bloodTypeAnswerFormat) + bloodTypeFormItem.placeholder = String(describing: TaskListRowStrings.exampleTapHereText) + + let bloodTypeFormStep = ORKFormStep(identifier: String(describing: Identifier.healthQuantityFormStep2), + title: NSLocalizedString("Blood Type", comment: ""), + text: TaskListRowStrings.exampleDetailText) + bloodTypeFormStep.formItems = [formItemSectionHeader, bloodTypeFormItem] + + return bloodTypeFormStep + } +#endif + + static var continuousScaleWithPercentExample: ORKFormStep { + // The second step is a scale control that allows continuous movement with a percent formatter. + let scaleAnswerFormat = ORKAnswerFormat.continuousScale(withMaximumValue: 1.0, + minimumValue: 0.0, + defaultValue: 99.0, + maximumFractionDigits: 0, + vertical: false, + maximumValueDescription: nil, + minimumValueDescription: nil) + scaleAnswerFormat.numberStyle = .percent + + let scaleFormItem = ORKFormItem(identifier: String(describing: Identifier.scaleFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: scaleAnswerFormat) + let scaleFormStep = ORKFormStep(identifier: String(describing: Identifier.continuousScaleFormStep), title: NSLocalizedString("Scale", comment: ""), text: NSLocalizedString("Continuous Scale", comment: "")) + scaleFormStep.formItems = [scaleFormItem] + + return scaleFormStep + } + + static var continuousVerticalScaleExample: ORKFormStep { + // The fourth step is a vertical scale control that allows continuous movement. + let scaleAnswerFormat = ORKAnswerFormat.continuousScale(withMaximumValue: 5.0, + minimumValue: 1.0, + defaultValue: 99.0, + maximumFractionDigits: 2, + vertical: true, + maximumValueDescription: TaskListRowStrings.exampleHighValueText, + minimumValueDescription: TaskListRowStrings.exampleLowValueText) + + let scaleFormItem = ORKFormItem(identifier: String(describing: Identifier.scaleFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: scaleAnswerFormat) + let scaleFormStep = ORKFormStep(identifier: String(describing: Identifier.continuousVerticalScaleFormStep), title: NSLocalizedString("Scale", comment: ""), text: NSLocalizedString("Continuous Vertical Scale", comment: "")) + scaleFormStep.formItems = [scaleFormItem] + + return scaleFormStep + } + + static var decimalExample: ORKFormStep { + let localizedQuestionStep1AnswerFormatUnit = NSLocalizedString("Your unit", comment: "") + let decimalAnswerFormat = ORKAnswerFormat.decimalAnswerFormat(withUnit: localizedQuestionStep1AnswerFormatUnit) + + let sectionHeaderFormItem = ORKFormItem(sectionTitle: TaskListRowStrings.exampleQuestionText) + let decimalFormItem = ORKFormItem(identifier: String(describing: Identifier.numericFormItem), + text: nil, + answerFormat: decimalAnswerFormat) + decimalFormItem.placeholder = "Enter value" + + let decimalFormStep = ORKFormStep(identifier: String(describing: Identifier.numericQuestionFormStep), + title: NSLocalizedString("Numeric", comment: ""), + text: TaskListRowStrings.exampleDetailText) + decimalFormStep.formItems = [sectionHeaderFormItem, decimalFormItem] + + return decimalFormStep + } + + static var decimalNoUnitExample: ORKFormStep { + let decimalAnswerFormat = ORKAnswerFormat.decimalAnswerFormat(withUnit: nil) + + let sectionHeaderFormItem = ORKFormItem(sectionTitle: TaskListRowStrings.exampleQuestionText) + let decimalFormItem = ORKFormItem(identifier: String(describing: Identifier.numericFormItem), + text: nil, + answerFormat: decimalAnswerFormat) + decimalFormItem.placeholder = "Enter value" + + let decimalFormStep = ORKFormStep(identifier: String(describing: Identifier.numericNoUnitQuestionFormStep), + title:NSLocalizedString("Numeric", comment: ""), + text: TaskListRowStrings.exampleDetailText) + decimalFormStep.formItems = [sectionHeaderFormItem, decimalFormItem] + + return decimalFormStep + } + + static var decimalWithDisplayUnitExample: ORKFormStep { + let decimalAnswerFormat = ORKNumericAnswerFormat(style: .decimal, + unit: "weeks", + displayUnit: "semanas", + minimum: nil, + maximum: nil, + maximumFractionDigits: 1) + + let sectionHeaderFormItem = ORKFormItem(sectionTitle: TaskListRowStrings.exampleQuestionText) + let decimalFormItem = ORKFormItem(identifier: String(describing: Identifier.numericFormItem), + text: nil, + answerFormat: decimalAnswerFormat) + decimalFormItem.placeholder = "Enter value" + + let decimalFormStep = ORKFormStep(identifier: String(describing: Identifier.numericDisplayUnitQuestionFormStep), + title: NSLocalizedString("Numeric with Display Unit", comment: ""), + text: TaskListRowStrings.exampleDetailText) + decimalFormStep.formItems = [sectionHeaderFormItem, decimalFormItem] + + return decimalFormStep + } + + static var emailExample: ORKFormStep { + let emailDomainRegularExpressionPattern = "^[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$" + let emailDomainRegularExpression = try? NSRegularExpression(pattern: emailDomainRegularExpressionPattern) + let emailAnswerFormatDomain = ORKAnswerFormat.textAnswerFormat(withValidationRegularExpression: emailDomainRegularExpression!, invalidMessage: "Invalid Email: %@") + + let sectionHeaderFormItem = ORKFormItem(sectionTitle: NSLocalizedString("Email", comment: "")) + let emailFormItem = ORKFormItem(identifier: String(describing: Identifier.validatedTextFormItem), text: nil, answerFormat: emailAnswerFormatDomain) + emailFormItem.placeholder = "Enter email" + + let emailFormStep = ORKFormStep(identifier: String(describing: Identifier.validatedTextFormStepEmail), title: NSLocalizedString("Validated Text", comment: ""), text: TaskListRowStrings.exampleDetailText) + emailFormStep.formItems = [sectionHeaderFormItem, emailFormItem] + + return emailFormStep + } + + static var groupFormExample: ORKFormStep { + let step = ORKFormStep(identifier: String(describing: Identifier.groupedFormStep), + title: NSLocalizedString("Form Step", comment: ""), + text: TaskListRowStrings.exampleDetailText) + + //Start of first section + let learnMoreInstructionStep01 = ORKLearnMoreInstructionStep(identifier: "LearnMoreInstructionStep01") + learnMoreInstructionStep01.title = NSLocalizedString("Learn more title", comment: "") + learnMoreInstructionStep01.text = NSLocalizedString("Learn more text", comment: "") + let learnMoreItem01 = ORKLearnMoreItem(text: nil, learnMoreInstructionStep: learnMoreInstructionStep01) + let section01 = ORKFormItem(sectionTitle: NSLocalizedString("Section title", comment: ""), detailText: NSLocalizedString("Section detail text", comment: ""), learnMoreItem: learnMoreItem01, showsProgress: true) + + // A first field, for entering an integer. + let formItem01Text = NSLocalizedString("Field01", comment: "") + let formItem01 = ORKFormItem(identifier: String(describing: Identifier.formItem01), text: formItem01Text, answerFormat: ORKAnswerFormat.integerAnswerFormat(withUnit: nil)) + formItem01.placeholder = NSLocalizedString("Your placeholder here", comment: "") + + // A second field, for entering a time interval. + let formItem02Text = NSLocalizedString("Field02", comment: "") + let formItem02 = ORKFormItem(identifier: String(describing: Identifier.formItem02), text: formItem02Text, answerFormat: ORKTimeIntervalAnswerFormat()) + formItem02.placeholder = NSLocalizedString("Your placeholder here", comment: "") + + let textOnlySection = ORKFormItem(sectionTitle: NSLocalizedString("Text Only Section", comment: ""), detailText: NSLocalizedString("Text section text", comment: ""), learnMoreItem: learnMoreItem01, showsProgress: true) + let textOnlyFormItemA = ORKFormItem(identifier: "text-section-text-item-a", text: "Text Field A", answerFormat: ORKTextAnswerFormat()) + let textOnlyFormItemB = ORKFormItem(identifier: "text-section-text-item-b", text: "Text Field B", answerFormat: ORKTimeIntervalAnswerFormat()) + + let sesAnswerFormat = ORKSESAnswerFormat(topRungText: "Best Off", bottomRungText: "Worst Off") + let sesFormItem = ORKFormItem(identifier: "sesIdentifier", text: "Select where you are on the socioeconomic ladder.", answerFormat: sesAnswerFormat) + + //Start of section for scale question + let formItem03Text = TaskListRowStrings.exampleQuestionText + let scaleAnswerFormat = ORKContinuousScaleAnswerFormat(maximumValue: 10, minimumValue: 0, defaultValue: 0.0, maximumFractionDigits: 1) + let formItem03 = ORKFormItem(identifier: String(describing: Identifier.formItem03), text: formItem03Text, detailText: nil, learnMoreItem: nil, showsProgress: true, answerFormat: scaleAnswerFormat, tagText: nil, optional: true) + + step.formItems = [ + section01, + formItem01, + formItem02, + textOnlySection, + textOnlyFormItemA, + textOnlyFormItemB, + formItem03, + sesFormItem + ] + + return step + } + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + static var heartRateExample: ORKFormStep { + let heartRateType = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRate)! + let heartRateAnswerFormat = ORKHealthKitQuantityTypeAnswerFormat(quantityType: heartRateType, + unit: nil, + style: .decimal) + + let formItemSectionHeader = ORKFormItem(sectionTitle: String(describing: TaskListRowStrings.exampleHeartRateQuestion)) + let heartRateFormItem = ORKFormItem(identifier: String(describing: Identifier.healthQuantityFormItem), + text: nil, + answerFormat:heartRateAnswerFormat) + + let heartRateFormStep = ORKFormStep(identifier: String(describing: Identifier.healthQuantityFormStep1), + title: NSLocalizedString("Heart Rate", comment: ""), + text: TaskListRowStrings.exampleDetailText) + heartRateFormStep.formItems = [formItemSectionHeader, heartRateFormItem] + + return heartRateFormStep + } +#endif + + static var heightExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.heightQuestionFormStep1) + let heightAnswerFormat = ORKAnswerFormat.heightAnswerFormat() + let title = NSLocalizedString("Height", comment: "") + let stepText = NSLocalizedString("Local system", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:heightAnswerFormat, title:title, text:stepText) + + return formStep + } + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + static var heightHealthKitExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.heightQuestionFormStep4) + let heightAnswerFormat = ORKHealthKitQuantityTypeAnswerFormat(quantityType: HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.height)!, unit: HKUnit.meterUnit(with: .centi), style: .decimal) + let title = NSLocalizedString("Height", comment: "") + let stepText = NSLocalizedString("HealthKit, height", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:heightAnswerFormat, title:title, text:stepText) + + return formStep + } +#endif + + static var heightMetricSystemExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.heightQuestionFormStep2) + let heightAnswerFormat = ORKAnswerFormat.heightAnswerFormat(with: .metric) + let title = NSLocalizedString("Height", comment: "") + let stepText = NSLocalizedString("Metric system", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:heightAnswerFormat, title:title, text:stepText) + + return formStep + } + + static var heightUSCSystemExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.heightQuestionFormStep3) + let heightAnswerFormat = ORKAnswerFormat.heightAnswerFormat(with: .USC) + let title = NSLocalizedString("Height", comment: "") + let stepText = NSLocalizedString("USC system", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:heightAnswerFormat, title:title, text:stepText) + + return formStep + } + + static var imageChoiceExample: ORKFormStep { + let imageChoices = self.imageChoicesExample + let imageChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: imageChoices) + + let imageChoiceFormItem = ORKFormItem(identifier: String(describing: Identifier.imageChoiceFormItem), + text: TaskListRowStrings.exampleQuestionText, + answerFormat: imageChoiceAnswerFormat) + + let imageChoiceFormStep = ORKFormStep(identifier: String(describing: Identifier.imageChoiceFormStep1), + title: NSLocalizedString("Image Choice", comment: ""), + text: TaskListRowStrings.exampleDetailText) + imageChoiceFormStep.formItems = [imageChoiceFormItem] + + return imageChoiceFormStep + } + + static var imageChoiceVerticalExample: ORKFormStep { + let imageChoices = self.imageChoicesExample + let imageChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: imageChoices, style: .multipleChoice, vertical: true) + + let imageChoiceFormItem = ORKFormItem(identifier: String(describing: Identifier.imageChoiceFormItem), + text: TaskListRowStrings.exampleQuestionText, + answerFormat: imageChoiceAnswerFormat) + + let imageChoiceFormStep = ORKFormStep(identifier: String(describing: Identifier.imageChoiceFormStep2), + title: NSLocalizedString("Image Choice", comment: ""), + text: TaskListRowStrings.exampleDetailText) + imageChoiceFormStep.formItems = [imageChoiceFormItem] + + return imageChoiceFormStep + } + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + static var locationExample: ORKFormStep { + let locationAnswerFormat = ORKLocationAnswerFormat() + let locationFormItem = ORKFormItem(identifier: String(describing: Identifier.locationQuestionFormItem), + text: TaskListRowStrings.exampleQuestionText, + answerFormat: locationAnswerFormat) + + let locationFormStep = ORKFormStep(identifier: String(describing: Identifier.locationQuestionFormStep), + title: NSLocalizedString("Location", comment: ""), + text: TaskListRowStrings.exampleDetailText) + locationFormStep.formItems = [locationFormItem] + + return locationFormStep + } +#endif + + static var textAnswerExample: ORKFormStep { + let textAnswerFormat = ORKTextAnswerFormat() + + let sectionHeaderFormItem = ORKFormItem(sectionTitle: "What is your name?") + let textAnswerFormItem = ORKFormItem(identifier: String(describing: Identifier.textQuestionFormItem), + text: "What is your name?", + answerFormat: textAnswerFormat) + + let textAnswerFormStep = ORKFormStep(identifier: String(describing: Identifier.textQuestionFormStep), + title: TaskListRowStrings.exampleQuestionText, + text: TaskListRowStrings.exampleDetailText) + textAnswerFormStep.formItems = [sectionHeaderFormItem, textAnswerFormItem] + + return textAnswerFormStep + } + + static var textChoiceExample: ORKFormStep { + let textChoices: [ORKTextChoice] = [ + ORKTextChoice(text: "choice 1", detailText: "detail 1", value: 1 as NSNumber, exclusive: false), + ORKTextChoice(text: "choice 2", detailText: "detail 2", value: 2 as NSNumber, exclusive: false), + ORKTextChoice(text: "choice 3", detailText: "detail 3", value: 3 as NSNumber, exclusive: false), + ORKTextChoice(text: "choice 4", detailText: "detail 4", value: 4 as NSNumber, exclusive: false), + ORKTextChoice(text: "choice 5", detailText: "detail 5", value: 5 as NSNumber, exclusive: false), + ORKTextChoice(text: "choice 6", detailText: "detail 6", value: 6 as NSNumber, exclusive: false), + ORKTextChoiceOther.choice(withText: "choice 7", detailText: "detail 7", value: "choice 7" as NSString, exclusive: true, textViewPlaceholderText: "enter additional information") + ] + + let textChoiceQuestion = NSLocalizedString("Select an option below.", comment: "") + let textChoiceAnswerFormat = ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: textChoices) + + let textChoiceFormItem = ORKFormItem(identifier: String(describing: Identifier.textChoiceFormItem), text: textChoiceQuestion, answerFormat: textChoiceAnswerFormat) + textChoiceFormItem.learnMoreItem = self.learnMoreItemExample + let textChoiceFormStep = ORKFormStep(identifier: String(describing: Identifier.textChoiceFormStep), title: "Questionnaire", text: TaskListRowStrings.exampleDetailText) + textChoiceFormStep.formItems = [textChoiceFormItem] + + return textChoiceFormStep + } + + static var textChoiceImagesExample: ORKFormStep { + let textChoiceOneText = NSLocalizedString("Choice 1", comment: "") + let textChoiceTwoText = NSLocalizedString("Choice 2", comment: "") + let textChoiceThreeText = NSLocalizedString("Choice 3", comment: "") + + // The text to display can be separate from the value coded for each choice: + let textChoices = [ + ORKTextChoice(text: textChoiceOneText, image: UIImage(named: "Face")!, value: "tap 1" as NSString), + ORKTextChoice(text: textChoiceTwoText, image: UIImage(named: "Face")!, value: "tap 2" as NSString), + ORKTextChoice(text: textChoiceThreeText, image: UIImage(named: "Face")!, value: "tap 3" as NSString) + ] + + let textChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: textChoices) + + let textChoiceQuestion = NSLocalizedString("Select an option below.", comment: "") + let textChoiceFormItem = ORKFormItem(identifier: String(describing: Identifier.textChoiceFormItem), text: textChoiceQuestion, answerFormat: textChoiceAnswerFormat) + + let textChoiceFormStep = ORKFormStep(identifier: String(describing: Identifier.textChoiceFormStep), title: NSLocalizedString("Text Choice", comment: ""), text: TaskListRowStrings.exampleDetailText) + textChoiceFormStep.formItems = [textChoiceFormItem] + + return textChoiceFormStep + } + + static var textMultiLineAnswerExample: ORKFormStep { + let textAnswerFormat = ORKTextAnswerFormat() + textAnswerFormat.multipleLines = true + textAnswerFormat.maximumLength = 280 + + let textAnswerFormItem = ORKFormItem(identifier: String(describing: Identifier.textQuestionFormItem), + text: "What is your name?", + answerFormat: textAnswerFormat) + + let textAnswerFormStep = ORKFormStep(identifier: String(describing: Identifier.textQuestionFormStep), + title: NSLocalizedString("Text", comment: ""), + text: TaskListRowStrings.exampleDetailText) + textAnswerFormStep.formItems = [textAnswerFormItem] + + return textAnswerFormStep + } + + static var timeIntervalExample: ORKFormStep { + /* + The time interval answer format is constrained to entering a time + less than 24 hours and in steps of minutes. For times that don't fit + these restrictions, use another mode of data entry. + */ + let timeIntervalAnswerFormat = ORKAnswerFormat.timeIntervalAnswerFormat() + + let formItemSectionHeader = self.formItemSectionHeaderExample + let timeIntervalFormItem = ORKFormItem(identifier: String(describing: Identifier.timeIntervalFormItem), text: nil, answerFormat: timeIntervalAnswerFormat) + timeIntervalFormItem.placeholder = "Select interval" + + let timeIntervalFormStep = ORKFormStep(identifier: String(describing: Identifier.timeIntervalFormStep), title: NSLocalizedString("Time Interval", comment: ""), text: TaskListRowStrings.exampleDetailText) + timeIntervalFormStep.formItems = [formItemSectionHeader, timeIntervalFormItem] + + return timeIntervalFormStep + } + + static var timeOfDayExample: ORKFormStep { + /* + Because we don't specify a default, the picker will default to the + time the step is presented. For questions like "What time do you have + breakfast?", it would make sense to set the default on the answer + format. + */ + let timeOfDayAnswerFormat = ORKAnswerFormat.timeOfDayAnswerFormat() + + let formItemSectionHeader = self.formItemSectionHeaderExample + let timeOfDayFormItem = ORKFormItem(identifier: String(describing: Identifier.timeOfDayFormItem), text: nil, answerFormat: timeOfDayAnswerFormat) + timeOfDayFormItem.placeholder = "Select time of day" + + let timeIntervalFormStep = ORKFormStep(identifier: String(describing: Identifier.timeOfDayQuestionFormStep), title: NSLocalizedString("Time", comment: ""), text: TaskListRowStrings.exampleDetailText) + timeIntervalFormStep.formItems = [formItemSectionHeader, timeOfDayFormItem] + + return timeIntervalFormStep + } + + static var scaleExample: ORKFormStep { + // The first step is a scale control with 10 discrete ticks. + let scaleAnswerFormat = ORKAnswerFormat.scale(withMaximumValue: 10, + minimumValue: 1, + defaultValue: NSIntegerMax, + step: 1, + vertical: false, + maximumValueDescription: TaskListRowStrings.exampleHighValueText, + minimumValueDescription: TaskListRowStrings.exampleLowValueText) + + let scaleFormItem = ORKFormItem(identifier: String(describing: Identifier.scaleFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: scaleAnswerFormat) + let scaleFormStep = ORKFormStep(identifier: String(describing: Identifier.discreteScaleFormStep), title: NSLocalizedString("Scale", comment: ""), text: NSLocalizedString("Discrete Scale", comment: "")) + scaleFormStep.formItems = [scaleFormItem] + + return scaleFormStep + } + + static var scaleWithTextChoicesExample: ORKFormStep { + // The fifth step is a scale control that allows text choices. + let textChoices = self.textChoicesExample + let scaleAnswerFormat = ORKAnswerFormat.textScale(with: textChoices, defaultIndex: NSIntegerMax, vertical: false) + + let scaleFormItem = ORKFormItem(identifier: String(describing: Identifier.scaleFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: scaleAnswerFormat) + let scaleFormStep = ORKFormStep(identifier: String(describing: Identifier.textScaleFormStep), title: NSLocalizedString("Scale", comment: ""), text: NSLocalizedString("Text Scale", comment: "")) + scaleFormStep.formItems = [scaleFormItem] + + return scaleFormStep + } + + static var validatedTextExample: ORKFormStep { + let urlDomainRegularExpressionPattern = "^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$" + let urlDomainRegularExpression = try? NSRegularExpression(pattern: urlDomainRegularExpressionPattern) + + let textAnswerFormat = ORKAnswerFormat.textAnswerFormat(withValidationRegularExpression: urlDomainRegularExpression!, invalidMessage: "Invalid URL: %@") + textAnswerFormat.multipleLines = false + textAnswerFormat.keyboardType = .URL + textAnswerFormat.autocapitalizationType = UITextAutocapitalizationType.none + textAnswerFormat.autocorrectionType = UITextAutocorrectionType.no + textAnswerFormat.spellCheckingType = UITextSpellCheckingType.no + textAnswerFormat.textContentType = UITextContentType.URL + + let sectionHeaderFormItem = ORKFormItem(sectionTitle: NSLocalizedString("URL", comment: "")) + let validatedTextFormItem = ORKFormItem(identifier: String(describing: Identifier.validatedTextFormItem), text: nil, answerFormat:textAnswerFormat) + validatedTextFormItem.placeholder = "enter URL" + + let validatedTextFormStep = ORKFormStep(identifier: String(describing: Identifier.validatedTextFormStepDomain), title: NSLocalizedString("Validated Text", comment: ""), text: TaskListRowStrings.exampleDetailText) + validatedTextFormStep.formItems = [sectionHeaderFormItem, validatedTextFormItem] + + return validatedTextFormStep + } + + static var valuePickerChoicesExample: ORKFormStep { + let textChoices = self.textChoicesExample + let valuePickerAnswerFormat = ORKAnswerFormat.valuePickerAnswerFormat(with: textChoices) + + let sectionHeaderFormItem = self.formItemSectionHeaderExample + let valuePickerFormItem = ORKFormItem(identifier: String(describing: Identifier.valuePickerChoiceFormItem), text: nil, answerFormat: valuePickerAnswerFormat) + valuePickerFormItem.placeholder = "Select value" + + let valuePickerFormStep = ORKFormStep(identifier: String(describing: Identifier.valuePickerChoiceFormStep), title: NSLocalizedString("Value Picker", comment: ""), text: TaskListRowStrings.exampleDetailText) + valuePickerFormStep.formItems = [sectionHeaderFormItem, valuePickerFormItem] + + return valuePickerFormStep + } + + static var verticalScaleWithPercentExample: ORKFormStep { + // The third step is a vertical scale control with 10 discrete ticks. + let scaleAnswerFormat = ORKAnswerFormat.scale(withMaximumValue: 10, + minimumValue: 1, + defaultValue: NSIntegerMax, + step: 1, + vertical: true, + maximumValueDescription: nil, + minimumValueDescription: nil) + + let scaleFormItem = ORKFormItem(identifier: String(describing: Identifier.scaleFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: scaleAnswerFormat) + let scaleFormStep = ORKFormStep(identifier: String(describing: Identifier.discreteVerticalScaleFormStep), title: NSLocalizedString("Scale", comment: ""), text: NSLocalizedString("Discrete Vertical Scale", comment: "")) + scaleFormStep.formItems = [scaleFormItem] + + return scaleFormStep + } + + static var verticalScaleWithTextChoicesExample: ORKFormStep { + // The sixth step is a vertical scale control that allows text choices. + let textChoices = self.textChoicesExample + let scaleAnswerFormat = ORKAnswerFormat.textScale(with: textChoices, defaultIndex: NSIntegerMax, vertical: true) + + let scaleFormItem = ORKFormItem(identifier: String(describing: Identifier.scaleFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: scaleAnswerFormat) + let scaleFormStep = ORKFormStep(identifier: String(describing: Identifier.textVerticalScaleFormStep), title: NSLocalizedString("Scale", comment: ""), text: NSLocalizedString("Text Vertical Scale", comment: "")) + scaleFormStep.formItems = [scaleFormItem] + + return scaleFormStep + } + + static var weightExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.weightQuestionFormStep1) + let weightAnswerFormat = ORKAnswerFormat.weightAnswerFormat() + let title = NSLocalizedString("Weight", comment: "") + let stepText = NSLocalizedString("Local system, default precision", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:weightAnswerFormat, title:title, text:stepText) + + return formStep + } + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + static var weightHealthKitBodyMassExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.weightQuestionFormStep7) + let weightAnswerFormat = ORKHealthKitQuantityTypeAnswerFormat(quantityType: HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)!, unit: HKUnit.gramUnit(with: .kilo), style: .decimal) + let title = NSLocalizedString("Weight", comment: "") + let stepText = NSLocalizedString("HealthKit, body mass", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:weightAnswerFormat, title:title, text:stepText) + + return formStep + } +#endif + + static var weightMetricSystemExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.weightQuestionFormStep2) + let weightAnswerFormat = ORKAnswerFormat.weightAnswerFormat(with: .metric) + let title = NSLocalizedString("Weight", comment: "") + let stepText = NSLocalizedString("Metric system, default precision", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:weightAnswerFormat, title:title, text:stepText) + + return formStep + } + + static var weightMetricSystemHighPrecisionExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.weightQuestionFormStep4) + let weightAnswerFormat = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.metric, numericPrecision: ORKNumericPrecision.high, minimumValue: ORKDoubleDefaultValue, maximumValue: ORKDoubleDefaultValue, defaultValue: ORKDoubleDefaultValue) + let title = NSLocalizedString("Weight", comment: "") + let stepText = NSLocalizedString("Metric system, high precision", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:weightAnswerFormat, title:title, text:stepText) + + return formStep + } + + static var weightMetricSystemLowPrecisionExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.weightQuestionFormStep3) + let weightAnswerFormat = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.metric, numericPrecision: ORKNumericPrecision.low, minimumValue: ORKDoubleDefaultValue, maximumValue: ORKDoubleDefaultValue, defaultValue: ORKDoubleDefaultValue) + let title = NSLocalizedString("Weight", comment: "") + let stepText = NSLocalizedString("Metric system, low precision", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:weightAnswerFormat, title:title, text:stepText) + + return formStep + } + + static var weightUSCSystemExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.weightQuestionFormStep5) + let weightAnswerFormat = ORKAnswerFormat.weightAnswerFormat(with: .USC) + let title = NSLocalizedString("Weight", comment: "") + let stepText = NSLocalizedString("USC system, default precision", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:weightAnswerFormat, title:title, text:stepText) + + return formStep + } + + static var weightUSCSystemHighPrecisionExample: ORKFormStep { + let stepIdentifier = String(describing: Identifier.weightQuestionFormStep6) + let weightAnswerFormat = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.USC, numericPrecision: ORKNumericPrecision.high, minimumValue: ORKDoubleDefaultValue, maximumValue: ORKDoubleDefaultValue, defaultValue: ORKDoubleDefaultValue) + let title = NSLocalizedString("Weight", comment: "") + let stepText = NSLocalizedString("USC system, high precision", comment: "") + + let formStep = self.heightWeightFormStepExample(identifier:stepIdentifier, answerFormat:weightAnswerFormat, title:title, text:stepText) + + return formStep + } + + // MARK: - Steps for consent + + static var consentWelcomeStepExample: ORKInstructionStep { + let instructionStep = ORKInstructionStep(identifier: String(describing: Identifier.consentWelcomeInstructionStep)) + instructionStep.iconImage = UIImage(systemName: "hand.wave") + instructionStep.title = "Welcome!" + instructionStep.detailText = "Thank you for joining our study. Tap Next to learn more before signing up." + + return instructionStep + } + + static var informedConsentStepExample: ORKInstructionStep { + let instructionStep = ORKInstructionStep(identifier: String(describing: Identifier.informedConsentInstructionStep)) + instructionStep.iconImage = UIImage(systemName: "doc.text.magnifyingglass") + instructionStep.title = "Before You Join" + + let sharingHealthDataBodyItem = ORKBodyItem(text: "The study will ask you to share some of your Health data.", + detailText: nil, + image: UIImage(systemName: "heart.fill"), + learnMoreItem: nil, + bodyItemStyle: .image, + useCardStyle: false, + alignImageToTop: true) + + let completingTasksBodyItem = ORKBodyItem(text: "You will be asked to complete various tasks over the duration of the study.", + detailText: nil, + image: UIImage(systemName: "checkmark.circle.fill"), + learnMoreItem: nil, + bodyItemStyle: .image, + useCardStyle: false, + alignImageToTop: true) + + let signatureBodyItem = ORKBodyItem(text: "Before joining, we will ask you to sign an informed consent document.", + detailText: nil, + image: UIImage(systemName: "signature"), + learnMoreItem: nil, + bodyItemStyle: .image, + useCardStyle: false, + alignImageToTop: true) + + let secureDataBodyItem = ORKBodyItem(text: "Your data is kept private and secure.", + detailText: nil, + image: UIImage(systemName: "lock.fill"), + learnMoreItem: nil, + bodyItemStyle: .image, + useCardStyle: false, + alignImageToTop: true) + + instructionStep.bodyItems = [ + sharingHealthDataBodyItem, + completingTasksBodyItem, + signatureBodyItem, + secureDataBodyItem + ] + + return instructionStep + } + + static var informedConsentSharingStepExample: ORKFormStep { + // Construct the text choices. + let textChoices: [ORKTextChoice] = [ORKTextChoice(text: "Institution and qualified researchers worldwide", value: 1 as NSNumber), + ORKTextChoice(text: "Only institution and its partners", value: 2 as NSNumber)] + let textChoiceAnswerFormat = ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: textChoices) + + // Construct the form item for text choices. + let textChoiceFormItem = ORKFormItem(identifier: "TextChoiceFormItem", text: "Who would you like to share your data with?", answerFormat: textChoiceAnswerFormat) + + // Construct the form step. + let formStepText = "Institution and its partners will receive your study data from your participation in this study.\n \nSharing your coded study data more broadly (without information such as your name) may benefit this and future research." + + let formStep = ORKFormStep(identifier: "ConsentSharingFormStepIdentifier", title: "Sharing Options", text: formStepText) + formStep.formItems = [textChoiceFormItem] + + return formStep + } + + static var webViewStepExample: ORKWebViewStep { + let instructionSteps = [ + TaskListRowSteps.consentWelcomeStepExample, + TaskListRowSteps.informedConsentStepExample + ] + + let webViewStep = ORKWebViewStep(identifier: String(describing: Identifier.webViewStep), instructionSteps: instructionSteps) + webViewStep.showSignatureAfterContent = true + return webViewStep + } + + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + static var requestPermissionsStepExample: ORKRequestPermissionsStep { + let healthKitTypesToWrite: Set = [ + HKObjectType.quantityType(forIdentifier: .bodyMassIndex)!, + HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)!, + HKObjectType.workoutType()] + + let healthKitTypesToRead: Set = [ + HKObjectType.characteristicType(forIdentifier: .dateOfBirth)!, + HKObjectType.characteristicType(forIdentifier: .bloodType)!, + HKObjectType.workoutType()] + + let healthKitPermissionType = ORKHealthKitPermissionType(sampleTypesToWrite: healthKitTypesToWrite, objectTypesToRead: healthKitTypesToRead) + + let requestPermissionsStep = ORKRequestPermissionsStep(identifier: String(describing: Identifier.requestPermissionsStep), permissionTypes: [healthKitPermissionType]) + requestPermissionsStep.title = "Health Data Request" + requestPermissionsStep.text = "Please review the health data types below and enable sharing to contribute to the study." + + return requestPermissionsStep + } +#endif + + static var consentCompletionStepExample: ORKCompletionStep { + let completionStep = ORKCompletionStep(identifier: "completionId") + completionStep.title = "Enrollment Complete" + completionStep.text = "Thank you for enrolling in this study. Your participation will contribute to meaningful research!" + return completionStep + } + + // MARK: - ORKReviewStep + + static var embeddedReviewStepExample: ORKReviewStep { + let embeddedReviewStep = ORKReviewStep.embeddedReviewStep(withIdentifier: String(describing: Identifier.embeddedReviewStep)) + embeddedReviewStep.bodyItems = [ + ORKBodyItem(text: "Review Item #1", detailText: nil, image: nil, learnMoreItem: nil, bodyItemStyle: .bulletPoint), + ORKBodyItem(text: "Review Item #2", detailText: nil, image: nil, learnMoreItem: nil, bodyItemStyle: .bulletPoint), + ORKBodyItem(text: "Review Item #3", detailText: nil, image: nil, learnMoreItem: nil, bodyItemStyle: .bulletPoint), + ORKBodyItem(text: "Review Item #4", detailText: nil, image: nil, learnMoreItem: nil, bodyItemStyle: .bulletPoint) + ] + embeddedReviewStep.title = "Embedded Review Step" + + return embeddedReviewStep + } + + // MARK: - ORK3DModelStep + + static var usdzModelExample: ORK3DModelStep { + let modelManager = ORKUSDZModelManager(usdzFileName: "sphere_model") + modelManager.allowsSelection = true + modelManager.enableContinueAfterSelection = true + modelManager.highlightColor = .systemBlue + + let usdzModelStep = ORK3DModelStep(identifier: String(describing: Identifier.usdzModelStep), modelManager: modelManager) + usdzModelStep.title = "Example USDZ Model" + usdzModelStep.text = "Tap the model to continue" + + return usdzModelStep + } + + // MARK: - ORKCompletionStep + + static var completionStepExample: ORKCompletionStep { + let completionStep = ORKCompletionStep(identifier: String(describing: Identifier.completionStep)) + completionStep.iconImage = UIImage(systemName: "checkmark.circle.fill") + completionStep.title = "Task Completed" + completionStep.text = "Thank you for completing the task." + + return completionStep + } + + // MARK: - ORKFamilyHistoryStep + + static var familyHistoryStepExample: ORKFamilyHistoryStep { + // create ORKHealthConditions + + let healthConditions = [ + ORKHealthCondition(identifier: "healthConditionIdentifier1", displayName: "Diabetes", value: "Diabetes" as NSString), + ORKHealthCondition(identifier: "healthConditionIdentifier2", displayName: "Heart Attack", value: "Heart Attack" as NSString), + ORKHealthCondition(identifier: "healthConditionIdentifier3", displayName: "Stroke", value: "Stroke" as NSString) + ] + + // add ORKHealthConditions to ORKConditionStepConfiguration object + + let conditionStepConfiguration = ORKConditionStepConfiguration(stepIdentifier: "FamilyHistoryConditionStepIdentifier", conditionsFormItemIdentifier: "HealthConditionsFormItemIdentifier", conditions: healthConditions, formItems: []) + + // create formItems and formStep for parent relative group + let learnMoreInstructionStep01 = ORKLearnMoreInstructionStep(identifier: "LearnMoreInstructionStep01") + learnMoreInstructionStep01.title = NSLocalizedString("Learn more title", comment: "") + learnMoreInstructionStep01.text = NSLocalizedString("Learn more text", comment: "") + let learnMoreItem01 = ORKLearnMoreItem(text: nil, learnMoreInstructionStep: learnMoreInstructionStep01) + + let relativeNameSectionHeaderFormItem = ORKFormItem(sectionTitle: "Add a label to identify this family member", detailText: "Instead of their full name, please use a nickname, alias, or initials. Your response will only be saved on your device.", learnMoreItem: learnMoreItem01, showsProgress: true) + relativeNameSectionHeaderFormItem.tagText = "OPTIONAL" + let parentTextEntryAnswerFormat = ORKAnswerFormat.textAnswerFormat() + parentTextEntryAnswerFormat.multipleLines = false + parentTextEntryAnswerFormat.maximumLength = 3 + + let parentNameFormItem = ORKFormItem(identifier: "ParentNameIdentifier", text: "enter optional name", answerFormat: parentTextEntryAnswerFormat) + parentNameFormItem.isOptional = true + + let sexAtBirthOptions = [ + ORKTextChoice(text: "Female", value: "Female" as NSString), + ORKTextChoice(text: "Male", value: "Male" as NSString), + ORKTextChoice(text: "Intersex", value: "Intersex" as NSString), + ORKTextChoice(text: "I don't know", value: "i_dont_know" as NSString), + ORKTextChoice(text: "I prefer not to answer", value: "i_prefer_not_to_answer" as NSString) + ] + + let parentSexAtBirthChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: sexAtBirthOptions) + let parentSextAtBirthFormItem = ORKFormItem(identifier: "ParentSexAtBirthIdentifier", text: "What was the sex assigned on their original birth certificate?", answerFormat: parentSexAtBirthChoiceAnswerFormat) + parentSextAtBirthFormItem.isOptional = false + + let vitalStatusOptions = [ + ORKTextChoice(text: "Living", value: "living" as NSString), + ORKTextChoice(text: "Deceased", value: "deceased" as NSString), + ORKTextChoice(text: "I don't know", value: "dont_know" as NSString), + ORKTextChoice(text: "I prefer not to answer", value: "prefer_not_to_answer" as NSString), + ] + + let parentVitalStatusChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: vitalStatusOptions) + let parentVitalStatusFormItem = ORKFormItem(identifier: "ParentVitalStatusIdentifier", text: "What is their current vital status?", answerFormat: parentVitalStatusChoiceAnswerFormat) + parentVitalStatusFormItem.isOptional = false + + let parentFormStep = ORKFormStep(identifier: "ParentSurveyIdentifier") + let visibilityRule = ORKPredicateFormItemVisibilityRule( + predicate: ORKResultPredicate.predicateForChoiceQuestionResult( + with: .init(stepIdentifier: parentFormStep.identifier, resultIdentifier: parentVitalStatusFormItem.identifier), + expectedAnswerValue: NSString(string: "living") + ) + ) + + let parentAgePickerSectionHeaderFormItem = ORKFormItem(identifier: "ParentAgeSectionHeaderIdentifier", text: "What is their approximate birth year?", answerFormat: nil) + parentAgePickerSectionHeaderFormItem.visibilityRule = visibilityRule + + let parentAgePickerAnswerFormat = ORKAgeAnswerFormat( + minimumAge: 18, + maximumAge: 90, + minimumAgeCustomText: "18 or younger", + maximumAgeCustomText: "90 or older", + showYear: true, + useYearForResult: true, + treatMinAgeAsRange: true, + treatMaxAgeAsRange: false, + defaultValue: 30) + parentAgePickerAnswerFormat.shouldShowDontKnowButton = true + + let parentAgeFormItem = ORKFormItem(identifier: "ParentAgeFormItemIdentifier", text: nil, answerFormat: parentAgePickerAnswerFormat) + parentAgeFormItem.isOptional = false + parentAgeFormItem.visibilityRule = visibilityRule + + parentFormStep.isOptional = false + parentFormStep.title = "Parent" + parentFormStep.detailText = "Answer these questions to the best of your ability." + parentFormStep.formItems = [ + relativeNameSectionHeaderFormItem, + parentNameFormItem, + parentSextAtBirthFormItem, + parentVitalStatusFormItem, + parentAgePickerSectionHeaderFormItem, + parentAgeFormItem + ] + + // create formItems and formStep for siblings relative group + + let siblingTextEntryAnswerFormat = ORKAnswerFormat.textAnswerFormat() + siblingTextEntryAnswerFormat.multipleLines = false + siblingTextEntryAnswerFormat.placeholder = "enter optional name" + siblingTextEntryAnswerFormat.maximumLength = 3 + + let siblingNameFormItem = ORKFormItem(identifier: "SiblingNameIdentifier", text: "Name or Nickname", answerFormat: siblingTextEntryAnswerFormat) + siblingNameFormItem.isOptional = false + + let siblingSexAtBirthChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: sexAtBirthOptions) + let siblingSextAtBirthFormItem = ORKFormItem(identifier: "SiblingSexAtBirthIdentifier", text: "What was the sex assigned on their original birth certificate?", answerFormat: siblingSexAtBirthChoiceAnswerFormat) + siblingSextAtBirthFormItem.isOptional = false + + let siblingVitalStatusChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: vitalStatusOptions) + let siblingVitalStatusFormItem = ORKFormItem(identifier: "SiblingVitalStatusIdentifier", text: "What is their current vital status?", answerFormat: siblingVitalStatusChoiceAnswerFormat) + siblingVitalStatusFormItem.isOptional = false + + let siblingAgePickerAnswerFormat = ORKAgeAnswerFormat( + minimumAge: 18, + maximumAge: 90, + minimumAgeCustomText: "18 or younger", + maximumAgeCustomText: "90 or older", + showYear: true, + useYearForResult: true, + treatMinAgeAsRange: true, + treatMaxAgeAsRange: false, + defaultValue: 30) + siblingAgePickerAnswerFormat.shouldShowDontKnowButton = true + + let siblingAgePickerSectionHeaderFormItem = ORKFormItem(identifier: "SiblingAgeSectionHeaderIdentifier", text: "What is their approximate birth year?", answerFormat: nil) + + let siblingAgeFormItem = ORKFormItem(identifier: "SiblingAgeFormItemIdentifier", text: nil, answerFormat: siblingAgePickerAnswerFormat) + siblingAgeFormItem.isOptional = false + + let siblingFormStep = ORKFormStep(identifier: "SiblingSurveyIdentifier") + let siblingAgeVisibilityRule = ORKPredicateFormItemVisibilityRule( + predicate: ORKResultPredicate.predicateForChoiceQuestionResult( + with: .init(stepIdentifier: siblingFormStep.identifier, resultIdentifier: siblingVitalStatusFormItem.identifier), + expectedAnswerValue: NSString(string: "living") + ) + ) + siblingAgePickerSectionHeaderFormItem.visibilityRule = siblingAgeVisibilityRule + siblingAgeFormItem.visibilityRule = siblingAgeVisibilityRule + + siblingFormStep.title = "Sibling" + siblingFormStep.detailText = "Answer these questions to the best of your ability." + siblingFormStep.formItems = [ + relativeNameSectionHeaderFormItem, + siblingNameFormItem, + siblingSextAtBirthFormItem, + siblingVitalStatusFormItem, + siblingAgePickerSectionHeaderFormItem, + siblingAgeFormItem + ] + + // create ORKRelativeGroups + + let relativeGroups = [ + ORKRelativeGroup(identifier: "ParentGroupIdentifier", + name: "Biological Parent", + sectionTitle: "Biological Parents", + sectionDetailText: "Include your blood-related parents.", + identifierForCellTitle: "ParentNameIdentifier", + maxAllowed: 2, + formSteps: [parentFormStep], + detailTextIdentifiers: ["ParentSexAtBirthIdentifier", "ParentVitalStatusIdentifier", "ParentAgeFormItemIdentifier"]), + ORKRelativeGroup(identifier: "SiblingGroupIdentifier", + name: "Sibling", + sectionTitle: "Biological Siblings", + sectionDetailText: "Include all siblings who share one or both of your blood-related parents.", + identifierForCellTitle: "SiblingNameIdentifier", + maxAllowed: 10, + formSteps: [siblingFormStep], + detailTextIdentifiers: ["SiblingSexAtBirthIdentifier", "SiblingVitalStatusIdentifier", "SiblingAgeFormItemIdentifier"]) + ] + + // create ORKFamilyHistoryStep and add to a ORKOrderedTask + + let familyHistoryStep = ORKFamilyHistoryStep(identifier: String(describing: Identifier.familyHistoryStep)) + familyHistoryStep.title = "Family Health History" + familyHistoryStep.detailText = "The overview of your biological family members can inform health risks and lifestyle." + familyHistoryStep.conditionStepConfiguration = conditionStepConfiguration + familyHistoryStep.relativeGroups = relativeGroups + + return familyHistoryStep + } + + + // MARK: - Helpers + + private static var formItemSectionHeaderExample: ORKFormItem { + return ORKFormItem(sectionTitle: TaskListRowStrings.exampleQuestionText) + } + + private static var learnMoreItemExample: ORKLearnMoreItem { + let learnMoreInstructionStep = ORKLearnMoreInstructionStep(identifier: "LearnMoreInstructionStep01") + learnMoreInstructionStep.title = NSLocalizedString("Learn more title", comment: "") + learnMoreInstructionStep.text = NSLocalizedString("Learn more text", comment: "") + let learnMoreItem = ORKLearnMoreItem(text: nil, learnMoreInstructionStep: learnMoreInstructionStep) + + return learnMoreItem + } + + private static func heightWeightFormStepExample(identifier: String, answerFormat: ORKAnswerFormat, title: String, text: String) -> ORKFormStep { + let formItemSectionHeader = self.formItemSectionHeaderExample + let heightQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.heightQuestionFormItem1), text: nil, answerFormat: answerFormat) + heightQuestionFormItem.placeholder = TaskListRowStrings.exampleTapHereText + + let heightQuestionFormStep = ORKFormStep(identifier: String(describing: identifier), title: title, text: text) + heightQuestionFormStep.formItems = [formItemSectionHeader, heightQuestionFormItem] + + return heightQuestionFormStep + } + + private static var imageChoicesExample: [ORKImageChoice] { + let roundShapeImage = UIImage(named: "round_shape")! + let roundShapeText = NSLocalizedString("Round Shape", comment: "") + + let squareShapeImage = UIImage(named: "square_shape")! + let squareShapeText = NSLocalizedString("Square Shape", comment: "") + + let imageChoices = [ + ORKImageChoice(normalImage: roundShapeImage, selectedImage: nil, text: roundShapeText, value: roundShapeText as NSString), + ORKImageChoice(normalImage: squareShapeImage, selectedImage: nil, text: squareShapeText, value: squareShapeText as NSString) + ] + + return imageChoices + } + + private static var textChoicesExample: [ORKTextChoice] { + let textChoices: [ORKTextChoice] = [ORKTextChoice(text: "Poor", value: 1 as NSNumber), + ORKTextChoice(text: "Fair", value: 2 as NSNumber), + ORKTextChoice(text: "Good", value: 3 as NSNumber), + ORKTextChoice(text: "Above Average", value: 10 as NSNumber), + ORKTextChoice(text: "Excellent", value: 5 as NSNumber)] + + return textChoices + } + +} diff --git a/samples/ORKCatalog/ORKCatalog/Tasks/TaskListRow.swift b/samples/ORKCatalog/ORKCatalog/Tasks/TaskListRow.swift index 9a20291f3b..4d15b7dddf 100644 --- a/samples/ORKCatalog/ORKCatalog/Tasks/TaskListRow.swift +++ b/samples/ORKCatalog/ORKCatalog/Tasks/TaskListRow.swift @@ -30,9 +30,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import ResearchKit.Private import AudioToolbox import ResearchKit +import ResearchKit_Private +import ResearchKitActiveTask +import ResearchKitActiveTask_Private +import ResearchKitUI /** Wraps a SystemSoundID. @@ -63,15 +66,19 @@ class SystemSound { enum TaskListRow: Int, CustomStringConvertible { case form = 0 case groupedForm + case groupedFormNoScroll case survey - case platterUIQuestion + case dontknowSurvey + case surveyWithMultipleOptions case booleanQuestion case customBooleanQuestion case dateQuestion case dateTimeQuestion case date3DayLimitQuestionTask case imageChoiceQuestion +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION case locationQuestion +#endif case numericQuestion case scaleQuestion case textQuestion @@ -94,6 +101,7 @@ enum TaskListRow: Int, CustomStringConvertible { case biometricPasscode case audio case amslerGrid + case tecumsehCubeTest case sixMinuteWalk case fitness case holePegTest @@ -105,7 +113,6 @@ enum TaskListRow: Int, CustomStringConvertible { case speechRecognition case speechInNoise case stroop - case swiftStroop case timedWalkWithTurnAround case toneAudiometry case dBHLToneAudiometry @@ -116,13 +123,21 @@ enum TaskListRow: Int, CustomStringConvertible { case walkBackAndForth case heightQuestion case weightQuestion +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + case healthQuantity +#endif case kneeRangeOfMotion case shoulderRangeOfMotion case trailMaking - case visualAcuityLandoltC - case contrastSensitivityPeakLandoltC case videoInstruction + case review case webView + case consentTask + case consentDoc + case usdzModel + case ageQuestion + case colorChoiceQuestion + case familyHistory class TaskListRowSection { @@ -138,85 +153,111 @@ enum TaskListRow: Int, CustomStringConvertible { /// Returns an array of all the task list row enum cases. static var sections: [ TaskListRowSection ] { - let defaultSections = [ + var defaultSections = [ TaskListRowSection(title: "Surveys", rows: [ - .form, + .dontknowSurvey, .groupedForm, - .survey + .groupedFormNoScroll, + .form, + .survey, + .surveyWithMultipleOptions ]), TaskListRowSection(title: "Survey Questions", rows: [ - .platterUIQuestion, + .ageQuestion, .booleanQuestion, + .colorChoiceQuestion, .customBooleanQuestion, - .dateQuestion, .dateTimeQuestion, + .dateQuestion, .date3DayLimitQuestionTask, + .familyHistory, .heightQuestion, - .weightQuestion, .imageChoiceQuestion, - .locationQuestion, .numericQuestion, .scaleQuestion, - .textQuestion, .textChoiceQuestion, .textChoiceQuestionWithImageTask, + .textQuestion, .timeIntervalQuestion, .timeOfDayQuestion, - .valuePickerChoiceQuestion, .validatedTextQuestion, - .imageCapture, - .videoCapture, - .frontFacingCamera, - .wait, - .PDFViewer, - .requestPermissions + .valuePickerChoiceQuestion, + .weightQuestion, ]), TaskListRowSection(title: "Onboarding", rows: [ - .eligibilityTask, .accountCreation, + .biometricPasscode, + .consentDoc, + .consentTask, + .eligibilityTask, .login, .passcode, - .biometricPasscode + .review + ]), + TaskListRowSection(title: "Miscellaneous", rows: + [ + .frontFacingCamera, + .imageCapture, + .PDFViewer, + .requestPermissions, + .usdzModel, + .videoCapture, + .videoInstruction, + .wait, + .webView ]), TaskListRowSection(title: "Active Tasks", rows: [ .audio, .amslerGrid, - .sixMinuteWalk, + .dBHLToneAudiometry, .fitness, .holePegTest, + .kneeRangeOfMotion, + .normalizedReactionTime, .psat, .reactionTime, - .normalizedReactionTime, .shortWalk, + .shoulderRangeOfMotion, + .sixMinuteWalk, .spatialSpanMemory, - .speechRecognition, .speechInNoise, + .speechRecognition, + .splMeter, .stroop, - .swiftStroop, + .tecumsehCubeTest, .timedWalkWithTurnAround, .toneAudiometry, - .dBHLToneAudiometry, - .splMeter, .towerOfHanoi, .tremorTest, .twoFingerTappingInterval, .walkBackAndForth, - .kneeRangeOfMotion, - .shoulderRangeOfMotion, - .trailMaking, - .visualAcuityLandoltC, - .contrastSensitivityPeakLandoltC - ]), - TaskListRowSection(title: "Miscellaneous", rows: - [ - .videoInstruction, - .webView ])] + + #if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + let healthSections:[TaskListRowSection] = [ + TaskListRowSection(title: "Health", rows: + [ + .healthQuantity + ]) + ] + defaultSections = defaultSections + healthSections + #endif + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + let locationSections:[TaskListRowSection] = [ + TaskListRowSection(title: "Location", rows: + [ + .locationQuestion, + ]) + ] + defaultSections = defaultSections + locationSections +#endif + return defaultSections } @@ -225,23 +266,26 @@ enum TaskListRow: Int, CustomStringConvertible { var description: String { switch self { case .form: - return NSLocalizedString("Form Survey Example", comment: "") + return NSLocalizedString("Form Survey", comment: "") case .groupedForm: - return NSLocalizedString("Grouped Form Survey Example", comment: "") + return NSLocalizedString("Grouped Form Survey", comment: "") + + case .groupedFormNoScroll: + return NSLocalizedString("Grouped Form Survey No AutoScroll", comment: "") case .survey: - return NSLocalizedString("Simple Survey Example", comment: "") + return NSLocalizedString("Simple Survey", comment: "") - case .platterUIQuestion: - return NSLocalizedString("Platter UI Question", comment: "") + case .dontknowSurvey: + return NSLocalizedString("Don't Know Survey", comment: "") case .booleanQuestion: return NSLocalizedString("Boolean Question", comment: "") case .customBooleanQuestion: return NSLocalizedString("Custom Boolean Question", comment: "") - + case .dateQuestion: return NSLocalizedString("Date Question", comment: "") @@ -256,12 +300,16 @@ enum TaskListRow: Int, CustomStringConvertible { case .weightQuestion: return NSLocalizedString("Weight Question", comment: "") - +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + case .healthQuantity: + return NSLocalizedString("Health Quantity Question", comment: "") +#endif case .imageChoiceQuestion: return NSLocalizedString("Image Choice Question", comment: "") - +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION case .locationQuestion: return NSLocalizedString("Location Question", comment: "") +#endif case .numericQuestion: return NSLocalizedString("Numeric Question", comment: "") @@ -308,6 +356,9 @@ enum TaskListRow: Int, CustomStringConvertible { case .requestPermissions: return NSLocalizedString("Request Permissions Step", comment: "") + case .review: + return NSLocalizedString("Review Step", comment: "") + case .eligibilityTask: return NSLocalizedString("Eligibility Task Example", comment: "") @@ -329,6 +380,9 @@ enum TaskListRow: Int, CustomStringConvertible { case .amslerGrid: return NSLocalizedString("Amsler Grid", comment: "") + case .tecumsehCubeTest: + return NSLocalizedString("Tecumseh Cube Test", comment: "") + case .sixMinuteWalk: return NSLocalizedString("Six Minute Walk", comment: "") @@ -362,9 +416,6 @@ enum TaskListRow: Int, CustomStringConvertible { case .stroop: return NSLocalizedString("Stroop", comment: "") - case .swiftStroop: - return NSLocalizedString("Swift Stroop", comment: "") - case .timedWalkWithTurnAround: return NSLocalizedString("Timed Walk with Turn Around", comment: "") @@ -401,220 +452,31 @@ enum TaskListRow: Int, CustomStringConvertible { case .trailMaking: return NSLocalizedString("Trail Making Test", comment: "") - case .visualAcuityLandoltC: - return NSLocalizedString("Visual Acuity Landolt C", comment: "") - - case .contrastSensitivityPeakLandoltC: - return NSLocalizedString("Contrast Sensitivity Peak", comment: "") - case .webView: return NSLocalizedString("Web View", comment: "") - } - } - - // MARK: Types - - /** - Every step and task in the ResearchKit framework has to have an identifier. - Within a task, the step identifiers should be unique. - - Here we use an enum to ensure that the identifiers are kept unique. Since - the enum has a raw underlying type of a `String`, the compiler can determine - the uniqueness of the case values at compile time. - - In a real application, the identifiers for your tasks and steps might - come from a database, or in a smaller application, might have some - human-readable meaning. - */ - enum Identifier { - // Task with a form, where multiple items appear on one page. - case formTask - case groupedFormTask - case formStep - case groupedFormStep - case formItem01 - case formItem02 - case formItem03 - case formItem04 - - // Survey task specific identifiers. - case surveyTask - case introStep - case questionStep - case birthdayQuestion - case summaryStep - - // Task with a Platter UI Question - case platterQuestionTask - case platterQuestionStep - - // Task with a Boolean question. - case booleanQuestionTask - case booleanQuestionStep - - // Task with an example of date entry. - case dateQuestionTask - case dateQuestionStep - case date3DayLimitQuestionTask - - // Task with an example of date and time entry. - case dateTimeQuestionTask - case dateTimeQuestionStep - - // Task with an example of height entry. - case heightQuestionTask - case heightQuestionStep1 - case heightQuestionStep2 - case heightQuestionStep3 - case heightQuestionStep4 - - // Task with an example of weight entry. - case weightQuestionTask - case weightQuestionStep1 - case weightQuestionStep2 - case weightQuestionStep3 - case weightQuestionStep4 - case weightQuestionStep5 - case weightQuestionStep6 - case weightQuestionStep7 - - // Task with an image choice question. - case imageChoiceQuestionTask - case imageChoiceQuestionStep1 - case imageChoiceQuestionStep2 - - // Task with a location entry. - case locationQuestionTask - case locationQuestionStep - - // Task with examples of numeric questions. - case numericQuestionTask - case numericQuestionStep - case numericNoUnitQuestionStep - case numericDisplayUnitQuestionStep - - // Task with examples of questions with sliding scales. - case scaleQuestionTask - case discreteScaleQuestionStep - case continuousScaleQuestionStep - case discreteVerticalScaleQuestionStep - case continuousVerticalScaleQuestionStep - case textScaleQuestionStep - case textVerticalScaleQuestionStep - - // Task with an example of free text entry. - case textQuestionTask - case textQuestionStep - - // Task with an example of a multiple choice question. - case textChoiceQuestionTask - case textChoiceQuestionStep - case textChoiceQuestionWithImageStep - case textChoiceQuestionWithImageTask - - // Task with an example of time of day entry. - case timeOfDayQuestionTask - case timeOfDayQuestionStep - - // Task with an example of time interval entry. - case timeIntervalQuestionTask - case timeIntervalQuestionStep - - // Task with a value picker. - case valuePickerChoiceQuestionTask - case valuePickerChoiceQuestionStep - - // Task with an example of validated text entry. - case validatedTextQuestionTask - case validatedTextQuestionStepEmail - case validatedTextQuestionStepDomain - - // Image capture task specific identifiers. - case imageCaptureTask - case imageCaptureStep - - // Video capture task specific identifiers. - case videoCaptureTask - case videoCaptureStep - - case frontFacingCameraStep - - // Task with an example of waiting. - case waitTask - case waitStepDeterminate - case waitStepIndeterminate - - case pdfViewerStep - case pdfViewerTask - - case requestPermissionsStep - - // Eligibility task specific indentifiers. - case eligibilityTask - case eligibilityIntroStep - case eligibilityFormStep - case eligibilityFormItem01 - case eligibilityFormItem02 - case eligibilityFormItem03 - case eligibilityIneligibleStep - case eligibilityEligibleStep - - // Account creation task specific identifiers. - case accountCreationTask - case registrationStep - case waitStep - case verificationStep - - // Login task specific identifiers. - case loginTask - case loginStep - case loginWaitStep - - // Passcode task specific identifiers. - case passcodeTask - case passcodeStep - case biometricPasscodeTask - case biometricPasscodeStep - - // Active tasks. - case audioTask - case amslerGridTask - case sixMinuteWalkTask - case fitnessTask - case holePegTestTask - case psatTask - case reactionTime - case normalizedReactionTime - case shortWalkTask - case spatialSpanMemoryTask - case speechRecognitionTask - case speechInNoiseTask - case stroopTask - case swiftStroopTask - case timedWalkWithTurnAroundTask - case toneAudiometryTask - case dBHLToneAudiometryTask - case splMeterTask - case splMeterStep - case towerOfHanoi - case tremorTestTask - case twoFingerTappingIntervalTask - case walkBackAndForthTask - case kneeRangeOfMotion - case shoulderRangeOfMotion - case trailMaking - case visualAcuityLandoltC - case contrastSensitivityPeakLandoltC - - // Video instruction tasks. - case videoInstructionTask - case videoInstructionStep - - // Web view tasks. - case webViewTask - case webViewStep + case .consentTask: + return NSLocalizedString("Consent Task", comment: "") + + case .consentDoc: + return NSLocalizedString("Consent Document Review", comment: "") + + case .usdzModel: + return NSLocalizedString("USDZ Model", comment: "") + + case .ageQuestion: + return NSLocalizedString("Age Question", comment: "") + + case .colorChoiceQuestion: + return NSLocalizedString("Color Choice Question", comment: "") + case .familyHistory: + return NSLocalizedString("Family History Step", comment: "") + + + case .surveyWithMultipleOptions: + return NSLocalizedString("Survey With Multiple Options", comment: "") + } } // MARK: Properties @@ -628,11 +490,17 @@ enum TaskListRow: Int, CustomStringConvertible { case .groupedForm: return groupedFormTask + case .groupedFormNoScroll: + return groupedFormTaskNoScroll + + case .surveyWithMultipleOptions: + return formTaskWithMultipleOptions + case .survey: return surveyTask - case .platterUIQuestion: - return platterQuestionTask + case .dontknowSurvey: + return dontKnowTask case .booleanQuestion: return booleanQuestionTask @@ -654,16 +522,26 @@ enum TaskListRow: Int, CustomStringConvertible { case .weightQuestion: return weightQuestionTask + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + case .healthQuantity: + return healthQuantityTypeTask +#endif case .imageChoiceQuestion: return imageChoiceQuestionTask +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION case .locationQuestion: return locationQuestionTask +#endif case .numericQuestion: return numericQuestionTask + case .review: + return reviewTask + case .scaleQuestion: return scaleQuestionTask @@ -724,6 +602,9 @@ enum TaskListRow: Int, CustomStringConvertible { case .amslerGrid: return amslerGridTask + case .tecumsehCubeTest: + return tecumsehCubeTestTask + case .sixMinuteWalk: return sixMinuteWalkTask @@ -757,9 +638,6 @@ enum TaskListRow: Int, CustomStringConvertible { case .stroop: return stroopTask - case .swiftStroop: - return swiftStroopTask - case .timedWalkWithTurnAround: return timedWalkWithTurnAroundTask @@ -792,21 +670,34 @@ enum TaskListRow: Int, CustomStringConvertible { case .trailMaking: return trailMaking - - case .visualAcuityLandoltC: - return visualAcuityLandoltC - - case .contrastSensitivityPeakLandoltC: - return contrastSensitivityPeakLandoltC - + case .videoInstruction: return videoInstruction case .webView: return webView + case .consentTask: + return consentTask + + case .consentDoc: + return consentDoc + + case .usdzModel: + return usdzModel + + case .ageQuestion: + return ageQuestionTask + + case .colorChoiceQuestion: + return colorChoiceQuestionTask + + case .familyHistory: + return familyHistoryTask + case .textChoiceQuestionWithImageTask: return textChoiceQuestionWithImageTask + } } @@ -819,7 +710,7 @@ enum TaskListRow: Int, CustomStringConvertible { diastolic values. */ private var formTask: ORKTask { - let step = ORKFormStep(identifier: String(describing: Identifier.formStep), title: NSLocalizedString("Form Step", comment: ""), text: exampleDetailText) + let step = ORKFormStep(identifier: String(describing: Identifier.formStep), title: NSLocalizedString("Form Step", comment: ""), text: TaskListRowStrings.exampleDetailText) // A first field, for entering an integer. let formItem01Text = NSLocalizedString("Field01", comment: "") @@ -831,7 +722,7 @@ enum TaskListRow: Int, CustomStringConvertible { let formItem02 = ORKFormItem(identifier: String(describing: Identifier.formItem02), text: formItem02Text, answerFormat: ORKTimeIntervalAnswerFormat()) formItem02.placeholder = NSLocalizedString("Your placeholder here", comment: "") - let formItem03Text = NSLocalizedString(exampleQuestionText, comment: "") + let formItem03Text = TaskListRowStrings.exampleQuestionText let scaleAnswerFormat = ORKScaleAnswerFormat(maximumValue: 10, minimumValue: 0, defaultValue: 0, step: 1)//ORKScaleAnswerFormat(maximumValue: 10, minimumValue: 0, defaultValue: 0, step: 1) scaleAnswerFormat.shouldHideRanges = true let formItem03 = ORKFormItem(identifier: String(describing: Identifier.formItem03), text: formItem03Text, answerFormat: scaleAnswerFormat) @@ -842,26 +733,46 @@ enum TaskListRow: Int, CustomStringConvertible { ORKTextChoice(text: "choice 3", detailText: "detail 3", value: 3 as NSNumber, exclusive: false), ORKTextChoice(text: "choice 4", detailText: "detail 4", value: 4 as NSNumber, exclusive: false), ORKTextChoice(text: "choice 5", detailText: "detail 5", value: 5 as NSNumber, exclusive: false), - ORKTextChoice(text: "choice 6", detailText: "detail 6", value: 6 as NSNumber, exclusive: false) + ORKTextChoice(text: "choice 6", detailText: "detail 6", value: 6 as NSNumber, exclusive: false), + ORKTextChoiceOther.choice(withText: "choice 7", detailText: "detail 7", value: "choice 7" as NSString, exclusive: true, textViewPlaceholderText: "enter additional information") ] let textScaleAnswerFormat = ORKTextScaleAnswerFormat(textChoices: textChoices, defaultIndex: 10) textScaleAnswerFormat.shouldHideLabels = true textScaleAnswerFormat.shouldShowDontKnowButton = true - let formItem04 = ORKFormItem(identifier: String(describing: Identifier.formItem04), text: exampleQuestionText, answerFormat: textScaleAnswerFormat) + let formItem04 = ORKFormItem(identifier: String(describing: Identifier.formItem04), text: TaskListRowStrings.exampleQuestionText, answerFormat: textScaleAnswerFormat) + + let textChoiceAnswerFormat = ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: textChoices) + textChoiceAnswerFormat.shouldShowDontKnowButton = true + let textChoiceFormItem = ORKFormItem(identifier: String(describing: Identifier.textChoiceFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: textChoiceAnswerFormat) + let appleChoices: [ORKTextChoice] = [ORKTextChoice(text: "Granny Smith", value: 1 as NSNumber), ORKTextChoice(text: "Honeycrisp", value: 2 as NSNumber), ORKTextChoice(text: "Fuji", value: 3 as NSNumber), ORKTextChoice(text: "McIntosh", value: 10 as NSNumber), ORKTextChoice(text: "Kanzi", value: 5 as NSNumber)] let appleAnswerFormat = ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: appleChoices) - let appleFormItem = ORKFormItem(identifier: "appleFormItemIdentifier", text: "Which is your favorite apple?", answerFormat: appleAnswerFormat) + let appleFormItem = ORKFormItem(identifier: String(describing: Identifier.appleFormItemIdentifier), text: "Which is your favorite apple?", answerFormat: appleAnswerFormat) + + let roundShapeImage = UIImage(named: "round_shape")! + let roundShapeText = NSLocalizedString("Round Shape", comment: "") - let freeTextSection = ORKFormItem(identifier: "freeTextSectionIdentifier", text: "Enter your text below", answerFormat: nil) + let squareShapeImage = UIImage(named: "square_shape")! + let squareShapeText = NSLocalizedString("Square Shape", comment: "") + + let imageChoices = [ + ORKImageChoice(normalImage: roundShapeImage, selectedImage: nil, text: roundShapeText, value: roundShapeText as NSString), + ORKImageChoice(normalImage: squareShapeImage, selectedImage: nil, text: squareShapeText, value: squareShapeText as NSString) + ] + + let imageChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormat(with: imageChoices) + let imageChoiceItem = ORKFormItem(identifier: String(describing: Identifier.imageChoiceItem), text: "Enter your favorite shape", answerFormat: imageChoiceAnswerFormat) + + let freeTextSection = ORKFormItem(identifier: String(describing: Identifier.freeTextSectionIdentifier), text: "Enter your text below", answerFormat: nil) let freeTextAnswerFormat = ORKAnswerFormat.textAnswerFormat(withMaximumLength: 200) freeTextAnswerFormat.multipleLines = true - let freeTextItem = ORKFormItem(identifier: "freeTextItemIdentifier", text: nil, answerFormat: freeTextAnswerFormat) + let freeTextItem = ORKFormItem(identifier:String(describing: Identifier.freeTextItemIdentifier), text: nil, answerFormat: freeTextAnswerFormat) step.formItems = [ appleFormItem, @@ -869,84 +780,194 @@ enum TaskListRow: Int, CustomStringConvertible { formItem04, formItem01, formItem02, + textChoiceFormItem, + imageChoiceItem, freeTextSection, freeTextItem ] - let completionStep = ORKCompletionStep(identifier: "CompletionStep") + let completionStep = ORKCompletionStep(identifier: String(describing: Identifier.completionStep)) completionStep.title = NSLocalizedString("All Done!", comment: "") completionStep.detailText = NSLocalizedString("You have completed the questionnaire.", comment: "") return ORKOrderedTask(identifier: String(describing: Identifier.formTask), steps: [step, completionStep]) } - private var groupedFormTask: ORKTask { - let step = ORKFormStep(identifier: String(describing: Identifier.groupedFormStep), title: NSLocalizedString("Form Step", comment: ""), text: exampleDetailText) - - //Start of first section - let learnMoreInstructionStep01 = ORKLearnMoreInstructionStep(identifier: "LearnMoreInstructionStep01") - learnMoreInstructionStep01.title = NSLocalizedString("Learn more title", comment: "") - learnMoreInstructionStep01.text = NSLocalizedString("Learn more text", comment: "") - let learnMoreItem01 = ORKLearnMoreItem(text: nil, learnMoreInstructionStep: learnMoreInstructionStep01) - let section01 = ORKFormItem(sectionTitle: NSLocalizedString("Section title", comment: ""), detailText: NSLocalizedString("Section detail text", comment: ""), learnMoreItem: learnMoreItem01, showsProgress: true) - + private var dontKnowTask: ORKTask { + let step = ORKFormStep(identifier: String(describing: Identifier.formStep), title: NSLocalizedString("Form Step", comment: ""), text: TaskListRowStrings.exampleDetailText) + // A first field, for entering an integer. - let formItem01Text = NSLocalizedString("Field01", comment: "") - let formItem01 = ORKFormItem(identifier: String(describing: Identifier.formItem01), text: formItem01Text, answerFormat: ORKAnswerFormat.integerAnswerFormat(withUnit: nil)) - formItem01.placeholder = NSLocalizedString("Your placeholder here", comment: "") - - // A second field, for entering a time interval. - let formItem02Text = NSLocalizedString("Field02", comment: "") - let formItem02 = ORKFormItem(identifier: String(describing: Identifier.formItem02), text: formItem02Text, answerFormat: ORKTimeIntervalAnswerFormat()) - formItem02.placeholder = NSLocalizedString("Your placeholder here", comment: "") - - let sesAnswerFormat = ORKSESAnswerFormat(topRungText: "Best Off", bottomRungText: "Worst Off") - let sesFormItem = ORKFormItem(identifier: "sesIdentifier", text: "Select where you are on the socioeconomic ladder.", answerFormat: sesAnswerFormat) + let formItem01Text = NSLocalizedString("What is your Zip Code", comment: "") + let answerFormat = ORKAnswerFormat.integerAnswerFormat(withUnit: nil) + answerFormat.shouldShowDontKnowButton = true + let formItem01 = ORKFormItem(identifier: String(describing: Identifier.formItem01), text: nil, answerFormat: answerFormat) + formItem01.placeholder = NSLocalizedString("Add Zip Code", comment: "") + + let formItem02Text = NSLocalizedString("What is your height", comment: "") + let answerFormat02 = ORKAnswerFormat.heightAnswerFormat() + answerFormat02.shouldShowDontKnowButton = true + let formItem02 = ORKFormItem(identifier: String(describing: Identifier.formItem02), text: nil, answerFormat: answerFormat02) + formItem02.placeholder = NSLocalizedString("Add Height", comment: "") + + let formItem03Text = NSLocalizedString("What is your weight", comment: "") + let formItem03Section = ORKFormItem(identifier: formItem03Text, text: formItem03Text, answerFormat: nil) + + let answerFormat03 = ORKAnswerFormat.weightAnswerFormat() + answerFormat03.shouldShowDontKnowButton = true + let formItem03 = ORKFormItem(identifier: String(describing: Identifier.formItem03), text: nil, answerFormat: answerFormat03) + formItem03.placeholder = NSLocalizedString("Add Weight", comment: "") + + let formItem04Text = NSLocalizedString("What is your Attitude", comment: "") + let answerFormat04 = ORKAnswerFormat.textAnswerFormat() + answerFormat04.multipleLines = true + answerFormat04.shouldShowDontKnowButton = true + let formItem04 = ORKFormItem(identifier: String(describing: Identifier.formItem04), text: nil, answerFormat: answerFormat04) + formItem04.placeholder = NSLocalizedString("Add your Attitude", comment: "") + + let formItem05Text = NSLocalizedString("What is your Pain Level", comment: "") + let answerFormat05 = ORKAnswerFormat.scale(withMaximumValue: 5, minimumValue: 1, defaultValue: 1, step: 1, vertical: false, maximumValueDescription: "Low", minimumValueDescription: "High") + answerFormat05.shouldShowDontKnowButton = true + let formItem05 = ORKFormItem(identifier: String(describing: Identifier.formItem05), text: formItem05Text, answerFormat: answerFormat05) + formItem05.placeholder = NSLocalizedString("Pain Level", comment: "") + + let attitudeSelector = ORKResultSelector(stepIdentifier: String(describing: Identifier.formStep), resultIdentifier: String(describing: Identifier.formItem04)) + let predicateForAttitudeSelector = ORKResultPredicate.predicateForTextQuestionResult(with: attitudeSelector, expectedString: "Happy") + + let formItem06Text = NSLocalizedString("SES Level", comment: "") + let answerFormat06 = ORKSESAnswerFormat(topRungText: "top", bottomRungText: "bottom") + answerFormat06.shouldShowDontKnowButton = true + let formItem06 = ORKFormItem(identifier: String(describing: Identifier.formItem06), text: formItem06Text, answerFormat: answerFormat06) + formItem06.placeholder = formItem06Text + + + let appleChoices: [ORKTextChoice] = [ORKTextChoice(text: "Granny Smith", value: 1 as NSNumber), + ORKTextChoice(text: "Honeycrisp", value: 2 as NSNumber), + ORKTextChoice(text: "Fuji", value: 3 as NSNumber), + ORKTextChoice(text: "McIntosh", value: 10 as NSNumber), + ORKTextChoice(text: "Kanzi", value: 5 as NSNumber), + ORKTextChoice(text: NSLocalizedString("I don't know", comment: ""), value: NSString("dunno"))] + let appleAnswerFormat = ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: appleChoices) - //Start of section for scale question - let formItem03Text = NSLocalizedString(exampleQuestionText, comment: "") - let scaleAnswerFormat = ORKContinuousScaleAnswerFormat(maximumValue: 10, minimumValue: 0, defaultValue: 0.0, maximumFractionDigits: 1)//ORKScaleAnswerFormat(maximumValue: 10, minimumValue: 0, defaultValue: 0, step: 1) - let formItem03 = ORKFormItem(identifier: String(describing: Identifier.formItem03), text: formItem03Text, detailText: nil, learnMoreItem: nil, showsProgress: true, answerFormat: scaleAnswerFormat, tagText: nil, optional: true) - + let appleFormItem = ORKFormItem(identifier: "appleFormItemIdentifier", text: "Which is your favorite apple?", answerFormat: appleAnswerFormat) + + appleFormItem.visibilityRule = ORKPredicateFormItemVisibilityRule(predicate: predicateForAttitudeSelector) + formItem03Section.visibilityRule = ORKPredicateFormItemVisibilityRule(predicate: predicateForAttitudeSelector) + formItem03.visibilityRule = ORKPredicateFormItemVisibilityRule(predicate: predicateForAttitudeSelector) + step.formItems = [ - section01, + ORKFormItem(identifier: formItem01Text, text: formItem01Text, answerFormat: nil), formItem01, + ORKFormItem(identifier: formItem02Text, text: formItem02Text, answerFormat: nil), formItem02, + formItem03Section, formItem03, - sesFormItem + ORKFormItem(identifier: formItem04Text, text: formItem04Text, answerFormat: nil), + formItem04, + formItem05, + formItem06, + appleFormItem ] - // Add a question step. - let question1StepAnswerFormat = ORKBooleanAnswerFormat() + let fruitSizeStep = { step in + step.title = NSLocalizedString("Picking Fruit", comment: "") + let weightAnswerFormat = ORKNumericAnswerFormat(style: .integer, unit: "lb") + weightAnswerFormat.shouldShowDontKnowButton = true + + step.formItems = [ + ORKFormItem( + identifier: "fruitHarvestTiming", + text: NSLocalizedString("Was the fruit picked early?", comment: ""), + answerFormat: .choiceAnswerFormat( + with: .singleChoice, + textChoices: [ + ORKTextChoice(text: NSLocalizedString("Yes", comment: ""), value: NSString("yes")), + ORKTextChoice(text: NSLocalizedString("No", comment: ""), value: NSString("no")), + ORKTextChoice(text: NSLocalizedString("I don't know", comment: ""), value: NSString("dunno")), + ORKTextChoice(text: NSLocalizedString("Prefer not to answer", comment: ""), value: NSString("no_answer")), + ] + ) + ), + ORKFormItem(sectionTitle: "What was the weight?"), + ORKFormItem( + identifier: "fruitHarvestWeight", + text: nil, + answerFormat: weightAnswerFormat + ) + ] + return step + }( ORKFormStep(identifier: "FruitWeightFormStep") ) - let question1 = NSLocalizedString("Would you like to subscribe to our newsletter?", comment: "") - let learnMoreInstructionStep = ORKLearnMoreInstructionStep(identifier: "LearnMoreInstructionStep01") - learnMoreInstructionStep.title = NSLocalizedString("Learn more title", comment: "") - learnMoreInstructionStep.text = NSLocalizedString("Learn more text", comment: "") - let learnMoreItem = ORKLearnMoreItem(text: nil, learnMoreInstructionStep: learnMoreInstructionStep) - - let question1Step = ORKQuestionStep(identifier: String(describing: Identifier.questionStep), title: "Questionnaire", question: question1, answer: question1StepAnswerFormat, learnMoreItem: learnMoreItem) - question1Step.text = exampleDetailText + let completionStep = ORKCompletionStep(identifier: "CompletionStep") + completionStep.title = NSLocalizedString("All Done!", comment: "") + completionStep.detailText = NSLocalizedString("You have completed the questionnaire.", comment: "") + return ORKOrderedTask(identifier: String(describing: Identifier.formTask), steps: [step, fruitSizeStep, completionStep]) + } + + private var formTaskWithMultipleOptions: ORKTask { + let textChoices: [ORKTextChoice] = [1...50] + .flatMap({ $0 }) + .compactMap({ index in + ORKTextChoiceOther(text: "Option \(index)", value: index as NSNumber) + }) + + let steps: [ORKFormStep] = [ + { + let step = ORKFormStep(identifier: String(describing: Identifier.formStepWithMultipleSelection), title: NSLocalizedString("Form Step with Multiple Selections", comment: ""), text: TaskListRowStrings.exampleDetailText) + step.formItems = [ + ORKFormItem(identifier: String(describing: Identifier.formItem01), text: TaskListRowStrings.exampleQuestionText, answerFormat: ORKTextChoiceAnswerFormat(style: .multipleChoice, textChoices: textChoices)), + ORKFormItem(identifier: String(describing: Identifier.formItem02), text: TaskListRowStrings.exampleQuestionText, answerFormat: ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: textChoices)) + + ] + return step + }(), + { + let step = ORKFormStep(identifier: String(describing: Identifier.formStepWithSingleSelection), title: NSLocalizedString("Form Step with Single Selection", comment: ""), text: TaskListRowStrings.exampleDetailText) + step.formItems = [ + ORKFormItem(identifier: String(describing: Identifier.formItem01), text: "Select only one", answerFormat: ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: textChoices)) + ] + return step + }() + ] - //Add a question step with different layout format. - let question2StepAnswerFormat = ORKAnswerFormat.dateAnswerFormat(withDefaultDate: nil, minimumDate: nil, maximumDate: Date(), calendar: nil) + return ORKOrderedTask(identifier: String(describing: Identifier.surveyTaskWithMultipleSelection), steps: steps) + } + + private var groupedFormTask: ORKTask { + let step = TaskListRowSteps.groupFormExample - let question2 = NSLocalizedString("When is your birthday?", comment: "") - let question2Step = ORKQuestionStep(identifier: String(describing: Identifier.birthdayQuestion), title: "Questionnaire", question: question2, answer: question2StepAnswerFormat) - question2Step.text = exampleDetailText + let booleanQuestionFormStep = TaskListRowSteps.booleanExample + //Add a question step with different layout format. + let birthdayQuestionFormStep = TaskListRowSteps.birthdayExample let appleChoices: [ORKTextChoice] = [ORKTextChoice(text: "Granny Smith", value: 1 as NSNumber), ORKTextChoice(text: "Honeycrisp", value: 2 as NSNumber), ORKTextChoice(text: "Fuji", value: 3 as NSNumber), ORKTextChoice(text: "McIntosh", value: 10 as NSNumber), ORKTextChoice(text: "Kanzi", value: 5 as NSNumber)] let appleAnswerFormat = ORKTextChoiceAnswerFormat(style: .singleChoice, textChoices: appleChoices) let appleFormItem = ORKFormItem(identifier: "appleFormItemIdentifier", text: "Which is your favorite apple?", answerFormat: appleAnswerFormat) + let conditionalFormItem = ORKFormItem(identifier: "newletterFormItemIdentifier", text: "Include apples with your newletter?", answerFormat: ORKBooleanAnswerFormat()) + conditionalFormItem.visibilityRule = ORKPredicateFormItemVisibilityRule( + predicate: ORKResultPredicate.predicateForBooleanQuestionResult( + with: .init(stepIdentifier: booleanQuestionFormStep.identifier, resultIdentifier: String(describing: Identifier.booleanFormItem)), + expectedAnswer: true + ) + ) let appleFormStep = ORKFormStep(identifier: "appleFormStepIdentifier", title: "Fruit!", text: "Select the fruit you like.") - appleFormStep.formItems = [appleFormItem] + appleFormStep.formItems = [ + appleFormItem, + conditionalFormItem + ] + + return ORKOrderedTask(identifier: String(describing: Identifier.groupedFormTask), steps: [step, booleanQuestionFormStep, birthdayQuestionFormStep, appleFormStep]) + } + + private var groupedFormTaskNoScroll: ORKTask { + let groupedFormStep = TaskListRowSteps.groupFormExample + groupedFormStep.autoScrollEnabled = false - return ORKOrderedTask(identifier: String(describing: Identifier.groupedFormTask), steps: [step, question1Step, question2Step, appleFormStep]) + return ORKOrderedTask(identifier: String(describing: Identifier.groupedFormTask), steps: [groupedFormStep]) } /** @@ -957,113 +978,83 @@ enum TaskListRow: Int, CustomStringConvertible { // Create the intro step. let instructionStep = ORKInstructionStep(identifier: String(describing: Identifier.introStep)) instructionStep.title = NSLocalizedString("Simple Survey", comment: "") - instructionStep.text = exampleDescription + instructionStep.text = TaskListRowStrings.exampleDescription instructionStep.detailText = NSLocalizedString("Please use this space to provide instructions for participants. Please make sure to provide enough information so that users can progress through the survey and complete with ease.", comment: "") - // Add a question step. - let question1StepAnswerFormat = ORKBooleanAnswerFormat() - - let question1 = NSLocalizedString("Would you like to subscribe to our newsletter?", comment: "") - - let learnMoreInstructionStep = ORKLearnMoreInstructionStep(identifier: "LearnMoreInstructionStep01") - learnMoreInstructionStep.title = NSLocalizedString("Learn more title", comment: "") - learnMoreInstructionStep.text = NSLocalizedString("Learn more text", comment: "") - let learnMoreItem = ORKLearnMoreItem(text: nil, learnMoreInstructionStep: learnMoreInstructionStep) - - let question1Step = ORKQuestionStep(identifier: String(describing: Identifier.questionStep), title: "Questionnaire", question: question1, answer: question1StepAnswerFormat, learnMoreItem: learnMoreItem) - question1Step.text = exampleDetailText + let booleanQuestionFormStep = TaskListRowSteps.booleanExample //Add a question step with different layout format. - let question2StepAnswerFormat = ORKAnswerFormat.dateAnswerFormat(withDefaultDate: nil, minimumDate: nil, maximumDate: Date(), calendar: nil) + let birthdayQuestionFormStep = TaskListRowSteps.birthdayExample - let question2 = NSLocalizedString("When is your birthday?", comment: "") - let question2Step = ORKQuestionStep(identifier: String(describing: Identifier.birthdayQuestion), title: "Questionnaire", question: question2, answer: question2StepAnswerFormat) - question2Step.text = exampleDetailText + let textChoiceFormStep = TaskListRowSteps.textChoiceExample - // Add a summary step. let summaryStep = ORKInstructionStep(identifier: String(describing: Identifier.summaryStep)) summaryStep.title = NSLocalizedString("Thanks", comment: "") summaryStep.text = NSLocalizedString("Thank you for participating in this sample survey.", comment: "") - + return ORKOrderedTask(identifier: String(describing: Identifier.surveyTask), steps: [ instructionStep, - question1Step, - question2Step, + booleanQuestionFormStep, + birthdayQuestionFormStep, + textChoiceFormStep, summaryStep ]) } - private var platterQuestionTask: ORKTask { - - let textChoiceOneText = NSLocalizedString("Choice 1", comment: "") - let textChoiceTwoText = NSLocalizedString("Choice 2", comment: "") - let textChoiceThreeText = NSLocalizedString("Choice 3", comment: "") + private var consentTask: ORKTask { + let welcomeInstructionStep = TaskListRowSteps.consentWelcomeStepExample + let informedConsentInstructionStep = TaskListRowSteps.informedConsentStepExample + let webViewStep = TaskListRowSteps.webViewStepExample + let consentSharingFormStep = TaskListRowSteps.informedConsentSharingStepExample - let descriptor = UIFontDescriptor.preferredFontDescriptor(withTextStyle: .headline) - let font = UIFont(descriptor: descriptor, size: descriptor.pointSize) - - let primaryAttributes = [NSAttributedString.Key.font:font] - - let textChoiceOnePrimaryAttributedString = NSAttributedString(string: textChoiceOneText, attributes:primaryAttributes) - let textChoiceTwoPrimaryAttributedString = NSAttributedString(string: textChoiceTwoText, attributes: primaryAttributes) - let textChoiceThreePrimaryAttributedString = NSAttributedString(string: textChoiceThreeText, attributes: primaryAttributes) - - let textChoices = [ - ORKTextChoice(text: nil, - primaryTextAttributedString: textChoiceOnePrimaryAttributedString, - detailText: "Detail", - detailTextAttributedString: nil, - value: "choice 1" as NSString, - exclusive: true), - ORKTextChoice(text: nil, - primaryTextAttributedString: textChoiceTwoPrimaryAttributedString, - detailText: "Detail", - detailTextAttributedString: nil, - value: "choice 2" as NSString, - exclusive: true), - ORKTextChoice(text: nil, - primaryTextAttributedString: textChoiceThreePrimaryAttributedString, - detailText: "Detail", - detailTextAttributedString: nil, - value: "choice 3" as NSString, - exclusive: true) + var steps: [ORKStep] = [ + welcomeInstructionStep, + informedConsentInstructionStep, + webViewStep, + consentSharingFormStep, ] +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + let requestPermissionStep = TaskListRowSteps.requestPermissionsStepExample + steps.append(requestPermissionStep) +#endif - let answerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, - textChoices: textChoices) + let consentCompletionStep = TaskListRowSteps.consentCompletionStepExample + steps.append(consentCompletionStep) - let questionStep = ORKQuestionStep.platterQuestion(withIdentifier: String(describing: Identifier.platterQuestionStep), - question: "How many fingers am I holding up?", - text: "Answer to the best of your knowledge.", - answerFormat: answerFormat) + return ORKOrderedTask(identifier: String(describing: Identifier.consentTask), steps: steps) + } + + private var consentDoc: ORKTask { + let pdfURL = FileManager.default.temporaryDirectory + .appendingPathComponent("consentTask") + .appendingPathExtension("pdf") + let pdfStep = ORKPDFViewerStep(identifier: "pdfStep", pdfURL: pdfURL) - return ORKOrderedTask(identifier: String(describing: Identifier.platterQuestionTask), steps: [questionStep]) + return ORKOrderedTask(identifier: String(describing: Identifier.consentDoc), steps: [pdfStep]) } - /// This task presents just a single "Yes" / "No" question. private var booleanQuestionTask: ORKTask { - let answerFormat = ORKBooleanAnswerFormat() + let booleanQuestionFormStep = TaskListRowSteps.booleanGenericExample - // We attach an answer format to a question step to specify what controls the user sees. - let questionStep = ORKQuestionStep(identifier: String(describing: Identifier.booleanQuestionStep), title: NSLocalizedString("Boolean", comment: ""), question: exampleQuestionText, answer: answerFormat) - - // The detail text is shown in a small font below the title. - questionStep.text = exampleDetailText - - return ORKOrderedTask(identifier: String(describing: Identifier.booleanQuestionTask), steps: [questionStep]) + return ORKOrderedTask(identifier: String(describing: Identifier.booleanQuestionTask), steps: [booleanQuestionFormStep]) } /// This task presents a customized "Yes" / "No" question. private var customBooleanQuestionTask: ORKTask { - let answerFormat = ORKBooleanAnswerFormat(yesString: "Agree", noString: "Disagree") + // Add a question step. + let booleanQuestionAnswerFormat = ORKBooleanAnswerFormat(yesString: "Agree", noString: "Disagree") - // We attach an answer format to a question step to specify what controls the user sees. - let questionStep = ORKQuestionStep(identifier: String(describing: Identifier.booleanQuestionStep), title: NSLocalizedString("Custom Boolean", comment: ""), question: exampleQuestionText, answer: answerFormat) + let learnMoreInstructionStep = ORKLearnMoreInstructionStep(identifier: "LearnMoreInstructionStep01") + learnMoreInstructionStep.title = NSLocalizedString("Learn more title", comment: "") + learnMoreInstructionStep.text = NSLocalizedString("Learn more text", comment: "") + let booleanQuestionLearnMoreItem = ORKLearnMoreItem(text: nil, learnMoreInstructionStep: learnMoreInstructionStep) - // The detail text is shown in a small font below the title. - questionStep.text = exampleDetailText + let booleanQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.booleanFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: booleanQuestionAnswerFormat) + booleanQuestionFormItem.learnMoreItem = booleanQuestionLearnMoreItem + let booleanQuestionFormStep = ORKFormStep(identifier: String(describing: Identifier.booleanFormStep), title: NSLocalizedString("Custom Boolean", comment: ""), text: TaskListRowStrings.exampleDetailText) + booleanQuestionFormStep.formItems = [booleanQuestionFormItem] - return ORKOrderedTask(identifier: String(describing: Identifier.booleanQuestionTask), steps: [questionStep]) + return ORKOrderedTask(identifier: String(describing: Identifier.booleanQuestionTask), steps: [booleanQuestionFormStep]) } /// This task demonstrates a question which asks for a date. @@ -1072,13 +1063,15 @@ enum TaskListRow: Int, CustomStringConvertible { The date answer format can also support minimum and maximum limits, a specific default value, and overriding the calendar to use. */ - let answerFormat = ORKAnswerFormat.dateAnswerFormat() + let dateAnswerFormat = ORKAnswerFormat.dateAnswerFormat() - let step = ORKQuestionStep(identifier: String(describing: Identifier.dateQuestionStep), title: NSLocalizedString("Date", comment: ""), question: exampleQuestionText, answer: answerFormat) + let dateQuestionSectionHeaderFormItem = ORKFormItem(sectionTitle: TaskListRowStrings.exampleQuestionText) + let dateQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.dateQuestionFormItem), text: nil, answerFormat: dateAnswerFormat) + dateQuestionFormItem.placeholder = "Select Date" + let dateQuestionFormStep = ORKFormStep(identifier: String(describing: Identifier.dateQuestionStep), title: NSLocalizedString("Date", comment: ""), text: TaskListRowStrings.exampleDetailText) + dateQuestionFormStep.formItems = [dateQuestionSectionHeaderFormItem, dateQuestionFormItem] - step.text = exampleDetailText - - return ORKOrderedTask(identifier: String(describing: Identifier.dateQuestionTask), steps: [step]) + return ORKOrderedTask(identifier: String(describing: Identifier.dateQuestionTask), steps: [dateQuestionFormStep]) } /// This task demonstrates a question which asks for a date. @@ -1087,153 +1080,77 @@ enum TaskListRow: Int, CustomStringConvertible { The date answer format can also support minimum and maximum limits, a specific default value, and overriding the calendar to use. */ - let answerFormat = ORKAnswerFormat.dateAnswerFormatWithDays(beforeCurrentDate: 3, daysAfterCurrentDate: 3, calendar: nil) - let step = ORKQuestionStep(identifier: String(describing: Identifier.dateQuestionStep), title: NSLocalizedString("Date", comment: ""), question: exampleDate3DayLimitQuestionTask, answer: answerFormat) + let dateAnswerFormat = ORKAnswerFormat.dateAnswerFormatWithDays(beforeCurrentDate: 3, daysAfterCurrentDate: 3, calendar: nil) - step.text = exampleDetailText + let dateQuestionSectionHeaderFormItem = ORKFormItem(sectionTitle: TaskListRowStrings.exampleQuestionText) + let dateQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.dateQuestionFormItem), text: nil, answerFormat: dateAnswerFormat) + dateQuestionFormItem.placeholder = "Select Date" + let dateQuestionFormStep = ORKFormStep(identifier: String(describing: Identifier.dateQuestionStep), title: NSLocalizedString("Date", comment: ""), text: TaskListRowStrings.exampleDate3DayLimitQuestionTask) + dateQuestionFormStep.formItems = [dateQuestionSectionHeaderFormItem, dateQuestionFormItem] - return ORKOrderedTask(identifier: String(describing: Identifier.dateQuestionTask), steps: [step]) + return ORKOrderedTask(identifier: String(describing: Identifier.dateQuestionTask), steps: [dateQuestionFormStep]) } - /// This task demonstrates a question asking for a date and time of an event. private var dateTimeQuestionTask: ORKTask { /* This uses the default calendar. Use a more detailed constructor to set minimum / maximum limits. */ - let answerFormat = ORKAnswerFormat.dateTime() - let step = ORKQuestionStep(identifier: String(describing: Identifier.dateTimeQuestionStep), title: NSLocalizedString("Date and Time", comment: ""), question: exampleQuestionText, answer: answerFormat) + let dateTimeAnswerFormat = ORKAnswerFormat.dateTime() - step.text = exampleDetailText + let dateTimeQuestionSectionHeaderFormItem = ORKFormItem(sectionTitle: TaskListRowStrings.exampleQuestionText) + let dateTimeQuestionFormItem = ORKFormItem(identifier: String(describing: Identifier.dateTimeQuestionFormStep), text: nil, answerFormat: dateTimeAnswerFormat) + dateTimeQuestionFormItem.placeholder = "Select Date & Time" + let dateTimeQuestionFormStep = ORKFormStep(identifier: String(describing: Identifier.dateTimeQuestionFormItem), title: NSLocalizedString("Date and Time", comment: ""), text: TaskListRowStrings.exampleQuestionText) + dateTimeQuestionFormStep.formItems = [dateTimeQuestionSectionHeaderFormItem, dateTimeQuestionFormItem] - return ORKOrderedTask(identifier: String(describing: Identifier.dateTimeQuestionTask), steps: [step]) + return ORKOrderedTask(identifier: String(describing: Identifier.dateTimeQuestionTask), steps: [dateTimeQuestionFormStep]) } /// This task demonstrates a question asking for the user height. private var heightQuestionTask: ORKTask { - let answerFormat1 = ORKAnswerFormat.heightAnswerFormat() - - let step1 = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep1), title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat1) - - step1.text = "Local system" - - - let step1NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep1) + "NonOptional", title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat1) - step1NonOptional.text = "Local system (Non Optional)" - step1NonOptional.isOptional = false - - let answerFormat2 = ORKAnswerFormat.heightAnswerFormat(with: ORKMeasurementSystem.metric) + let step1 = TaskListRowSteps.heightExample + let step2 = TaskListRowSteps.heightMetricSystemExample + let step3 = TaskListRowSteps.heightUSCSystemExample - let step2 = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep2), title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat2) - - step2.text = "Metric system" - - let step2NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep2) + "NonOptional", title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat2) - step2NonOptional.text = "Metric system (Non Optional)" - step2NonOptional.isOptional = false - - let answerFormat3 = ORKAnswerFormat.heightAnswerFormat(with: ORKMeasurementSystem.USC) - - let step3 = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep3), title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat3) - - step3.text = "USC system" - - let step3NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep3) + "NonOptional", title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat3) - step3NonOptional.text = "USC system (Non Optional)" - step3NonOptional.isOptional = false + var steps = [step1, step2, step3] - let answerFormat4 = ORKHealthKitQuantityTypeAnswerFormat(quantityType: HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.height)!, unit: HKUnit.meterUnit(with: .centi), style: .decimal) - - let step4 = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep4), title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat4) - - step4.text = "HealthKit, height" - - let step4NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.heightQuestionStep4) + "NonOptional", title: NSLocalizedString("Height", comment: ""), question: exampleQuestionText, answer: answerFormat1) - step4NonOptional.text = "HealthKit, height (Non Optional" - step4NonOptional.isOptional = false - - return ORKOrderedTask(identifier: String(describing: Identifier.heightQuestionTask), steps: [step1, step1NonOptional, step2, step2NonOptional, step3, step3NonOptional, step4NonOptional, step4]) +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + let step4 = TaskListRowSteps.heightHealthKitExample + steps.append(contentsOf:[step4]) +#endif + return ORKOrderedTask(identifier: String(describing: Identifier.heightQuestionTask), steps: steps) } /// This task demonstrates a question asking for the user weight. private var weightQuestionTask: ORKTask { - let answerFormat1 = ORKAnswerFormat.weightAnswerFormat() - - let step1 = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep1), title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat1) - - step1.text = "Local system, default precision" - - let step1NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep1) + "NonOptional", title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat1) - - step1NonOptional.text = "Local system, default precision (nonOptional)" - step1NonOptional.isOptional = false - - let answerFormat2 = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.metric) - - let step2 = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep2), title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat2) - - step2.text = "Metric system, default precision" - - let step2NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep2) + "NonOptional", title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat2) + let step1 = TaskListRowSteps.weightExample + let step2 = TaskListRowSteps.weightMetricSystemExample + let step3 = TaskListRowSteps.weightMetricSystemLowPrecisionExample + let step4 = TaskListRowSteps.weightMetricSystemHighPrecisionExample + let step5 = TaskListRowSteps.weightUSCSystemExample + let step6 = TaskListRowSteps.weightUSCSystemHighPrecisionExample - step2NonOptional.text = "Metric system, default precision (nonOptional)" - step2NonOptional.isOptional = false + var steps = [step1, step2, step3, step4, step5, step6] - let answerFormat3 = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.metric, numericPrecision: ORKNumericPrecision.low, minimumValue: ORKDoubleDefaultValue, maximumValue: ORKDoubleDefaultValue, defaultValue: ORKDoubleDefaultValue) - - let step3 = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep3), title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat3) - - step3.text = "Metric system, low precision" - - let step3NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep3) + "NonOptional", title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat3) - step3NonOptional.text = "Metric system, low precision (nonOptional)" - step3NonOptional.isOptional = false - - let answerFormat4 = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.metric, numericPrecision: ORKNumericPrecision.high, minimumValue: 20.0, maximumValue: 100.0, defaultValue: 45.50) - - let step4 = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep4), title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat4) - - step4.text = "Metric system, high precision" - - let step4NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep4) + "NonOptional", title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat4) - step4NonOptional.text = "Metric system, high precision (nonOptional)" - step4NonOptional.isOptional = false - - let answerFormat5 = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.USC) - - let step5 = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep5), title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat5) - - step5.text = "USC system, default precision" - - let step5NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep5) + "NonOptional", title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat5) - step5NonOptional.text = "USC system, default precision (nonOptional)" - step5NonOptional.isOptional = false - - let answerFormat6 = ORKAnswerFormat.weightAnswerFormat(with: ORKMeasurementSystem.USC, numericPrecision: ORKNumericPrecision.high, minimumValue: 50.0, maximumValue: 150.0, defaultValue: 100.0) - - let step6 = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep6), title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat6) - - step6.text = "USC system, high precision" - - let step6NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep6) + "NonOptional", title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat6) - step6NonOptional.text = "USC system, high precision (nonOptional)" - step6NonOptional.isOptional = false - - let answerFormat7 = ORKHealthKitQuantityTypeAnswerFormat(quantityType: HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)!, unit: HKUnit.gramUnit(with: .kilo), style: .decimal) - - let step7 = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep7), title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat7) - - step7.text = "HealthKit, body mass" +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + let step7 = TaskListRowSteps.weightHealthKitBodyMassExample + steps.append(contentsOf:[step7]) +#endif + return ORKOrderedTask(identifier: String(describing: Identifier.weightQuestionTask), steps: steps) + } - let step7NonOptional = ORKQuestionStep(identifier: String(describing: Identifier.weightQuestionStep7) + "NonOptional", title: NSLocalizedString("Weight", comment: ""), question: exampleQuestionText, answer: answerFormat7) - step7NonOptional.text = "HealthKit, body mass (nonOptional)" - step7NonOptional.isOptional = false +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION + private var healthQuantityTypeTask: ORKTask { + let heartRateQuestion = TaskListRowSteps.heartRateExample + let bloodTypeQuestion = TaskListRowSteps.bloodTypeExample - return ORKOrderedTask(identifier: String(describing: Identifier.weightQuestionTask), steps: [step1, step1NonOptional, step2, step2NonOptional, step3, step3NonOptional, step4, step4NonOptional, step5, step5NonOptional, step6, step6NonOptional, step7NonOptional, step7]) + return ORKOrderedTask(identifier: String(describing: Identifier.healthQuantityTask), steps: [heartRateQuestion, bloodTypeQuestion]) } +#endif /** This task demonstrates a survey question involving picking from a series of @@ -1241,43 +1158,42 @@ enum TaskListRow: Int, CustomStringConvertible { use a range of icons for faces ranging from happy to sad. */ private var imageChoiceQuestionTask: ORKTask { - let roundShapeImage = UIImage(named: "round_shape")! - let roundShapeText = NSLocalizedString("Round Shape", comment: "") - - let squareShapeImage = UIImage(named: "square_shape")! - let squareShapeText = NSLocalizedString("Square Shape", comment: "") - - let imageChoces = [ - ORKImageChoice(normalImage: roundShapeImage, selectedImage: nil, text: roundShapeText, value: roundShapeText as NSString), - ORKImageChoice(normalImage: squareShapeImage, selectedImage: nil, text: squareShapeText, value: squareShapeText as NSString) - ] - - let answerFormat1 = ORKAnswerFormat.choiceAnswerFormat(with: imageChoces) - - let questionStep1 = ORKQuestionStep(identifier: String(describing: Identifier.imageChoiceQuestionStep1), title: NSLocalizedString("Image Choice", comment: ""), question: exampleQuestionText, answer: answerFormat1) - - questionStep1.text = exampleDetailText - - let answerFormat2 = ORKAnswerFormat.choiceAnswerFormat(with: imageChoces, style: .singleChoice, vertical: true) - - let questionStep2 = ORKQuestionStep(identifier: String(describing: Identifier.imageChoiceQuestionStep2), title: NSLocalizedString("Image Choice", comment: ""), question: exampleQuestionText, answer: answerFormat2) - - questionStep2.text = exampleDetailText + let questionStep1 = TaskListRowSteps.imageChoiceExample + let questionStep2 = TaskListRowSteps.imageChoiceVerticalExample return ORKOrderedTask(identifier: String(describing: Identifier.imageChoiceQuestionTask), steps: [questionStep1, questionStep2]) } - + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION /// This task presents just a single location question. private var locationQuestionTask: ORKTask { - let answerFormat = ORKLocationAnswerFormat() + let locationFormStep = TaskListRowSteps.locationExample - // We attach an answer format to a question step to specify what controls the user sees. - let questionStep = ORKQuestionStep(identifier: String(describing: Identifier.locationQuestionStep), title: NSLocalizedString("Location", comment: ""), question: exampleQuestionText, answer: answerFormat) - // The detail text is shown in a small font below the title. - questionStep.text = exampleDetailText - questionStep.placeholder = NSLocalizedString("Address", comment: "") + return ORKOrderedTask(identifier: String(describing: Identifier.locationQuestionTask), steps: [locationFormStep]) + } +#endif + + /// This task presents a few different ORKReviewSteps + private var reviewTask: ORKTask { + let embeddedReviewStep = TaskListRowSteps.embeddedReviewStepExample - return ORKOrderedTask(identifier: String(describing: Identifier.locationQuestionTask), steps: [questionStep]) + let standAloneInstructionStep1 = ORKInstructionStep(identifier: "standAloneInstruction1") + standAloneInstructionStep1.text = "First Item" + standAloneInstructionStep1.detailText = "There is a lot of detail to cover in this Instruction Step" + + let standAloneInstructionStep2 = ORKInstructionStep(identifier: "standAloneInstruction2") + standAloneInstructionStep2.text = "Second Item" + standAloneInstructionStep2.detailText = "There is a lot of detail to cover in this Instruction Step" + + let standAloneInstructionStep3 = ORKInstructionStep(identifier: "standAloneInstruction3") + standAloneInstructionStep3.text = "Third Item" + standAloneInstructionStep3.detailText = "There is a lot of detail to cover in this Instruction Step" + + let textAnswerFormStep = TaskListRowSteps.textAnswerExample + + let standAloneReviewStep = ORKReviewStep.standaloneReviewStep(withIdentifier:String(describing: Identifier.standAloneReviewStep), steps:[standAloneInstructionStep1, standAloneInstructionStep2, standAloneInstructionStep3, textAnswerFormStep], resultSource: nil) + standAloneReviewStep.title = "Standalone Review" + return ORKOrderedTask(identifier: String(describing: Identifier.reviewTask), steps: [embeddedReviewStep, standAloneReviewStep]) } /** @@ -1286,27 +1202,9 @@ enum TaskListRow: Int, CustomStringConvertible { in the expected unit. The unit string propagates into the result object. */ private var numericQuestionTask: ORKTask { - // This answer format will display a unit in-line with the numeric entry field. - let localizedQuestionStep1AnswerFormatUnit = NSLocalizedString("Your unit", comment: "") - let questionStep1AnswerFormat = ORKAnswerFormat.decimalAnswerFormat(withUnit: localizedQuestionStep1AnswerFormatUnit) - - let questionStep1 = ORKQuestionStep(identifier: String(describing: Identifier.numericQuestionStep), title: NSLocalizedString("Numeric", comment: ""), question: exampleQuestionText, answer: questionStep1AnswerFormat) - - questionStep1.text = exampleDetailText - questionStep1.placeholder = NSLocalizedString("Your placeholder.", comment: "") - - // This answer format is similar to the previous one, but this time without displaying a unit. - let questionStep2 = ORKQuestionStep(identifier: String(describing: Identifier.numericNoUnitQuestionStep), title: NSLocalizedString("Numeric", comment: ""), question: exampleQuestionText, answer: ORKAnswerFormat.decimalAnswerFormat(withUnit: nil)) - - questionStep2.text = exampleDetailText - questionStep2.placeholder = NSLocalizedString("Placeholder without unit.", comment: "") - - // This answer format is similar to the previous one, but this time with a display unit. - let questionStep3 = ORKQuestionStep(identifier: String(describing: Identifier.numericDisplayUnitQuestionStep), title: NSLocalizedString("Numeric with Display Unit", comment: ""), question: exampleQuestionText, answer: ORKNumericAnswerFormat(style: .decimal, unit: "weeks", displayUnit: "semanas", minimum: nil, maximum: nil, maximumFractionDigits: 1)) - - questionStep3.text = exampleDetailText - questionStep3.placeholder = NSLocalizedString("Placeholder with display unit.", comment: "") - + let questionStep1 = TaskListRowSteps.decimalExample + let questionStep2 = TaskListRowSteps.decimalNoUnitExample + let questionStep3 = TaskListRowSteps.decimalWithDisplayUnitExample return ORKOrderedTask(identifier: String(describing: Identifier.numericQuestionTask), steps: [ questionStep1, @@ -1317,52 +1215,12 @@ enum TaskListRow: Int, CustomStringConvertible { /// This task presents two options for questions displaying a scale control. private var scaleQuestionTask: ORKTask { - // The first step is a scale control with 10 discrete ticks. - let stepTitle = NSLocalizedString("Scale", comment: "") - - let step1AnswerFormat = ORKAnswerFormat.scale(withMaximumValue: 10, minimumValue: 1, defaultValue: NSIntegerMax, step: 1, vertical: false, maximumValueDescription: exampleHighValueText, minimumValueDescription: exampleLowValueText) - - let questionStep1 = ORKQuestionStep(identifier: String(describing: Identifier.discreteScaleQuestionStep), title: stepTitle, question: exampleQuestionText, answer: step1AnswerFormat) - - questionStep1.text = NSLocalizedString("Discrete Scale", comment: "") - - // The second step is a scale control that allows continuous movement with a percent formatter. - let step2AnswerFormat = ORKAnswerFormat.continuousScale(withMaximumValue: 1.0, minimumValue: 0.0, defaultValue: 99.0, maximumFractionDigits: 0, vertical: false, maximumValueDescription: nil, minimumValueDescription: nil) - step2AnswerFormat.numberStyle = .percent - - let questionStep2 = ORKQuestionStep(identifier: String(describing: Identifier.continuousScaleQuestionStep), title: stepTitle, question: exampleQuestionText, answer: step2AnswerFormat) - - questionStep2.text = NSLocalizedString("Continuous Scale", comment: "") - - // The third step is a vertical scale control with 10 discrete ticks. - let step3AnswerFormat = ORKAnswerFormat.scale(withMaximumValue: 10, minimumValue: 1, defaultValue: NSIntegerMax, step: 1, vertical: true, maximumValueDescription: nil, minimumValueDescription: nil) - - let questionStep3 = ORKQuestionStep(identifier: String(describing: Identifier.discreteVerticalScaleQuestionStep), title: stepTitle, question: exampleQuestionText, answer: step3AnswerFormat) - - questionStep3.text = NSLocalizedString("Discrete Vertical Scale", comment: "") - - // The fourth step is a vertical scale control that allows continuous movement. - let step4AnswerFormat = ORKAnswerFormat.continuousScale(withMaximumValue: 5.0, minimumValue: 1.0, defaultValue: 99.0, maximumFractionDigits: 2, vertical: true, maximumValueDescription: exampleHighValueText, minimumValueDescription: exampleLowValueText) - - let questionStep4 = ORKQuestionStep(identifier: String(describing: Identifier.continuousVerticalScaleQuestionStep), title: stepTitle, question: exampleQuestionText, answer: step4AnswerFormat) - - questionStep4.text = "Continuous Vertical Scale" - - // The fifth step is a scale control that allows text choices. - let textChoices: [ORKTextChoice] = [ORKTextChoice(text: "Poor", value: 1 as NSNumber), ORKTextChoice(text: "Fair", value: 2 as NSNumber), ORKTextChoice(text: "Good", value: 3 as NSNumber), ORKTextChoice(text: "Above Average", value: 10 as NSNumber), ORKTextChoice(text: "Excellent", value: 5 as NSNumber)] - - let step5AnswerFormat = ORKAnswerFormat.textScale(with: textChoices, defaultIndex: NSIntegerMax, vertical: false) - - let questionStep5 = ORKQuestionStep(identifier: String(describing: Identifier.textScaleQuestionStep), title: stepTitle, question: exampleQuestionText, answer: step5AnswerFormat) - - questionStep5.text = "Text Scale" - - // The sixth step is a vertical scale control that allows text choices. - let step6AnswerFormat = ORKAnswerFormat.textScale(with: textChoices, defaultIndex: NSIntegerMax, vertical: true) - - let questionStep6 = ORKQuestionStep(identifier: String(describing: Identifier.textVerticalScaleQuestionStep), title: stepTitle, question: exampleQuestionText, answer: step6AnswerFormat) - - questionStep6.text = "Text Vertical Scale" + let questionStep1 = TaskListRowSteps.scaleExample + let questionStep2 = TaskListRowSteps.continuousScaleWithPercentExample + let questionStep3 = TaskListRowSteps.verticalScaleWithPercentExample + let questionStep4 = TaskListRowSteps.continuousVerticalScaleExample + let questionStep5 = TaskListRowSteps.scaleWithTextChoicesExample + let questionStep6 = TaskListRowSteps.verticalScaleWithTextChoicesExample return ORKOrderedTask(identifier: String(describing: Identifier.scaleQuestionTask), steps: [ questionStep1, @@ -1380,14 +1238,8 @@ enum TaskListRow: Int, CustomStringConvertible { format. */ private var textQuestionTask: ORKTask { - let answerFormat = ORKAnswerFormat.textAnswerFormat() - answerFormat.multipleLines = true - answerFormat.maximumLength = 280 - - let step = ORKQuestionStep(identifier: String(describing: Identifier.textQuestionStep), title: NSLocalizedString("Text", comment: ""), question: exampleQuestionText, answer: answerFormat) - step.text = exampleDetailText - - return ORKOrderedTask(identifier: String(describing: Identifier.textQuestionTask), steps: [step]) + let textFormStep = TaskListRowSteps.textMultiLineAnswerExample + return ORKOrderedTask(identifier: String(describing: Identifier.textQuestionTask), steps: [textFormStep]) } @@ -1407,37 +1259,31 @@ enum TaskListRow: Int, CustomStringConvertible { ORKTextChoice(text: textChoiceOneText, value: "choice_1" as NSString), ORKTextChoice(text: textChoiceTwoText, value: "choice_2" as NSString), ORKTextChoice(text: textChoiceThreeText, value: "choice_3" as NSString), - ORKTextChoiceOther.choice(withText: textChoiceFourText, detailText: nil, value: "choice_4" as NSString, exclusive: true, textViewPlaceholderText: "enter additional information") + ORKTextChoiceOther.choice(withText: textChoiceFourText, detailText: nil, value: textChoiceFourText as NSString, exclusive: true, textViewPlaceholderText: "enter additional information") ] - let answerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: textChoices) + let answerFormat1 = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: textChoices) + + let formItem1 = ORKFormItem(identifier: String(describing: Identifier.formItem01), text: "Select an option", answerFormat: answerFormat1) - let questionStep = ORKQuestionStep(identifier: String(describing: Identifier.textChoiceQuestionStep), title: NSLocalizedString("Text Choice", comment: ""), question: exampleQuestionText, answer: answerFormat) + let formStep1 = ORKFormStep(identifier: String(describing: Identifier.formStep), title: "Your title here", text: "Your text here") + formStep1.formItems = [formItem1] + + let answerFormat2 = ORKAnswerFormat.choiceAnswerFormat(with: .multipleChoice, textChoices: textChoices) + let formItem2 = ORKFormItem(identifier: String(describing: Identifier.formItem02), text: "Select one or more options", answerFormat: answerFormat2) + let formStep2 = ORKFormStep(identifier: String(describing: Identifier.formStep02), title: "Your title here", text: "Your text here") + formStep2.formItems = [formItem2] - questionStep.text = exampleDetailText + let completionStep = ORKCompletionStep(identifier: String(describing: Identifier.completionStep)) + completionStep.title = "Task Complete" - return ORKOrderedTask(identifier: String(describing: Identifier.textChoiceQuestionTask), steps: [questionStep]) + return ORKOrderedTask(identifier: String(describing: Identifier.textChoiceQuestionTask), steps: [formStep1, formStep2, completionStep]) } - private var textChoiceQuestionWithImageTask: ORKTask { - let textChoiceOneText = NSLocalizedString("Choice 1", comment: "") - let textChoiceTwoText = NSLocalizedString("Choice 2", comment: "") - let textChoiceThreeText = NSLocalizedString("Choice 3", comment: "") - - // The text to display can be separate from the value coded for each choice: - let textChoices = [ - ORKTextChoice(text: textChoiceOneText, image: UIImage(named: "Face")!, value: "tap 1" as NSString), - ORKTextChoice(text: textChoiceTwoText, image: UIImage(named: "Face")!, value: "tap 2" as NSString), - ORKTextChoice(text: textChoiceThreeText, image: UIImage(named: "Face")!, value: "tap 3" as NSString) - ] - - let answerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, textChoices: textChoices) - let questionStep = ORKQuestionStep(identifier: String(describing: Identifier.textChoiceQuestionWithImageStep), title: NSLocalizedString("Text Choice", comment: ""), question: exampleQuestionText, answer: answerFormat) - - questionStep.text = exampleDetailText - - return ORKOrderedTask(identifier: String(describing: Identifier.textChoiceQuestionWithImageTask), steps: [questionStep]) + let textChoiceFormStep = TaskListRowSteps.textChoiceImagesExample + + return ORKOrderedTask(identifier: String(describing: Identifier.textChoiceQuestionWithImageTask), steps: [textChoiceFormStep]) } /** @@ -1446,35 +1292,16 @@ enum TaskListRow: Int, CustomStringConvertible { commute?" */ private var timeIntervalQuestionTask: ORKTask { - /* - The time interval answer format is constrained to entering a time - less than 24 hours and in steps of minutes. For times that don't fit - these restrictions, use another mode of data entry. - */ - let answerFormat = ORKAnswerFormat.timeIntervalAnswerFormat() - - let step = ORKQuestionStep(identifier: String(describing: Identifier.timeIntervalQuestionStep), title: NSLocalizedString("Time Interval", comment: ""), question: exampleQuestionText, answer: answerFormat) - - step.text = exampleDetailText + let timeIntervalFormStep = TaskListRowSteps.timeIntervalExample - return ORKOrderedTask(identifier: String(describing: Identifier.timeIntervalQuestionTask), steps: [step]) + return ORKOrderedTask(identifier: String(describing: Identifier.timeIntervalQuestionTask), steps: [timeIntervalFormStep]) } /// This task demonstrates a question asking for a time of day. private var timeOfDayQuestionTask: ORKTask { - /* - Because we don't specify a default, the picker will default to the - time the step is presented. For questions like "What time do you have - breakfast?", it would make sense to set the default on the answer - format. - */ - let answerFormat = ORKAnswerFormat.timeOfDayAnswerFormat() - - let questionStep = ORKQuestionStep(identifier: String(describing: Identifier.timeOfDayQuestionStep), title: NSLocalizedString("Time", comment: ""), question: exampleQuestionText, answer: answerFormat) + let timeOfDayFormStep = TaskListRowSteps.timeOfDayExample - questionStep.text = exampleDetailText - - return ORKOrderedTask(identifier: String(describing: Identifier.timeOfDayQuestionTask), steps: [questionStep]) + return ORKOrderedTask(identifier: String(describing: Identifier.timeOfDayQuestionTask), steps: [timeOfDayFormStep]) } /** @@ -1483,24 +1310,9 @@ enum TaskListRow: Int, CustomStringConvertible { which can serve a similar purpose. */ private var valuePickerChoiceQuestionTask: ORKTask { - let textChoiceOneText = NSLocalizedString("Choice 1", comment: "") - let textChoiceTwoText = NSLocalizedString("Choice 2", comment: "") - let textChoiceThreeText = NSLocalizedString("Choice 3", comment: "") - - // The text to display can be separate from the value coded for each choice: - let textChoices = [ - ORKTextChoice(text: textChoiceOneText, value: "choice_1" as NSString), - ORKTextChoice(text: textChoiceTwoText, value: "choice_2" as NSString), - ORKTextChoice(text: textChoiceThreeText, value: "choice_3" as NSString) - ] - - let answerFormat = ORKAnswerFormat.valuePickerAnswerFormat(with: textChoices) - - let questionStep = ORKQuestionStep(identifier: String(describing: Identifier.valuePickerChoiceQuestionStep), title: NSLocalizedString("Value Picker", comment: ""), question: exampleQuestionText, answer: answerFormat) - - questionStep.text = NSLocalizedString("Text Value picker", comment: "") + let valuePickerFormStep = TaskListRowSteps.valuePickerChoicesExample - return ORKOrderedTask(identifier: String(describing: Identifier.valuePickerChoiceQuestionTask), steps: [questionStep]) + return ORKOrderedTask(identifier: String(describing: Identifier.valuePickerChoiceQuestionTask), steps: [valuePickerFormStep]) } /** @@ -1509,27 +1321,10 @@ enum TaskListRow: Int, CustomStringConvertible { format. */ private var validatedTextQuestionTask: ORKTask { - let emailDomainRegularExpressionPattern = "^[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$" - let emailDomainRegularExpression = try? NSRegularExpression(pattern: emailDomainRegularExpressionPattern) - let emailAnswerFormatDomain = ORKAnswerFormat.textAnswerFormat(withValidationRegularExpression: emailDomainRegularExpression!, invalidMessage: "Invalid Email: %@") - - let stepEmail = ORKQuestionStep(identifier: String(describing: Identifier.validatedTextQuestionStepEmail), title: NSLocalizedString("Validated Text", comment: ""), question: NSLocalizedString("Email", comment: ""), answer: emailAnswerFormatDomain) - stepEmail.text = exampleDetailText - - let urlDomainRegularExpressionPattern = "^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$" - let urlDomainRegularExpression = try? NSRegularExpression(pattern: urlDomainRegularExpressionPattern) - let answerFormatDomain = ORKAnswerFormat.textAnswerFormat(withValidationRegularExpression: urlDomainRegularExpression!, invalidMessage: "Invalid URL: %@") - - answerFormatDomain.multipleLines = false - answerFormatDomain.keyboardType = .URL - answerFormatDomain.autocapitalizationType = UITextAutocapitalizationType.none - answerFormatDomain.autocorrectionType = UITextAutocorrectionType.no - answerFormatDomain.spellCheckingType = UITextSpellCheckingType.no - answerFormatDomain.textContentType = UITextContentType.URL - let stepDomain = ORKQuestionStep(identifier: String(describing: Identifier.validatedTextQuestionStepDomain), title: NSLocalizedString("Validated Text", comment: ""), question: NSLocalizedString("URL", comment: ""), answer: answerFormatDomain) - stepDomain.text = exampleDetailText + let validatedEmailFormStep = TaskListRowSteps.emailExample + let validatedTextFormStep = TaskListRowSteps.validatedTextExample - return ORKOrderedTask(identifier: String(describing: Identifier.validatedTextQuestionTask), steps: [stepEmail, stepDomain]) + return ORKOrderedTask(identifier: String(describing: Identifier.validatedTextQuestionTask), steps: [validatedEmailFormStep, validatedTextFormStep]) } /// This task presents the image capture step in an ordered task. @@ -1539,7 +1334,7 @@ enum TaskListRow: Int, CustomStringConvertible { instructionStep.title = NSLocalizedString("Image Capture Survey", comment: "") - instructionStep.text = exampleDescription + instructionStep.text = TaskListRowStrings.exampleDescription let handSolidImage = UIImage(named: "hand_solid")! instructionStep.image = handSolidImage.withRenderingMode(.alwaysTemplate) @@ -1567,7 +1362,7 @@ enum TaskListRow: Int, CustomStringConvertible { instructionStep.title = NSLocalizedString("Video Capture Survey", comment: "") - instructionStep.text = exampleDescription + instructionStep.text = TaskListRowStrings.exampleDescription let handSolidImage = UIImage(named: "hand_solid")! instructionStep.image = handSolidImage.withRenderingMode(.alwaysTemplate) @@ -1590,12 +1385,12 @@ enum TaskListRow: Int, CustomStringConvertible { private var waitTask: ORKTask { let waitStepIndeterminate = ORKWaitStep(identifier: String(describing: Identifier.waitStepIndeterminate)) waitStepIndeterminate.title = NSLocalizedString("Wait Step", comment: "") - waitStepIndeterminate.text = exampleDescription + waitStepIndeterminate.text = "Will navigate forward after 5 seconds" waitStepIndeterminate.indicatorType = ORKProgressIndicatorType.indeterminate let waitStepDeterminate = ORKWaitStep(identifier: String(describing: Identifier.waitStepDeterminate)) waitStepDeterminate.title = NSLocalizedString("Wait Step", comment: "") - waitStepDeterminate.text = exampleDescription + waitStepDeterminate.text = TaskListRowStrings.exampleDescription waitStepDeterminate.indicatorType = ORKProgressIndicatorType.progressBar return ORKOrderedTask(identifier: String(describing: Identifier.waitTask), steps: [waitStepIndeterminate, waitStepDeterminate]) @@ -1616,6 +1411,10 @@ enum TaskListRow: Int, CustomStringConvertible { let motionActivityPermissionType = ORKMotionActivityPermissionType() + + var permissionTypes = [notificationsPermissionType, motionActivityPermissionType] + +#if ORK_FEATURE_HEALTHKIT_AUTHORIZATION let healthKitTypesToWrite: Set = [ HKObjectType.quantityType(forIdentifier: .bodyMassIndex)!, HKObjectType.quantityType(forIdentifier: .activeEnergyBurned)!, @@ -1626,16 +1425,27 @@ enum TaskListRow: Int, CustomStringConvertible { HKObjectType.characteristicType(forIdentifier: .bloodType)!, HKObjectType.workoutType()] - let healthKitPermissionType = ORKHealthKitPermissionType(sampleTypesToWrite: healthKitTypesToWrite, - objectTypesToRead: healthKitTypesToRead) + let healthKitPermissionType = ORKHealthKitPermissionType( + sampleTypesToWrite: healthKitTypesToWrite, + objectTypesToRead: healthKitTypesToRead + ) + + permissionTypes.append(healthKitPermissionType) +#endif + +#if ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION let locationPermissionType = ORKLocationPermissionType() + permissionTypes.append(locationPermissionType) +#endif let requestPermissionsStep = ORKRequestPermissionsStep( identifier: String(describing: Identifier.requestPermissionsStep), - permissionTypes: [notificationsPermissionType, motionActivityPermissionType, healthKitPermissionType, locationPermissionType]) + permissionTypes: permissionTypes) requestPermissionsStep.title = "Health Data Request" + requestPermissionsStep.detailText = "Some details here" + requestPermissionsStep.useExtendedPadding = false requestPermissionsStep.text = "Please review the health data types below and enable sharing to contribute to the study." return ORKOrderedTask(identifier: String(describing: Identifier.requestPermissionsStep), steps: [requestPermissionsStep]) @@ -1649,7 +1459,7 @@ enum TaskListRow: Int, CustomStringConvertible { // Intro step let introStep = ORKInstructionStep(identifier: String(describing: Identifier.eligibilityIntroStep)) introStep.title = NSLocalizedString("Eligibility Task", comment: "") - introStep.text = exampleDescription + introStep.text = TaskListRowStrings.exampleDescription introStep.detailText = NSLocalizedString("Please use this space to provide instructions for participants. Please make sure to provide enough information so that users can progress through the survey and complete with ease.", comment: "") // Form step @@ -1659,14 +1469,13 @@ enum TaskListRow: Int, CustomStringConvertible { // Form items let textChoices: [ORKTextChoice] = [ORKTextChoice(text: "Yes", value: "Yes" as NSString), ORKTextChoice(text: "No", value: "No" as NSString), ORKTextChoice(text: "N/A", value: "N/A" as NSString)] - let answerFormat = ORKTextChoiceAnswerFormat(style: ORKChoiceAnswerStyle.singleChoice, textChoices: textChoices) - let formItem01 = ORKFormItem(identifier: String(describing: Identifier.eligibilityFormItem01), text: exampleQuestionText, answerFormat: answerFormat) + let formItem01 = ORKFormItem(identifier: String(describing: Identifier.eligibilityFormItem01), text: TaskListRowStrings.exampleQuestionText, answerFormat: answerFormat) formItem01.isOptional = false - let formItem02 = ORKFormItem(identifier: String(describing: Identifier.eligibilityFormItem02), text: exampleQuestionText, answerFormat: answerFormat) + let formItem02 = ORKFormItem(identifier: String(describing: Identifier.eligibilityFormItem02), text: TaskListRowStrings.exampleQuestionText, answerFormat: answerFormat) formItem02.isOptional = false - let formItem03 = ORKFormItem(identifier: String(describing: Identifier.eligibilityFormItem03), text: exampleQuestionText, answerFormat: answerFormat) + let formItem03 = ORKFormItem(identifier: String(describing: Identifier.eligibilityFormItem03), text: TaskListRowStrings.exampleQuestionText, answerFormat: answerFormat) formItem03.isOptional = false formStep.formItems = [ @@ -1695,7 +1504,6 @@ enum TaskListRow: Int, CustomStringConvertible { // Build navigation rules. var resultSelector = ORKResultSelector(stepIdentifier: String(describing: Identifier.eligibilityFormStep), resultIdentifier: String(describing: Identifier.eligibilityFormItem01)) - let predicateFormItem01 = ORKResultPredicate.predicateForChoiceQuestionResult(with: resultSelector, expectedAnswerValue: "Yes" as NSString) resultSelector = ORKResultSelector(stepIdentifier: String(describing: Identifier.eligibilityFormStep), resultIdentifier: String(describing: Identifier.eligibilityFormItem02)) @@ -1727,7 +1535,7 @@ enum TaskListRow: Int, CustomStringConvertible { let passcodeValidationRegularExpression = try? NSRegularExpression(pattern: passcodeValidationRegexPattern) let passcodeInvalidMessage = NSLocalizedString("A valid password must be 4 to 8 characters long and include at least one numeric character.", comment: "") let registrationOptions: ORKRegistrationStepOption = [.includeGivenName, .includeFamilyName, .includeGender, .includeDOB, .includePhoneNumber] - let registrationStep = ORKRegistrationStep(identifier: String(describing: Identifier.registrationStep), title: registrationTitle, text: exampleDetailText, passcodeValidationRegularExpression: passcodeValidationRegularExpression, passcodeInvalidMessage: passcodeInvalidMessage, options: registrationOptions) + let registrationStep = ORKRegistrationStep(identifier: String(describing: Identifier.registrationStep), title: registrationTitle, text: TaskListRowStrings.exampleDetailText, passcodeValidationRegularExpression: passcodeValidationRegularExpression, passcodeInvalidMessage: passcodeInvalidMessage, options: registrationOptions) registrationStep.phoneNumberValidationRegularExpression = try? NSRegularExpression(pattern: "^[+]{1,1}[1]{1,1}\\s{1,1}[(]{1,1}[1-9]{3,3}[)]{1,1}\\s{1,1}[1-9]{3,3}\\s{1,1}[1-9]{4,4}$") registrationStep.phoneNumberInvalidMessage = "Expected format +1 (555) 555 5555" @@ -1754,7 +1562,7 @@ enum TaskListRow: Int, CustomStringConvertible { } } - let verificationStep = ORKVerificationStep(identifier: String(describing: Identifier.verificationStep), text: exampleDetailText, verificationViewControllerClass: VerificationViewController.self) + let verificationStep = ORKVerificationStep(identifier: String(describing: Identifier.verificationStep), text: TaskListRowStrings.exampleDetailText, verificationViewControllerClass: VerificationViewController.self) return ORKOrderedTask(identifier: String(describing: Identifier.accountCreationTask), steps: [ registrationStep, @@ -1784,7 +1592,7 @@ enum TaskListRow: Int, CustomStringConvertible { and a button for `Forgot password?`. */ let loginTitle = NSLocalizedString("Login", comment: "") - let loginStep = ORKLoginStep(identifier: String(describing: Identifier.loginStep), title: loginTitle, text: exampleDetailText, loginViewControllerClass: LoginViewController.self) + let loginStep = ORKLoginStep(identifier: String(describing: Identifier.loginStep), title: loginTitle, text: TaskListRowStrings.exampleDetailText, loginViewControllerClass: LoginViewController.self) /* A wait step allows you to validate the data from the user login against your server before proceeding. @@ -1833,14 +1641,14 @@ enum TaskListRow: Int, CustomStringConvertible { /// This task presents the Audio pre-defined active task. private var audioTask: ORKTask { - return ORKOrderedTask.audioTask(withIdentifier: String(describing: Identifier.audioTask), intendedUseDescription: exampleDescription, speechInstruction: exampleSpeechInstruction, shortSpeechInstruction: exampleSpeechInstruction, duration: 20, recordingSettings: nil, checkAudioLevel: true, options: []) + return ORKOrderedTask.audioTask(withIdentifier: String(describing: Identifier.audioTask), intendedUseDescription: TaskListRowStrings.exampleDescription, speechInstruction: TaskListRowStrings.exampleSpeechInstruction, shortSpeechInstruction: TaskListRowStrings.exampleSpeechInstruction, duration: 20, recordingSettings: nil, checkAudioLevel: true, options: []) } /** Amsler Grid */ private var amslerGridTask: ORKTask { - return ORKOrderedTask.amslerGridTask(withIdentifier: String(describing: Identifier.amslerGridTask), intendedUseDescription: exampleDescription, options: []) + return ORKOrderedTask.amslerGridTask(withIdentifier: String(describing: Identifier.amslerGridTask), intendedUseDescription: TaskListRowStrings.exampleDescription, options: []) } /** @@ -1849,20 +1657,41 @@ enum TaskListRow: Int, CustomStringConvertible { realistic durations might be several minutes each. */ private var fitnessTask: ORKTask { - return ORKOrderedTask.fitnessCheck(withIdentifier: String(describing: Identifier.fitnessTask), intendedUseDescription: exampleDescription, walkDuration: 20, restDuration: 20, options: []) + return ORKOrderedTask.fitnessCheck(withIdentifier: String(describing: Identifier.fitnessTask), intendedUseDescription: TaskListRowStrings.exampleDescription, walkDuration: 20, restDuration: 20, options: []) + } + + private var tecumsehCubeTestTask: ORKTask { + if #available(iOS 14, *) { + return ORKOrderedTask.tecumsehCubeTask( + withIdentifier: String(describing: Identifier.tecumsehCubeTestTask), + intendedUseDescription: TaskListRowStrings.exampleDescription, + audioBundleIdentifier: Bundle.main.bundleIdentifier!, + audioResourceName: "", + audioFileExtension: "", + options: [] + ) + + } else { + return ORKOrderedTask.fitnessCheck( + withIdentifier: String(describing: Identifier.tecumsehCubeTestTask), + intendedUseDescription: TaskListRowStrings.exampleDescription, + walkDuration: 180, + restDuration: 180, + options: []) + } } private var sixMinuteWalkTask: ORKTask { if #available(iOS 14, *) { return ORKOrderedTask.sixMinuteWalk( withIdentifier: String(describing: Identifier.sixMinuteWalkTask), - intendedUseDescription: exampleDescription, + intendedUseDescription: TaskListRowStrings.exampleDescription, options: [] ) } else { return ORKOrderedTask.fitnessCheck( withIdentifier: String(describing: Identifier.sixMinuteWalkTask), - intendedUseDescription: exampleDescription, + intendedUseDescription: TaskListRowStrings.exampleDescription, walkDuration: 360, restDuration: 0, options: [] @@ -1872,12 +1701,12 @@ enum TaskListRow: Int, CustomStringConvertible { /// This task presents the Hole Peg Test pre-defined active task. private var holePegTestTask: ORKTask { - return ORKNavigableOrderedTask.holePegTest(withIdentifier: String(describing: Identifier.holePegTestTask), intendedUseDescription: exampleDescription, dominantHand: .right, numberOfPegs: 9, threshold: 0.2, rotated: false, timeLimit: 300, options: []) + return ORKNavigableOrderedTask.holePegTest(withIdentifier: String(describing: Identifier.holePegTestTask), intendedUseDescription: TaskListRowStrings.exampleDescription, dominantHand: .right, numberOfPegs: 9, threshold: 0.2, rotated: false, timeLimit: 300, options: []) } /// This task presents the PSAT pre-defined active task. private var PSATTask: ORKTask { - return ORKOrderedTask.psatTask(withIdentifier: String(describing: Identifier.psatTask), intendedUseDescription: exampleDescription, presentationMode: ORKPSATPresentationMode.auditory.union(.visual), interStimulusInterval: 3.0, stimulusDuration: 1.0, seriesLength: 60, options: []) + return ORKOrderedTask.psatTask(withIdentifier: String(describing: Identifier.psatTask), intendedUseDescription: TaskListRowStrings.exampleDescription, presentationMode: ORKPSATPresentationMode.auditory.union(.visual), interStimulusInterval: 3.0, stimulusDuration: 1.0, seriesLength: 60, options: []) } /// This task presents the Reaction Time pre-defined active task. @@ -1885,82 +1714,49 @@ enum TaskListRow: Int, CustomStringConvertible { /// An example of a custom sound. let successSoundURL = Bundle.main.url(forResource: "tap", withExtension: "aif")! let successSound = SystemSound(soundURL: successSoundURL)! - return ORKOrderedTask.reactionTime(withIdentifier: String(describing: Identifier.reactionTime), intendedUseDescription: exampleDescription, maximumStimulusInterval: 10, minimumStimulusInterval: 4, thresholdAcceleration: 0.5, numberOfAttempts: 3, timeout: 3, successSound: successSound.soundID, timeoutSound: 0, failureSound: UInt32(kSystemSoundID_Vibrate), options: []) + return ORKOrderedTask.reactionTime(withIdentifier: String(describing: Identifier.reactionTime), intendedUseDescription: TaskListRowStrings.exampleDescription, maximumStimulusInterval: 10, minimumStimulusInterval: 4, thresholdAcceleration: 0.5, numberOfAttempts: 3, timeout: 3, successSound: successSound.soundID, timeoutSound: 0, failureSound: UInt32(kSystemSoundID_Vibrate), options: []) } private var normalizedReactionTimeTask: ORKTask { /// An example of a custom sound. let successSoundURL = Bundle.main.url(forResource: "tap", withExtension: "aif")! let successSound = SystemSound(soundURL: successSoundURL)! - return ORKOrderedTask.normalizedReactionTime(withIdentifier: String(describing: Identifier.normalizedReactionTime), intendedUseDescription: exampleDescription, maximumStimulusInterval: 10, minimumStimulusInterval: 4, thresholdAcceleration: 0.5, numberOfAttempts: 3, timeout: 3, successSound: successSound.soundID, timeoutSound: 0, failureSound: UInt32(kSystemSoundID_Vibrate), options: []) + return ORKOrderedTask.normalizedReactionTime(withIdentifier: String(describing: Identifier.normalizedReactionTime), intendedUseDescription: TaskListRowStrings.exampleDescription, maximumStimulusInterval: 10, minimumStimulusInterval: 4, thresholdAcceleration: 0.5, numberOfAttempts: 3, timeout: 3, successSound: successSound.soundID, timeoutSound: 0, failureSound: UInt32(kSystemSoundID_Vibrate), options: []) } /// This task presents the Gait and Balance pre-defined active task. private var shortWalkTask: ORKTask { - return ORKOrderedTask.shortWalk(withIdentifier: String(describing: Identifier.shortWalkTask), intendedUseDescription: exampleDescription, numberOfStepsPerLeg: 20, restDuration: 20, options: []) + return ORKOrderedTask.shortWalk(withIdentifier: String(describing: Identifier.shortWalkTask), intendedUseDescription: TaskListRowStrings.exampleDescription, numberOfStepsPerLeg: 20, restDuration: 20, options: []) } /// This task presents the Spatial Span Memory pre-defined active task. private var spatialSpanMemoryTask: ORKTask { - return ORKOrderedTask.spatialSpanMemoryTask(withIdentifier: String(describing: Identifier.spatialSpanMemoryTask), intendedUseDescription: exampleDescription, initialSpan: 3, minimumSpan: 2, maximumSpan: 15, playSpeed: 1.0, maximumTests: 5, maximumConsecutiveFailures: 3, customTargetImage: nil, customTargetPluralName: nil, requireReversal: false, options: []) + return ORKOrderedTask.spatialSpanMemoryTask(withIdentifier: String(describing: Identifier.spatialSpanMemoryTask), intendedUseDescription: TaskListRowStrings.exampleDescription, initialSpan: 3, minimumSpan: 2, maximumSpan: 15, playSpeed: 1.0, maximumTests: 5, maximumConsecutiveFailures: 3, customTargetImage: nil, customTargetPluralName: nil, requireReversal: false, options: []) } /// This task presents the Speech Recognition pre-defined active task. private var speechRecognitionTask: ORKTask { - return ORKOrderedTask.speechRecognitionTask(withIdentifier: String(describing: Identifier.speechRecognitionTask), intendedUseDescription: exampleDescription, speechRecognizerLocale: .englishUS, speechRecognitionImage: nil, speechRecognitionText: NSLocalizedString("A quick brown fox jumps over the lazy dog.", comment: ""), shouldHideTranscript: false, allowsEdittingTranscript: true, options: []) + return ORKOrderedTask.speechRecognitionTask(withIdentifier: String(describing: Identifier.speechRecognitionTask), intendedUseDescription: TaskListRowStrings.exampleDescription, speechRecognizerLocale: .englishUS, speechRecognitionImage: nil, speechRecognitionText: NSLocalizedString("A quick brown fox jumps over the lazy dog.", comment: ""), shouldHideTranscript: false, allowsEdittingTranscript: true, options: []) } /// This task presents the Speech in Noise pre-defined active task. private var speechInNoiseTask: ORKTask { - return ORKOrderedTask.speechInNoiseTask(withIdentifier: String(describing: Identifier.speechInNoiseTask), intendedUseDescription: nil, options: []) + return ORKOrderedTask.speechInNoiseTask(withIdentifier: String(describing: Identifier.speechInNoiseTask), intendedUseDescription: TaskListRowStrings.exampleDescription, options: []) } - /// This task presents the Stroop pre-defined active task. private var stroopTask: ORKTask { - return ORKOrderedTask.stroopTask(withIdentifier: String(describing: Identifier.stroopTask), intendedUseDescription: exampleDescription, numberOfAttempts: 10, options: []) - } - - /// This task presents the swift Stroop pre-defined active task. - private var swiftStroopTask: ORKTask { - let instructionStep = ORKInstructionStep(identifier: "stroopInstructionStep") - instructionStep.title = "Stroop" - instructionStep.text = "Your description goes here." - instructionStep.image = UIImage(named: "stroop") - instructionStep.imageContentMode = .center - instructionStep.detailText = "Every time a word appears, select the first letter of the name of the COLOR that is shown." - - let instructionStep2 = ORKInstructionStep(identifier: "stroopInstructionStep2") - instructionStep2.title = "Stroop" - instructionStep2.text = "Your description goes here." - instructionStep2.detailText = "Every time a word appears, select the first letter of the name of the COLOR that is shown." - instructionStep2.image = UIImage(named: "stroop") - instructionStep2.imageContentMode = .center - - let countdownStep = ORKCountdownStep(identifier: "stroopCountdownStep") - countdownStep.title = "Stroop" - - let stroopStep = ORKSwiftStroopStep(identifier: "stroopStep") - stroopStep.numberOfAttempts = 10 - stroopStep.title = "Stroop" - stroopStep.text = "Select the first letter of the name of the COLOR that is shown." - stroopStep.spokenInstruction = stroopStep.text - - let completionStep = ORKCompletionStep(identifier: "stroopCompletionStep") - completionStep.title = "Activity Complete" - completionStep.text = "Your data will be analyzed and you will be notified when your results are ready." - - return ORKOrderedTask(identifier: "stroopTask", steps: [instructionStep, instructionStep2, countdownStep, stroopStep, completionStep]) + return ORKOrderedTask.stroopTask(withIdentifier: String(describing: Identifier.stroopTask), intendedUseDescription: TaskListRowStrings.exampleDescription, numberOfAttempts: 10, options: []) } /// This task presents the Timed Walk with turn around pre-defined active task. private var timedWalkWithTurnAroundTask: ORKTask { - return ORKOrderedTask.timedWalk(withIdentifier: String(describing: Identifier.timedWalkWithTurnAroundTask), intendedUseDescription: exampleDescription, distanceInMeters: 100.0, timeLimit: 180.0, turnAroundTimeLimit: 60.0, includeAssistiveDeviceForm: true, options: []) + return ORKOrderedTask.timedWalk(withIdentifier: String(describing: Identifier.timedWalkWithTurnAroundTask), intendedUseDescription: TaskListRowStrings.exampleDescription, distanceInMeters: 100.0, timeLimit: 180.0, turnAroundTimeLimit: 60.0, includeAssistiveDeviceForm: true, options: []) } /// This task presents the Tone Audiometry pre-defined active task. private var toneAudiometryTask: ORKTask { - return ORKOrderedTask.toneAudiometryTask(withIdentifier: String(describing: Identifier.toneAudiometryTask), intendedUseDescription: exampleDescription, speechInstruction: nil, shortSpeechInstruction: nil, toneDuration: 20, options: []) + return ORKOrderedTask.toneAudiometryTask(withIdentifier: String(describing: Identifier.toneAudiometryTask), intendedUseDescription: TaskListRowStrings.exampleDescription, speechInstruction: nil, shortSpeechInstruction: nil, toneDuration: 20, options: []) } /// This task presents the dBHL Tone Audiometry pre-defined active task. @@ -1979,38 +1775,38 @@ enum TaskListRow: Int, CustomStringConvertible { } private var towerOfHanoiTask: ORKTask { - return ORKOrderedTask.towerOfHanoiTask(withIdentifier: String(describing: Identifier.towerOfHanoi), intendedUseDescription: exampleDescription, numberOfDisks: 5, options: []) + return ORKOrderedTask.towerOfHanoiTask(withIdentifier: String(describing: Identifier.towerOfHanoi), intendedUseDescription: TaskListRowStrings.exampleDescription, numberOfDisks: 5, options: []) } /// This task presents the Two Finger Tapping pre-defined active task. private var twoFingerTappingIntervalTask: ORKTask { - return ORKOrderedTask.twoFingerTappingIntervalTask(withIdentifier: String(describing: Identifier.twoFingerTappingIntervalTask), intendedUseDescription: exampleDescription, duration: 10, + return ORKOrderedTask.twoFingerTappingIntervalTask(withIdentifier: String(describing: Identifier.twoFingerTappingIntervalTask), intendedUseDescription: TaskListRowStrings.exampleDescription, duration: 10, handOptions: [.both], options: []) } /// This task presents a walk back-and-forth task private var walkBackAndForthTask: ORKTask { - return ORKOrderedTask.walkBackAndForthTask(withIdentifier: String(describing: Identifier.walkBackAndForthTask), intendedUseDescription: exampleDescription, walkDuration: 30, restDuration: 30, options: []) + return ORKOrderedTask.walkBackAndForthTask(withIdentifier: String(describing: Identifier.walkBackAndForthTask), intendedUseDescription: TaskListRowStrings.exampleDescription, walkDuration: 30, restDuration: 30, options: []) } /// This task presents the Tremor Test pre-defined active task. private var tremorTestTask: ORKTask { return ORKOrderedTask.tremorTest(withIdentifier: String(describing: Identifier.tremorTestTask), - intendedUseDescription: exampleDescription, - activeStepDuration: 10, - activeTaskOptions: [], - handOptions: [.both], - options: []) + intendedUseDescription: TaskListRowStrings.exampleDescription, + activeStepDuration: 10, + activeTaskOptions: [], + handOptions: [.both], + options: []) } /// This task presents a knee range of motion task private var kneeRangeOfMotion: ORKTask { - return ORKOrderedTask.kneeRangeOfMotionTask(withIdentifier: String(describing: Identifier.kneeRangeOfMotion), limbOption: .right, intendedUseDescription: exampleDescription, options: []) + return ORKOrderedTask.kneeRangeOfMotionTask(withIdentifier: String(describing: Identifier.kneeRangeOfMotion), limbOption: .right, intendedUseDescription: TaskListRowStrings.exampleDescription, options: []) } /// This task presents a shoulder range of motion task private var shoulderRangeOfMotion: ORKTask { - return ORKOrderedTask.shoulderRangeOfMotionTask(withIdentifier: String(describing: Identifier.shoulderRangeOfMotion), limbOption: .left, intendedUseDescription: exampleDescription, options: []) + return ORKOrderedTask.shoulderRangeOfMotionTask(withIdentifier: String(describing: Identifier.shoulderRangeOfMotion), limbOption: .left, intendedUseDescription: TaskListRowStrings.exampleDescription, options: []) } /// This task presents a trail making task @@ -2019,18 +1815,6 @@ enum TaskListRow: Int, CustomStringConvertible { return ORKOrderedTask.trailmakingTask(withIdentifier: String(describing: Identifier.trailMaking), intendedUseDescription: intendedUseDescription, trailmakingInstruction: nil, trailType: .B, options: []) } - // This task presents a visual acuity landolt C task - private var visualAcuityLandoltC: ORKTask { - let orderedTask = ORKOrderedTask.landoltCVisualAcuityTask(withIdentifier: String(describing: Identifier.visualAcuityLandoltC), intendedUseDescription: "lorem ipsum") - return orderedTask - } - - // This task presents a contrast sensitivity peak landolt C task - private var contrastSensitivityPeakLandoltC: ORKTask { - let orderedTask = ORKOrderedTask.landoltCContrastSensitivityTask(withIdentifier: String(describing: Identifier.contrastSensitivityPeakLandoltC), intendedUseDescription: "lorem ipsum") - return orderedTask - } - /// This task presents a video instruction step private var videoInstruction: ORKTask { let videoInstructionStep = ORKVideoInstructionStep(identifier: String(describing: Identifier.videoInstructionStep)) @@ -2052,128 +1836,150 @@ enum TaskListRow: Int, CustomStringConvertible { return ORKOrderedTask(identifier: String(describing: Identifier.videoInstructionTask), steps: [frontFacingCameraStep]) } - /// This task presents a web view step private var webView: ORKTask { - let webViewStep = ORKWebViewStep(identifier: String(describing: Identifier.webViewStep), html: exampleHtml) - webViewStep.title = NSLocalizedString("Web View", comment: "") - webViewStep.showSignatureAfterContent = true + let webViewStep = TaskListRowSteps.webViewStepExample return ORKOrderedTask(identifier: String(describing: Identifier.webViewTask), steps: [webViewStep]) } - // MARK: `ORKTask` Reused Text Convenience - - private var exampleDescription: String { - return NSLocalizedString("Your description goes here.", comment: "") - } - - private var exampleSpeechInstruction: String { - return NSLocalizedString("Your more specific voice instruction goes here. For example, say 'Aaaah'.", comment: "") - } - - private var exampleQuestionText: String { - return NSLocalizedString("Your question goes here.", comment: "") - } - - private var exampleHighValueText: String { - return NSLocalizedString("High Value", comment: "") - } - - private var exampleLowValueText: String { - return NSLocalizedString("Low Value", comment: "") - } - - private var exampleDetailText: String { - return NSLocalizedString("Additional text can go here.", comment: "") - } - - private var exampleEmailText: String { - return NSLocalizedString("jappleseed@example.com", comment: "") - } - - private var exampleDate3DayLimitQuestionTask: String { - return NSLocalizedString("This date picker is restricted to 3 days before or after the current date.", comment: "") + private var usdzModel: ORKTask { + let usdzModelStep = TaskListRowSteps.usdzModelExample + return ORKOrderedTask(identifier: String(describing: Identifier.usdzModelTask), steps: [usdzModelStep]) } - private var loremIpsumText: String { - return "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." - } - - private var loremIpsumShortText: String { - return "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + /// This task demonstrates a question asking for the user age. + private var ageQuestionTask: ORKTask { + let ageFormItemSectionHeader1 = ORKFormItem(sectionTitle: "What is your age?", detailText: "Age question with default values.", learnMoreItem: nil, showsProgress: true) + + + // age picker example 1 + let answerFormat = ORKAgeAnswerFormat() + answerFormat.shouldShowDontKnowButton = true + answerFormat.customDontKnowButtonText = "Prefer not to answer" + let ageFormItem = ORKFormItem(identifier: String(describing: Identifier.ageQuestionFormItem), text: nil, answerFormat: answerFormat) + + ageFormItem.isOptional = true + + let step = ORKFormStep(identifier: String(describing: Identifier.ageQuestionFormStep), title: "Title here", text: "Default age picker.") + step.formItems = [ageFormItemSectionHeader1, ageFormItem] + + // age picker example 2 + let ageFormItemSectionHeader2 = ORKFormItem(sectionTitle: "What is your age?", detailText: "Age question with custom min/max values.", learnMoreItem: nil, showsProgress: true) + + let answerFormat2 = ORKAgeAnswerFormat(minimumAge: 18, maximumAge: 90) + let ageFormItem2 = ORKFormItem(identifier: String(describing: Identifier.ageQuestionFormItem2), text: nil, answerFormat: answerFormat2) + ageFormItem2.isOptional = false + + let step2 = ORKFormStep(identifier: String(describing: Identifier.ageQuestionFormStep2), title: "Title here", text: "Age picker with modified min and max ages.") + step2.formItems = [ageFormItemSectionHeader2, ageFormItem2] + + // age picker example 3 + let ageFormItemSectionHeader3 = ORKFormItem(sectionTitle: "What is your age?", detailText: "Age question that shows year in choices and passes back year for the result.", learnMoreItem: nil, showsProgress: true) + + let answerFormat3 = ORKAgeAnswerFormat( + minimumAge: 18, + maximumAge: 80, + minimumAgeCustomText: "18 or younger", + maximumAgeCustomText: "80 or older", + showYear: true, + useYearForResult: true, + defaultValue: 40) + + let ageFormItem3 = ORKFormItem(identifier: String(describing: Identifier.ageQuestionFormItem3), text: nil, answerFormat: answerFormat3) + ageFormItem3.isOptional = false + + let step3 = ORKFormStep(identifier: String(describing: Identifier.ageQuestionFormStep3), title: "Title here", text: "Age picker with modified min and max ages.") + step3.formItems = [ageFormItemSectionHeader3, ageFormItem3] + + + // age picker example 4 + let ageFormItemSectionHeader4 = ORKFormItem(sectionTitle: "What was your age in the year 2000?", detailText: "Age question that passes back sentinel values for the result if the minimum (-1) or maximum (-2) values are selected.", learnMoreItem: nil, showsProgress: true) + + let answerFormat4 = ORKAgeAnswerFormat( + minimumAge: 1, + maximumAge: 60, + minimumAgeCustomText: "Under a year old", + maximumAgeCustomText: "60 or older", + showYear: true, + useYearForResult: false, + treatMinAgeAsRange: true, + treatMaxAgeAsRange: true, + defaultValue: 30) + + answerFormat4.relativeYear = 2000 + + let ageFormItem4 = ORKFormItem(identifier: String(describing: Identifier.ageQuestionFormItem4), text: nil, answerFormat: answerFormat4) + ageFormItem4.isOptional = false + + let step4 = ORKFormStep(identifier: String(describing: Identifier.ageQuestionFormStep4), title: "Title here", text: "Age picker with utilizing a updated relative year.") + step4.formItems = [ageFormItemSectionHeader4, ageFormItem4] + + let completionStep = ORKCompletionStep(identifier: "completionStepIdentifier") + completionStep.title = "Task complete" + + return ORKOrderedTask(identifier: String(describing: Identifier.ageQuestionTask), steps: [step, step2, step3, step4, completionStep]) } - private var loremIpsumMediumText: String { - return "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo?" + private var colorChoiceQuestionTask: ORKTask { + let colorChoiceOneText = NSLocalizedString("Choice 1", comment: "") + let colorChoiceTwoText = NSLocalizedString("Choice 2", comment: "") + let colorChoiceThreeText = NSLocalizedString("Choice 3", comment: "") + let colorChoiceFourText = NSLocalizedString("Choice 4", comment: "") + let colorChoiceFiveText = NSLocalizedString("Choice 5", comment: "") + let colorChoiceSixText = NSLocalizedString("Choice 6", comment: "") + let colorChoiceSevenText = NSLocalizedString("None of the above", comment: "") + + let colorOne = UIColor(red: 244/255, green: 208/255, blue: 176/255, alpha: 1.0) + let colorTwo = UIColor(red: 232/255, green: 180/255, blue: 143/255, alpha: 1.0) + let colorThree = UIColor(red: 211/255, green: 158/255, blue: 124/255, alpha: 1.0) + let colorFour = UIColor(red: 187/255, green: 119/255, blue: 80/255, alpha: 1.0) + let colorFive = UIColor(red: 165/255, green: 93/255, blue: 43/255, alpha: 1.0) + let colorSix = UIColor(red: 60/255, green: 32/255, blue: 29/255, alpha: 1.0) + + let colorChoices = [ + ORKColorChoice(color: colorOne, text: colorChoiceOneText, detailText: nil, value: "choice_1" as NSString), + ORKColorChoice(color: colorTwo, text: colorChoiceTwoText, detailText: nil, value: "choice_2" as NSString), + ORKColorChoice(color: colorThree, text: colorChoiceThreeText, detailText: nil, value: "choice_3" as NSString), + ORKColorChoice(color: colorFour, text: colorChoiceFourText, detailText: nil, value: "choice_4" as NSString), + ORKColorChoice(color: colorFive, text: colorChoiceFiveText, detailText: nil, value: "choice_5" as NSString), + ORKColorChoice(color: colorSix, text: colorChoiceSixText, detailText: nil, value: "choice_6" as NSString), + ORKColorChoice(color: nil, text: colorChoiceSevenText, detailText: nil, value: "choice_7" as NSString) + ] + + let answerFormat = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, colorChoices: colorChoices) + let formItem = ORKFormItem(identifier: String(describing: Identifier.colorChoiceQuestionFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: answerFormat) + formItem.detailText = "Select your favorite color from the offerings below" + let formStep = ORKFormStep(identifier: String(describing: Identifier.colorChoiceQuestionStep), title: NSLocalizedString("Color Choice", comment: ""), text: TaskListRowStrings.exampleDetailText) + + formStep.formItems = [formItem] + + let colorChoicesSwatchOnly = [ + ORKColorChoice(color: colorOne, text: nil, detailText: nil, value: "choice_1" as NSString), + ORKColorChoice(color: colorTwo, text: nil, detailText: nil, value: "choice_2" as NSString), + ORKColorChoice(color: colorThree, text: nil, detailText: nil, value: "choice_3" as NSString), + ORKColorChoice(color: colorFour, text: nil, detailText: nil, value: "choice_4" as NSString), + ORKColorChoice(color: colorFive, text: nil, detailText: nil, value: "choice_5" as NSString), + ORKColorChoice(color: colorSix, text: nil, detailText: nil, value: "choice_6" as NSString), + ] + + let answerFormatSwatchOnly = ORKAnswerFormat.choiceAnswerFormat(with: .singleChoice, colorChoices: colorChoicesSwatchOnly) + let formItemSwatchOnly = ORKFormItem(identifier: String(describing: Identifier.colorChoiceQuestionFormItem), text: TaskListRowStrings.exampleQuestionText, answerFormat: answerFormatSwatchOnly) + + let formStepSwatchOnly = ORKFormStep(identifier: String(describing: Identifier.colorChoiceQuestionStepSwatchOnly), title: NSLocalizedString("Color Choice No Text", comment: ""), text: TaskListRowStrings.exampleDetailText) + + formStepSwatchOnly.formItems = [formItemSwatchOnly] + + return ORKOrderedTask(identifier: String(describing: Identifier.colorChoiceQuestionTask), steps: [formStep, formStepSwatchOnly]) } - private var loremIpsumLongText: String { - return "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adhuc, meo fortasse vitio, quid ego quaeram non perspicis. Plane idem, inquit, et maxima quidem, qua fieri nulla maior potest. Quonam, inquit, modo? An potest, inquit ille, quicquam esse suavius quam nihil dolere? Cave putes quicquam esse verius. Quonam, inquit, modo?" + private var familyHistoryTask: ORKTask { + + let familyHistoryStep = TaskListRowSteps.familyHistoryStepExample + + let completionStep = ORKCompletionStep(identifier: "FamilyHistoryCompletionStep") + completionStep.title = "All Done" + + return ORKOrderedTask(identifier: String(describing: Identifier.familyHistoryStep), steps: [familyHistoryStep, completionStep]) } - private var exampleHtml: String { - return """ - - - - - - - - - - -
    - - -
    - - - """ - } - } diff --git a/samples/ORKCatalog/ORKCatalog/Tasks/TaskListViewController.swift b/samples/ORKCatalog/ORKCatalog/Tasks/TaskListViewController.swift index b4296bb03d..5749562989 100644 --- a/samples/ORKCatalog/ORKCatalog/Tasks/TaskListViewController.swift +++ b/samples/ORKCatalog/ORKCatalog/Tasks/TaskListViewController.swift @@ -30,7 +30,10 @@ */ import UIKit -import ResearchKit.Private +import ResearchKit_Private +import ResearchKitUI + + /** This example displays a catalog of tasks, each consisting of one or two steps, @@ -47,6 +50,7 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega var waitStepUpdateTimer: Timer? var waitStepProgress: CGFloat = 0.0 + // In-memory store for taskViewController restoration data var restorationDataByTaskID: [String:Data] = [:] @@ -69,9 +73,7 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega override func viewDidLoad() { super.viewDidLoad() - if #available(iOS 13.0, *) { - self.tableView.backgroundColor = UIColor.systemGroupedBackground - } + self.tableView.backgroundColor = UIColor.systemGroupedBackground } // MARK: UITableViewDataSource @@ -94,10 +96,7 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega let taskListRow = TaskListRow.sections[(indexPath as NSIndexPath).section].rows[(indexPath as NSIndexPath).row] cell.textLabel!.text = "\(taskListRow)" - - if #available(iOS 13.0, *) { - cell.textLabel?.textColor = UIColor.label - } + cell.textLabel?.textColor = UIColor.label return cell } @@ -111,14 +110,23 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega let taskListRow = TaskListRow.sections[(indexPath as NSIndexPath).section].rows[(indexPath as NSIndexPath).row] displayTaskViewController(taskListRow: taskListRow) - } func displayTaskViewController(taskListRow: TaskListRow) { // Create a task from the `TaskListRow` to present in the `ORKTaskViewController`. let task = taskListRow.representedTask - let taskViewController: ORKTaskViewController + /* + Passing `nil` for the `taskRunUUID` lets the task view controller + generate an identifier for this run of the task. + */ + var taskViewController = ORKTaskViewController(task: task, taskRun: nil) + + // Make sure we receive events from `taskViewController`. + taskViewController.delegate = self + + // Assign a directory to store `taskViewController` output. + taskViewController.outputDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! if let restorationData = restorationDataByTaskID[task.identifier] { // we have data we can use to recreate the state of a previous taskViewController @@ -131,18 +139,39 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega // Assign a directory to store `taskViewController` output. taskViewController.outputDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! } - /* We present the task directly, but it is also possible to use segues. The task property of the task view controller can be set any time before the task view controller is presented. */ - present(taskViewController, animated: true, completion: nil) + present(taskViewController, animated: true) + } + + + func storePDFIfConsentTaskDetectedIn(taskViewController: ORKTaskViewController) { + guard taskViewController.task?.identifier == String(describing: Identifier.consentTask) else { + return + } + + guard let stepResult = taskViewController.result.result(forIdentifier: String(describing: Identifier.webViewStep)) as? ORKStepResult else { + return + } + + if let webViewStepResult = stepResult.results?.first as? ORKWebViewStepResult, let html = webViewStepResult.htmlWithSignature { + let htmlFormatter = ORKHTMLPDFWriter() + + htmlFormatter.writePDF(fromHTML: html) { data, error in + let pdfURL = FileManager.default.temporaryDirectory + .appendingPathComponent("consentTask") + .appendingPathExtension("pdf") + try? data.write(to: pdfURL) + } + } } // MARK: ORKTaskViewControllerDelegate - func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskViewControllerFinishReason, error: Error?) { + func taskViewController(_ taskViewController: ORKTaskViewController, didFinishWith reason: ORKTaskFinishReason, error: Error?) { /* The `reason` passed to this method indicates why the task view controller finished: Did the user cancel, save, or actually complete @@ -151,11 +180,13 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega The actual result of the task is on the `result` property of the task view controller. */ + + storePDFIfConsentTaskDetectedIn(taskViewController: taskViewController) taskResultFinishedCompletionHandler?(taskViewController.result) switch (reason) { case .saved: - saveRestorationDataFor(taskViewController); + saveRestorationData(for: taskViewController); break; case .discarded: @@ -163,12 +194,12 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega This way, if the user launches the same task again, it'll behave like it's been launched for the first time. */ - resetRestorationDataFor(taskViewController); + resetRestorationData(for: taskViewController); break; case .completed, .earlyTermination, .failed: // For any other reason, we also reset restoration data - resetRestorationDataFor(taskViewController); + resetRestorationData(for: taskViewController); break; default: @@ -180,15 +211,15 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega func taskViewController(_ taskViewController: ORKTaskViewController, stepViewControllerWillAppear stepViewController: ORKStepViewController) { // Example data processing for the wait step. - if stepViewController.step?.identifier == "WaitStepIndeterminate" || - stepViewController.step?.identifier == "WaitStep" || - stepViewController.step?.identifier == "LoginWaitStep" { + if stepViewController.step?.identifier == String(describing: Identifier.waitStepIndeterminate) || + stepViewController.step?.identifier == String(describing: Identifier.waitStep) || + stepViewController.step?.identifier == String(describing: Identifier.loginStep) { delay(5.0, closure: { () -> Void in if let stepViewController = stepViewController as? ORKWaitStepViewController { stepViewController.goForward() } }) - } else if stepViewController.step?.identifier == "WaitStepDeterminate" { + } else if stepViewController.step?.identifier == String(describing: Identifier.waitStepDeterminate) { delay(1.0, closure: { () -> Void in if let stepViewController = stepViewController as? ORKWaitStepViewController { self.waitStepViewController = stepViewController @@ -199,12 +230,13 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega }) } } + func taskViewController(_ taskViewController: ORKTaskViewController, learnMoreButtonPressedWith learnMoreStep: ORKLearnMoreInstructionStep, for stepViewController: ORKStepViewController) { stepViewController.present(UINavigationController(rootViewController: ORKLearnMoreStepViewController(step: learnMoreStep)), animated: true) { } } - + func taskViewControllerSupportsSaveAndRestore(_ taskViewController: ORKTaskViewController) -> Bool { return true } @@ -237,7 +269,7 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega /* Once saved in-memory, the user can later bring up the same task and start off where they left off. This works only until the app relaunches since we don't save the restorationData to disk */ - func saveRestorationDataFor(_ taskViewController: ORKTaskViewController) { + func saveRestorationData(for taskViewController: ORKTaskViewController) { guard let taskID = taskViewController.task?.identifier else { return } @@ -245,7 +277,7 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega restorationDataByTaskID[taskID] = taskViewController.restorationData } - func resetRestorationDataFor(_ taskViewController: ORKTaskViewController) { + func resetRestorationData(for taskViewController: ORKTaskViewController) { guard let taskID = taskViewController.task?.identifier else { return } @@ -254,3 +286,5 @@ class TaskListViewController: UITableViewController, ORKTaskViewControllerDelega } } + + diff --git a/Testing/ORKTest/ORKTestTests/ORKKeychainWrapperTests.m b/samples/ORKCatalog/ORKCatalogTests/ORKKeychainWrapperTests.m similarity index 82% rename from Testing/ORKTest/ORKTestTests/ORKKeychainWrapperTests.m rename to samples/ORKCatalog/ORKCatalogTests/ORKKeychainWrapperTests.m index df46be4d91..80efddf046 100644 --- a/Testing/ORKTest/ORKTestTests/ORKKeychainWrapperTests.m +++ b/samples/ORKCatalog/ORKCatalogTests/ORKKeychainWrapperTests.m @@ -30,7 +30,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE @import XCTest; -@import ResearchKit.Private; +@import ResearchKit; @interface ORKKeychainWrapperTests : XCTestCase @@ -55,10 +55,8 @@ - (void)testSetObjectInKeychain { XCTAssertTrue(success); // Test that the object set is equal to the object retrieved. - NSString *outObject = (NSString *) [ORKKeychainWrapper objectOfClass:NSString.self - forKey:key - error:&error]; - + NSString *outObject = (NSString *) [ORKKeychainWrapper objectForKey:key + error:&error]; XCTAssertNil(error); XCTAssertEqualObjects(inObject, outObject); @@ -69,22 +67,20 @@ - (void)testGetObjectFromKeychain { // Set an object in the keychain. BOOL success = [ORKKeychainWrapper setObject:inObject - forKey:key - error:&error]; + forKey:key + error:&error]; XCTAssertNil(error); XCTAssertTrue(success); // Test that the object set is equal to the object retrieved. - NSString *outObject = (NSString *) [ORKKeychainWrapper objectOfClass:NSString.self - forKey:key - error:&error]; + NSString *outObject = (NSString *) [ORKKeychainWrapper objectForKey:key + error:&error]; XCTAssertNil(error); XCTAssertEqualObjects(inObject, outObject); // Test that there is an error for invalid key. - id object = [ORKKeychainWrapper objectOfClass:NSDictionary.class - forKey:invalidKey - error:&error]; + id object = [ORKKeychainWrapper objectForKey:invalidKey + error:&error]; XCTAssertNotNil(error); XCTAssertNil(object); } @@ -94,8 +90,8 @@ - (void)testRemoveObjectFromKeychain { // Set an object in the keychain. BOOL success = [ORKKeychainWrapper setObject:inObject - forKey:key - error:&error]; + forKey:key + error:&error]; XCTAssertNil(error); XCTAssertTrue(success); @@ -106,9 +102,8 @@ - (void)testRemoveObjectFromKeychain { XCTAssertTrue(success); // Test that there is no object for the key. - id object = [ORKKeychainWrapper objectOfClass:NSString.self - forKey:key - error:&error]; + id object = [ORKKeychainWrapper objectForKey:key + error:&error]; XCTAssertNotNil(error); XCTAssertNil(object); } @@ -129,9 +124,8 @@ - (void)testResetKeychain { XCTAssertTrue(success); // Test that there is no object for the key. - id object = [ORKKeychainWrapper objectOfClass:NSString.self - forKey:key - error:&error]; + id object = [ORKKeychainWrapper objectForKey:key + error:&error]; XCTAssertNotNil(error); XCTAssertNil(object); } diff --git a/samples/ORKCatalog/ORKCatalogUITests/Helpers.swift b/samples/ORKCatalog/ORKCatalogUITests/Helpers.swift deleted file mode 100644 index 5979b069c4..0000000000 --- a/samples/ORKCatalog/ORKCatalogUITests/Helpers.swift +++ /dev/null @@ -1,297 +0,0 @@ -/* -Copyright (c) 2015, Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import Foundation -import XCTest - -class Helpers: XCTestCase { - let app = XCUIApplication() - let commonElements = CommonElements() - let taskScreen = TaskScreen() - - enum SliderTesting { - case slider1 - case slider2 - case slider3 - case slider4 - case slider5 - case slider6 - } - enum SwipeDirection { - case up - case down - case left - case right - case skip - } - - //Verify existence of any XCUIElement with an option to tap that element - func verifyElement(_ element: XCUIElement, _ tap: Bool = false) -> Bool { - if element.exists { - if tap && element.isEnabled { - element.tap() - } - return true - } - XCTFail("Unable to confirm \(element) exists") - return false - } - - //Verify an element exists based on static text label, option to tap the element after verification - func verifyElementByText(identifier: String, _ tap: Bool = false) -> Bool { - let item = app.staticTexts["\(identifier)"] - if item.exists { - if tap && item.isEnabled { - item.tap() - } - return true - } - XCTFail("Unable to locate Element based on text \(identifier)") - return false - } - - //Verify an element matching XCUIElement.ElementType exists based on an identifying string existing in the label or value of the element. - func verifyElementByType(_ elementType: XCUIElement.ElementType, _ identifier: String, _ tap: Bool = false) -> Bool { - let identifyingOptions = ["label", "value"] - for option in identifyingOptions { - let predicate = NSPredicate(format: "\(option) CONTAINS '\(identifier)'") - let target = app.descendants(matching: elementType).element(matching: predicate) - if target.exists { - if tap && target.isEnabled { - target.tap() - } - return true - } - } - XCTFail("Unable to locate Element based on text \(identifier)") - return false - } - - //Verify any XCUIElement exists and return that element for assignment, option to tap available - func verifyAndAssign(_ element: XCUIElement, _ tap: Bool = false) -> XCUIElement? { - if element.exists { - if tap && element.isEnabled { - element.tap() - } - return element - } - XCTFail("Unable to confirm \(element) exists") - return nil - } - - //Verify an element exists based on static text label, option to tap the element after verification. Element returned for assignment. - func verifyAndAssignByText(_ identifier: String, _ tap: Bool = false) -> XCUIElement? { - let item = app.staticTexts["\(identifier)"] - if item.exists { - if tap && item.isEnabled { - item.tap() - } - return item - } - XCTFail("Unable to locate Element based on text \(identifier)") - return nil - } - - //Verify an element matching XCUIElement.ElementType exists based on an identifying string existing in the label or value of the element. - //Element returned for assignment. - func verifyAndAssignByType(_ elementType: XCUIElement.ElementType, _ identifier: String, _ tap: Bool = false) -> XCUIElement? { - let identifyingOptions = ["label", "value"] - for option in identifyingOptions { - let predicate = NSPredicate(format: "\(option) CONTAINS '\(identifier)'") - let target = app.descendants(matching: elementType).element(matching: predicate) - if target.exists { - if tap && target.isEnabled { - target.tap() - } - return target - } - } - XCTFail("Unable to locate Element based on text \(identifier)") - return nil - } - - //Enter any ORKCatalog task based on the name of the task and leave without taking action - func launchAndLeave(_ task: String) -> Bool { - XCTAssert(verifyElement(taskScreen.mainTaskScreen)) - let currentTask = verifyAndAssignByText(task)! - currentTask.tap() - - sleep(1) - guard let cancelButton = commonElements.cancelButton else { - XCTFail("Unable to locate Cancel Button") - return false - } - cancelButton.tap() - - sleep(1) - guard let exitButton = commonElements.getExitButton() else { - XCTFail("Unable to locate End Task or Discard Results button") - return false - } - exitButton.tap() - - return verifyElement(taskScreen.mainTaskScreen) - } - - //Deletes the ORKCatalog app from the simulator instance. - func deleteORKCatalog() { - app.terminate() - let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") - let icon = springboard.icons["ORKCatalog"] - if icon.exists { - icon.press(forDuration: 1.3) - springboard.buttons["Delete App"].tap() - sleep(2) - springboard.buttons["Delete"].tap() - } - } - - //Verify that the Navigation bar includes a page count in the form of "pageNumber of pageTotal" - func verifyPageByCount(_ pageNumber: Int, _ pageTotal: Int) -> Bool { - let pageCount = app.navigationBars["\(String(pageNumber)) of \(String(pageTotal))"] - XCTAssert(pageCount.exists) - return true - } - - //Return an XCUIElement based on page number of the Scale test - func scaleTitle(_ pageNumber: Int) -> XCUIElement? { - let titles: [Int: String] = [1: "Discrete Scale", 2: "Continuous Scale", 3: "Discrete Vertical Scale", 4: "Continuous Vertical Scale", 5: "Text Scale", 6: "Text Vertical Scale"] - return app.scrollViews.otherElements.staticTexts[titles[pageNumber] ?? "Invalid Page Number"] - } - - //Select and interact with sliders in the Scale Question task. Function verifies expected outputs of each slider. - func sliderValuesCheck(_ sliderScreen:SliderTesting, _ screenNum: Int, _ direction:SwipeDirection) -> Bool { - let sliderValues: [SliderTesting:String] = [ - .slider1:"8", - .slider3:"8", - .slider4:"4.23", - .slider5:"Above Average", - .slider6:"Above Average" - ] - - let slider = verifyAndAssignByType(.slider, "Response slider")! - XCTAssert(slider.waitForExistence(timeout: 2), "Unable to locate slider on page \(screenNum)") - XCTAssert(verifyPageByCount(screenNum, 6), "Unable to locate \"\(screenNum) of 6\"") - XCTAssert(scaleTitle(screenNum)!.waitForExistence(timeout: 2), "Unable to locate \(scaleTitle(screenNum)!)") - - switch direction { - case .up: - slider.swipeUp() - case .right: - slider.swipeRight() - case .left: - XCTFail("Unexpected Swipe Direction of Left Entered") - case .down: - XCTFail("Unexpected Swipe Direction of Down Entered") - case .skip: - XCTAssert(commonElements.skipButton!.waitForExistence(timeout: 2)) - commonElements.skipButton!.tap() - - } - - if sliderScreen != .slider2 { - XCTAssert(verifyElementByType(.slider, sliderValues[sliderScreen]!)) - if commonElements.doneButton!.exists { - commonElements.doneButton!.tap() - return true - } - XCTAssert(commonElements.nextButton!.waitForExistence(timeout: 2)) - commonElements.nextButton!.tap() - return true - } - return true - } - - //Returns true if sliders behave as expected on any given screen in the Scale Question task. - func sliderScreenCheck(_ sliderScreen:SliderTesting) -> Bool { - XCTAssert(verifyElement(app.scrollViews.otherElements.staticTexts["Scale"])) - XCTAssert(verifyElement(app.scrollViews.otherElements.staticTexts["Your question here."])) - - switch sliderScreen { - case .slider1: - XCTAssert(sliderValuesCheck(sliderScreen, 1, .right), "Slider1 Values Check Failed") - case .slider2: - XCTAssert(sliderValuesCheck(sliderScreen, 2, .skip), "Slider2 Values Check Failed") - case .slider3: - XCTAssert(sliderValuesCheck(sliderScreen, 3, .up), "Slider3 Values Check Failed") - case .slider4: - XCTAssert(sliderValuesCheck(sliderScreen, 4, .up), "Slider4 Values Check Failed") - case .slider5: - XCTAssert(sliderValuesCheck(sliderScreen, 5, .right), "Slider5 Values Check Failed") - case .slider6: - XCTAssert(sliderValuesCheck(sliderScreen, 6, .up), "Slider6 Values Check Failed") - } - return true - } - - //Monitors for any alerts that may appear and interupt the normal flow of the applicaiton. - func monitorAlerts() { - addUIInterruptionMonitor(withDescription: "Alert") { element in - do { - // Push Notification - let button = element.buttons["Allow"] - let title = element.staticTexts["“ORKCatalog” Would Like to Send You Notifications"] - if title.exists && button.exists { - button.tap() - return true - } - } - - do { - // Location - let button = element.buttons["Allow While Using App"] - if button.exists { - button.tap() - return true - } - } - - do { - // Microphone - let button = element.buttons["OK"] - let title = element.staticTexts["“ORKCatalog” Would Like to Access the Microphone"] - if title.exists && button.exists { - button.tap() - return true - } - } - return false - } - } - - func verifyElementByText(_ text: String, _ tap: Bool = false) -> Bool { - let item = app.staticTexts["\(text)"] - XCTAssert(item.waitForExistence(timeout: 3)) - if tap && item.isEnabled { - item.tap() - } - return true - } -} diff --git a/samples/ORKCatalog/ORKCatalogUITests/Info.plist b/samples/ORKCatalog/ORKCatalogUITests/Info.plist deleted file mode 100644 index 64d65ca495..0000000000 --- a/samples/ORKCatalog/ORKCatalogUITests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/samples/ORKCatalog/ORKCatalogUITests/ORKCatalogUI.xctestplan b/samples/ORKCatalog/ORKCatalogUITests/ORKCatalogUI.xctestplan deleted file mode 100644 index 8e7461ad6c..0000000000 --- a/samples/ORKCatalog/ORKCatalogUITests/ORKCatalogUI.xctestplan +++ /dev/null @@ -1,29 +0,0 @@ -{ - "configurations" : [ - { - "id" : "CE2DCF31-672A-4F3F-A538-AF0ADA4806F4", - "name" : "Configuration 1", - "options" : { - - } - } - ], - "defaultOptions" : { - "codeCoverage" : false, - "targetForVariableExpansion" : { - "containerPath" : "container:ORKCatalog.xcodeproj", - "identifier" : "869230BD1AAA890A00BFE11B", - "name" : "ORKCatalog" - } - }, - "testTargets" : [ - { - "target" : { - "containerPath" : "container:ORKCatalog.xcodeproj", - "identifier" : "9622282924F04D780056E74D", - "name" : "ORKCatalogUITests" - } - } - ], - "version" : 1 -} diff --git a/samples/ORKCatalog/ORKCatalogUITests/PreSubmissionTests.swift b/samples/ORKCatalog/ORKCatalogUITests/PreSubmissionTests.swift deleted file mode 100644 index 74f380dd20..0000000000 --- a/samples/ORKCatalog/ORKCatalogUITests/PreSubmissionTests.swift +++ /dev/null @@ -1,237 +0,0 @@ -/* -Copyright (c) 2015, Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import XCTest - -class PreSubmissionTests: XCTestCase { - let app = XCUIApplication() - let commonElements = CommonElements() - let allowScreens = AllowScreens() - let helpers = Helpers() - let taskScreen = TaskScreen() - - override func setUpWithError() throws { - continueAfterFailure = false - helpers.monitorAlerts() - app.launch() - - } - - override func tearDownWithError() throws { - - } - - func testAccessSurveyTasks() throws { - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - - for task in taskScreen.surveyTasks { - XCTAssert(helpers.launchAndLeave(task)) - } - } - - func testAccessSurveyQuestions() throws { - XCTAssert(allowScreens.triggerAllowScreens()) - - for task in taskScreen.surveyQuestions { - XCTAssert(helpers.launchAndLeave(task)) - } - - return - } - - func testAccessActiveTasks() throws { - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - - for task in taskScreen.activeTasks { - XCTAssert(helpers.launchAndLeave(task)) - } - - return - } - - func testWrittenMultipleChoice() throws { - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - let options = ["Choice 1", "Choice 2", "Choice 3", "Other"] - let required = ["Text Choice", "Additional text can go here.", "Your question here."] - - XCTAssert(helpers.verifyElementByText("Text Choice Question", true)) - - for item in required { - XCTAssert(app.tables.staticTexts[item].exists, "Unable to locate the \(item) element.") - } - - XCTAssert(helpers.verifyElementByText(options.randomElement()!, true)) - - XCTAssert(helpers.verifyElementByType(.button, "Done", true)) - return - } - - func testImageMultipleChoice() throws { - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - XCTAssert(helpers.verifyElementByText("Image Choice Question", true)) - - let required = ["Image Choice", "Additional text can go here."] - for item in required { - XCTAssert(helpers.verifyElementByText(item)) - } - - let square = helpers.verifyAndAssignByType(.button, "Square Shape")! - let circle = helpers.verifyAndAssignByType(.button, "Round Shape")! - - square.tap() - - XCTAssert(helpers.verifyElementByType(.button, "Next", true)) - XCTAssert(helpers.verifyPageByCount(2, 2)) - XCTAssert(helpers.verifyElementByType(.button, "Back", true)) - XCTAssert(helpers.verifyPageByCount(1, 2)) - square.tap() - circle.tap() - - XCTAssert(helpers.verifyElementByType(.button, "Next", true)) - XCTAssert(helpers.verifyPageByCount(2, 2)) - circle.tap() - - XCTAssert(helpers.verifyElementByType(.button, "Done", true)) - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - return - } - - func testSQPickerWheel() throws { - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - - let dt = helpers.verifyAndAssignByText("Date and Time Question")! - let elementsQuery = app.scrollViews.otherElements.staticTexts - - dt.tap() - XCTAssert(elementsQuery["Date and Time"].exists) - XCTAssert(elementsQuery["Additional text can go here."].exists) - XCTAssert(elementsQuery["Your question here."].exists) - - let skip = helpers.verifyAndAssignByText("Skip")! - XCTAssert(skip.isEnabled) - - let done = helpers.verifyAndAssignByType(.button, "Done")! - XCTAssert(done.isEnabled) - - let now = Date() - let formatter = DateFormatter() - formatter.setLocalizedDateFormatFromTemplate("a") - let datetime = formatter.string(from: now) - formatter.setLocalizedDateFormatFromTemplate("MMM dd") - let newDate = Calendar.current.date(byAdding: .day, value: 5, to: now) - let newDateString = formatter.string(from: newDate!) - - let firstPredicate = NSPredicate(format: "value BEGINSWITH 'Today'") - let firstPicker = app.pickerWheels.element(matching: firstPredicate) - XCTAssert(firstPicker.isEnabled) - firstPicker.adjust(toPickerWheelValue: newDateString) - - let secondPicker = helpers.verifyAndAssignByType(.pickerWheel, "clock")! - XCTAssert((secondPicker.isEnabled)) - secondPicker.adjust(toPickerWheelValue: "5") - - let thirdPicker = helpers.verifyAndAssignByType(.pickerWheel, "minute")! - XCTAssert(thirdPicker.isEnabled) - thirdPicker.adjust(toPickerWheelValue: "23") - let fourthPredicate = NSPredicate(format: "value CONTAINS '\(datetime)'") - let fourthPicker = app.pickerWheels.element(matching: fourthPredicate) - XCTAssert(fourthPicker.isEnabled) - datetime == "AM" ? fourthPicker.adjust(toPickerWheelValue: "PM") : fourthPicker.adjust(toPickerWheelValue: "AM") - - XCTAssert(done.isEnabled) - done.tap() - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - - dt.tap() - skip.tap() - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - - return - } - - func testSQSliders() throws { - XCTAssert(helpers.verifyElementByText("Scale Question", true)) - - XCTAssert(helpers.sliderScreenCheck(.slider1)) - XCTAssert(helpers.sliderScreenCheck(.slider2)) - XCTAssert(helpers.sliderScreenCheck(.slider3)) - XCTAssert(helpers.sliderScreenCheck(.slider4)) - XCTAssert(helpers.sliderScreenCheck(.slider5)) - XCTAssert(helpers.sliderScreenCheck(.slider6)) - - XCTAssert(helpers.sliderScreenCheck(.slider1)) - XCTAssert(helpers.sliderScreenCheck(.slider2)) - XCTAssert(helpers.sliderScreenCheck(.slider3)) - XCTAssert(helpers.sliderScreenCheck(.slider4)) - XCTAssert(helpers.sliderScreenCheck(.slider5)) - XCTAssert(helpers.sliderScreenCheck(.slider6)) - - XCTAssert(taskScreen.mainTaskScreen.waitForExistence(timeout: 5)) - return - } - - func testSQTextEntry() throws { - let testString = "The wonderful thing about tiggers is tiggers are wonderful things! Their tops are made out of rubber, their bottoms are made out of springs!" - - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - XCTAssert(helpers.verifyElementByText("Text Question", true)) - guard let done = commonElements.doneButton else { - XCTFail("Unable to locate done button") - return - } - XCTAssertFalse(done.isEnabled) - XCTAssert(helpers.verifyElementByText("Text")) - XCTAssert(helpers.verifyElementByText("Additional text can go here.")) - - let textView = app.textViews.element(boundBy: 0) - XCTAssert(textView.waitForExistence(timeout: 5)) - textView.tap() - - app.typeText(testString) - XCTAssert(helpers.verifyElementByText("140/280")) - - let clear = app.buttons["Clear"] - XCTAssert(clear.waitForExistence(timeout: 3)) - clear.tap() - - XCTAssert(helpers.verifyElementByText("0/280")) - app.typeText(testString) - - XCTAssert(commonElements.doneButton!.firstMatch.exists) - commonElements.doneButton!.firstMatch.tap() - - done.tap() - - XCTAssert(helpers.verifyElement(taskScreen.mainTaskScreen)) - - return - } - -} diff --git a/samples/ORKCatalog/ORKCatalogUITests/Screens/AllowScreens.swift b/samples/ORKCatalog/ORKCatalogUITests/Screens/AllowScreens.swift deleted file mode 100644 index d6ad4193d5..0000000000 --- a/samples/ORKCatalog/ORKCatalogUITests/Screens/AllowScreens.swift +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright (c) 2015, Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import Foundation -import XCTest - -struct AllowScreens { - let app = XCUIApplication() - let commonElements = CommonElements() - let taskScreen = TaskScreen() - - var healthAccessScreen: XCUIElement { - app.navigationBars.staticTexts["Health Access"] - } - - var locationAccessAlert: XCUIElement { - app.alerts["Allow “ORKCatalog” to use your location?"] - } - - func allowHealthAccess() { - if healthAccessScreen.exists { - app.tables.staticTexts["Turn All Categories On"].tap() - sleep(1) - app.navigationBars["Health Access"].buttons["Allow"].tap() - } - } - - func allowLocationServices() { - if locationAccessAlert.exists { - locationAccessAlert.scrollViews.otherElements.buttons["Allow While Using App"].tap() - } - } - - func triggerAllowScreens() -> Bool { - let healthTriggers = ["Height Question", "Weight Question"] - XCTAssert(commonElements.verifyElement(taskScreen.mainTaskScreen)) - - for task in healthTriggers { - let healthTask = app.tables.staticTexts[task] - healthTask.tap() - - sleep(3) - allowHealthAccess() - - sleep(2) - guard let cancelButton = commonElements.cancelButton else { - XCTFail("Unable to locate Cancel Button") - return false - } - cancelButton.tap() - - sleep(1) - guard let exitButton = commonElements.getExitButton() else { - XCTFail("Unable to locate End Task or Discard Results button") - return false - } - exitButton.tap() - - XCTAssert(taskScreen.mainTaskScreen.exists) - } - - return true - } -} diff --git a/samples/ORKCatalog/ORKCatalogUITests/Screens/CommonElements.swift b/samples/ORKCatalog/ORKCatalogUITests/Screens/CommonElements.swift deleted file mode 100644 index 1aa8fa9cad..0000000000 --- a/samples/ORKCatalog/ORKCatalogUITests/Screens/CommonElements.swift +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright (c) 2015, Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import Foundation -import XCTest - -struct CommonElements { - let app = XCUIApplication() - - var cancelButton: XCUIElement? { - app.navigationBars.buttons["Cancel"] - } - - var exitTaskButton: XCUIElement { - getExitButton()! - } - - var doneButton: XCUIElement? { - app.buttons["Done"] - } - - var nextButton: XCUIElement? { - app.scrollViews.otherElements.staticTexts["Next"] - } - - var backButton: XCUIElement? { - app.navigationBars.buttons["Back"] - } - - var skipButton: XCUIElement? { - app.scrollViews.otherElements.staticTexts["Skip"] - } - - func getExitButton() -> XCUIElement? { - let otherElements = app.sheets.scrollViews.otherElements - if otherElements.buttons["Discard Results"].exists { - return otherElements.buttons["Discard Results"] - } - if otherElements.buttons["End Task"].exists { - return otherElements.buttons["End Task"] - } - return nil - } - - func verifyElement(_ element: XCUIElement) -> Bool { - if element.exists { - return true - } - XCTFail("Unable to confrim \(element) exists") - return false - } - -} diff --git a/samples/ORKCatalog/ORKCatalogUITests/Screens/TaskScreen.swift b/samples/ORKCatalog/ORKCatalogUITests/Screens/TaskScreen.swift deleted file mode 100644 index 7888b6c505..0000000000 --- a/samples/ORKCatalog/ORKCatalogUITests/Screens/TaskScreen.swift +++ /dev/null @@ -1,103 +0,0 @@ -/* -Copyright (c) 2015, Apple Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation and/or -other materials provided with the distribution. - -3. Neither the name of the copyright holder(s) nor the names of any contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. No license is granted to the trademarks of -the copyright holders even if such marks are included in this software. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -import Foundation -import XCTest - -struct TaskScreen { - let app = XCUIApplication() - - var surveyTasks = [ - "Form Survey Example", - "Grouped Form Survey Example", - "Simple Survey Example" - ] - - var surveyQuestions = [ - "Boolean Question", - "Custom Boolean Question", - "Date Question", - "Date and Time Question", - "Height Question", - "Weight Question", - "Image Choice Question", - "Location Question", - "Numeric Question", - "Scale Question", - "Text Question", - "Text Choice Question", - "Time Interval Question", - "Value Picker Choice Question", - "Validated Text Question", - "Image Capture Step", - "Video Capture Step", - "Front Facing Camera Step", - "Wait Step", - "PDF Viewer Step", - "Request Permissions Step" - ] - - var activeTasks: [String] { - var tasks = [ - "Audio", - "Amsler Grid", - "Fitness Check", - "Hole Peg Test", - "PSAT", - "Reaction Time", - "Short Walk", - "Spatial Span Memory", - "Speech Recognition", - "Speech in Noise", - "Stroop", - "Timed Walk with Turn Around", - "Tone Audiometry", - "dBHL Tone Audiometry", - //"Environment SPL Meter", - "Tower of Hanoi", - "Tremor Test", - "Two Finger Tapping Interval", - "Walk Back and Forth", - "Knee Range of Motion", - "Shoulder Range of Motion", - "Trail Making Test" - ] - - return tasks - } - - var mainTaskScreen: XCUIElement { - app.navigationBars["ORKCatalog"].staticTexts["ORKCatalog"] - } - - func getCurrentTask(task: String) -> XCUIElement? { - return app.tables.staticTexts[task] - } -} diff --git a/samples/ORKCatalog/ResearchKit-Shared.xcconfig b/samples/ORKCatalog/ResearchKit-Shared.xcconfig new file mode 100644 index 0000000000..ca9ea74c1b --- /dev/null +++ b/samples/ORKCatalog/ResearchKit-Shared.xcconfig @@ -0,0 +1,40 @@ +// ResearchKit-Shared.xcconfig +// ORKCatalog +// +// Copyright © 2021 researchkit.org. All rights reserved. +// + +ORK_CATALOG_VERSION_NUMBER = 3.1.1 + +ORK_CATALOG_BUILD_NUMBER = $(ORK_CATALOG_BUILD_NUMBER_CI_$(CI)) // ORK_CATALOG_BUILD_NUMBER_CI_TRUE or ORK_CATALOG_BUILD_NUMBER_CI_ +ORK_CATALOG_BUILD_NUMBER_CI_TRUE = $(CI_BUILD_NUMBER) +ORK_CATALOG_BUILD_NUMBER_CI_FALSE = $(ORK_CATALOG_VERSION_NUMBER) // when not in CI, just assume the build number is our version number +ORK_CATALOG_BUILD_NUMBER_CI_ = $(ORK_CATALOG_BUILD_NUMBER_CI_FALSE) + +ORK_FEATURE_HEALTHKIT_AUTHORIZATION = 1 +ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION = 1 + +// GCC Preprocessor definitions +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC = $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_$(ORK_FEATURE_HEALTHKIT_AUTHORIZATION)) +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_0 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION=0 +ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC_1 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION=1 + +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC = $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC_$(ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION)) +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC_0 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=0 +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC_1 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION=1 + +// Swift active compilation conditions +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT = $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_$(ORK_FEATURE_HEALTHKIT_AUTHORIZATION)) +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_0 = +ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT_1 = ORK_FEATURE_HEALTHKIT_AUTHORIZATION + +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT = $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT_$(ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION)) +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT_0 = +ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT_1 = ORK_FEATURE_CLLOCATIONMANAGER_AUTHORIZATION + + +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_GCC) $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_GCC) + +SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(inherited) $(ORK_FEATURE_HEALTHKIT_DEFINITIONS_SWIFT) $(ORK_FEATURE_CLLOCATIONMANAGER_DEFINITIONS_SWIFT) + +