Learn how to communicate between view controllers with the delegate and data source pattern in Swift.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


The Complete Understanding of Swift Delegate and Data Source

alt text


I’ve noticed not only the delegate/data source pattern exists everywhere within the iOS ecosystem, but also most people simply copy and paste without knowing the behind implementation. 

If you’ve wondered how UITableViewDataSource works, you might have come to the right place.


First, the delegate design pattern is used to pass data or communicate between classes or structs. That’s it. The word “delegate” may come across confusing. I will try to use analogy throughout the tutorial.  Your job is to pass data from FirstVC to SecondVC. Let us use the delegate pattern. First, you need to create a protocol that has a required function with a String parameter.

Read More: https://medium.com/ios-geek-community/the-complete-understanding-of-swift-delegate-and-data-source-9c91ecd7f1

Facebook Page: https://facebook.com/bobthedeveloper