What is the best way to declare global variables in Swift? I am using Singletons to hold objects in memory. Besides I can access them from everywhere.
But since arrays are not thread-safe in swift, does this pattern also tackle concurrency? Are there better ways of storing e.g. network resources in global properties?
E.g.
class Repository {
static let sharedInstance = Repository()
var objects:[String] = []
}