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 Swift Basics (retired) Variables and Constants What is Swift?

Tundi Kebab
Tundi Kebab
884 Points

Can I use both objective c and swift during the same project in xcode? Please...it's URGENT.

please answer fast

5 Answers

Yes, by way of a bridging Header.

yes ofcourse you can!

Tundi Kebab
Tundi Kebab
884 Points

thank you so much man! It's been a breakthrough in my life to receive such a prestigious answer from you, my lord. Thou hast livth long!

Tundi Kebab
Tundi Kebab
884 Points

thank you so much man! It's been a breakthrough in my life to receive such a prestigious answer from you, my lord. Thou hast livth long!

Yes, you can. It is done using what is called a bridge header. Bridge headers are simply a file which contains an include statement, naming the Objective-C file to include.

Here is a nice tutorial page on the topic: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html