If your distro is based on the latest Debian or Ubuntu versions the install script fails to find a Swift package,you can manually install Swift by downloading the equivalent Debian or Ubuntu package closest to the version of your OS.
For example if you are using Linux Mint 20.1 which is based on Ubuntu Focal
You will need to download the .deb installation package for Ubuntu 20.04 Focal.
The wget download link is available on the package release page.
Then use following command to install Swift.
The official OS for the Raspberry Pi is still 32bit and will restrict the version of Swift that you can install.
The latest version of Swift available for 32bit arm is 5.1.5.
If you need the latest version of Swift you will need to install a 64bit OS.
Ubuntu 20.10, 21.04 and Raspbian 64bit Beta are available.