How to add swift compiler to c object project

When I tried to import Swift Framework into my existing target c project, I have a hard time finding a fast compiler in build settings. When I searched about using swift code in object c, they talk about header jumper. However, since there is no fast compiler in my build settings, there is no configuration for the compiler. My Xcode version is 6.3.2, I don't know how other people could have a fast compiler by default?

The only walk around is to recreate the project with swift. Then replace everything with c lens. I don't want to recreate the project.

UPDATE:

For future reference only: when importing a fast library (project) into an existing objective-c project. Create a temp swift file, (this is what I missed) and delete. "Swift Compiler" will appear in the build settings. You can then follow other guides, such as Apple docs, for configuring header jumpers and other stuff. compile it

+3


source to share


1 answer


All you need to do is add Swift code to your project. Xcode will recognize it and compile it properly. There is no need to make any changes to the project settings.

You will need a bridged header file to call your own Objective-C code (not Cocoa code) from your Swift code.



To call Swift code you just need to get #import right.

For any of these, search here on SO. Then post a new, specific question if you can't get it to work.

+2


source







All Articles