I am trying to use the new ShareLink component in an app I am moving to SwiftUI. If I use the init(items: Data, subject: Text?, message: Text?)
variant of the initializer all works well. However if I try to include a preview using the initializer that takes an additional parameter that is a SharePreview instance I get a crash.
The crash complains about Fatal error: SWIFT TASK CONTINUATION MISUSE: data(contentType:) tried to resume its continuation more than once, throwing exportFailed!
thread #2, queue = 'com.apple.root.user-initiated-qos.cooperative', stop reason = Fatal error: SWIFT TASK CONTINUATION MISUSE: data(contentType:) tried to resume its continuation more than once, throwing exportFailed!
The creation of the SharePreview object itself succeeds with nothing. Its the initialization of the ShareLink object that goes boom.
Any ideas? Known issue? Wait for next beta?
Environment:
Xcode 14 beta 2, iOS 16 beta 2, iPhone 8