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 Intermediate Swift Extensions and Protocols Method Dispatch in a Protocol Extension

William Humphrey
William Humphrey
5,543 Points

Update for Protocol Extensions Xcode Version 9.2?

I am following along with the video "Method Dispatch in a Protocol Extension | Intermediate Swift" Using Xcode Version 9.2. In the video it's explaining how an extension on a protocol given a default implementation not all stubs need to be implemented because we are giving a default implementation. However with the new update all stubs must be added to the extension on a Protocol such as Person, or the compiler complains and asks to "add protocol stubs?". I am very new to programming so I can't understand what the benefit is with this new update. Can someone explain that to me? Thank you for taking the time to explain it.

Cheers!

1 Answer

Heidi Puk Hermann
Heidi Puk Hermann
33,366 Points

Hi,

I don't have an answer to your question (sorry... also quite new in this world), but I am also working with the newest version of xCode and I don't get that error... Which leads me to think, that it might be something else that's missing...

Apart from that, it should not depend on the compiler you are using, but the language itself, whether you should add all protocol stubs: even if they have been defined in an extension. - And as far as I can read in the documentation there should not be any changes of that sort to Swift...