It appears that the ShareLink can be added, alongside other buttons, within the .contextMenu as below.
.contextMenu {
Button(action: {
debugPrint("Share")
}) {
Label("Share", systemImage: "square.and.arrow.up")
}
ShareLink(item: image, preview: SharePreview("image", image: image)) {
Label("Share", systemImage: "square.and.arrow.up")
}
}
Post
Replies
Boosts
Views
Activity
Using ViewThatFits is definitely the recommended approach to getting a user interface that adapts to different devices and also different device orientations (e.g. landscape vs. portrait).
As with many other aspects of Swift and SwiftUI, ViewThatFits takes a little time to get used to. The first view within ViewThatFits should be the largest view with progressively smaller views coming next. Use the in: parameter to specify whether the view should assess the size horizontally or vertically, as this example shows:
ViewThatFits will choose the first child view that fits. While it can be used without the in: parameter, it usually doesn’t provide the required result unless it’s specified.
ViewThatFits(in: .horizontal) {
HStack {
// Large View
}
HStack {
// Medium View
}
HStack {
// Small View
}
}
If anyone else runs into this issue, I recommend looking at this article: Deploying an iCloud Container's Schema.
I hadn't used CloudKit before and didn't realize the additional steps required to deploy the container into production. I should be able to resolve this issue now before the next TestFlight release.
I think this maybe caused by the other two devices using the development container and the third device, which never had a development build, using the production container. All three are using an Apple ID from the internal testing group and so I would have thought all three should be on the same container.
This change needs to be made by Apple Developer Support. Give them a call and they can resolve this.
The SwiftUI version of MapKit is supported on visionOS although it really should embrace 3D and let users explore maps horizontally that have contoured terrain and 3D roads, bridges and buildings etc.