I would like to know how to achieve this: Assume I have a singleton class as
class Global{
static let shared = Global()
private init(){}
}
I want this class as closed to modification. But open to extend.
I want to achieve result as
Global.shared.var1
When var1
is coming from another class somehow extending Global
.
It's a wish. Is it even possible? What is the right way to achieve this.