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

What is a concrete type in swfit and what is the opposite of that?

Can someone please elaborte. Teachers keep using this word in almost every video and I don't remeber them defining it properly.

2 Answers

I have a better answer ...

Concrete types are structs, classes, and enums which adopt protocols and provide concrete values and implementations for the required properties and functions.

In contrast, protocols are not concrete types, because they simply define an interface which specifies what properties and functions are required, but without specifying any concrete values or implementations for them.

Are you referring to generics? For example, [T] is generic, because "T" can refer to any type, so the array can consist of any type. But [String] is concrete, because the array is specified to consist of elements of only the type String.