Sharesheet Uiviewcontrollerrepresentable Swiftui

[Solved] Sharesheet Uiviewcontrollerrepresentable Swiftui | Swift - Code Explorer | yomemimo.com
Question : ShareSheet: UIViewControllerRepresentable swiftui

Answered by : quaint-quail-rblyi6q3wthz

struct ShareSheetView: View { var body: some View { Button(action: actionSheet) { Image(systemName: "square.and.arrow.up") .resizable() .aspectRatio(contentMode: .fit) .frame(width: 36, height: 36) } } func actionSheet() { guard let data = URL(string: "https://www.apple.com") else { return } let av = UIActivityViewController(activityItems: [data], applicationActivities: nil) UIApplication.shared.windows.first?.rootViewController?.present(av, animated: true, completion: nil) }
}

Source : https://stackoverflow.com/questions/58286344/presenting-uiactivityviewcontroller-from-swiftui-view | Last Update : Fri, 23 Oct 20

Answers related to sharesheet uiviewcontrollerrepresentable swiftui

Code Explorer Popular Question For Swift