Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Generics in Swift Generics and Protocols Constraining Associated Types

tomandrews
tomandrews
13,183 Points

Course feedback

I think this course is a bit long winded and slightly unnecessary for developing apps. I would much prefer courses that focus actually on making apps rather than intricacies of the swift language. Short courses that focus primarily on aspects such as Table Views or Parsing data would be awesome. I feel those aspects of treehouse courses are glossed over too much. For example it would be nice to know about what some of the functions do when creating a table view.

Just my two cents, however thankyou Pasan for all the great content you provide.

3 Answers

Iván Martínez
Iván Martínez
11,278 Points

I don't think that a course teaching you every method in Swift would work, there are a lot of methods and functions. Material like this gives you the fundamentals of how things work, which is way more valuable because that way you can learn what any method, function or class does by reading the docs or StackOverflow.

Boon Kiat Seah
Boon Kiat Seah
66,640 Points

I do agree with Ivan about what you said above. However, it was very tough for me to go through this short course as it is very dry.

This is an advanced and complicated topic, but for me this Treehouse video was the most important one I've watched so far. I've tried to code with protocols with associated types, and with protocols with generic types, and I've run into that infuriating error message every time - "Protocol '...' can only be used as a generic constraint because it has Self or associated type requirements". If you want to use protocols and generics but don't understand how to deal with this issue, you will most likely run into this dreaded error message and end up spending countless hours pulling your hair out until you have none left! It's an extremely complex concept but well worth learning. Thank you Pasan!