Skip to content

Commit

Permalink
feat: add visionos support
Browse files Browse the repository at this point in the history
  • Loading branch information
okwasniewski committed Feb 1, 2024
1 parent 96b5559 commit b8d319b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RNReanimated.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion apple/LayoutReanimation/REAAnimationsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ - (void)setNewProps:(NSMutableDictionary *)newProps
if (needsViewPositionUpdate) {
CGPoint newCenter = CGPointMake(centerX, centerY);
if (convertFromAbsolute) {
REAUIView *window = UIApplication.sharedApplication.keyWindow;
REAUIView *window = RCTKeyWindow();
CGPoint convertedCenter = [window convertPoint:newCenter toView:view.superview];
view.center = convertedCenter;
} else {
Expand Down
2 changes: 1 addition & 1 deletion apple/LayoutReanimation/REASharedTransitionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ - (void)configureTransitionContainer
{
if (!_isSharedTransitionActive) {
_isSharedTransitionActive = YES;
REAUIView *mainWindow = UIApplication.sharedApplication.keyWindow;
REAUIView *mainWindow = RCTKeyWindow();
if (_transitionContainer == nil) {
_transitionContainer = [REAUIView new];
}
Expand Down
3 changes: 2 additions & 1 deletion apple/LayoutReanimation/REASnapshot.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#import <RNReanimated/REASnapshot.h>
#import <React/RCTView.h>
#import <React/UIView+React.h>
#import <React/RCTUtils.h>

NS_ASSUME_NONNULL_BEGIN

Expand All @@ -27,7 +28,7 @@ - (instancetype)initWithAbsolutePosition:(REAUIView *)view

- (void)makeSnapshotForView:(REAUIView *)view useAbsolutePositionOnly:(BOOL)useAbsolutePositionOnly
{
REAUIView *mainWindow = UIApplication.sharedApplication.keyWindow;
REAUIView *mainWindow = RCTKeyWindow();
CGPoint absolutePosition = [[view superview] convertPoint:view.center toView:nil];
_values = [NSMutableDictionary new];
#if TARGET_OS_OSX
Expand Down
2 changes: 1 addition & 1 deletion apple/sensor/ReanimatedSensor.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import <RNReanimated/ReanimatedSensor.h>

#if !TARGET_OS_TV && !TARGET_OS_OSX
#if !TARGET_OS_TV && !TARGET_OS_OSX && !TARGET_OS_VISION
@implementation ReanimatedSensor

- (instancetype)init:(ReanimatedSensorType)sensorType
Expand Down

0 comments on commit b8d319b

Please sign in to comment.