Does anybody know how I can grab an environment variable in Swift?
Yes it is possible. Use ProcessInfo for that.
ProcessInfo
Simple example :
let dic = ProcessInfo.processInfo.environment if dic["VAR"] != nil { }