Browse Source

rename to mergeWith and applyOn RNNNavigationOptions

Daniel Zlotin 7 years ago
parent
commit
fe0b79cf00

+ 2
- 2
lib/ios/RNNCommandsHandler.m View File

@@ -38,8 +38,8 @@
38 38
 -(void) setOptions:(NSString*)containerId options:(NSDictionary*)options {
39 39
 	[self assertReady];
40 40
 	RNNRootViewController* vc = [_store findContainerForId:containerId];
41
-	[vc.navigationOptions setOptionsDynamically:options];
42
-	[vc.navigationOptions apply:vc];
41
+	[vc.navigationOptions mergeWith:options];
42
+	[vc.navigationOptions applyOn:vc];
43 43
 }
44 44
 
45 45
 -(void) push:(NSString*)containerId layout:(NSDictionary*)layout {

+ 2
- 2
lib/ios/RNNNavigationOptions.h View File

@@ -10,8 +10,8 @@
10 10
 
11 11
 -(instancetype)initWithDict:(NSDictionary *)navigationOptions;
12 12
 
13
--(void)apply:(UIViewController*)viewController;
14
--(void)setOptionsDynamically:(NSDictionary*)dynamicOptions;
13
+-(void)applyOn:(UIViewController*)viewController;
14
+-(void)mergeWith:(NSDictionary*)otherOptions;
15 15
 
16 16
 @end
17 17
 

+ 4
- 4
lib/ios/RNNNavigationOptions.m View File

@@ -13,13 +13,13 @@
13 13
 	return self;
14 14
 }
15 15
 
16
--(void)setOptionsDynamically:(NSDictionary *)dynamicOptions {
17
-	for(id key in dynamicOptions) {
18
-		[self setValue:[dynamicOptions objectForKey:key] forKey:key];
16
+-(void)mergeWith:(NSDictionary *)otherOptions {
17
+	for (id key in otherOptions) {
18
+		[self setValue:[otherOptions objectForKey:key] forKey:key];
19 19
 	}
20 20
 }
21 21
 
22
--(void)apply:(UIViewController*)viewController{
22
+-(void)applyOn:(UIViewController*)viewController{
23 23
 	if (self.topBarBackgroundColor) {
24 24
 		UIColor* backgroundColor = [RCTConvert UIColor:self.topBarBackgroundColor];
25 25
 		viewController.navigationController.navigationBar.barTintColor = backgroundColor;

+ 1
- 1
lib/ios/RNNRootViewController.m View File

@@ -46,7 +46,7 @@
46 46
 
47 47
 -(void)viewWillAppear:(BOOL)animated{
48 48
 	[super viewWillAppear:animated];
49
-	[self.navigationOptions apply:self];
49
+	[self.navigationOptions applyOn:self];
50 50
 }
51 51
 /**
52 52
  *	fix for #877, #878

+ 2
- 2
lib/ios/RNNSideMenu/MMDrawerController/MMDrawerController.h View File

@@ -458,7 +458,7 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
458 458
  
459 459
  This block is called when a gesture action has started.
460 460
  
461
- @param gestureCompletionBlock A block object to be called that allows the implementer be notified when a gesture action has started.
461
+ @param gestureStartBlock A block object to be called that allows the implementer be notified when a gesture action has started.
462 462
  */
463 463
 -(void)setGestureStartBlock:(void (^)(MMDrawerController *, UIGestureRecognizer *))gestureStartBlock;
464 464
 
@@ -477,4 +477,4 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
477 477
  */
478 478
 -(void)setGestureShouldRecognizeTouchBlock:(BOOL(^)(MMDrawerController * drawerController, UIGestureRecognizer * gesture, UITouch * touch))gestureShouldRecognizeTouchBlock;
479 479
 
480
-@end
480
+@end

+ 2
- 2
lib/ios/ReactNativeNavigationTests/RNNNavigationOptionsTest.m View File

@@ -27,7 +27,7 @@
27 27
 -(void)testChangeRNNNavigationOptionsDynamically{
28 28
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBarBackgroundColor" : @(0xff0000ff)}];
29 29
 	NSDictionary* dynamicOptions = @{@"topBarTextColor" : @(0xffff00ff), @"title" : @"hello"};
30
-    [options setOptionsDynamically:dynamicOptions];
30
+    [options mergeWith:dynamicOptions];
31 31
 	XCTAssertTrue([options.title isEqual:@"hello"]);
32 32
 	
33 33
 }
@@ -35,6 +35,6 @@
35 35
 -(void)testChangeRNNNavigationOptionsWithInvalidProperties{
36 36
 	RNNNavigationOptions* options = [[RNNNavigationOptions alloc] initWithDict:@{@"topBarBackgroundColor" : @(0xff0000ff)}];
37 37
 	NSDictionary* dynamicOptions = @{@"titleeeee" : @"hello"};
38
-	XCTAssertThrows([options setOptionsDynamically:dynamicOptions]);
38
+	XCTAssertThrows([options mergeWith:dynamicOptions]);
39 39
 }
40 40
 @end