Latest 1.0.4
License BSD
Platforms ios 9.0, watchos 2.0, tvos 9.0, osx 10.10

Swift Version
Build Status
CocoaPods Compatible
Carthage Compatible
Swift Package Manager Compatible

RuntimeEnvironment manage all your environment variable with a specific environment set in your Info.plist file



To install RuntimeEnvironment with CocoaPods, add the following lines to your Podfile.

source ''
platform :ios, '9.0'

pod 'RuntimeEnvironment'


Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate RuntimeEnvironment into your Xcode project using Carthage, specify it in your Cartfile:

github 'Digipolitan/runtime-environment' ~> 1.0

Run carthage update to build the framework and drag the built RuntimeEnvironment.framework into your Xcode project.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

Once you have your Swift package set up, adding RuntimeEnvironment as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "", from: "1.0.0")

The Basics

First you must set the environment mode in your Info.plist file


Authorized environment value are development, staging, production

After that, at runtime you must register all your variable as follow:

let env = RuntimeEnvironment.shared
env.set("API_KEY", "dsdqsiIDNSIQUdiusqdDSQ")


Variable from dictionary

You can set multiple variable at once using dictionary

let env = RuntimeEnvironment.shared
  "secure": true,
  "baseUrl": "http://localhost"

Variable from file

2 file format are available: json & plist

let env = RuntimeEnvironment.shared
env.setFile("", format: .json)


See for more details!

This project adheres to the Contributor Covenant Code of Conduct.
By participating, you are expected to uphold this code. Please report
unacceptable behavior to [email protected].


RuntimeEnvironment is licensed under the BSD 3-Clause license.

Latest podspec

    "name": "RuntimeEnvironment",
    "version": "1.0.4",
    "summary": "Manage environment variable at runtime with environment mode set in Info.plist",
    "homepage": "",
    "authors": "Digipolitan",
    "source": {
        "git": "",
        "tag": "v1.0.4"
    "license": {
        "type": "BSD",
        "file": "LICENSE"
    "source_files": "Sources/**/*.{swift,h}",
    "platforms": {
        "ios": "9.0",
        "watchos": "2.0",
        "tvos": "9.0",
        "osx": "10.10"
    "swift_versions": "5.0",
    "swift_version": "5.0"

Pin It on Pinterest

Share This