Hello, I am getting very confused about how to solve this issue: Suppose I send 3 network requests from my repository and i need to notify my viewcontroller after third request is successful and it receives json. After that I send third request again and waiting for new results… how can I notify my viewcontroller without starting request from viewontroller and sending closure back??? Notification center is bad the way I heard it… possible memory leaks… What about delegates or closures? Please provide best, most performant and adopted version… Also, I can’t use any third party. So I will repeat once again: how can I notify particular viewController then results were received after starting request from different model? If someone uses notificationcenter please provide example with no memory leaks… I am tired of bad and incomplete examples.
I might switch to react native if no solutions found… this is really disappointing.
Hi @wellbranding,
From the description you have above, what you are after is a chained get, which relies on the results from the previous ones.
If you mentioned ReactNative, then you are used to a particular way of dealing with this, the closest that you can get is with using AlamoFire which would offer you a similar API.
If you do not want to use a 3rd party, then you can try chaining them or using a queue.