Skip to content

Commit f5d47e2

Browse files
committed
Fix Implicit declaration of function 'RCTPresentedViewController'
1 parent 1d75810 commit f5d47e2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ios/RNInAppBrowser.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ - (dispatch_queue_t)methodQueue
128128
// This is a hack to present the SafariViewController modally
129129
UINavigationController *safariHackVC = [[UINavigationController alloc] initWithRootViewController:safariVC];
130130
[safariHackVC setNavigationBarHidden:true animated:false];
131-
[RCTPresentedViewController() presentViewController:safariHackVC animated:true completion:nil];
131+
UIViewController *presentingViewController = RCTPresentedViewController();
132+
[presentingViewController presentViewController:safariHackVC animated:true completion:nil];
132133
}
133134

134135
- (void)performSynchronouslyOnMainThread:(void (^)(void))block
@@ -144,7 +145,8 @@ - (void)_close
144145
{
145146
__weak typeof(self) weakSelf = self;
146147
[self performSynchronouslyOnMainThread:^{
147-
[RCTPresentedViewController() dismissViewControllerAnimated:YES completion:^{
148+
UIViewController *presentingViewController = RCTPresentedViewController();
149+
[presentingViewController dismissViewControllerAnimated:YES completion:^{
148150
__strong typeof(self) strongSelf = weakSelf;
149151
if (strongSelf) {
150152
strongSelf.redirectResolve(@{

0 commit comments

Comments
 (0)