|
@@ -127,7 +127,6 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
127
|
127
|
[rootVc registerForPreviewingWithDelegate:(id)rootVc sourceView:elementView];
|
128
|
128
|
}
|
129
|
129
|
} else {
|
130
|
|
- [_eventEmitter sendOnNavigationCommand:push params:@{@"componentId": componentId}];
|
131
|
130
|
[_navigationStackManager push:newVc onTop:componentId completion:^{
|
132
|
131
|
[_eventEmitter sendOnNavigationCommandCompletion:push params:@{@"componentId": componentId}];
|
133
|
132
|
completion();
|
|
@@ -137,7 +136,6 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
137
|
136
|
|
138
|
137
|
-(void)setStackRoot:(NSString*)componentId layout:(NSDictionary*)layout completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
139
|
138
|
[self assertReady];
|
140
|
|
- [_eventEmitter sendOnNavigationCommand:setStackRoot params:@{@"componentId": componentId}];
|
141
|
139
|
|
142
|
140
|
UIViewController<RNNRootViewProtocol> *newVc = [_controllerFactory createLayoutAndSaveToStore:layout];
|
143
|
141
|
__weak typeof(RNNEventEmitter*) weakEventEmitter = _eventEmitter;
|
|
@@ -149,7 +147,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
149
|
147
|
|
150
|
148
|
-(void)pop:(NSString*)componentId options:(NSDictionary*)options completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
151
|
149
|
[self assertReady];
|
152
|
|
- [_eventEmitter sendOnNavigationCommand:pop params:@{@"componentId": componentId}];
|
|
150
|
+
|
153
|
151
|
[CATransaction begin];
|
154
|
152
|
[CATransaction setCompletionBlock:^{
|
155
|
153
|
[_eventEmitter sendOnNavigationCommandCompletion:pop params:@{@"componentId": componentId}];
|
|
@@ -169,7 +167,6 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
169
|
167
|
|
170
|
168
|
-(void) popTo:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
171
|
169
|
[self assertReady];
|
172
|
|
- [_eventEmitter sendOnNavigationCommand:popTo params:@{@"componentId": componentId}];
|
173
|
170
|
[CATransaction begin];
|
174
|
171
|
[CATransaction setCompletionBlock:^{
|
175
|
172
|
[_eventEmitter sendOnNavigationCommandCompletion:popTo params:@{@"componentId": componentId}];
|
|
@@ -183,7 +180,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
183
|
180
|
|
184
|
181
|
-(void) popToRoot:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|
185
|
182
|
[self assertReady];
|
186
|
|
- [_eventEmitter sendOnNavigationCommand:popToRoot params:@{@"componentId": componentId}];
|
|
183
|
+
|
187
|
184
|
[CATransaction begin];
|
188
|
185
|
[CATransaction setCompletionBlock:^{
|
189
|
186
|
[_eventEmitter sendOnNavigationCommandCompletion:popToRoot params:@{@"componentId": componentId}];
|
|
@@ -197,7 +194,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
197
|
194
|
|
198
|
195
|
-(void) showModal:(NSDictionary*)layout completion:(RNNTransitionCompletionBlock)completion {
|
199
|
196
|
[self assertReady];
|
200
|
|
- [_eventEmitter sendOnNavigationCommand:showModal params:@{@"layout": layout}];
|
|
197
|
+
|
201
|
198
|
UIViewController<RNNRootViewProtocol> *newVc = [_controllerFactory createLayoutAndSaveToStore:layout];
|
202
|
199
|
[_modalManager showModal:newVc completion:^{
|
203
|
200
|
[_eventEmitter sendOnNavigationCommandCompletion:showModal params:@{@"layout": layout}];
|
|
@@ -207,7 +204,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
207
|
204
|
|
208
|
205
|
-(void) dismissModal:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion {
|
209
|
206
|
[self assertReady];
|
210
|
|
- [_eventEmitter sendOnNavigationCommand:dismissModal params:@{@"componentId": componentId}];
|
|
207
|
+
|
211
|
208
|
[CATransaction begin];
|
212
|
209
|
[CATransaction setCompletionBlock:^{
|
213
|
210
|
[_eventEmitter sendOnNavigationCommandCompletion:dismissModal params:@{@"componentId": componentId}];
|
|
@@ -221,7 +218,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
221
|
218
|
|
222
|
219
|
-(void) dismissAllModalsWithCompletion:(RNNTransitionCompletionBlock)completion {
|
223
|
220
|
[self assertReady];
|
224
|
|
- [_eventEmitter sendOnNavigationCommand:dismissAllModals params:@{}];
|
|
221
|
+
|
225
|
222
|
[CATransaction begin];
|
226
|
223
|
[CATransaction setCompletionBlock:^{
|
227
|
224
|
[_eventEmitter sendOnNavigationCommandCompletion:dismissAllModals params:@{}];
|
|
@@ -235,7 +232,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
235
|
232
|
|
236
|
233
|
-(void)showOverlay:(NSDictionary *)layout completion:(RNNTransitionCompletionBlock)completion {
|
237
|
234
|
[self assertReady];
|
238
|
|
- [_eventEmitter sendOnNavigationCommand:showOverlay params:@{@"layout": layout}];
|
|
235
|
+
|
239
|
236
|
UIViewController<RNNRootViewProtocol>* overlayVC = [_controllerFactory createOverlay:layout];
|
240
|
237
|
[_overlayManager showOverlay:overlayVC completion:^{
|
241
|
238
|
[_eventEmitter sendOnNavigationCommandCompletion:showOverlay params:@{@"layout": layout}];
|
|
@@ -245,7 +242,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
245
|
242
|
|
246
|
243
|
- (void)dismissOverlay:(NSString*)componentId completion:(RNNTransitionCompletionBlock)completion {
|
247
|
244
|
[self assertReady];
|
248
|
|
- [_eventEmitter sendOnNavigationCommand:dismissModal params:@{@"componentId": componentId}];
|
|
245
|
+
|
249
|
246
|
[_overlayManager dismissOverlay:componentId completion:^{
|
250
|
247
|
[_eventEmitter sendOnNavigationCommandCompletion:dismissModal params:@{@"componentId": componentId}];
|
251
|
248
|
completion();
|