Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No Swift settings in Xcode 5 project

I am trying to add some Swift code to an existing project created in Xcode 5 and I get a crash whenever I try to automatically generate a bridging header. Looking in my project settings, I think it is because there are no Swift Compiler settings. Anyone know of a way to migrate a project to Xcode 6 settings or do I need to re-create the project?

like image 675
JonahGabriel Avatar asked Dec 20 '22 14:12

JonahGabriel


1 Answers

The only solution I've found for this is to create a new target. Make sure to select "Swift" as the language choice for the new target. Something in the creation of a target with this selection enables the Swift build settings.

Update: Creating a new target containing Swift worked because of what it contained. When I removed the template Swift files from the new target the Swift-specific build settings disappeared from the project again.

The real indicator to Xcode on whether to show those build settings is whether the target contains at least one .swift file. So, the easiest solution is to simply add a new Swift file. This also triggers Xcode to prompt you about automatically creating an Objective-C bridging header - which you'll need in any project that has some Objective-C in it.

like image 65
phatblat Avatar answered Dec 22 '22 03:12

phatblat