Xcode swift indexing forever

Killing the processes named 'swift' and then checking the error in xcode will give you the part of the code giving you trouble. There are some bugs in swift that needs to be circumvented.

To kill the process: Applications > Utilities > Activity Monitor. Then find the "swift" process, double click and choose Quit or Force Quit.


Happened to me with Xcode 7.3

Had to clean everything Xcode had cached to solve it.

Solution:

rm -frd ~/Library/Developer/Xcode/DerivedData/*

rm -frd ~/Library/Caches/com.apple.dt.Xcode/*