Hello, I would like to know how to create a global settings file.
I'm using a Lib to do http query, Alamofire.
I'd like it anywhere that in any file I called the constant it would be accessed. Example:
Alamofire.request(.GET, FILECONFIG.CONSTANTEURLGLOBAL, parameters: ["foo": "bar"])
.responseJSON { response in
print(response.request) // original URL request
print(response.response) // URL response
print(response.data) // server data
print(response.result) // result of response serialization
if let JSON = response.result.value {
print("JSON: \(JSON)")
}
}
In the part of the code that has the expression FILECONFIG.CONSTANTEURLGLOBAL would be the one that would contain the URL address that I want to access.
Soon the configuration file would look something like this:
let CONSTANTEURLGLOBAL1 = "http://...."
let CONSTANTEURLGLOBAL2 = "http://...."
let CONSTANTEURLGLOBAL3 = "http://...."
I'm extremely new to swift so thank you in advance.