samedi 18 février 2017

Swift: What other way to store a currentUser than a singleton?

I use a singleton in my project but have been reading on stackOverflow singletons are bad.

I have an app that in the app delegate gets the currentUser information. I need to access this information all through out the app, what way other than making a singleton is there to store the currentUser then access it?

I also use a singleton for a firebaseController (a view controller used to parse data from firebase again used throughout the app). Is this a good idea or what would be a better alternative?

Aucun commentaire:

Enregistrer un commentaire