Latest 0.1.0
Homepage https://github.com/ioscodigo/ICEnvironmentSetting
License MIT
Platforms ios 8.0
Authors

Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Minimum Requirements

iOS8+
Swift 3.0
XCode 8.0

Installation

ICEnvironmentSetting is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "ICEnvironmentSetting"

Usage

Setup Environment on AppDelegate

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [   UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Default development
    ICEnvironmentSetting.setup(window: self.window!) 
    // you can set default environment
    ICEnvironmentSetting.setup(window: self.window!,defaultEnv: .STAGGING)
    //Setup your URL API environment
    ICEnvironmentSetting.setupBaseURL(development: "DEV", staging: "STG", production: "PROD")
    return true
}

Setup Listener

Add delegate on home your app

ICEnvironmentSettingDelegate
func reloadEnvironment(environment: ENVIRONMENT) {
    //Reload data when environment change
}

Add touch to switch environment with three fingers

ICEnvironmentSetting.setupTouch(self.view)

You can use string extension with modify environment

let homeURL = "/home"
request(homeURL.ENV) //see example more info

Author

Fajar Agung W, [email protected]

License

ICEnvironmentSetting is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "ICEnvironmentSetting",
    "version": "0.1.0",
    "summary": "ICEnvironmentSetting use for switch environment API",
    "description": "ICEnvironmentSetting to make test easier to switch environment API between Development, Production and Stagging without build app again.",
    "homepage": "https://github.com/ioscodigo/ICEnvironmentSetting",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Fajar Agung W": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ioscodigo/ICEnvironmentSetting.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ICEnvironmentSetting/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This