I am building a navigation stack consisting of both native iOS views and react-native screens. But when I push the native iOS view, the view layout is not coming out as designed in storyboard. I am using autolayout in Xcode for the native views.
ICNativeViewManager.h
---------------------
#import <React/RCTViewManager.h>
@interface ICNativeViewManager : RCTViewManager
@end
ICNativeViewManager.m
---------------------
#import <React/RCTViewManager.h>
#import <React/RCTView.h>
#import "ICNativeViewManager.h"
@implementation ICNativeViewManager
UIViewController *vc;
RCT_EXPORT_MODULE()
-(UIView *)view
{
if (vc == nil)
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"ICNativeUI" bundle:nil];
vc = [storyboard instantiateInitialViewController];
}
return vc.view;
}
RCT_EXPORT_VIEW_PROPERTY(labelText, NSString)
@end