Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Nir Ohayon
Nir Ohayon
2,399 Points

Protocols

Hey Guys,

Just wondering since I saw there is an explenation about protocols in the iOS track and I could not find it, can you tell me in which section it appears?

Thanks Nir

2 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

A protocol is a list of method declarations. If your class adopts the protocol, then you have to implement those methods in your class.. The best way to understand it is within the context of building an app like the UITableViewController used in the Blog Reader app. The UITableViewDelegate is a protocol which is essentially a set of methods that can be implemented by any class. The class declaring these methods can then access the custom implementations. The UITableViewController defines the methods needed to customize the table view but the actual customization is done by you when you implement the methods defined by the UITableViewDelegate protocol.

Nir Ohayon
Nir Ohayon
2,399 Points

Awesome, this was very helpful! thanks you.