Skip to content

Commit

Permalink
Stable Public Release 2.2.15
Browse files Browse the repository at this point in the history
 Merging main into stable
  • Loading branch information
louie-apple committed Dec 5, 2023
1 parent 1b9daf6 commit 38d161f
Show file tree
Hide file tree
Showing 711 changed files with 18,864 additions and 14,499 deletions.
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -88,6 +88,20 @@ 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

```
pod 'ResearchKit', :git => 'https://github.com/ResearchKit/ResearchKit.git', :branch => 'main'
```

Building
--------

Expand Down
6 changes: 0 additions & 6 deletions RKWorkspace.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ResearchKit.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'ResearchKit'
s.version = '2.1.0'
s.version = '2.2.15'
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/'
Expand Down
1,879 changes: 1,059 additions & 820 deletions ResearchKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

36 changes: 12 additions & 24 deletions ResearchKit.xcodeproj/xcshareddata/xcschemes/ResearchKit.xcscheme
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
Expand Down Expand Up @@ -40,33 +40,21 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "B183A4731A8535D100C76870"
BuildableName = "ResearchKit.framework"
BlueprintName = "ResearchKit"
ReferencedContainer = "container:ResearchKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86CC8E991AC09332001CCD89"
BuildableName = "ResearchKitTests.xctest"
BlueprintName = "ResearchKitTests"
ReferencedContainer = "container:ResearchKit.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<TestPlans>
<TestPlanReference
reference = "container:ResearchKit.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
enableUBSanitizer = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion ResearchKit.xcodeproj/xcshareddata/xcschemes/docs.xcscheme
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
24 changes: 24 additions & 0 deletions ResearchKit.xctestplan
@@ -0,0 +1,24 @@
{
"configurations" : [
{
"id" : "A9C8689E-BBEE-4643-8C5D-DBA6A5AF01B2",
"name" : "Configuration 1",
"options" : {

}
}
],
"defaultOptions" : {

},
"testTargets" : [
{
"target" : {
"containerPath" : "container:ResearchKit.xcodeproj",
"identifier" : "86CC8E991AC09332001CCD89",
"name" : "ResearchKitTests"
}
}
],
"version" : 1
}
2 changes: 1 addition & 1 deletion ResearchKit/ActiveTasks/ORK3DModelManager.h
Expand Up @@ -57,7 +57,7 @@ This method signifies that the step is about to end so any necessary clean up be
You can also optionally pass back an array of ORKResults.
*/
- (nullable NSArray<ORKResult *> *)provideResults;
- (nullable NSArray<ORKResult *> *)provideResultsWithIdentifier:(NSString *)identifier;

@end

