|
@@ -46,7 +46,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
46
|
46
|
[self assertReady];
|
47
|
47
|
|
48
|
48
|
[_modalManager dismissAllModals];
|
49
|
|
- [_eventEmitter sendOnNavigationComment:setRoot params:@{@"layout": layout}];
|
|
49
|
+ [_eventEmitter sendOnNavigationCommand:setRoot params:@{@"layout": layout}];
|
50
|
50
|
|
51
|
51
|
UIViewController *vc = [_controllerFactory createLayoutAndSaveToStore:layout];
|
52
|
52
|
|
|
@@ -57,7 +57,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
57
|
57
|
|
58
|
58
|
-(void) mergeOptions:(NSString*)componentId options:(NSDictionary*)options completion:(RNNTransitionCompletionBlock)completion {
|
59
|
59
|
[self assertReady];
|
60
|
|
- [_eventEmitter sendOnNavigationComment:mergeOptions params:@{@"componentId": componentId, @"options": options}];
|
|
60
|
+ [_eventEmitter sendOnNavigationCommand:mergeOptions params:@{@"componentId": componentId, @"options": options}];
|
61
|
61
|
|
62
|
62
|
UIViewController* vc = [_store findComponentForId:componentId];
|
63
|
63
|
if([vc isKindOfClass:[RNNRootViewController class]]) {
|
|
@@ -74,13 +74,13 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
74
|
74
|
|
75
|
75
|
-(void) setDefaultOptions:(NSDictionary*)optionsDict completion:(RNNTransitionCompletionBlock)completion {
|
76
|
76
|
[self assertReady];
|
77
|
|
- [_eventEmitter sendOnNavigationComment:setDefaultOptions params:@{@"options": optionsDict}];
|
|
77
|
+ [_eventEmitter sendOnNavigationCommand:setDefaultOptions params:@{@"options": optionsDict}];
|
78
|
78
|
[_controllerFactory setDefaultOptionsDict:optionsDict];
|
79
|
79
|
}
|
80
|
80
|
|
81
|
81
|
-(void)push:(NSString*)componentId layout:(NSDictionary*)layout completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
82
|
82
|
[self assertReady];
|
83
|
|
- [_eventEmitter sendOnNavigationComment:push params:@{@"componentId": componentId}];
|
|
83
|
+ [_eventEmitter sendOnNavigationCommand:push params:@{@"componentId": componentId}];
|
84
|
84
|
UIViewController<RNNRootViewProtocol> *newVc = [_controllerFactory createLayoutAndSaveToStore:layout];
|
85
|
85
|
[_navigationStackManager push:newVc onTop:componentId completion:^{
|
86
|
86
|
completion();
|
|
@@ -89,7 +89,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
89
|
89
|
|
90
|
90
|
-(void)setStackRoot:(NSString*)componentId layout:(NSDictionary*)layout completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
91
|
91
|
[self assertReady];
|
92
|
|
- [_eventEmitter sendOnNavigationComment:setStackRoot params:@{@"componentId": componentId}];
|
|
92
|
+ [_eventEmitter sendOnNavigationCommand:setStackRoot params:@{@"componentId": componentId}];
|
93
|
93
|
|
94
|
94
|
UIViewController<RNNRootViewProtocol> *newVc = [_controllerFactory createLayoutAndSaveToStore:layout];
|
95
|
95
|
[_navigationStackManager setStackRoot:newVc fromComponent:componentId completion:^{
|
|
@@ -99,7 +99,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
99
|
99
|
|
100
|
100
|
-(void)pop:(NSString*)componentId options:(NSDictionary*)options completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
101
|
101
|
[self assertReady];
|
102
|
|
- [_eventEmitter sendOnNavigationComment:pop params:@{@"componentId": componentId}];
|
|
102
|
+ [_eventEmitter sendOnNavigationCommand:pop params:@{@"componentId": componentId}];
|
103
|
103
|
[CATransaction begin];
|
104
|
104
|
[CATransaction setCompletionBlock:^{
|
105
|
105
|
completion();
|
|
@@ -118,7 +118,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
118
|
118
|
|
119
|
119
|
-(void) popTo:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
120
|
120
|
[self assertReady];
|
121
|
|
- [_eventEmitter sendOnNavigationComment:popTo params:@{@"componentId": componentId}];
|
|
121
|
+ [_eventEmitter sendOnNavigationCommand:popTo params:@{@"componentId": componentId}];
|
122
|
122
|
[CATransaction begin];
|
123
|
123
|
[CATransaction setCompletionBlock:^{
|
124
|
124
|
completion();
|
|
@@ -131,7 +131,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
131
|
131
|
|
132
|
132
|
-(void) popToRoot:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
133
|
133
|
[self assertReady];
|
134
|
|
- [_eventEmitter sendOnNavigationComment:popToRoot params:@{@"componentId": componentId}];
|
|
134
|
+ [_eventEmitter sendOnNavigationCommand:popToRoot params:@{@"componentId": componentId}];
|
135
|
135
|
[CATransaction begin];
|
136
|
136
|
[CATransaction setCompletionBlock:^{
|
137
|
137
|
completion();
|
|
@@ -144,7 +144,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
144
|
144
|
|
145
|
145
|
-(void) showModal:(NSDictionary*)layout completion:(RNNTransitionCompletionBlock)completion {
|
146
|
146
|
[self assertReady];
|
147
|
|
- [_eventEmitter sendOnNavigationComment:showModal params:@{@"layout": layout}];
|
|
147
|
+ [_eventEmitter sendOnNavigationCommand:showModal params:@{@"layout": layout}];
|
148
|
148
|
UIViewController<RNNRootViewProtocol> *newVc = [_controllerFactory createLayoutAndSaveToStore:layout];
|
149
|
149
|
[_modalManager showModal:newVc completion:^{
|
150
|
150
|
completion();
|
|
@@ -153,7 +153,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
153
|
153
|
|
154
|
154
|
-(void) dismissModal:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion {
|
155
|
155
|
[self assertReady];
|
156
|
|
- [_eventEmitter sendOnNavigationComment:dismissModal params:@{@"componentId": componentId}];
|
|
156
|
+ [_eventEmitter sendOnNavigationCommand:dismissModal params:@{@"componentId": componentId}];
|
157
|
157
|
[CATransaction begin];
|
158
|
158
|
[CATransaction setCompletionBlock:^{
|
159
|
159
|
completion();
|
|
@@ -166,7 +166,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
166
|
166
|
|
167
|
167
|
-(void) dismissAllModalsWithCompletion:(RNNTransitionCompletionBlock)completion {
|
168
|
168
|
[self assertReady];
|
169
|
|
- [_eventEmitter sendOnNavigationComment:dismissAllModals params:@{}];
|
|
169
|
+ [_eventEmitter sendOnNavigationCommand:dismissAllModals params:@{}];
|
170
|
170
|
[CATransaction begin];
|
171
|
171
|
[CATransaction setCompletionBlock:^{
|
172
|
172
|
completion();
|
|
@@ -179,7 +179,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
179
|
179
|
|
180
|
180
|
-(void)showOverlay:(NSDictionary *)layout completion:(RNNTransitionCompletionBlock)completion {
|
181
|
181
|
[self assertReady];
|
182
|
|
- [_eventEmitter sendOnNavigationComment:showOverlay params:@{@"layout": layout}];
|
|
182
|
+ [_eventEmitter sendOnNavigationCommand:showOverlay params:@{@"layout": layout}];
|
183
|
183
|
UIViewController<RNNRootViewProtocol>* overlayVC = [_controllerFactory createOverlay:layout];
|
184
|
184
|
[_overlayManager showOverlay:overlayVC completion:^{
|
185
|
185
|
completion();
|
|
@@ -188,7 +188,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
188
|
188
|
|
189
|
189
|
- (void)dismissOverlay:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion {
|
190
|
190
|
[self assertReady];
|
191
|
|
- [_eventEmitter sendOnNavigationComment:dismissModal params:@{@"componentId": componentId}];
|
|
191
|
+ [_eventEmitter sendOnNavigationCommand:dismissModal params:@{@"componentId": componentId}];
|
192
|
192
|
[_overlayManager dismissOverlay:componentId completion:^{
|
193
|
193
|
completion();
|
194
|
194
|
}];
|