浏览代码

Remove component if title is defined in mergeOptions (#5634)

When mergeOptions was called without a title component, existing component was undesirably removed.
This commit changes how component is removed when mergeOptions is called. It will now be removed if a component is not defined and title is defined in mergeOptions.
Fixes #5628
Guy Carmeli 5 年前
父节点
当前提交
6d446a8882
没有帐户链接到提交者的电子邮件

+ 1
- 1
lib/ios/RNNBasePresenter.h 查看文件

@@ -12,7 +12,7 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
12 12
 
13 13
 - (instancetype)initWithDefaultOptions:(RNNNavigationOptions *)defaultOptions;
14 14
 
15
-- (void)bindViewController:(UIViewController *)boundViewController;
15
+- (void)boundViewController:(UIViewController *)boundViewController;
16 16
 
17 17
 - (void)setDefaultOptions:(RNNNavigationOptions *)defaultOptions;
18 18
 

+ 1
- 1
lib/ios/RNNBasePresenter.m 查看文件

@@ -18,7 +18,7 @@
18 18
     return self;
19 19
 }
20 20
 
21
-- (void)bindViewController:(UIViewController <RNNLayoutProtocol> *)boundViewController {
21
+- (void)boundViewController:(UIViewController *)boundViewController {
22 22
     self.boundComponentId = boundViewController.layoutInfo.componentId;
23 23
     _boundViewController = boundViewController;
24 24
 }

+ 0
- 1
lib/ios/RNNCommandsHandler.m 查看文件

@@ -89,7 +89,6 @@ static NSString* const setDefaultOptions	= @"setDefaultOptions";
89 89
 		[CATransaction begin];
90 90
 		[CATransaction setCompletionBlock:completion];
91 91
 		
92
-		[vc overrideOptions:newOptions];
93 92
 		[vc mergeOptions:newOptions];
94 93
 		
95 94
 		[CATransaction commit];

+ 2
- 0
lib/ios/RNNComponentOptions.h 查看文件

@@ -7,4 +7,6 @@
7 7
 @property (nonatomic, strong) Text* alignment;
8 8
 @property (nonatomic, strong) Bool* waitForRender;
9 9
 
10
+- (BOOL)hasValue;
11
+
10 12
 @end

+ 4
- 0
lib/ios/RNNComponentOptions.m 查看文件

@@ -13,4 +13,8 @@
13 13
 	return self;
14 14
 }
15 15
 
16
+- (BOOL)hasValue {
17
+	return _name.hasValue;
18
+}
19
+
16 20
 @end

+ 11
- 7
lib/ios/RNNComponentPresenter.m 查看文件

@@ -21,8 +21,8 @@
21 21
 	return self;
22 22
 }
23 23
 
24
-- (void)bindViewController:(UIViewController<RNNLayoutProtocol> *)bindedViewController {
25
-	[super bindViewController:bindedViewController];
24
+- (void)boundViewController:(UIViewController *)boundViewController {
25
+	[super boundViewController:boundViewController];
26 26
 	_navigationButtons = [[RNNNavigationButtons alloc] initWithViewController:self.boundViewController componentRegistry:_componentRegistry];
27 27
 }
28 28
 
@@ -80,9 +80,9 @@
80 80
 - (void)mergeOptions:(RNNNavigationOptions *)options resolvedOptions:(RNNNavigationOptions *)currentOptions {
81 81
     [super mergeOptions:options resolvedOptions:currentOptions];
82 82
 	RNNNavigationOptions * withDefault	= (RNNNavigationOptions *) [[currentOptions overrideOptions:options] withDefault:[self defaultOptions]];
83
-
84 83
 	UIViewController* viewController = self.boundViewController;
85
-	
84
+	[self removeTitleComponentIfNeeded:options];
85
+
86 86
 	if (options.backgroundImage.hasValue) {
87 87
 		[viewController setBackgroundImage:options.backgroundImage.get];
88 88
 	}
@@ -155,9 +155,6 @@
155 155
 
156 156
 	if (options.topBar.title.component.name.hasValue) {
157 157
 		[self setCustomNavigationTitleView:options perform:nil];
158
-	} else {
159
-		[_customTitleView removeFromSuperview];
160
-		_customTitleView = nil;
161 158
 	}
162 159
 
163 160
 	[self setTitleViewWithSubtitle:withDefault];
@@ -169,6 +166,13 @@
169 166
 	}
170 167
 }
