我真的很难让UIActivityViewController
一个UIViewControllerRepresentable
在 SwiftUI 中工作。例如,当尝试分享到 WhatsApp 时,屏幕只是轻微移动,好像要发生一些动作,然后它返回到原来的位置,并出现以下一连串错误(为了便于阅读,删除了一些时间戳等):
[core] HOST: Failed to load remote view controller with error:
Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 2539 named
net.whatsapp.WhatsApp.ShareExtension.viewservice was interrupted, but the message was
sent over an additional proxy and therefore this proxy has become invalid."
[core] Sheet not being presented, calling premature completion
[net.whatsapp.WhatsApp.ShareExtension(2.20.111)] Connection to plugin interrupted while in use.
[net.whatsapp.WhatsApp.ShareExtension(2.20.111)] Connection to plugin invalidated while in use.
这只是与使用 SwiftUI 时模态的(看似可怕的错误)行为有关吗?我似乎无法解决这个持续存在的问题。