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 trialEduardo Moreno Nava
10,023 Pointswhat is the difference between a cocoa toach file and a swift file ?
sometimes in the classes Pasan use one or another but i havent found the difference between them.
1 Answer
Joshua Hawthorne
18,523 PointsCocoa Touch is a UI Framework used for building software programs to run on iOS. You can think of it as a swift file that comes "ready made" with a few things for you to use. For example, the UITableViewController Cocoa Touch object comes pre-filled with methods necessary to make the table view work. UICollectionViewController is another example.
A swift file is just that - an empty swift file. There is nothing pre-populated inside of it. Empty swift files are typically used for custom classes, structs, enums, etc. Once you start building more applications the difference will become apparent.