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 Protocols in Swift Protocol Basics Creating a Protocol

Mart Gaedtgens
Mart Gaedtgens
2,251 Points

What is the point of a protocol?

I still don't understand why you can't just make a 'var = fullName' in the struct itself, instead of making a protocol and letting the struct adopt that protocol. What is the point? To me it just seems like this requires more code to be written.

i also have that question when learning about protocol oriented programming, i got the answer why we implement POP instead of OOP after watching this video https://www.youtube.com/watch?v=lBr8onqP_fM

Mart Gaedtgens
Mart Gaedtgens
2,251 Points

Thanks, i get it now ! :)

Gavin Hobbs
Gavin Hobbs
5,205 Points

Thanks anna saraswati ! That video was perfect!