Nested Callbacks in Swift 3.0

Updated 5 February 2018


Nested Callbacks

If you don’ t know how to create callbacks in swift you can visit my previous blogs click here.

Need of nested callbacks. Suppose you hit a request to network manager using callback and get request result in back in the controller and send a data to ViewModel and want back data again in the controller. Most of we use to inform NotificationCenter to inform the controller that data is stored in the object after that we reload table view, collection view or draw view to represent data on the screen.The better is that we create the callbacks so its saves our lots of time creating a notification using NotificationCenter and also save us to remember the each notification names. Example of creating nested callback:-

Example of fetching data in the above by creating another callback in it or you can say that creating a nested callback:-

If you don’ t know how to create callbacks in swift you can this blog

Use Callbacks in Swift in place of Delegates


. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.

Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home