|
@@ -99,7 +99,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
99
|
99
|
UIViewController<RNNLayoutProtocol> *newVc = [_controllerFactory createLayout:layout saveToStore:_store];
|
100
|
100
|
UIViewController *fromVC = [_store findComponentForId:componentId];
|
101
|
101
|
|
102
|
|
- if ([newVc.options.preview.reactTag floatValue] > 0) {
|
|
102
|
+ if ([[newVc.options.preview.reactTag getWithDefaultValue:@(0)] floatValue] > 0) {
|
103
|
103
|
UIViewController* vc = [_store findComponentForId:componentId];
|
104
|
104
|
|
105
|
105
|
if([vc isKindOfClass:[RNNRootViewController class]]) {
|
|
@@ -109,7 +109,7 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
109
|
109
|
rootVc.previewCallback = ^(UIViewController *vcc) {
|
110
|
110
|
RNNRootViewController* rvc = (RNNRootViewController*)vcc;
|
111
|
111
|
[self->_eventEmitter sendOnPreviewCompleted:componentId previewComponentId:newVc.layoutInfo.componentId];
|
112
|
|
- if ([newVc.options.preview.commit floatValue] > 0) {
|
|
112
|
+ if ([newVc.options.preview.commit getWithDefaultValue:NO]) {
|
113
|
113
|
[CATransaction begin];
|
114
|
114
|
[CATransaction setCompletionBlock:^{
|
115
|
115
|
[self->_eventEmitter sendOnNavigationCommandCompletion:push params:@{@"componentId": componentId}];
|
|
@@ -122,20 +122,20 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
122
|
122
|
|
123
|
123
|
CGSize size = CGSizeMake(rootVc.view.frame.size.width, rootVc.view.frame.size.height);
|
124
|
124
|
|
125
|
|
- if (newVc.options.preview.width) {
|
126
|
|
- size.width = [newVc.options.preview.width floatValue];
|
|
125
|
+ if (newVc.options.preview.width.hasValue) {
|
|
126
|
+ size.width = [newVc.options.preview.width.get floatValue];
|
127
|
127
|
}
|
128
|
128
|
|
129
|
|
- if (newVc.options.preview.height) {
|
130
|
|
- size.height = [newVc.options.preview.height floatValue];
|
|
129
|
+ if (newVc.options.preview.height.hasValue) {
|
|
130
|
+ size.height = [newVc.options.preview.height.get floatValue];
|
131
|
131
|
}
|
132
|
132
|
|
133
|
|
- if (newVc.options.preview.width || newVc.options.preview.height) {
|
|
133
|
+ if (newVc.options.preview.width.hasValue || newVc.options.preview.height.hasValue) {
|
134
|
134
|
newVc.preferredContentSize = size;
|
135
|
135
|
}
|
136
|
136
|
|
137
|
137
|
RCTExecuteOnMainQueue(^{
|
138
|
|
- UIView *view = [[ReactNativeNavigation getBridge].uiManager viewForReactTag:newVc.options.preview.reactTag];
|
|
138
|
+ UIView *view = [[ReactNativeNavigation getBridge].uiManager viewForReactTag:newVc.options.preview.reactTag.get];
|
139
|
139
|
[rootVc registerForPreviewingWithDelegate:(id)rootVc sourceView:view];
|
140
|
140
|
});
|
141
|
141
|
}
|