I am building a simple image and video database app for my own specific needs. I want to add share sheet functionality to it in order to import the images and videos from other apps. I don't want or need to present any UI - I just want a user to be able to select one or more images and/or videos, press "share", tap my app icon, and have the data passed to some function of my app to be saved as files to my app's local documents directory (the result of dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first). My database stores the filename for each item (as well as lots of user-generated metadata), which means I should be able to retrieve the URL for each stored item with dir.appendingPathComponent(filename).
All of the tutorials I've found for creating share extensions with Swift focus on creating complex UI and do very little to explain what kind of data is received. It'd be lovely if I got URLs that I could use FileManager.default.moveItem(at: URL, to: dir.appendingPathComponent(filename)) to copy to my app storage, but of course I'm happy with whatever data representation the share sheet gives me.
Thank you for your patience, as I'm almost a complete beginner to Swift and SwiftUI.