简体   繁体   中英

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?

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.

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

清洁构建文件夹(Cmd + Shift + Opt + K)通常在这种情况下帮助我,但不时发出返回。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM