Skip to content

Commit 425972c

Browse files
committed
fix nonull, noop and RNSLog
1 parent 2e04cc5 commit 425972c

File tree

3 files changed

+15
-23
lines changed

3 files changed

+15
-23
lines changed

ios/gamma/stack/host/RNSStackHostComponentView.mm

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,10 @@ - (void)stackScreenChangedActivityMode:(nonnull RNSStackScreenComponentView *)st
8282

8383
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
8484
{
85-
RCTAssert(
86-
[childComponentView isKindOfClass:RNSStackScreenComponentView.class],
87-
@"[RNScreens] Attempt to mount child of unsupported type: %@, expected %@",
88-
childComponentView.class,
89-
RNSStackScreenComponentView.class);
85+
RCTAssert([childComponentView isKindOfClass:RNSStackScreenComponentView.class],
86+
@"[RNScreens] Attempt to mount child of unsupported type: %@, expected %@",
87+
childComponentView.class,
88+
RNSStackScreenComponentView.class);
9089

9190
auto *childScreen = static_cast<RNSStackScreenComponentView *>(childComponentView);
9291
childScreen.stackHost = self;
@@ -103,11 +102,10 @@ - (void)addPushOperationIfNeeded:(nonnull RNSStackScreenComponentView *)stackScr
103102

104103
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
105104
{
106-
RCTAssert(
107-
[childComponentView isKindOfClass:RNSStackScreenComponentView.class],
108-
@"[RNScreens] Attempt to unmount child of unsupported type: %@, expected %@",
109-
childComponentView.class,
110-
RNSStackScreenComponentView.class);
105+
RCTAssert([childComponentView isKindOfClass:RNSStackScreenComponentView.class],
106+
@"[RNScreens] Attempt to unmount child of unsupported type: %@, expected %@",
107+
childComponentView.class,
108+
RNSStackScreenComponentView.class);
111109

112110
auto *childScreen = static_cast<RNSStackScreenComponentView *>(childComponentView);
113111
[_renderedScreens removeObject:childScreen];
@@ -121,9 +119,8 @@ - (void)addPopOperationIfNeeded:(nonnull RNSStackScreenComponentView *)stackScre
121119
// This shouldn't happen in typical scenarios but it can happen with fast-refresh.
122120
[_stackOperationCoordinator addPopOperation:stackScreen];
123121
} else {
124-
RNSLog(
125-
@"[RNScreens] ignoring pop operation of %s, already not attached or natively dismissed",
126-
[stackScreen.screenKey cStringUsingEncoding:NSUTF8StringEncoding]);
122+
RNSLog(@"[RNScreens] ignoring pop operation of %s, already not attached or natively dismissed",
123+
[stackScreen.screenKey cStringUsingEncoding:NSUTF8StringEncoding]);
127124
}
128125
}
129126

@@ -141,12 +138,6 @@ + (BOOL)shouldBeRecycled
141138

142139
#pragma mark - RCTMountingTransactionObserving
143140

144-
- (void)mountingTransactionWillMount:(const facebook::react::MountingTransaction &)transaction
145-
withSurfaceTelemetry:(const facebook::react::SurfaceTelemetry &)surfaceTelemetry
146-
{
147-
// noop
148-
}
149-
150141
- (void)mountingTransactionDidMount:(const facebook::react::MountingTransaction &)transaction
151142
withSurfaceTelemetry:(const facebook::react::SurfaceTelemetry &)surfaceTelemetry
152143
{

ios/gamma/stack/host/RNSStackOperation.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ NS_ASSUME_NONNULL_BEGIN
66

77
@protocol RNSStackOperation
88

9-
@property (nonatomic, strong, readonly, nonnull) RNSStackScreenComponentView *stackScreen;
9+
@property (nonatomic, strong, readonly) RNSStackScreenComponentView *stackScreen;
1010

1111
@end
1212

1313
@interface RNSPushOperation : NSObject <RNSStackOperation>
1414

15-
@property (nonatomic, strong, readonly, nonnull) RNSStackScreenComponentView *stackScreen;
15+
@property (nonatomic, strong, readonly) RNSStackScreenComponentView *stackScreen;
1616

1717
- (instancetype)initWithScreen:(nonnull RNSStackScreenComponentView *)stackScreen;
1818

1919
@end
2020

2121
@interface RNSPopOperation : NSObject <RNSStackOperation>
2222

23-
@property (nonatomic, strong, readonly, nonnull) RNSStackScreenComponentView *stackScreen;
23+
@property (nonatomic, strong, readonly) RNSStackScreenComponentView *stackScreen;
2424

2525
- (instancetype)initWithScreen:(nonnull RNSStackScreenComponentView *)stackScreen;
2626

ios/gamma/stack/screen/RNSStackScreenController.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#import "RNSStackScreenController.h"
2+
#import "RNSLog.h"
23
#import "RNSStackHostComponentView.h"
34
#import "RNSStackNavigationController.h"
45
#import "RNSStackScreenComponentEventEmitter.h"
@@ -54,7 +55,7 @@ - (void)viewDidDisappear:(BOOL)animated
5455

5556
- (void)didMoveToParentViewController:(UIViewController *)parent
5657
{
57-
NSLog(@"[RNScreens] Screen view with tag=%ld didMoveToParentViewController %@", (long)_screenView.tag, parent);
58+
RNSLog(@"[RNScreens] Screen view with tag=%ld didMoveToParentViewController %@", (long)_screenView.tag, parent);
5859
[super didMoveToParentViewController:parent];
5960

6061
if (parent == nil) {

0 commit comments

Comments
 (0)