Adam Carter
Adam Carter

Reputation: 4844

Xcode build - stuck on Compiling Swift source files

When building my project in Xcode 8 GM, Xcode sticks on "Compiling Swift source files". It also never finishes indexing my project at any point.

I've looked at the similar questions but none of those answers work for me.

Does anyone know what this could be?

Upvotes: 3

Views: 6669

Answers (3)

Anton Plebanovich
Anton Plebanovich

Reputation: 1526

Clean Build Folder (Cmd+Shift+Opt+K) usually helps me in this case, but time to time issue returns.

Upvotes: 0

Lokesh Deshmukh
Lokesh Deshmukh

Reputation: 748

If you used lot of Concatination of string like

var fun=0;
var tempvalue=2;
var result="some data"+fun+" more data"+tempvalue;

Transform it to

var result="somedata \(fun) more data \(tempvalue)";

Because swift compiler take lots of time to analyse overloding methods of "+" operator

Upvotes: 3

Adam Carter
Adam Carter

Reputation: 4844

Swift inference was the problem.

There were several instance where I was inferring a dictionary type that for some reason grew exponentially as the dictionary had more values.

Upvotes: 8

Related Questions