171 168
 
169
+- (void)removeTitleComponentIfNeeded:(RNNNavigationOptions *)options {
170
+	if (options.topBar.title.text.hasValue && !options.topBar.component.hasValue) {
171
+		[_customTitleView removeFromSuperview];
172
+		_customTitleView = nil;
173
+	}
174
+}
175
+
172 176
 - (void)renderComponents:(RNNNavigationOptions *)options perform:(RNNReactViewReadyCompletionBlock)readyBlock {
173 177
 	[self setCustomNavigationTitleView:options perform:readyBlock];
174 178
 }

+ 1
- 1
lib/ios/RNNSideMenuController.m 查看文件

@@ -16,7 +16,7 @@
16 16
 	self = [super initWithCenterViewController:self.center leftDrawerViewController:self.left rightDrawerViewController:self.right];
17 17
 	
18 18
 	self.presenter = presenter;
19
-	[self.presenter bindViewController:self];
19
+    [self.presenter boundViewController:self];
20 20
 	
21 21
 	self.defaultOptions = defaultOptions;
22 22
 	self.options = options;

+ 4
- 4
lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj 查看文件

@@ -183,7 +183,7 @@
183 183
 		506A2B1420973DFD00F43A95 /* RNNErrorHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 506A2B1220973DFD00F43A95 /* RNNErrorHandler.h */; };
184 184
 		506A2B1520973DFD00F43A95 /* RNNErrorHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 506A2B1320973DFD00F43A95 /* RNNErrorHandler.m */; };
185 185
 		506F630D216A599300AD0D0A /* RNNTabBarControllerTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 506F630C216A599300AD0D0A /* RNNTabBarControllerTest.m */; };
186
-		506F630F216A5AD700AD0D0A /* RNNViewControllerPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 506F630E216A5AD700AD0D0A /* RNNViewControllerPresenterTest.m */; };
186
+		506F630F216A5AD700AD0D0A /* RNNComponentPresenterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 506F630E216A5AD700AD0D0A /* RNNComponentPresenterTest.m */; };
187 187
 		50706E6D20CE7CA5003345C3 /* UIImage+tint.h in Headers */ = {isa = PBXBuildFile; fileRef = 50706E6B20CE7CA5003345C3 /* UIImage+tint.h */; };
188 188
 		50706E6E20CE7CA5003345C3 /* UIImage+tint.m in Sources */ = {isa = PBXBuildFile; fileRef = 50706E6C20CE7CA5003345C3 /* UIImage+tint.m */; };
189 189
 		507E7D57201DDD3000444E6C /* RNNSharedElementAnimationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 507E7D55201DDD3000444E6C /* RNNSharedElementAnimationOptions.h */; };
@@ -531,7 +531,7 @@
531 531
 		506A2B1220973DFD00F43A95 /* RNNErrorHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNErrorHandler.h; sourceTree = "<group>"; };
532 532
 		506A2B1320973DFD00F43A95 /* RNNErrorHandler.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNErrorHandler.m; sourceTree = "<group>"; };
533 533
 		506F630C216A599300AD0D0A /* RNNTabBarControllerTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNTabBarControllerTest.m; sourceTree = "<group>"; };
534
-		506F630E216A5AD700AD0D0A /* RNNViewControllerPresenterTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNViewControllerPresenterTest.m; sourceTree = "<group>"; };
534
+		506F630E216A5AD700AD0D0A /* RNNComponentPresenterTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNNComponentPresenterTest.m; sourceTree = "<group>"; };
535 535
 		50706E6B20CE7CA5003345C3 /* UIImage+tint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+tint.h"; sourceTree = "<group>"; };
536 536
 		50706E6C20CE7CA5003345C3 /* UIImage+tint.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+tint.m"; sourceTree = "<group>"; };
537 537
 		507E7D55201DDD3000444E6C /* RNNSharedElementAnimationOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNNSharedElementAnimationOptions.h; sourceTree = "<group>"; };
@@ -1054,7 +1054,7 @@
1054 1054
 				504753772109C13C00FFFBE6 /* RNNOverlayManagerTest.m */,
