Skip to content

Commit

Permalink
A bit more of cleanup & refactor of iOS code
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed Jan 15, 2025
1 parent 2703a0f commit f6f78c2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ios/RNSScreenStack.mm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ - (void)maybeUpdateHeaderInsetsInShadowTreeForScreen:(RNSScreen *)screenControll
[headerConfig updateHeaderConfigState:self.navigationBar.frame.size];
for (RNSScreenStackHeaderSubview *subview in headerConfig.reactSubviews) {
CGRect frameInNavBarCoordinates = [subview convertRect:subview.frame toView:self.navigationBar];
[subview updateHeaderSubviewFrame:frameInNavBarCoordinates];
[subview updateHeaderSubviewFrameInShadowTree:frameInNavBarCoordinates];
}
#else
NSDirectionalEdgeInsets navBarMargins = [self.navigationBar directionalLayoutMargins];
Expand Down
2 changes: 1 addition & 1 deletion ios/RNSScreenStackHeaderConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ - (void)prepareForRecycle
_initialPropsSet = NO;

#ifdef RCT_NEW_ARCH_ENABLED
_lastSize = CGSize();
_lastSize = CGSizeZero;
#else
_lastHeaderInsets = NSDirectionalEdgeInsets{};
#endif
Expand Down
2 changes: 1 addition & 1 deletion ios/RNSScreenStackHeaderSubview.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) UIView *reactSuperview;

#ifdef RCT_NEW_ARCH_ENABLED
- (void)updateHeaderSubviewFrame:(CGRect)frame;
- (void)updateHeaderSubviewFrameInShadowTree:(CGRect)frame;
#endif

@end
Expand Down
2 changes: 1 addition & 1 deletion ios/RNSScreenStackHeaderSubview.mm
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ - (void)updateState:(const facebook::react::State::Shared &)state
_state = std::static_pointer_cast<const react::RNSScreenStackHeaderSubviewShadowNode::ConcreteState>(state);
}

- (void)updateHeaderSubviewFrame:(CGRect)frame
- (void)updateHeaderSubviewFrameInShadowTree:(CGRect)frame
{
if (_state != nullptr) {
auto newState =
Expand Down

0 comments on commit f6f78c2

Please sign in to comment.