Check out example codes for "how to install swift on ubuntu". It will help you in understanding the concepts better.

Code Example 1

sudo apt-get update
sudo apt-get -y install curl libcurl4 libcurl4-openssl-dev clang libicu-dev
mkdir ~/.swiftenv
git clone ~/.swiftenv
echo 'export SWIFTENV_ROOT="$HOME/.swiftenv"' >> ~/.bashrc
echo 'export PATH="$SWIFTENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(swiftenv init -)"' >> ~/.bashrc
source ~/.bashrc
swiftenv install
swift --version

Learn ReactJs, React Native from