From 7ecfd9b517a05250ad92c156624deae7a9b0cf2b Mon Sep 17 00:00:00 2001 From: Walter Holohan Date: Fri, 8 Sep 2023 22:23:01 +0100 Subject: [PATCH] chore: handle xcode 14 --- ios/ReactNativeHealthkit.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/ReactNativeHealthkit.swift b/ios/ReactNativeHealthkit.swift index 4aa9004..1ebd4e4 100644 --- a/ios/ReactNativeHealthkit.swift +++ b/ios/ReactNativeHealthkit.swift @@ -1243,6 +1243,7 @@ class ReactNativeHealthkit: RCTEventEmitter { @available(iOS 17.0.0, *) func getWorkoutPlan(workout: HKWorkout) async -> [String: Any]? { + #if canImport(WorkoutKit) do { let workoutPlan = try await workout.workoutPlan @@ -1262,6 +1263,9 @@ class ReactNativeHealthkit: RCTEventEmitter { } catch { return nil } + #else + return nil + #endif } @objc(getWorkoutPlanById:resolve:reject:)