-5

This question already has an answer here:

In Swift, if I have a class with only type properties and methods (everything declared static) would that be considered a singleton object? If not, why?

marked as duplicate by gnat, Jules, Community Jun 29 '17 at 6:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

This isn't specific to Swift at all.

You don't have an object, you don't have an instance of the class, therefore you don't have the singleton.

The essence of the singleton object is that it is the sole instance of a class. Exactly one instance. Not two, not three, not zero. One instance. You have zero instances, therefore you don't have a singleton object.

  • Well, in languages where classes are objects and are singleton instances of their metaclass (e.g. Smalltalk), one could make the argument that it is a singleton. I don't know enough about Swift, though, to tell whether or not that is the case here. – Jörg W Mittag Jun 30 '17 at 7:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.