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 Build An iTunes Search App Building the User Interface Displaying Stubbed Data

Why did you create a Cocoa class for SearchResultsDataSource?

Wouldn't creating a swift class, importing UIKit, and adding NSObject as the parent class achieve the same thing?

1 Answer

Javier Alvarado
Javier Alvarado
16,060 Points

Yes, that's another way of doing it.

I think it ultimately comes down to the developer's preference. If you like to set up your classes through the GUI then you can do it the way Pasan did it, or if you prefer to write things out yourself then you can do it the way you described.