No Swift Settings in Xcode 5 Project

I am trying to add Swift code to an existing project created in Xcode 5 and it crashes whenever I try to automatically generate the bridge title. Looking at the settings of my project, I think this is because there are no Swift Compiler settings. Does anyone know a way to transfer the project to Xcode 6 settings or do I need to recreate the project?

+4
source share
3 answers

The only solution I found for this is to create a new goal. Be sure to select "Swift" as the language choice for the new target. Something in creating a goal with this choice allows you to set Swift settings.

Update: Creating a new target containing Swift due to the fact that it contained. When I deleted the Swift template files from the new target, the Swift-dependent build options disappeared from the project again.

The true Xcode indicator about whether to show these build options is whether the target contains at least one .swift file. So, the easiest solution is to simply add a new Swift file. This also causes Xcode to automatically generate the Objective-C bridge header, which you will need in any project that has Objective-C.

+9
source

I managed to get around this by manually adding some Swift parameters to the project.pbxproj file.

In the attribute block of the PBXProject section, add:

 LastSwiftUpdateCheck = 0720; 

In the XCBuildConfiguration section, add this to the Debug build settings for the project (the first and larger settings block):

 SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 

And add this to your Debug build settings for the purpose:

 OTHER_SWIFT_FLAGS = "-DDEBUG"; 

And this is for release build settings for the purpose:

 OTHER_SWIFT_FLAGS = ""; 

When you reopen the project, the Swift settings will be available.

0
source

Most of the quick settings were missing.

By adding a new Swift file to my goal, we also added build settings.

Deleting a single swift file also seems to have deleted all build settings. Therefore, make sure you have a quick file in your list of compiled sources.

0
source

All Articles