I implemented a share link in my app and for some reason, it's working on my iPhone but all my users are complaining that when they click on the Share Button, doesn't show any options to share.
import SwiftUI
import Kingfisher
struct PostIndividualView: View {
var post: Post
var body: some View {
ZStack {
let url_post = URL(string: "yourstudentapp://\(post.id)")
Color(red: 0.95, green: 0.95, blue: 0.95)
.ignoresSafeArea(.all)
ScrollView {
VStack {
Text(post.caption)
.padding(.top, 20)
.padding(.bottom, 5)
.fontWeight(.bold)
.font(.title2)
.multilineTextAlignment(.center)
.frame(maxWidth: .infinity)
ShareLink(item: url_post!,preview: SharePreview(post.caption,
image: Image(uiImage: UIImage(data: try! Data(contentsOf: URL(string: post.imageUrl)!))!))) {
HStack {
Image(systemName: "square.and.arrow.up")
Text("Share")
}
.padding(.bottom, 5)
}
Divider()