Browse Source

Added RNNNAvigationController

Ran Greenberg 7 years ago
parent
commit
b7f06d9c11

+ 15
- 0
ios/RNNNavigationController.h View File

@@ -0,0 +1,15 @@
1
+//
2
+//  RNNNavigationController.h
3
+//  ReactNativeNavigation
4
+//
5
+//  Created by Ran Greenberg on 27/12/2016.
6
+//  Copyright © 2016 Wix. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+@interface RNNNavigationController : UINavigationController
12
+
13
+-(instancetype)initWithRootViewController:(UIViewController*)rooViewController props:(NSDictionary*)props;
14
+
15
+@end

+ 27
- 0
ios/RNNNavigationController.m View File

@@ -0,0 +1,27 @@
1
+//
2
+//  RNNNavigationController.m
3
+//  ReactNativeNavigation
4
+//
5
+//  Created by Ran Greenberg on 27/12/2016.
6
+//  Copyright © 2016 Wix. All rights reserved.
7
+//
8
+
9
+#import "RNNNavigationController.h"
10
+
11
+@interface RNNNavigationController ()
12
+
13
+@end
14
+
15
+@implementation RNNNavigationController
16
+
17
+
18
+-(instancetype)initWithRootViewController:(UIViewController*)rooViewController props:(NSDictionary*)props {
19
+    self = [super initWithRootViewController:rooViewController];
20
+    if (!self) return nil;
21
+    
22
+    
23
+    
24
+    return self;
25
+}
26
+
27
+@end

+ 2
- 1
ios/RNNViewController.m View File

@@ -2,6 +2,7 @@
2 2
 #import "RCTRootView.h"
3 3
 #import "MMDrawerController.h"
4 4
 #import "RNNStyler.h"
5
+#import "RNNNavigationController.h"
5 6
 
6 7
 
7 8
 #define SCREEN                  @"screen"
@@ -160,7 +161,7 @@ typedef enum
160 161
     if (screen && screenKey) {
161 162
         UIViewController *rootVC = [RNNViewController controllerWithScreenKey:screenKey bridge:bridge];
162 163
         if (rootVC) {
163
-            controller = [[UINavigationController alloc] initWithRootViewController:rootVC];
164
+            controller = [[RNNNavigationController alloc] initWithRootViewController:rootVC props:nil];
164 165
             [controller.tabBarItem setTitle:screenKey];
165 166
         }
166 167
     }

+ 6
- 0
ios/ReactNativeNavigation.xcodeproj/project.pbxproj View File

@@ -9,6 +9,7 @@
9 9
 /* Begin PBXBuildFile section */
10 10
 		2606F7DA1E0BC3FC00CC69CC /* RNNViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2606F7D91E0BC3FC00CC69CC /* RNNViewController.m */; };
11 11
 		260804DB1CE0D9D20094DBA1 /* RCCToolBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 260804DA1CE0D9D20094DBA1 /* RCCToolBar.m */; };
12
+		263617541E124FA100D88A13 /* RNNNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 263617531E124FA100D88A13 /* RNNNavigationController.m */; };
12 13
 		2636F1611E0EC9E7007ABB09 /* RNNStyler.m in Sources */ = {isa = PBXBuildFile; fileRef = 2636F1601E0EC9E7007ABB09 /* RNNStyler.m */; };
13 14
 		26AFF3F51D7EEE2400CBA211 /* RCCTitleViewHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 26AFF3F41D7EEE2400CBA211 /* RCCTitleViewHelper.m */; };
14 15
 		CC84A19E1C1A0C4E00B3A6A2 /* RCCManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CC84A1941C1A0C4E00B3A6A2 /* RCCManager.m */; };
@@ -54,6 +55,8 @@
54 55
 		2606F7D91E0BC3FC00CC69CC /* RNNViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNViewController.m; sourceTree = "<group>"; };
55 56
 		260804D91CE0D9D20094DBA1 /* RCCToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCCToolBar.h; sourceTree = "<group>"; };
56 57
 		260804DA1CE0D9D20094DBA1 /* RCCToolBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCCToolBar.m; sourceTree = "<group>"; };
58
+		263617521E124FA100D88A13 /* RNNNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNNavigationController.h; sourceTree = "<group>"; };
59
+		263617531E124FA100D88A13 /* RNNNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNNavigationController.m; sourceTree = "<group>"; };
57 60
 		2636F15F1E0EC9E7007ABB09 /* RNNStyler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNStyler.h; sourceTree = "<group>"; };
58 61
 		2636F1601E0EC9E7007ABB09 /* RNNStyler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNStyler.m; sourceTree = "<group>"; };
59 62
 		26AFF3F31D7EEE2400CBA211 /* RCCTitleViewHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCCTitleViewHelper.h; sourceTree = "<group>"; };
@@ -220,6 +223,8 @@
220 223
 				D83514F51D29719A00D53758 /* RCCNotification.m */,
221 224
 				2606F7D81E0BC3FC00CC69CC /* RNNViewController.h */,
222 225
 				2606F7D91E0BC3FC00CC69CC /* RNNViewController.m */,
226
+				263617521E124FA100D88A13 /* RNNNavigationController.h */,
227
+				263617531E124FA100D88A13 /* RNNNavigationController.m */,
223 228
 				2636F15F1E0EC9E7007ABB09 /* RNNStyler.h */,
224 229
 				2636F1601E0EC9E7007ABB09 /* RNNStyler.m */,
225 230
 				D8AFADBE1BEE6F3F00A4592D /* Products */,
@@ -321,6 +326,7 @@
321 326
 				D85082E51CBCF54200FDB961 /* SidebarFacebookAnimation.m in Sources */,
322 327
 				CC84A1A21C1A0C4E00B3A6A2 /* RCCViewController.m in Sources */,
323 328
 				2636F1611E0EC9E7007ABB09 /* RNNStyler.m in Sources */,
329
+				263617541E124FA100D88A13 /* RNNNavigationController.m in Sources */,
324 330
 				2606F7DA1E0BC3FC00CC69CC /* RNNViewController.m in Sources */,
325 331
 				D85082E91CBCF54200FDB961 /* SidebarWunderlistAnimation.m in Sources */,
326 332
 				D85082E11CBCF54200FDB961 /* RCCDrawerHelper.m in Sources */,