Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync SwiftUI branch #32

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6cfb995
cleaning up unused strings (#1578)
louie-apple Jun 26, 2024
57427e8
Set “Enable Module Verifier” flag to “Yes” only in Release build conf…
aplummer-apple Aug 8, 2024
b274d1f
Update README.md
Pariecemckinney-apple Oct 15, 2024
5c5d295
Public release 3.1.0
Pariecemckinney-apple Oct 15, 2024
eedd39d
Public beta release - SwiftUI
simon-apple Oct 21, 2024
78b345a
merge upstream SwiftUI branch and resolve conflicts
NikolaiMadlener Nov 8, 2024
4e5d0c0
Update iPhone Used for Testing
PSchmiedmayer Nov 9, 2024
dbee8f0
Excape String
PSchmiedmayer Nov 9, 2024
0fc1e5e
Update Setup
PSchmiedmayer Nov 9, 2024
003a2d8
change SwiftUI target
NikolaiMadlener Nov 10, 2024
9195803
Merge branch 'SwiftUI' of github.com:StanfordBDHG/ResearchKit into Sw…
NikolaiMadlener Nov 10, 2024
50d3f85
dependencies must precede path
NikolaiMadlener Nov 10, 2024
2230d3a
add default localization
NikolaiMadlener Nov 10, 2024
d070ebd
lift iOS version to v18
NikolaiMadlener Nov 10, 2024
1f294e6
lift swift-tools version to 6.0
NikolaiMadlener Nov 10, 2024
25bedec
back to iOS 17
NikolaiMadlener Nov 10, 2024
5e6acad
iOS18
NikolaiMadlener Nov 10, 2024
996fb44
concurrency safety
NikolaiMadlener Nov 10, 2024
ca47c25
concurrency safety
NikolaiMadlener Nov 10, 2024
c21ab46
remove dependencies from swiftui target
NikolaiMadlener Nov 10, 2024
05b21be
add RK dependency to RKSwiftUI target
NikolaiMadlener Nov 10, 2024
ee57914
add swift testing dependency
NikolaiMadlener Nov 11, 2024
0550213
adjust swift testing version
NikolaiMadlener Nov 11, 2024
e42f48f
Remove Testig
PSchmiedmayer Nov 11, 2024
4a50b01
exlude RKSwiftUI from SwiftLint
NikolaiMadlener Nov 18, 2024
771a074
move back to old SwiftUI target in package.siwft
NikolaiMadlener Nov 18, 2024
afd5abe
remove RKSwiftUI target
NikolaiMadlener Nov 18, 2024
37f7668
remove StrictConcurrency from package.swift
NikolaiMadlener Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions Package.swift
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will have to keep our old ResearchKitSwiftUI target in place while adding a new one pointing to the one created by Apple as a new target. As we will have to tag a major version anyways (moving to only iOS 18 is a breaking change), we might want to:

  1. Incorporate the changes here in main without adding the Apple Swift UI target and not referencing it in the Swift Package.
  2. Create a swiftUI branch similar to the one from Apple where we rename our old target to ResearchKitSwitUIBridge or something and add the new Apple target as ResearchKitSwiftUI. While Apple might take a long time to finish up their implementation we could tag 4.0.0-beta.1 or similar releases on that branch including the breaking iOS 18 requirement. Eventually it would be great if Apple would do so but until then we have to maintain this ourselves ...

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.10
// swift-tools-version: 6.0

import class Foundation.ProcessInfo
import PackageDescription
Expand All @@ -13,6 +13,7 @@ let swiftConcurrency: SwiftSetting = .enableUpcomingFeature("StrictConcurrency")

let package = Package(
name: "ResearchKit",
defaultLocalization: "en",
platforms: [
.iOS(.v17),
.visionOS(.v1)
Expand Down Expand Up @@ -44,9 +45,6 @@ let package = Package(
.target(name: "ResearchKitUI"),
.target(name: "ResearchKitActiveTask", condition: .when(platforms: [.iOS]))
],
swiftSettings: [
swiftConcurrency
],
plugins: [] + swiftLintPlugin()
)
]
Expand Down
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![ResearchKit](https://github.com/user-attachments/assets/0384c1a6-ec67-45d3-be68-136a2e4cacff)

ResearchKit Framework
===========

Expand Down Expand Up @@ -86,6 +88,78 @@ The height question is presented in the figure below.
|---|---|
| ![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) |

### ResearchKit SwiftUI

We are excited to announce the release of a new beta API for surveys in ResearchKit. This API is designed to enhance the flexibility, customization, and cross-platform compatibility of surveys in your ResearchKit apps. Below are the key features and usage details.

New Form APIs offer an easily configurable and flexible UI, with the same look and feel of `ORKFormStep`:
* `ResearchForm`
* Manages the navigation between steps in a survey.
* `ResearchFormStep`
* Represents a step in a survey and lays out the header and questions on one page. Question numbers (e.g. 1 of 3) are automatically added at the top of each question to denote progress in a step.
* `ResearchFormCompletion`
* Represents the context for a survey's completion
* `ResearchFormResult`
* Represents responses for the different kinds of questions.
* `StepHeader`
* A step header containing an image, title, and subtitle.
* `QuestionHeader`
* A question header containing a title and detail.
* `InstructionBodyItem`
* Displays an image and text side by side.
* `questionRequired` (`ViewModifier`)
* Designates a question as required or optional.

#### Survey Question Types:
* `MultipleChoiceQuestion`
* `HeightQuestion`
* `WeightQuestion`
* `SliderQuestion`
* `TextQuestion`
* `DateTimeQuestion`
* `NumericQuestion`
* `ImageChoiceQuestion`

The example below shows how to create a `ResearchForm` to present a text question for the participant to answer, and then save their results.

```swift
import ResearchKitSwiftUI

ResearchForm(
id: "SurveyTask",
steps: {
ResearchFormStep(
title: "Demographics",
subtitle: "Tell us about yourself",
content: {
TextQuestion(
id: "textQuestion",
title: "What is your name?",
prompt: "Enter your name here",
lineLimit: .singleLine,
characterLimit: 0
)
.questionRequired(true)
}
)
},
onResearchFormCompletion: { completion in
switch completion {
case .completed(let results):
save(results)
case .discarded:
cancel()
default:
cancel()
}
}
)
```

#### Install as an embedded framework

Download the project source code and drag in the *ResearchKitSwiftUI* folder. In the dialog that pops up, choose to copy files to destination and create folders. Then hit the finish button. Finally, embed the *ResearchKitSwiftUI* framework in your app by adding it to the "Frameworks, Libraries, and Embedded Content" section for your target.

# Consent <a name="consent"></a>

The *ResearchKit framework* provides classes that you can customize to explain the
Expand Down
19 changes: 19 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# ResearchKit Release Notes

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

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

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

34 changes: 34 additions & 0 deletions ResearchKit.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Pod::Spec.new do |s|
s.name = 'ResearchKit'
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.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

Loading
Loading