Expand Down
4 changes: 2 additions & 2 deletions ResearchKit/ActiveTasks/ORK3DModelManager.m
Expand Up @@ -42,7 +42,7 @@ - (instancetype)init {
self = [super init];

if (self) {
_allowsSelection = YES;
_allowsSelection = NO;
_highlightColor = [UIColor yellowColor];
_identifiersOfObjectsToHighlight = nil;
}
Expand Down Expand Up @@ -117,7 +117,7 @@ - (void)stepWillEnd {
[NSException raise:@"stepWillEnd not overwitten" format:@"Subclasses must overwrite the stepWillEnd function"];
}

- (NSArray<ORKResult *> *)provideResults {
- (NSArray<ORKResult *> *)provideResultsWithIdentifier:(NSString *)identifier {
[NSException raise:@"provideResults not overwitten" format:@"Subclasses must overwrite the provideResults function"];
return nil;
}
Expand Down
5 changes: 2 additions & 3 deletions ResearchKit/ActiveTasks/ORK3DModelStep.m
Expand Up @@ -73,7 +73,7 @@ - (instancetype)copyWithZone:(NSZone *)zone {
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self ) {
ORK_DECODE_OBJ(aDecoder, modelManager);
ORK_DECODE_OBJ_CLASS(aDecoder, modelManager, ORK3DModelManager);
}
return self;
}
Expand All @@ -90,8 +90,7 @@ - (BOOL)isEqual:(id)object {
return (isParentSame && ORKEqualObjects(self.modelManager, castObject.modelManager));
}

- (NSUInteger)hash
{
- (NSUInteger)hash {
return [super hash] ^ [_modelManager hash];
}

Expand Down
14 changes: 7 additions & 7 deletions ResearchKit/ActiveTasks/ORK3DModelStepViewController.m
Expand Up @@ -45,7 +45,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE

@implementation ORK3DModelStepViewController {
ORK3DModelManager *_modelManager;
ORK3DModelStepContentView *_stepContentview;
ORK3DModelStepContentView *_stepContentView;
ORK3DModelStep *_step;
}

Expand All @@ -62,13 +62,13 @@ - (instancetype)initWithStep:(ORKStep *)step {
- (void)viewDidLoad {
[super viewDidLoad];

_stepContentview = [ORK3DModelStepContentView new];
_stepContentview.translatesAutoresizingMaskIntoConstraints = NO;
self.activeStepView.activeCustomView = _stepContentview;
_stepContentView = [ORK3DModelStepContentView new];
_stepContentView.translatesAutoresizingMaskIntoConstraints = NO;
self.activeStepView.activeCustomView = _stepContentView;
self.activeStepView.customContentFillsAvailableSpace = NO;
self.activeStepView.navigationFooterView.neverHasContinueButton = NO;

[[_stepContentview.bottomAnchor constraintEqualToAnchor:self.activeStepView.navigationFooterView.topAnchor] setActive:YES];
[[_stepContentView.bottomAnchor constraintEqualToAnchor:self.activeStepView.navigationFooterView.topAnchor] setActive:YES];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(disableContinueButton:)
Expand Down Expand Up @@ -97,7 +97,7 @@ - (void)dealloc {
- (void)activate3DModelManager {
_modelManager = _step.modelManager;

[_modelManager addContentToView:_stepContentview];
[_modelManager addContentToView:_stepContentView];
}

- (void)stepDidFinish {
Expand All @@ -118,7 +118,7 @@ - (ORKStepResult *)result {
ORKStepResult *stepResult = [super result];

if (_modelManager) {
NSArray<ORKResult *> *managerResults = [_modelManager provideResults];
NSArray<ORKResult *> *managerResults = [_modelManager provideResultsWithIdentifier:self.step.identifier];
if (managerResults) {
stepResult.results = [managerResults copy];
}
Expand Down
56 changes: 56 additions & 0 deletions ResearchKit/ActiveTasks/ORKAccuracyStroopResult.h
@@ -0,0 +1,56 @@
/*
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 <ResearchKit/ORKStroopResult.h>

NS_ASSUME_NONNULL_BEGIN

ORK_CLASS_AVAILABLE
@interface ORKAccuracyStroopResult : ORKStroopResult

/**
A value that indicates whether the user selected the correct color (i.e. the base display color).
*/
@property (nonatomic, readonly) BOOL didSelectCorrectColor;

/**
A value that indicates how long it took for the user to make a selection.
*/
@property (nonatomic, assign) NSTimeInterval timeTakenToSelect;

/**
A value that indicates how far away (in pixels) that the user selected away from the center
of the correct circle.
*/
@property (nonatomic) double distanceToClosestCenter;

@end

NS_ASSUME_NONNULL_END
99 changes: 99 additions & 0 deletions ResearchKit/ActiveTasks/ORKAccuracyStroopResult.m
@@ -0,0 +1,99 @@
/*
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 "ORKAccuracyStroopResult.h"
#import "ORKResult_Private.h"
#import "ORKHelpers_Internal.h"

@interface ORKAccuracyStroopResult ()
@property (readwrite) BOOL didSelectCorrectColor;
@end

@implementation ORKAccuracyStroopResult

#pragma mark - NSSecureCoding

+ (BOOL)supportsSecureCoding {
return YES;
}

- (instancetype)initWithCoder:(NSCoder *)coder {
self = [super initWithCoder:coder];
if (self) {
ORK_DECODE_DOUBLE(coder, distanceToClosestCenter);
}
return self;
}

- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
ORK_ENCODE_BOOL(coder, didSelectCorrectColor);
ORK_ENCODE_DOUBLE(coder, timeTakenToSelect);
ORK_ENCODE_DOUBLE(coder, distanceToClosestCenter);
}


#pragma mark - NSCopying

- (instancetype)copyWithZone:(NSZone *)zone {
ORKAccuracyStroopResult *result = [super copyWithZone:zone];
result.distanceToClosestCenter = self.distanceToClosestCenter;
return result;
}

- (BOOL)isEqual:(id)object {
BOOL isParentSame = [super isEqual:object];

__typeof(self) castObject = object;
return (isParentSame &&
self.distanceToClosestCenter == castObject.distanceToClosestCenter);
}

- (NSUInteger)hash {
return [super hash] ^ @(self.didSelectCorrectColor).hash ^ @(self.timeTakenToSelect).hash ^ @(self.distanceToClosestCenter).hash;
}

#pragma mark - ResearchKit

- (BOOL)didSelectCorrectColor {
_didSelectCorrectColor = [self.color isEqualToString:self.colorSelected];
return _didSelectCorrectColor;
}

- (NSString *)descriptionWithNumberOfPaddingSpaces:(NSUInteger)numberOfPaddingSpaces {
return [NSString stringWithFormat:@"%@; didSelectCorrectColor: %i; timeTakenToSelect: %.3f; distanceToClosestCenter: %.0f %@",
[self descriptionPrefixWithNumberOfPaddingSpaces:numberOfPaddingSpaces],
self.didSelectCorrectColor,
self.timeTakenToSelect,
self.distanceToClosestCenter,
self.descriptionSuffix];
}

@end

0 comments on commit 38d161f

Please sign in to comment.