diff --git a/MacOSExample/macos/Podfile.lock b/MacOSExample/macos/Podfile.lock index 692b158be91e..847a37067867 100644 --- a/MacOSExample/macos/Podfile.lock +++ b/MacOSExample/macos/Podfile.lock @@ -577,11 +577,11 @@ SPEC CHECKSUMS: ReactCommon: 6f2738740f0a5677dc3554112d49ce10d2b0a576 RNCAsyncStorage: c913ede1fa163a71cea118ed4670bbaaa4b511bb RNCPicker: 529d564911e93598cc399b56cc0769ce3675f8c8 - RNReanimated: 71dba8af3fcf22b055c801febf963fd3f3da6f73 + RNReanimated: ce7bb3c62611851fc282f079b8a4dd92b4dec414 RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d Yoga: b01d8e70b1bc0e88b40040a7d9c50fdadb1054b9 PODFILE CHECKSUM: b964368aafa7380114b03271f85998831a6e0f0b -COCOAPODS: 1.14.2 +COCOAPODS: 1.14.3 diff --git a/RNReanimated.podspec b/RNReanimated.podspec index 8e539f565d5c..5d596d47d89c 100644 --- a/RNReanimated.podspec +++ b/RNReanimated.podspec @@ -74,7 +74,7 @@ Pod::Spec.new do |s| s.homepage = "https://github.com/software-mansion/react-native-reanimated" s.license = "MIT" s.author = { "author" => "author@domain.cn" } - s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14" } + s.platforms = { :ios => ios_min_version, :tvos => "9.0", :osx => "10.14", :visionos => "1.0" } s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" } s.source_files = [ diff --git a/apple/LayoutReanimation/REAAnimationsManager.m b/apple/LayoutReanimation/REAAnimationsManager.m index 19b85a99f09c..0e626ddbafe5 100644 --- a/apple/LayoutReanimation/REAAnimationsManager.m +++ b/apple/LayoutReanimation/REAAnimationsManager.m @@ -250,7 +250,11 @@ - (void)setNewProps:(NSMutableDictionary *)newProps if (needsViewPositionUpdate) { CGPoint newCenter = CGPointMake(centerX, centerY); if (convertFromAbsolute) { +#if TARGET_OS_OSX REAUIView *window = UIApplication.sharedApplication.keyWindow; +#else + REAUIView *window = RCTKeyWindow(); +#endif CGPoint convertedCenter = [window convertPoint:newCenter toView:view.superview]; view.center = convertedCenter; } else { diff --git a/apple/LayoutReanimation/REASharedTransitionManager.m b/apple/LayoutReanimation/REASharedTransitionManager.m index 2102fbfe9275..3fc52c99ec23 100644 --- a/apple/LayoutReanimation/REASharedTransitionManager.m +++ b/apple/LayoutReanimation/REASharedTransitionManager.m @@ -529,7 +529,11 @@ - (void)configureTransitionContainer { if (!_isSharedTransitionActive) { _isSharedTransitionActive = YES; +#if TARGET_OS_OSX REAUIView *mainWindow = UIApplication.sharedApplication.keyWindow; +#else + REAUIView *mainWindow = (REAUIView *)RCTKeyWindow(); +#endif if (_transitionContainer == nil) { _transitionContainer = [REAUIView new]; } diff --git a/apple/LayoutReanimation/REASnapshot.m b/apple/LayoutReanimation/REASnapshot.m index 02ba8dc10728..832d3ea0f7bf 100644 --- a/apple/LayoutReanimation/REASnapshot.m +++ b/apple/LayoutReanimation/REASnapshot.m @@ -1,6 +1,7 @@ #import #import #import +#import #import #import @@ -27,7 +28,11 @@ - (instancetype)initWithAbsolutePosition:(REAUIView *)view - (void)makeSnapshotForView:(REAUIView *)view useAbsolutePositionOnly:(BOOL)useAbsolutePositionOnly { +#if TARGET_OS_OSX REAUIView *mainWindow = UIApplication.sharedApplication.keyWindow; +#else + REAUIView *mainWindow = RCTKeyWindow(); +#endif CGPoint absolutePosition = [[view superview] convertPoint:view.center toView:nil]; _values = [NSMutableDictionary new]; #if TARGET_OS_OSX diff --git a/apple/sensor/ReanimatedSensor.m b/apple/sensor/ReanimatedSensor.m index b290ab1906d7..863c788ea9a7 100644 --- a/apple/sensor/ReanimatedSensor.m +++ b/apple/sensor/ReanimatedSensor.m @@ -1,6 +1,6 @@ #import -#if !TARGET_OS_TV && !TARGET_OS_OSX +#if !TARGET_OS_TV && !TARGET_OS_OSX && !TARGET_OS_VISION @implementation ReanimatedSensor - (instancetype)init:(ReanimatedSensorType)sensorType