Skip to content

Commit

Permalink
chore: run yarn format-ios
Browse files Browse the repository at this point in the history
  • Loading branch information
WoLewicki authored and kkafar committed Jun 1, 2022
1 parent 8dcf268 commit 8bdcff0
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions ios/RNSScreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ @interface RNSScreenView ()
@implementation RNSScreenView {
__weak RCTBridge *_bridge;
#ifdef RN_FABRIC_ENABLED
// we recreate the behavior of `reactSetFrame` on new architecture
facebook::react::LayoutMetrics _oldLayoutMetrics;
facebook::react::LayoutMetrics _newLayoutMetrics;
// we recreate the behavior of `reactSetFrame` on new architecture
facebook::react::LayoutMetrics _oldLayoutMetrics;
facebook::react::LayoutMetrics _newLayoutMetrics;
RCTSurfaceTouchHandler *_touchHandler;
facebook::react::RNSScreenShadowNode::ConcreteState::Shared _state;
#else
Expand Down Expand Up @@ -291,7 +291,7 @@ - (void)notifyWillAppear
std::dynamic_pointer_cast<const facebook::react::RNSScreenEventEmitter>(_eventEmitter)
->onWillAppear(facebook::react::RNSScreenEventEmitter::OnWillAppear{});
}
[self updateLayoutMetrics:_layoutMetrics oldLayoutMetrics:_oldLayoutMetrics];
[self updateLayoutMetrics:_layoutMetrics oldLayoutMetrics:_oldLayoutMetrics];
#else
if (self.onWillAppear) {
self.onWillAppear(nil);
Expand Down Expand Up @@ -529,23 +529,23 @@ - (void)updateState:(facebook::react::State::Shared const &)state
_state = std::static_pointer_cast<const facebook::react::RNSScreenShadowNode::ConcreteState>(state);
}

- (void)updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics
oldLayoutMetrics:(const facebook::react::LayoutMetrics &)oldLayoutMetrics
{
_layoutMetrics = layoutMetrics;
_oldLayoutMetrics = oldLayoutMetrics;
UIViewController *parentVC = self.reactViewController.parentViewController;
if (parentVC != nil && ![parentVC isKindOfClass:[RNScreensNavigationController class]]) {
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
}
// when screen is mounted under RNScreensNavigationController it's size is controller
// by the navigation controller itself. That is, it is set to fill space of
// the controller. In that case we ignore react layout system from managing
// the screen dimensions and we wait for the screen VC to update and then we
// pass the dimensions to ui view manager to take into account when laying out
// subviews
// Explanation taken from `reactSetFrame`, which is old arch equivalent of this code.
}
- (void)updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics
oldLayoutMetrics:(const facebook::react::LayoutMetrics &)oldLayoutMetrics
{
_layoutMetrics = layoutMetrics;
_oldLayoutMetrics = oldLayoutMetrics;
UIViewController *parentVC = self.reactViewController.parentViewController;
if (parentVC != nil && ![parentVC isKindOfClass:[RNScreensNavigationController class]]) {
[super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics];
}
// when screen is mounted under RNScreensNavigationController it's size is controller
// by the navigation controller itself. That is, it is set to fill space of
// the controller. In that case we ignore react layout system from managing
// the screen dimensions and we wait for the screen VC to update and then we
// pass the dimensions to ui view manager to take into account when laying out
// subviews
// Explanation taken from `reactSetFrame`, which is old arch equivalent of this code.
}

#pragma mark - Paper specific
#else
Expand Down Expand Up @@ -674,7 +674,7 @@ - (void)viewWillAppear:(BOOL)animated
[super viewWillAppear:animated];
if (!_isSwiping) {
#ifdef RN_FABRIC_ENABLED
[_initialView notifyWillAppear];
[_initialView notifyWillAppear];
#else
[((RNSScreenView *)self.view) notifyWillAppear];
#endif
Expand Down Expand Up @@ -727,7 +727,7 @@ - (void)viewWillDisappear:(BOOL)animated
// same flow as in viewWillAppear
if (!_isSwiping) {
#ifdef RN_FABRIC_ENABLED
[_initialView notifyWillDisappear];
[_initialView notifyWillDisappear];
#else
[((RNSScreenView *)self.view) notifyWillDisappear];
#endif
Expand Down Expand Up @@ -755,9 +755,8 @@ - (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
if (!_isSwiping || _shouldNotify) {

#ifdef RN_FABRIC_ENABLED
[_initialView notifyAppear];
[_initialView notifyAppear];
#else
// we are going forward or dismissing without swipe
// or successfully swiped back
Expand Down Expand Up @@ -794,7 +793,7 @@ - (void)viewDidDisappear:(BOOL)animated
// same flow as in viewDidAppear
if (!_isSwiping || _shouldNotify) {
#ifdef RN_FABRIC_ENABLED
[_initialView notifyDisappear];
[_initialView notifyDisappear];
#else
[((RNSScreenView *)self.view) notifyDisappear];
[self notifyTransitionProgress:1.0 closing:YES goingForward:_goingForward];
Expand Down

0 comments on commit 8bdcff0

Please sign in to comment.