1055 1055
 				505EDD31214E4BE80071C7DE /* RNNNavigationControllerTest.m */,
1056 1056
 				506F630C216A599300AD0D0A /* RNNTabBarControllerTest.m */,
1057
-				506F630E216A5AD700AD0D0A /* RNNViewControllerPresenterTest.m */,
1057
+				506F630E216A5AD700AD0D0A /* RNNComponentPresenterTest.m */,
1058 1058
 				509B258E2178BE7A00C83C23 /* RNNStackPresenterTest.m */,
1059 1059
 				502F0E172179C39900367CC3 /* RNNTabBarPresenterTest.m */,
1060 1060
 				50CE8502217C6C9B00084EBF /* RNNSideMenuPresenterTest.m */,
@@ -1474,7 +1474,7 @@
1474 1474
 				502F0E162178D09600367CC3 /* RNNBasePresenterTest.m in Sources */,
1475 1475
 				504753782109C13C00FFFBE6 /* RNNOverlayManagerTest.m in Sources */,
1476 1476
 				502F0E182179C39900367CC3 /* RNNTabBarPresenterTest.m in Sources */,
1477
-				506F630F216A5AD700AD0D0A /* RNNViewControllerPresenterTest.m in Sources */,
1477
+				506F630F216A5AD700AD0D0A /* RNNComponentPresenterTest.m in Sources */,
1478 1478
 				505963F722676A0000EBB63C /* RNNLayoutManagerTest.m in Sources */,
1479 1479
 				7B49FECE1E95098500DEB3EA /* RNNCommandsHandlerTest.m in Sources */,
1480 1480
 				E5F6C3AB22DB4D0F0093C2CE /* UIColor+RNNUtils.m in Sources */,

+ 3
- 3
lib/ios/ReactNativeNavigationTests/RNNBasePresenterTest.m 查看文件

@@ -20,7 +20,7 @@
20 20
     self.uut = [[RNNBasePresenter alloc] init];
21 21
     self.boundViewController = [RNNComponentViewController new];
22 22
     self.mockBoundViewController = [OCMockObject partialMockForObject:self.boundViewController];
23
-    [self.uut bindViewController:self.mockBoundViewController];
23
+    [self.uut boundViewController:self.mockBoundViewController];
24 24
     self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
25 25
 }
26 26
 
@@ -45,7 +45,7 @@
45 45
 }
46 46
 
47 47
 - (void)testApplyOptions_setTabBarItemBadgeShouldNotCalledOnUITabBarController {
48
-    [self.uut bindViewController:self.mockBoundViewController];
48
+    [self.uut boundViewController:self.mockBoundViewController];
49 49
     self.options.bottomTab.badge = [[Text alloc] initWithValue:@"badge"];
50 50
     [[self.mockBoundViewController reject] setTabBarItemBadge:[[RNNBottomTabOptions alloc] initWithDict:@{@"badge": @"badge"}]];
51 51
     [self.uut applyOptions:self.options];
@@ -53,7 +53,7 @@
53 53
 }
54 54
 
