Swift Singleton

Swift Singleton

If you’re interested in a singleton pattern for Swift, consider this solution. Personally I find singleton classes something that can easily be avoided and their intent should be obvious. Just implement it once on your own. If someone decides to implement something that blows things up if they instantiate more than one, that seems to be a different problem.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.