Fix iPad crash due to missing sourceView
This commit is contained in:
parent
73c27928ca
commit
527a62b562
@ -114,7 +114,15 @@ public class InAppBrowserManager: ChannelDelegate {
|
|||||||
assertionFailure("Failure init the visibleViewController!")
|
assertionFailure("Failure init the visibleViewController!")
|
||||||
return
|
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)
|
visibleViewController.present(navController, animated: animated)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user