This repository contains small scripts as well as instructions to read .env files in several languages.
For using it in swift first you have to have:
Installed the SwiftDotEnv package.
For a .env
file like this:
import DotEnv
let env = DotEnv(withFile: ".env")
let DB_NAME = env.get("DB_NAME")
print(DB_NAME)