Learn Courses My Dashboard

Opening app by choosing a datafile

I started yesterday with SwiftUI. I am using a chess app (Hiarcs Chess Explorer Pro) where I use multiple databases. I wanted to create a UI which listed my databases (could add images/icons).
On the Mac, if I double click on the file (.pgn or .hce) the OS opens the app.

How can I achieve that with SwiftUI? I already have my desired UI designed, just don’t know how to invoke Hiarcs Chess Explorer.

Thanks everyone in advance…

P.S: I do not need to ‘remain’ on the SwiftUI App, all I want is to have a list of available databases. That already I have programmed, but which button action (or link) should I use to ‘double click’ on the file and hence start the HCE application/program ?

Not so simple. I downloaded the “Building a Document-Based App with SwiftUI” app that apple provides and it works like a champ, I accessed my files on iCloud, etc… Problem is a double click on the file did not open HCE as I was expecting. Different environment …