QuickLook in SwiftUI using QLPreviewcontroller to share local pdfs

Hi! I have many pdfs that a local to my app that I will access through Bundle. I want to open the pdf and be able to share it via text and email. I don’t think I can load local pdfs in safari using safari services, which has nice sharing capability, so I’ve found the QuickLook appears to have sharing functionality for these locally stored pdfs.
I need to import QuickLook correct?

  1. I know QLPreviewControl needs to be wrapped into Representable to using in SwiftUI, correct? How do I do this?
  2. I also want to show the pdf upon a Button Press: Button(action: {in here}){ } by passing in the location of the pdf from the bundle and having the command to load the pdf occur.
  3. I will have many buttons in a form to do this, calling different pdfs.

Can anyone help point me in the correct direction? Thank you for any help!

you probably need a collectionview or listview for this,

maybe this video by chris can point you to the right direction?

Thanks fuerte! The list format is fine, but what i really need to know is how to do is open a locally stored pdf via swiftui button action, once open i need to be able to share it via text and email. How the pdfs are organized is less important to me. Currently, using pdfkit i can open a locally stored pdf but i cant share it. Im using safariservices to open pdf from the web and once the pdf gets opened in safari i get all the sharing functionality. It works perfectly, but i want to do the same thing with locally stored pdfs. Since im using swiftui i have to wrap uikit viewcontrollers in representable and i want to use quick look QLviewcontrollers but i dont know how to set it up in representable. I did with SFsafariservices and it worked great. Thanks for the help!

is it possible just to use the safari services (only sharing) on a button while using your QLviewcontroller?