55 55
 - (void)testApplyOptions_setTabBarItemBadgeShouldWhenNoValue {
56
-    [self.uut bindViewController:self.mockBoundViewController];
56
+    [self.uut boundViewController:self.mockBoundViewController];
57 57
     self.options.bottomTab.badge = nil;
58 58
     [[self.mockBoundViewController reject] setTabBarItemBadge:[OCMArg any]];
59 59
     [self.uut applyOptions:self.options];

lib/ios/ReactNativeNavigationTests/RNNViewControllerPresenterTest.m → lib/ios/ReactNativeNavigationTests/RNNComponentPresenterTest.m 查看文件

@@ -3,8 +3,10 @@
3 3
 #import "RNNComponentPresenter.h"
4 4
 #import "UIViewController+RNNOptions.h"
5 5
 #import "RNNComponentViewController.h"
6
+#import "UIViewController+LayoutProtocol.h"
7
+#import "RNNTitleViewHelper.h"
6 8
 
7
-@interface RNNViewControllerPresenterTest : XCTestCase
9
+@interface RNNComponentPresenterTest : XCTestCase
8 10
 
9 11
 @property (nonatomic, strong) RNNComponentPresenter *uut;
10 12
 @property (nonatomic, strong) RNNNavigationOptions *options;
@@ -13,14 +15,14 @@
13 15
 
14 16
 @end
15 17
 
16
-@implementation RNNViewControllerPresenterTest
18
+@implementation RNNComponentPresenterTest
17 19
 
18 20
 - (void)setUp {
19 21
     [super setUp];
20 22
 	self.componentRegistry = [OCMockObject partialMockForObject:[RNNReactComponentRegistry new]];
21 23
 	self.uut = [[RNNComponentPresenter alloc] initWithComponentRegistry:self.componentRegistry:[[RNNNavigationOptions alloc] initEmptyOptions]];
22 24
 	self.boundViewController = [OCMockObject partialMockForObject:[RNNComponentViewController new]];
23
-	[self.uut bindViewController:self.boundViewController];
25
+	[self.uut boundViewController:self.boundViewController];
24 26
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
25 27
 }
26 28
 
@@ -71,7 +73,7 @@
71 73
 
72 74
 - (void)testBindViewControllerShouldCreateNavigationButtonsCreator {
73 75
 	RNNComponentPresenter* presenter = [[RNNComponentPresenter alloc] init];
74
-	[presenter bindViewController:self.boundViewController];
76
+	[presenter boundViewController:self.boundViewController];
75 77
 	XCTAssertNotNil(presenter.navigationButtons);
76 78
 }
77 79
 
@@ -136,7 +138,7 @@
136 138
 - (void)testReactViewShouldBeReleasedOnDealloc {
137 139
 	RNNComponentViewController* bindViewController = [RNNComponentViewController new];
138 140
 	bindViewController.layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
139
-	[self.uut bindViewController:bindViewController];
141
+	[self.uut boundViewController:bindViewController];
140 142
 	
141 143
 	self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"componentName"}];
142 144
 	
@@ -145,22 +147,21 @@
145 147
 	[(id)self.componentRegistry verify];
146 148
 }
147 149
 
148
-- (void)testBindViewControllerShouldSetBindedComponentId {
150
+- (void)testBindViewControllerShouldSetBoundComponentId {
149 151
 	RNNComponentViewController* bindViewController = [RNNComponentViewController new];
150 152
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] init];
151 153
 	layoutInfo.componentId = @"componentId";
152 154
 	bindViewController.layoutInfo = layoutInfo;
153
-	
154
-	[self.uut bindViewController:bindViewController];
155
+
156
+	[self.uut boundViewController:bindViewController];
155 157
 	XCTAssertEqual(self.uut.boundComponentId, @"componentId");
156 158
 }
157 159
 
