Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f1e8bbc
feat: Build CareKitUI for macOS
cbaker6 Jul 5, 2024
bb36446
update CI to test against macOS
cbaker6 Jul 5, 2024
40e88e7
xcode proj builds for macOS
cbaker6 Jul 5, 2024
8f4f043
add macOS to test projects
cbaker6 Jul 5, 2024
1f9385c
Update swift.yml
cbaker6 Jul 5, 2024
c87e91c
Update swift.yml
cbaker6 Jul 5, 2024
56406fd
build for visionOS
cbaker6 Jul 5, 2024
857dd83
add visionOS to CI
cbaker6 Jul 5, 2024
41aee7b
add min visionOS requirement
cbaker6 Jul 5, 2024
8ae3970
fix file protections for macOS
cbaker6 Jul 6, 2024
5421c7b
nit
cbaker6 Jul 6, 2024
d9149c3
nits
cbaker6 Jul 6, 2024
3adb362
Update Xcode
cbaker6 Sep 30, 2024
f9afe82
Merge branch 'carekit-apple:main' into buildCareKitUI
cbaker6 Feb 20, 2025
b8ef119
Update swift.yml
cbaker6 Feb 20, 2025
dff891a
replace xcpretty, it's producing errors
cbaker6 Feb 20, 2025
a7dce67
nit
cbaker6 Feb 20, 2025
8b2862d
retry tests on failure up to 3 times
cbaker6 Feb 20, 2025
af2ded5
Merge remote-tracking branch 'refs/remotes/origin/buildCareKitUI'
cbaker6 Feb 20, 2025
3bad297
Update swift.yml
cbaker6 Feb 23, 2025
1122642
repeat tests on store up to 3 times
cbaker6 Feb 25, 2025
bae166f
nit
cbaker6 Feb 25, 2025
e7647e7
Merge branch 'main' into buildCareKitUI
cbaker6 May 14, 2025
0cd2e3f
add code back for macOS store
cbaker6 May 14, 2025
6c6e427
health stores can read/write on all OS's
cbaker6 May 14, 2025
77265bb
Merge branch 'main' into buildCareKitUI
cbaker6 Dec 14, 2025
9bcb036
nits
cbaker6 Dec 14, 2025
6273b0c
Update Swift CI workflow for new macOS and iOS versions
cbaker6 Dec 14, 2025
2b23912
Only set file attribute key
cbaker6 Dec 14, 2025
e04359b
Merge remote-tracking branch 'refs/remotes/origin/buildCareKitUI'
cbaker6 Dec 14, 2025
1bda006
fix check on all OS's
cbaker6 Dec 14, 2025
52e2692
Remove testRepetitionMode from test plan
cbaker6 Dec 14, 2025
566bd61
ensure store is deleted in tests
cbaker6 Dec 14, 2025
7636a0a
comment out macOS tests for now
cbaker6 Dec 14, 2025
c15fd78
create unique OCKStore for tests
cbaker6 Dec 14, 2025
c110224
test one
cbaker6 Dec 14, 2025
c123899
revert
cbaker6 Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: macos-14
strategy:
matrix:
destination: ['platform=iOS\ Simulator,OS=17.5,name=iPhone\ 15\ Pro\ Max', 'platform=watchOS\ Simulator,OS=10.5,name=Apple\ Watch\ Series\ 7\ \(45mm\)']
destination: ['platform=iOS\ Simulator,OS=17.5,name=iPhone\ 15\ Pro\ Max', 'platform=watchOS\ Simulator,OS=10.5,name=Apple\ Watch\ Series\ 7\ \(45mm\)', 'platform=macOS CODE_SIGN_IDENTITY=""', 'platform=visionOS\ Simulator,OS=1.2,name=Apple\ Vision\ Pro CODE_SIGN_IDENTITY=""']
scheme: ['CareKit', 'CareKitStore', 'CareKitUI', 'CareKitFHIR']
steps:
- uses: actions/checkout@v4
Expand Down
22 changes: 13 additions & 9 deletions CareKit/CareKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 53;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -1131,12 +1131,12 @@
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = Apple.CareKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "watchsimulator watchos iphonesimulator iphoneos";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,4";
TARGETED_DEVICE_FAMILY = "1,2,4,7";
};
name = Debug;
};
Expand Down Expand Up @@ -1166,10 +1166,10 @@
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = Apple.CareKitTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "watchsimulator watchos iphonesimulator iphoneos";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,4";
TARGETED_DEVICE_FAMILY = "1,2,4,7";
};
name = Release;
};
Expand Down Expand Up @@ -1238,6 +1238,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = "$(VERSION_NUMBER)";
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
Expand All @@ -1252,6 +1253,7 @@
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 7.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1314,6 +1316,7 @@
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = "$(VERSION_NUMBER)";
MTL_ENABLE_DEBUG_INFO = NO;
ONLY_ACTIVE_ARCH = NO;
Expand All @@ -1328,6 +1331,7 @@
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 7.0;
XROS_DEPLOYMENT_TARGET = 1.0;
};
name = Release;
};
Expand Down Expand Up @@ -1365,13 +1369,13 @@
RUN_DOCUMENTATION_COMPILER = YES;
SDKROOT = auto;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator watchos watchsimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_UIKITFORMAC = NO;
"SWIFT_ACTIVE_COMPILATION_CONDITIONS[arch=*]" = DEBUG;
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
TARGETED_DEVICE_FAMILY = "1,2,4";
TARGETED_DEVICE_FAMILY = "1,2,4,7";
WATCHOS_DEPLOYMENT_TARGET = 7.0;
};
name = Debug;
Expand Down Expand Up @@ -1410,12 +1414,12 @@
RUN_DOCUMENTATION_COMPILER = YES;
SDKROOT = auto;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator watchos watchsimulator";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_UIKITFORMAC = NO;
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
TARGETED_DEVICE_FAMILY = "1,2,4";
TARGETED_DEVICE_FAMILY = "1,2,4,7";
WATCHOS_DEPLOYMENT_TARGET = 7.0;
};
name = Release;
Expand Down
4 changes: 4 additions & 0 deletions CareKit/CareKit/Shared/Extensions/UIImage+Asset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if canImport(UIKit)

