I have had this problem too, so here is the solution.
First, make sure that your Swift Playgrounds project is saved, and you have made a designated icon for it and a name.
Open the Shortcuts app.
Click the + button (top right-hand corner)
On the screen that pops up, search for “Open App”. Click on it and it will add it to the project.
Click the empty “App” button and scroll down or search for your Swift Playgrounds app. Click it.
Next, search for the action “Stop this Shortcut” and click it (Adds to project).
Then click the Share button, then “Add to Home Screen”.
If you have the image file for the icon of your Swift app, then just click the smaller icon on the Add to Home Screen page and then choose what to pick from.
If not, you can go back and click the down arrow (next to the name of the Shortcut), and then “Choose Icon”.
After you do that, don’t forget to rename the Shortcut to the name of your app.
There you go! If you have any questions, you can just reply to this post.