🌱 Share Sheet Research

Trying to get my first share sheet going.

Lots of the examples using UIApplication.shared.windows.first which now throws a deprecation warning

func shareButton() {
		let url = URL(string: "https://designcode.io")
		let activityController = UIActivityViewController(activityItems: [url!], applicationActivities: nil)

		UIApplication.shared.windows.first?.rootViewController!.present(activityController, animated: true, completion: nil)
}

Importing and Exporting Files in SwiftUI
https://betterprogramming.pub/importing-and-exporting-files-in-swiftui-719086ec712

Working with files and folders in Swift
https://www.swiftbysundell.com/articles/working-with-files-and-folders-in-swift/

How do I share files using share sheet in iOS?
https://stackoverflow.com/questions/35851118/how-do-i-share-files-using-share-sheet-in-ios

How to find the path to a file in your bundle
https://www.hackingwithswift.com/example-code/system/how-to-find-the-path-to-a-file-in-your-bundle

This one kinda works for me

Share Sheet UIActivityViewController within SwiftUI
https://hoyelam.com/share-sheet-uiactivityviewcontroller-within-swiftui/

My main issue was not getting the file in the proper type to send to the share sheet.

Made by Brandon . If you find this project useful you can donate.