Created
December 5, 2018 19:39
-
-
Save alexbaramilis/3db61081ee6bcb5ac75db75b4ffdea1b to your computer and use it in GitHub Desktop.
Namespacing with enums 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum API { | |
enum AirVisual { | |
static let BaseURL = "api.airvisual.com/v2/nearest_city?lat={{LATITUDE}}&lon={{LONGITUDE}}&key={{YOUR_API_KEY}}" | |
static let Key = "you_api_key" | |
} | |
enum PropellerAir { | |
static let BaseURL = "https://open.propellerhealth.com/prod/forecast?latitude={{LATITUDE}}&longitude={{LONGITUDE}}" | |
} | |
} | |
let url1 = API.AirVisual.BaseURL | |
let key = API.AirVisual.Key | |
let url2 = API.PropellerAir.BaseURL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment