ios - 在 iOS 13 中单击 webview 的链接时它会崩溃
问题描述
当点击 webview 中的链接时,没有响应。当长按链接时,它会崩溃并显示以下消息:
Trapped uncaught exception 'NSInternalInconsistencyException', reason: '_UIClickPresentationInteraction cannot determine presenting view controller.'
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23b98958 +[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff255eb6f5 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4 UIKitCore 0x00007fff470cf0fd -[_UIClickPresentationInteraction _canPerformPresentation] + 431
5 UIKitCore 0x00007fff470d16eb -[_UIClickPresentationInteraction _handleTransitionToPreview] + 136
6 UIKitCore 0x00007fff470d1046 __55-[_UIClickPresentationInteraction _prepareStateMachine]_block_invoke_3 + 35
7 UIKitCore 0x00007fff471f0fb0 -[_UIStateMachine handleEvent:withContext:] + 412
8 UIKitCore 0x00007fff470cff63 -[_UIClickPresentationInteraction clickInteractionDidClickUp:] + 55
9 UIKitCore 0x00007fff46dd5aed -[_UIClickInteraction clickDriver:didPerformEvent:] + 316
10 UIKitCore 0x00007fff46a3831f __58-[_UILongPressClickInteractionDriver _prepareStateMachine]_block_invoke_2 + 74
11 UIKitCore 0x00007fff471f0fb0 -[_UIStateMachine handleEvent:withContext:] + 412
12 UIKitCore 0x00007fff46a38e04 -[_UILongPressClickInteractionDriver _updateForActiveGestureRecognizer] + 673
13 UIKitCore 0x00007fff46a38a59 -[_UILongPressClickInteractionDriver _handleGestureRecognizer:] + 382
14 UIKitCore 0x00007fff46d1e777 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 44
15 UIKitCore 0x00007fff46d27909 _UIGestureRecognizerSendTargetActions + 109
16 UIKitCore 0x00007fff46d24fc5 _UIGestureRecognizerSendActions + 298
17 UIKitCore 0x00007fff46d242f2 -[UIGestureRecognizer _updateGestureForActiveEvents] + 757
18 UIKitCore 0x00007fff46d16308 _UIGestureEnvironmentUpdate + 2700
19 CoreFoundation 0x00007fff23afaeb7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
20 CoreFoundation 0x00007fff23af594e __CFRunLoopDoObservers + 430
21 CoreFoundation 0x00007fff23af5fca __CFRunLoopRun + 1514
22 CoreFoundation 0x00007fff23af56b6 CFRunLoopRunSpecific + 438
23 GraphicsServices 0x00007fff3815cbb0 GSEventRunModal + 65
24 UIKitCore 0x00007fff47162a67 UIApplicationMain + 1621
25 IBUWireless 0x000000010b372728 main + 296
26 libdyld.dylib 0x00007fff5123bcf5 start + 1
27 ??? 0x0000000000000001 0x0 + 1
iOS13 操作系统
解决方案
I have recently fixed this issue and solved by setting
webviewcontroller.modalPresentationStyle = .fullScreen
self.present(webviewcontroller, animated: animated, completion: nil)
推荐阅读
- c# - Winform Designer 使用自定义控件生成名称错误
- oracle - ORA-00904 PL/SQL 中的标识符无效
- c# - Implementing Linear Regression in ASP.NET web application
- reactjs - 字符在 div 中显示的限制
- javascript - Grouping incoming data by date in JS fixed and questions
- angular - 角度如何刷新@Input的值
- python - 替换json值,然后保存到新文件中
- java - How to resolve XSRF Cross-Site Request Forgery (CSRF) in API controller after SAST Checkmarx
- python - Rounding the 38 to 40 in grading students hackerrank
- algorithm - 找到数字之和为 10 的第 K 个最小的数