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 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,664 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!