I'm currently working on an app which requires that information be shared between multiple views. For simplicity's sake, I prefer to use a singleton for said purpose.
My questions are...
- Where should a singleton class be defined and initialized so that it is available to all view controllers and all other class files?
- How should other classes reference said singleton? Are any import statements or special initializations within a specific class necessary?
I'd just like to mention that I'm intrigued by the one line singleton found @ http://krakendev.io/blog/the-right-way-to-write-a-singleton
Such a method would be preferable.
BTW: I'm developing using Swift in Xcode 6.2
Thanks.