import Foundation
import UIKit

Expand All @@ -42,3 +44,5 @@ extension UIImage {
return otherUrlImage ?? appAssetsImage ?? symbol
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import CareKitStore
import Foundation
import UIKit

extension OCKAnyReadOnlyEventStore {

Expand Down
23 changes: 20 additions & 3 deletions CareKit/CareKit/Shared/Task/OCKTaskEvents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ public struct OCKTaskEvents: Collection, Identifiable {

// First make sure there is no matching event already stored in the data structure.
let indexPath = self.indexPath(of: event)
guard indexPath == nil else { return (self[indexPath!.section][indexPath!.row], false) }
guard indexPath == nil else {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See comment below about row/item is handled for how iOS/macOS

let indexPathRowValue = rowValueOfIndexPath(indexPath!)
return (self[indexPath!.section][indexPathRowValue], false)
}

// Append the event to the matching section if one exists.
if let section = section(for: event.task) {
Expand All @@ -113,7 +116,8 @@ public struct OCKTaskEvents: Collection, Identifiable {
public mutating func remove(event: OCKAnyEvent) -> OCKAnyEvent? {
guard let indexPath = indexPath(of: event) else { return nil }
var updatedEvents = events[indexPath.section]
let removedEvent = updatedEvents.remove(at: indexPath.row)
let indexPathRowValue = rowValueOfIndexPath(indexPath)
let removedEvent = updatedEvents.remove(at: indexPathRowValue)

// If the removed event was the last one in the section, remove the whole section.
guard !updatedEvents.isEmpty else {
Expand All @@ -132,7 +136,8 @@ public struct OCKTaskEvents: Collection, Identifiable {
public mutating func update(event: OCKAnyEvent) -> OCKAnyEvent? {
// Update the matching event
if let matchIndexPath = indexPath(of: event) {
events[matchIndexPath.section][matchIndexPath.row] = event
let matchIndexPathRowValue = rowValueOfIndexPath(matchIndexPath)
events[matchIndexPath.section][matchIndexPathRowValue] = event
return event
// Else append the event
} else {
Expand All @@ -148,7 +153,19 @@ public struct OCKTaskEvents: Collection, Identifiable {
private func indexPath(of event: OCKAnyEvent) -> IndexPath? {
guard let section = section(for: event.task) else { return nil }
guard let row = events[section].firstIndex(where: { $0.matches(event) }) else { return nil }
#if !os(macOS)
return .init(row: row, section: section)
#else
return .init(item: row, section: section)
#endif
}

private func rowValueOfIndexPath(_ indexPath: IndexPath) -> Int {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this method because iOS and macOS use row/item respectively

#if !os(macOS)
return indexPath.row
#else
return indexPath.item
#endif
}

// MARK: - Collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import Foundation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitStore
import CareKitUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitStore
import Foundation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitStore
import Foundation
Expand Down
2 changes: 1 addition & 1 deletion CareKit/CareKit/iOS/Details/OCKDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS) && !os(visionOS)

import CareKitUI
import UIKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import UIKit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitUI
import UIKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitUI
import UIKit
Expand Down
2 changes: 1 addition & 1 deletion CareKit/CareKit/iOS/Higher Order/View/OCKListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitUI
import UIKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,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 !os(watchOS)
#if !os(watchOS) && !os(macOS)

import CareKitStore
import CareKitUI
Expand Down
Loading