0
Ola would like to know how to create a global settings file.
I’m wearing a Lib for http, Alamofire query.
I’d like anywhere in any file I called the constant to 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 account that would contain the URL address I want to access.
Soon the configuration file would be something like this:
let CONSTANTEURLGLOBAL1 = "http://...."
let CONSTANTEURLGLOBAL2 = "http://...."
let CONSTANTEURLGLOBAL3 = "http://...."
I am extremely new to Swift so thanks in advance.