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

How to integrate Objective-C .m files and Frameworks into Swift?

Hi all,

I was hoping someone could provide a detailed explanation on how to integrate objective-C files in swift (example would help a lot).

I've read that you need to use a bridging-header however a lot of articles on stackoverflow appear to be out dated (all reference the xcode 6 beta versions). I really need an explanation using the latest version of Xcode6 cause I am not being prompted with the same messages as described in the answers on stackoverflow.

I will be importing both .m files from old projects and frameworks from cocoapods into this new swift project.

Thanks!

1 Answer

Use a bridging header. File > new > Header File Do the import status in here and it'll allow you use to obj-c libraries in Swift. DO THE IMPORT STATUS IN OBJ-C