I am using ShareLink from the latest SwiftUI and when I click it I get this warning on @main.
ShareLink was introduced in iOS 16 so I was wondering if anyone else came across this warning.
I can see other questions related to similar warning but they are about WebKit. Maybe ShareLink is using it under the hood but I don't see it in documentation.
The related questionsI found are here, here or here.
I tried to put it inside DispatchQueue.main.async but is not working.
This is minimal code to reproduce the warning.
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
ShareLink(item: URL(string: "https://apps.apple.com")!)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Running on XCode 14.2 for iOS 16.2.
Any help or guidance will be much appreciated. Thanks!