Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从react Native&;集成本机iOS库;回去反应一下_Ios_React Native_React Native Ios - Fatal编程技术网

如何从react Native&;集成本机iOS库;回去反应一下

如何从react Native&;集成本机iOS库;回去反应一下,ios,react-native,react-native-ios,Ios,React Native,React Native Ios,在我的react本机应用程序中,我想集成一个iOS本机库。这里的库是为UINavigation堆栈编写的,所以他们添加了一个按钮,从库中返回应用程序 在本机iOS中,调用库的代码如下: LibController *lib=[[LibController alloc]initWith:someparametrs]; [self.navigationController pushViewController:lib animated:YES]; 在这里,我使用Editor->Embed In->

在我的react本机应用程序中,我想集成一个iOS本机库。这里的库是为UINavigation堆栈编写的,所以他们添加了一个按钮,从库中返回应用程序

在本机iOS中,调用库的代码如下:

LibController *lib=[[LibController alloc]initWith:someparametrs];
[self.navigationController pushViewController:lib animated:YES];
在这里,我使用
Editor->Embed In->Navigation controller
简单地将我以前的控制器添加为UINavigation controller,这样我就可以很容易地调用库并关闭库

上面的代码在React Native应用程序中不起作用,因为我们无法从React Native到Native iOS获取导航堆栈。到目前为止,我尝试将set设置为rootview控制器并调用库,但无法返回React本机

我调用库的代码:

UINavigationController* nv = [[UINavigationController alloc] initWithRootViewController:lib];
    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    nv.modalPresentationStyle=UIModalPresentationFullScreen;
    nv.delegate=self;
    [delegate.window.rootViewController presentViewController:nv animated:YES completion:nil];
这段代码可以很好地调用本机库,但由于将控制器设置为RootViewController,我无法返回到react native

帮助我将控制器添加到react native导航堆栈,或调用我的native iOS库并返回react native。提前谢谢