I have looked into the code and I think I have misunderstood the context:
class WebServer {
static let WebServerSharedInstance = WebServer()
class var sharedInstance: WebServer {
return WebServerSharedInstance
}
}
While you can always use WebServer.WebServerSharedInstance to access the singleton, a subclass of WebServer can override sharedInstance.
class MyServer : WebServer {
override class var sharedInstance: MyServer {
return MyServer()
}
}
However, I have found no example in the code doing that so the original answer below is probably correct.
Original answer:
You are right. There is absolutely no reason to do that.
This has been probably translated directly from Objective-C, which uses similar syntax for singletons.
Also, with Swift 1.0 we weren't very sure how to create singletons and whether static let on a class is Thread safe.