Having hard time implement a simple singleton in swift

Viewed 838

I have created a new file ->swift file . called Globals.Swift Then in there I have done :

class Globals {

    static let sharedInstance = Globals()

    init() {
        var max=100
    }

}

In another class(UIViewcontroller) I would like to use it,

Globals.sharedInstance //is going ok

is good, but when i go deep to .max i get the error.

1 Answers
Related