mercredi 21 avril 2021

iOS: Decouple HTTP Requests from view controller

I have feature in my app where the user will initiate a http request to an API from a view controller and quickly navigate between different view controllers. However the http request response is still valid and should be handled even when the user moves out from the view controller. So technically, the app is in foreground only but the user can initiate http requests and navigate between different screens. What is the best design pattern to solve this on iOS. I know in Android we can use a combination of intent service and broadcast receivers to solve this problem.

Aucun commentaire:

Enregistrer un commentaire