I have got a button that presents the share sheet using ShareLink. However, this is only available in iOS 16. Therefore it requires a fallback. What can I put in here that would give the same results to the user?
Button(action: {
let link = URL(string: "https://www.website.co.uk")!
if #available(iOS 16.0, *) {
ShareLink(item: link, message: Text("My own message here"))
} else {
// Fallback on earlier versions
}
}) {
Image(systemName: "square.and.arrow.up")
.foregroundColor(.black)
.frame(width: 40, height: 40)
.background(Color("WhiteGray"),in: RoundedRectangle(cornerRadius: 10, style: .continuous))
.shadow(color: .black.opacity(0.1), radius: 5, x: 5, y: 5)
}
Any ideas?