Skip to content

Commit

Permalink
Fix iPad crash due to missing sourceView
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsrutek committed Dec 20, 2023
1 parent 73c2792 commit 527a62b
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,15 @@ public class InAppBrowserManager: ChannelDelegate {
assertionFailure("Failure init the visibleViewController!")
return
}


if let popover = navController.popoverPresentationController {
let sourceView = visibleViewController.view ?? UIView()

popover.sourceRect = CGRect(x: sourceView.bounds.midX, y: sourceView.bounds.midY, width: 0, height: 0)
popover.permittedArrowDirections = []
popover.sourceView = sourceView
}

visibleViewController.present(navController, animated: animated)
}

Expand Down

0 comments on commit 527a62b

Please # to comment.