I learned from Using Swift with Cocoa and Objective-C that a singleton can be created like this:

```
class Singleton {
    static let sharedInstance = Singleton()
}

```

But as I learned, we should also prevent an instance created from the constructor. Creating an instance of the class Singleton outside the class scope, like the statement below, should be prevented:

```
let inst = Singleton()

```

So, could I do just like this:

```
class Singleton {
    static let sharedInstance = Singleton()
    private init() {}
}

```

Or, is there any better practice?