|
@@ -16,7 +16,7 @@
|
16
|
16
|
# pragma mark public
|
17
|
17
|
|
18
|
18
|
|
19
|
|
--(instancetype)initWithRootViewCreator:(id <RNNRootViewCreator>)creator store:(RNNStore *)store {
|
|
19
|
+- (instancetype)initWithRootViewCreator:(id <RNNRootViewCreator>)creator store:(RNNStore *)store {
|
20
|
20
|
|
21
|
21
|
self = [super init];
|
22
|
22
|
self.creator = creator;
|
|
@@ -25,14 +25,14 @@
|
25
|
25
|
return self;
|
26
|
26
|
}
|
27
|
27
|
|
28
|
|
--(UIViewController *)createLayout:(NSDictionary *)layout
|
|
28
|
+- (UIViewController*)createLayoutAndSaveToStore:(NSDictionary*)layout
|
29
|
29
|
{
|
30
|
30
|
return [self fromTree:layout];
|
31
|
31
|
}
|
32
|
32
|
|
33
|
33
|
# pragma mark private
|
34
|
34
|
|
35
|
|
--(UIViewController*)fromTree:(NSDictionary*)json
|
|
35
|
+- (UIViewController*)fromTree:(NSDictionary*)json
|
36
|
36
|
{
|
37
|
37
|
RNNLayoutNode* node = [RNNLayoutNode create:json];
|
38
|
38
|
|
|
@@ -74,12 +74,12 @@
|
74
|
74
|
return result;
|
75
|
75
|
}
|
76
|
76
|
|
77
|
|
--(RNNRootViewController*)createContainer:(RNNLayoutNode*)node
|
|
77
|
+- (RNNRootViewController*)createContainer:(RNNLayoutNode*)node
|
78
|
78
|
{
|
79
|
79
|
return [[RNNRootViewController alloc] initWithNode:node rootViewCreator:self.creator];
|
80
|
80
|
}
|
81
|
81
|
|
82
|
|
--(UINavigationController*)createContainerStack:(RNNLayoutNode*)node
|
|
82
|
+- (UINavigationController*)createContainerStack:(RNNLayoutNode*)node
|
83
|
83
|
{
|
84
|
84
|
UINavigationController* vc = [[UINavigationController alloc] init];
|
85
|
85
|
|
|
@@ -109,7 +109,7 @@
|
109
|
109
|
return vc;
|
110
|
110
|
}
|
111
|
111
|
|
112
|
|
--(UIViewController*)createSideMenu:(RNNLayoutNode*)node
|
|
112
|
+- (UIViewController*)createSideMenu:(RNNLayoutNode*)node
|
113
|
113
|
{
|
114
|
114
|
NSMutableArray* childrenVCs = [NSMutableArray new];
|
115
|
115
|
|
|
@@ -124,7 +124,7 @@
|
124
|
124
|
}
|
125
|
125
|
|
126
|
126
|
|
127
|
|
--(UIViewController*)createSideMenuChild:(RNNLayoutNode*)node type:(RNNSideMenuChildType)type {
|
|
127
|
+- (UIViewController*)createSideMenuChild:(RNNLayoutNode*)node type:(RNNSideMenuChildType)type {
|
128
|
128
|
UIViewController* child = [self fromTree:node.children[0]];
|
129
|
129
|
RNNSideMenuChildVC *sideMenuChild = [[RNNSideMenuChildVC alloc] initWithChild: child type:type];
|
130
|
130
|
|
|
@@ -133,5 +133,4 @@
|
133
|
133
|
|
134
|
134
|
|
135
|
135
|
|
136
|
|
-
|
137
|
136
|
@end
|