0

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?

mbby
  • 397
  • 1
  • 11
  • 2
    https://stackoverflow.com/questions/59432291/how-to-integrate-uiactivityviewcontroller-with-swiftuis-scrollview/59433735#59433735 – ChrisR Jan 05 '23 at 17:38

0 Answers0