Skip to content

Instantly share code, notes, and snippets.

@alexbaramilis
Created December 5, 2018 19:39
Show Gist options
  • Save alexbaramilis/3db61081ee6bcb5ac75db75b4ffdea1b to your computer and use it in GitHub Desktop.
Save alexbaramilis/3db61081ee6bcb5ac75db75b4ffdea1b to your computer and use it in GitHub Desktop.
Namespacing with enums 2
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