Skip to content

Commit

Permalink
Fix failing macOS build (#3033)
Browse files Browse the repository at this point in the history
## Description

In
#2985
some changes were made regarding handling of ScrollViews by the native
handler. I have no idea how the build passed on the PR itself but a type
only available on iOS was used which causes macOS not to build.

This PR cleans it up.

## Test plan

Build macOS example
  • Loading branch information
j-piasecki authored Aug 7, 2024
1 parent 1d7c4d1 commit c7c28c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apple/Handlers/RNNativeViewHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ - (void)reset

- (void)updateStateIfScrollView
{
UIScrollView *scrollView = [_gestureHandler retrieveScrollView:self.view];
RNGHUIScrollView *scrollView = [_gestureHandler retrieveScrollView:self.view];
if (!scrollView) {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions apple/RNGHUIKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

typedef UIView RNGHUIView;
typedef UITouch RNGHUITouch;
typedef UIScrollView RNGHUIScrollView;

#define RNGHGestureRecognizerStateFailed UIGestureRecognizerStateFailed;
#define RNGHGestureRecognizerStatePossible UIGestureRecognizerStatePossible;
Expand All @@ -17,6 +18,7 @@ typedef UITouch RNGHUITouch;

typedef RCTUIView RNGHUIView;
typedef RCTUITouch RNGHUITouch;
typedef NSScrollView RNGHUIScrollView;

#define RNGHGestureRecognizerStateFailed NSGestureRecognizerStateFailed;
#define RNGHGestureRecognizerStatePossible NSGestureRecognizerStatePossible;
Expand Down
6 changes: 0 additions & 6 deletions apple/RNGestureHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
#import <Foundation/Foundation.h>
#import <React/RCTConvert.h>

#if TARGET_OS_OSX
#define RNGHUIScrollView NSScrollView
#else
#define RNGHUIScrollView UIScrollView
#endif

#define VEC_LEN_SQ(pt) (pt.x * pt.x + pt.y * pt.y)
#define TEST_MIN_IF_NOT_NAN(value, limit) \
(!isnan(limit) && ((limit < 0 && value <= limit) || (limit >= 0 && value >= limit)))
Expand Down

0 comments on commit c7c28c5

Please sign in to comment.