158
-- (void)testRenderComponentsCreateReactViewWithBindedComponentId {
159
-	RNNComponentViewController* bindedViewController = [RNNComponentViewController new];
160
+- (void)testRenderComponentsCreateReactViewWithBoundComponentId {
161
+	RNNComponentViewController* boundViewController = [RNNComponentViewController new];
160 162
 	RNNLayoutInfo* layoutInfo = [self createLayoutInfoWithComponentId:@"componentId"];
161
-	bindedViewController.layoutInfo = layoutInfo;
162
-	
163
-	[self.uut bindViewController:bindedViewController];
163
+	boundViewController.layoutInfo = layoutInfo;
164
+	[self.uut boundViewController:boundViewController];
164 165
 	
165 166
 	self.options.topBar.title.component = [[RNNComponentOptions alloc] initWithDict:@{@"name": @"titleComponent"}];
166 167
 	
@@ -172,7 +173,7 @@
172 173
 	XCTAssertEqual(self.uut.boundComponentId, @"componentId");
173 174
 }
174 175
 
175
-- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBindedViewController_withTitle {
176
+- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBoundViewController_withTitle {
176 177
 	Text* title = [[Text alloc] initWithValue:@"Title"];
177 178
 	self.options.topBar.backButton.title = title;
178 179
 	[[(id) self.boundViewController expect] setBackButtonIcon:nil withColor:nil title:title.get];
@@ -180,7 +181,7 @@
180 181
 	[(id)self.boundViewController verify];
181 182
 }
182 183
 
183
-- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBindedViewController_withHideTitle {
184
+- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBoundViewController_withHideTitle {
184 185
 	Text* title = [[Text alloc] initWithValue:@"Title"];
185 186
 	self.options.topBar.backButton.title = title;
186 187
 	self.options.topBar.backButton.showTitle = [[Bool alloc] initWithValue:@(0)];
@@ -189,7 +190,7 @@
189 190
 	[(id)self.boundViewController verify];
190 191
 }
191 192
 
192
-- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBindedViewController_withIcon {
193
+- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBoundViewController_withIcon {
193 194
 	Image* image = [[Image alloc] initWithValue:[UIImage new]];
194 195
 	self.options.topBar.backButton.icon = image;
195 196
 	[[(id) self.boundViewController expect] setBackButtonIcon:image.get withColor:nil title:nil];
@@ -197,16 +198,56 @@
197 198
 	[(id)self.boundViewController verify];
198 199
 }
199 200
 
200
-- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBindedViewController_withDefaultValues {
201
+- (void)testApplyOptionsOnWillMoveToParent_shouldSetBackButtonOnBoundViewController_withDefaultValues {
201 202
 	[[(id) self.boundViewController expect] setBackButtonIcon:nil withColor:nil title:nil];
202 203
 	[self.uut applyOptionsOnWillMoveToParentViewController:self.options];
203 204
 	[(id)self.boundViewController verify];
204 205
 }
205 206
 
207
+- (void)testRemoveTitleComponentIfNeeded_componentIsRemovedIfTitleTextIsDefined {
208
+	id mockTitle = [OCMockObject niceMockForClass:[RNNReactView class]];
209
+    OCMStub([self.componentRegistry createComponentIfNotExists:[OCMArg any] parentComponentId:[OCMArg any] reactViewReadyBlock:nil]).andReturn(mockTitle);
210
+
211
+	RNNComponentOptions* component = [RNNComponentOptions new];
212
+	component.name = [[Text alloc] initWithValue:@"componentName"];
213
+	component.componentId = [[Text alloc] initWithValue:@"someId"];
214
+	_options.topBar.title.component = component;
215
+
216
+	[self.uut mergeOptions:_options resolvedOptions:[[RNNNavigationOptions alloc] initEmptyOptions]];
217
+    XCTAssertNotNil(self.boundViewController.navigationItem.titleView);
218
+	XCTAssertEqual(self.boundViewController.navigationItem.titleView, mockTitle);
219
+
220
+	[[mockTitle expect] removeFromSuperview];
221
+    _options = [[RNNNavigationOptions alloc] initEmptyOptions];
222
+    _options.topBar.title.text = [[Text alloc] initWithValue:@""];
223
+	[self.uut mergeOptions:_options resolvedOptions:[[RNNNavigationOptions alloc] initEmptyOptions]];
224
+    XCTAssertNotEqual(self.boundViewController.navigationItem.titleView, mockTitle);
225
+	[mockTitle verify];
226
+}
227
+
228
+- (void)testRemoveTitleComponentIfNeeded_componentIsNotRemovedIfMergeOptionsIsCalledWithoutTitleText {
229
+    id mockTitle = [OCMockObject niceMockForClass:[RNNReactView class]];
230
+    OCMStub([self.componentRegistry createComponentIfNotExists:[OCMArg any] parentComponentId:[OCMArg any] reactViewReadyBlock:nil]).andReturn(mockTitle);
231
+
232
+    RNNComponentOptions* component = [RNNComponentOptions new];
233
+    component.name = [[Text alloc] initWithValue:@"componentName"];
234
+    component.componentId = [[Text alloc] initWithValue:@"someId"];
235
+    _options.topBar.title.component = component;
236
+
237
+    [self.uut mergeOptions:_options resolvedOptions:[[RNNNavigationOptions alloc] initEmptyOptions]];
238
+    XCTAssertNotNil(self.boundViewController.navigationItem.titleView);
239
+    XCTAssertEqual(self.boundViewController.navigationItem.titleView, mockTitle);
240
+
241
+
242
+    _options = [[RNNNavigationOptions alloc] initEmptyOptions];
243
+    _options.bottomTabs.visible = [[Bool alloc] initWithBOOL:NO];
244
+    [self.uut mergeOptions:_options resolvedOptions:[[RNNNavigationOptions alloc] initEmptyOptions]];
245
+    XCTAssertEqual(self.boundViewController.navigationItem.titleView, mockTitle);
246
+}
206 247
 
207 248
 - (RNNLayoutInfo *)createLayoutInfoWithComponentId:(NSString *)componentId {
208 249
 	RNNLayoutInfo* layoutInfo = [[RNNLayoutInfo alloc] init];
209
-	layoutInfo.componentId = @"componentId";
250
+	layoutInfo.componentId = componentId;
210 251
 	return layoutInfo;
211 252
 }
212 253
 

+ 1
- 1
lib/ios/ReactNativeNavigationTests/RNNSideMenuPresenterTest.m 查看文件

@@ -17,7 +17,7 @@
17 17
     [super setUp];
18 18
 	self.uut = [[RNNSideMenuPresenter alloc] init];
19 19
 	self.bindedViewController = [OCMockObject partialMockForObject:[RNNSideMenuController new]];
20
-	[self.uut bindViewController:self.bindedViewController];
20
+    [self.uut boundViewController:self.bindedViewController];
21 21
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
22 22
 }
23 23
 

+ 1
- 1
lib/ios/ReactNativeNavigationTests/RNNStackPresenterTest.m 查看文件

@@ -18,7 +18,7 @@
18 18
 	[super setUp];
19 19
 	self.uut = [[RNNStackPresenter alloc] init];
20 20
 	self.boundViewController = [OCMockObject partialMockForObject:[RNNStackController new]];
21
-	[self.uut bindViewController:self.boundViewController];
21
+    [self.uut boundViewController:self.boundViewController];
22 22
 	self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
23 23
 }
24 24
 

+ 1
- 1
lib/ios/ReactNativeNavigationTests/RNNTabBarPresenterTest.m 查看文件

@@ -18,7 +18,7 @@
18 18
     [super setUp];
19 19
     self.uut = [OCMockObject partialMockForObject:[RNNBottomTabsPresenter new]];
20 20
     self.boundViewController = [OCMockObject partialMockForObject:[RNNBottomTabsController new]];
21
-    [self.uut bindViewController:self.boundViewController];
21
+    [self.uut boundViewController:self.boundViewController];
22 22
     self.options = [[RNNNavigationOptions alloc] initEmptyOptions];
23 23
 }
24 24
 

+ 1
- 1
lib/ios/UIViewController+LayoutProtocol.m 查看文件

@@ -22,7 +22,7 @@
22 22
 		[self performSelector:@selector(setViewControllers:) withObject:childViewControllers];
23 23
 	}
24 24
 	self.presenter = presenter;
25
-	[self.presenter bindViewController:self];
25
+    [self.presenter boundViewController:self];
26 26
 	[self.presenter applyOptionsOnInit:self.resolveOptions];
27 27
 
28 28
 	return self;