vendredi 3 mars 2017

Which pattern will be best solution for creating instance of logged ApiClient, shared for all controllers

I use such mechanism of logging to server in my application: POST user credentials to server, which in case of success return to me token needed for signing my future API calls. Question is how share this token (or instance of logged APIClient) between all classes of my application?

Now I make in every controller property "token" and when performing each segue I have to initialise it, which is too much boiler code, so I'm looking for solution share it other way. Thanks

Aucun commentaire:

Enregistrer un commentaire