WZMChatUI icon indicating copy to clipboard operation
WZMChatUI copied to clipboard

关于使用UIMenuController 的问题,ViewController 属性 inputView 引起异常。

Open masakapa opened this issue 2 years ago • 1 comments

在让WZMChatTextMessageCell 的label 支持UIMenuController 功能时,在高版本(没有全部测试,iOS 15是这样)iOS 中,会弹出一个灰色的多余inputwindow 覆盖当前window;在低版本(iOS 12)中,直接崩溃,崩溃日志类似为: Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: > should have parent view controller:<: **> but requested parent is:<UIInputWindowController: **>'

找到问题原因: Your view controller probably has a property named inputView that is merely a subview, not an inputView as UIResponder interface expects it to be.

Starting with iOS 8 they check that UIResponder's inputView has no parent.

解决方法为:修改 WZMChatViewController 中的 inputView 属性名称,如 wzmInputView。显示就正常了。

masakapa avatar Apr 02 '22 03:04 masakapa

thank you!我去改一下

xiaoyi3699 avatar Apr 28 '22 11:04 xiaoyi3699