I need to create a singleton for a generic class in Swift, but Generic Class in Swift don´t support static stored properties, then this methods aren`t valid
public final class ApiClient<T>: ApiClientFor<T> where T:EntityType {
// Method 1
class var shared: ApiClient<T> {
struct Static {
static let instance = ApiClient<T>()
}
return Static.instance
}
//Or more simple Method 2
static let instance = ApiClient<T>()
}