Browse Source

Fixes compile errors on archiving

yogevbd 5 years ago
parent
commit
ba77394291

+ 2
- 1
lib/ios/RNNNavigationControllerPresenter.m View File

1
 #import "RNNNavigationControllerPresenter.h"
1
 #import "RNNNavigationControllerPresenter.h"
2
 #import "UINavigationController+RNNOptions.h"
2
 #import "UINavigationController+RNNOptions.h"
3
 #import "RNNNavigationController.h"
3
 #import "RNNNavigationController.h"
4
+#import <React/RCTConvert.h>
4
 
5
 
5
 @implementation RNNNavigationControllerPresenter
6
 @implementation RNNNavigationControllerPresenter
6
 
7
 
83
 	}
84
 	}
84
 	
85
 	
85
 	if (options.topBar.backButton.icon.hasValue) {
86
 	if (options.topBar.backButton.icon.hasValue) {
86
-		[navigationController rnn_setBackButtonIcon:[withDefault.topBar.backButton.icon getWithDefaultValue:nil] withColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil] title:[withDefault.topBar.backButton.showTitle getWithDefaultValue:nil] ? withDefault.topBar.backButton.title.get : @""];
87
+		[navigationController rnn_setBackButtonIcon:[withDefault.topBar.backButton.icon getWithDefaultValue:nil] withColor:[withDefault.topBar.backButton.color getWithDefaultValue:nil] title:[withDefault.topBar.backButton.showTitle getWithDefaultValue:YES] ? [withDefault.topBar.backButton.title getWithDefaultValue:nil] : @""];
87
 
88
 
88
 	}
89
 	}
89
 	
90
 	

+ 0
- 1
lib/ios/RNNNavigationOptions.h View File

10
 #import "RNNStatusBarOptions.h"
10
 #import "RNNStatusBarOptions.h"
11
 #import "RNNPreviewOptions.h"
11
 #import "RNNPreviewOptions.h"
12
 #import "RNNLayoutOptions.h"
12
 #import "RNNLayoutOptions.h"
13
-#import "RCTConvert+Modal.h"
14
 
13
 
15
 extern const NSInteger BLUR_TOPBAR_TAG;
14
 extern const NSInteger BLUR_TOPBAR_TAG;
16
 extern const NSInteger TOP_BAR_TRANSPARENT_TAG;
15
 extern const NSInteger TOP_BAR_TRANSPARENT_TAG;

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

217
 			
217
 			
218
 			_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
218
 			_customTopBarBackground = [[RNNCustomTitleView alloc] initWithFrame:self.navigationController.navigationBar.bounds subView:reactView alignment:@"fill"];
219
 			[self.navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];
219
 			[self.navigationController.navigationBar insertSubview:_customTopBarBackground atIndex:1];
220
-		} else if (self.navigationController.navigationBar.subviews.count && [[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
220
+		} else if (self.navigationController.navigationBar.subviews.count > 1 && [[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
221
 			[[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
221
 			[[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
222
 		}
222
 		}
223
 	} if (_customTopBarBackground && _customTopBarBackground.superview == nil) {
223
 	} if (_customTopBarBackground && _customTopBarBackground.superview == nil) {

+ 1
- 0
lib/ios/RNNViewControllerPresenter.m View File

2
 #import "UIViewController+RNNOptions.h"
2
 #import "UIViewController+RNNOptions.h"
3
 #import "UITabBarController+RNNOptions.h"
3
 #import "UITabBarController+RNNOptions.h"
4
 #import "RNNNavigationButtons.h"
4
 #import "RNNNavigationButtons.h"
5
+#import "RCTConvert+Modal.h"
5
 
6
 
6
 @interface RNNViewControllerPresenter()
7
 @interface RNNViewControllerPresenter()
7
 @property (nonatomic, strong) RNNNavigationButtons* navigationButtons;
8
 @property (nonatomic, strong) RNNNavigationButtons* navigationButtons;

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

64
 
64
 
65
 -(void)testTopBarBackgroundColorWithoutNavigationController{
65
 -(void)testTopBarBackgroundColorWithoutNavigationController{
66
 	NSNumber* inputColor = @(0xFFFF0000);
66
 	NSNumber* inputColor = @(0xFFFF0000);
67
-	self.options.topBar.background.color = [[Color alloc] initWithValue:inputColor];
67
+	self.options.topBar.background.color = [[Color alloc] initWithValue:[RCTConvert UIColor:inputColor]];
68
 
68
 
69
 	XCTAssertNoThrow([self.uut viewWillAppear:false]);
69
 	XCTAssertNoThrow([self.uut viewWillAppear:false]);
70
 }
70
 }
319
 -(void)testTopBarTextFontFamily_invalidFont{
319
 -(void)testTopBarTextFontFamily_invalidFont{
320
 	NSString* inputFont = @"HelveticaNeueeeee";
320
 	NSString* inputFont = @"HelveticaNeueeeee";
321
 	__unused RNNNavigationController* nav = [self createNavigationController];
321
 	__unused RNNNavigationController* nav = [self createNavigationController];
322
-	self.options.topBar.title.fontFamily = inputFont;
322
+	self.options.topBar.title.fontFamily = [[Text alloc] initWithValue:inputFont];
323
 	//	XCTAssertThrows([self.uut viewWillAppear:false]);
323
 	//	XCTAssertThrows([self.uut viewWillAppear:false]);
324
 }
324
 }
325
 
325